Gets the world transform of the OBB.
Test if a point is inside an OBB.
Point to test.
True if the point is inside the OBB and false otherwise.
Test if a Bounding Sphere is overlapping, enveloping, or inside this OBB.
Bounding Sphere to test.
True if the Bounding Sphere is overlapping, enveloping or inside this OBB and false otherwise.
An oriented bounding box is a box that can be rotated and translated in 3D space. It is defined by a world transform and half extents. Unlike an axis-aligned bounding box, an OBB can be oriented arbitrarily.
The constructor takes a Mat4 holding the box's position and rotation, then its half extents. Scale is assumed to be one, so size the box with the half extents rather than the matrix. worldTransform can be reassigned at any time and the setter copies the matrix, so assigning an entity's world transform each frame gives a box that follows it. The tests containsPoint, intersectsRay and intersectsBoundingSphere return a boolean and allocate nothing.
Example