Box

class Box(val center: FloatArray = FloatArray(3), val halfExtent: FloatArray = FloatArray(3))

An axis-aligned 3D box represented by its center and half-extent.

Constructors

Link copied to clipboard
constructor(center: FloatArray = FloatArray(3), halfExtent: FloatArray = FloatArray(3))
constructor()
constructor(centerX: Float, centerY: Float, centerZ: Float, halfExtentX: Float, halfExtentY: Float, halfExtentZ: Float)

Properties

Link copied to clipboard

Center of the 3D box

Link copied to clipboard

Half extent from the center on all 3 axes

Link copied to clipboard

Computes the largest coordinates corner of the box.

Link copied to clipboard

Computes the lowest coordinates corner of the box.

Functions

Link copied to clipboard
fun setCenter(x: Float, y: Float, z: Float)

Sets the center of the box to the given coordinates.

Link copied to clipboard
fun setHalfExtent(x: Float, y: Float, z: Float)

Sets the half-extent of the box on all axes.