API Reference

Class List

OrientedBox

Oriented Box.

Summary

Properties

worldTransform

The world transform of the OBB.

Methods

containsPoint

Test if a point is inside a OBB.

intersectsBoundingSphere

Test if a Bounding Sphere is overlapping, enveloping, or inside this OBB.

intersectsRay

Test if a ray intersects with the OBB.

Details

Constructor

OrientedBox([worldTransform], [halfExtents])

Create a new OrientedBox instance.

Parameters

worldTransformMat4

Transform that has the orientation and position of the box. Scale is assumed to be one.

halfExtentsVec3

Half the distance across the box in each local axis. The constructor takes a reference of this parameter.

Properties

Mat4worldTransform

The world transform of the OBB.

Methods

containsPoint(point)

Test if a point is inside a OBB.

Parameters

pointVec3

Point to test.

Returns

boolean

True if the point is inside the OBB and false otherwise.

intersectsBoundingSphere(sphere)

Test if a Bounding Sphere is overlapping, enveloping, or inside this OBB.

Parameters

sphereBoundingSphere

Bounding Sphere to test.

Returns

boolean

True if the Bounding Sphere is overlapping, enveloping or inside this OBB and false otherwise.

intersectsRay(ray, [point])

Test if a ray intersects with the OBB.

Parameters

rayRay

Ray to test against (direction must be normalized).

pointVec3

If there is an intersection, the intersection point will be copied into here.

Returns

boolean

True if there is an intersection.