pc.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 oriented box.
Parameters
| worldTransform | pc.Mat4 | Transform that has the orientation and position of the box. Scale is assumed to be one. |
| halfExtents | pc.Vec3 | Half the distance across the box in each local axis. The constructor takes a reference of this parameter. |
Properties
Methods
containsPoint(point)
Test if a point is inside a OBB.
Parameters
| point | pc.Vec3 | Point to test. |
Returns
booleanTrue 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
| sphere | pc.BoundingSphere | Bounding Sphere to test. |
Returns
booleanTrue if the Bounding Sphere is overlapping, enveloping or inside this OBB and false otherwise.