Box

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

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

Vectors are float3 arrays and matrices column-major mat3f/mat4f arrays, as in the rest of the API.

Constructors

Link copied to clipboard
constructor(center: FloatArray = FloatArray(3), halfExtent: FloatArray = FloatArray(3))

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Center of the 3D box

Link copied to clipboard

Half extent from the center on all 3 axes

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

The smallest sphere containing this box: its center (xyz) and radius (w).

Link copied to clipboard

The largest coordinates corner of the box: center + halfExtent.

Link copied to clipboard

The lowest coordinates corner of the box: center - halfExtent.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Whether the box is empty, i.e. its extents are zero.

Link copied to clipboard
fun set(min: FloatArray, max: FloatArray): Box

Initializes the box from its min and max corners. @return This box.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

A box centered in tr with the same extent as this one.

Link copied to clipboard
fun unionSelf(box: Box): Box

Grows this box to the bounding box of the union of this and box. @return This box.