Hitbox3D

class Hitbox3D(val minX: Float, val minY: Float, val minZ: Float, val maxX: Float, val maxY: Float, val maxZ: Float, val inside: (ERROR CLASS: Symbol not found for Triple<kotlin/Float, kotlin/Float, kotlin/Float>) -> Boolean) : Hitbox

A 3D hitbox for collision detection.

Constructors

Link copied to clipboard
constructor(minX: Float, minY: Float, minZ: Float, maxX: Float, maxY: Float, maxZ: Float, inside: (ERROR CLASS: Symbol not found for Triple<kotlin/Float, kotlin/Float, kotlin/Float>) -> Boolean)
constructor(minX: Float, minY: Float, minZ: Float, maxX: Float, maxY: Float, maxZ: Float)

Creates a rectangular hitbox defined by its minimum and maximum x, y, and z coordinates.

constructor(min: ERROR CLASS: Symbol not found for Triple<kotlin/Float, kotlin/Float, kotlin/Float>, max: ERROR CLASS: Symbol not found for Triple<kotlin/Float, kotlin/Float, kotlin/Float>)

Creates a rectangular hitbox defined by its minimum and maximum points.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val id: Long

The unique ID of this hitbox.

Link copied to clipboard
val inside: (ERROR CLASS: Symbol not found for Triple<kotlin/Float, kotlin/Float, kotlin/Float>) -> Boolean

A function that takes a triple of (x, y, z) coordinates and returns true if the point is inside the hitbox.

Link copied to clipboard
val maxX: Float

The side of the hitbox facing positive infinity on the X axis

Link copied to clipboard
val maxY: Float

The side of the hitbox facing positive infinity on the Y axis

Link copied to clipboard
val maxZ: Float

The side of the hitbox facing positive infinity on the Z axis

Link copied to clipboard
val minX: Float

The side of the hitbox facing negative infinity on the X axis

Link copied to clipboard
val minY: Float

The side of the hitbox facing negative infinity on the Y axis

Link copied to clipboard
val minZ: Float

The side of the hitbox facing negative infinity on the Z axis

Functions

Link copied to clipboard
fun add(other: Hitbox3D): Hitbox3D

Adds another hitbox to this hitbox. The resulting hitbox contains all points that are inside either the original hitbox or the other hitbox.

Link copied to clipboard
fun addCube(x: Float, y: Float, z: Float, size: Float): Hitbox3D

Adds a cubic hitbox to this hitbox. The resulting hitbox contains all points that are inside either the original hitbox or the new cube.

Link copied to clipboard
fun addRectangle(minX: Float, minY: Float, minZ: Float, maxX: Float, maxY: Float, maxZ: Float): Hitbox3D

Adds a rectangular hitbox to this hitbox. The resulting hitbox contains all points that are inside either the original hitbox or the new rectangle.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun inside(point: ERROR CLASS: Symbol not found for Triple<kotlin/Double, kotlin/Double, kotlin/Double>): Boolean
fun inside(point: ERROR CLASS: Symbol not found for Triple<kotlin/Int, kotlin/Int, kotlin/Int>): Boolean

Checks if the point defined by the point triple is inside the hitbox.

fun inside(x: Double, y: Double, z: Double): Boolean

Checks if the point defined by the x, y, and z triple is inside the hitbox.

fun inside(x: Float, y: Float, z: Float): Boolean
fun inside(x: Int, y: Int, z: Int): Boolean

Checks if the point defined by x, y, and z coordinates is inside the hitbox.

Link copied to clipboard

Returns whether the sprite is above the given Y boundary using minY.

Link copied to clipboard

Returns whether the sprite is below the given Y boundary using maxY.

Link copied to clipboard

Returns whether the sprite is left of the given X boundary using minX.

Link copied to clipboard

Returns whether the sprite is left of the given Z boundary using minZ.

Link copied to clipboard

Returns whether the sprite is right of the given X boundary using maxX.

Link copied to clipboard

Returns whether the sprite is right of the given Z boundary using maxZ.

Link copied to clipboard
operator fun plus(other: Hitbox3D): Hitbox3D
Link copied to clipboard
open override fun toString(): String