An oriented version of three.js' Box3 class. A variety of derivative values are cached on the
object to accelerate the intersection functions. .needsUpdate must be set to true when
modifying the box parameters.
On this page
Properties
Matrix transformation applied to the box.
needsUpdate: boolean
Indicates that the bounding box fields have changed so cached variables to accelerate
other function execution can be updated. Must be set to true after modifying the
oriented box min, max, matrix fields.
Methods
new OrientedBox( min?: Vector3, max?: Vector3, matrix?: Matrix4 )set( min: Vector3, max: Vector3, matrix: Matrix4 ): voidSets the oriented box parameters.
intersectsBox( box: Box3 ): booleanReturns true if intersecting with the provided box.
intersectsTriangle( triangle: Triangle ): booleanReturns true if intersecting with the provided triangle.
closestPointToPoint( point: Vector3, target: Vector3 ): numberReturns the distance to the provided point. Sets target to the closest point on the surface
of the box if provided.
distanceToPoint( point: Vector3 ): numberReturns the distance to the provided point.
distanceToBox(
box: Box3,
threshold: number = 0,
target1?: Vector3,
target2?: Vector3
): numberReturns the distance to the provided box. threshold is an optional distance to return early
if the distance is found to be within it. target1 and target2 are set to the points on the
surface of this box and the box argument respectively.