Constructor
new OrientedBox(worldTransformopt, halfExtentsopt)
Create a new oriented box.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
worldTransform |
pc.Mat4 |
<optional> |
Transform that has the orientation and position of the box. Scale is assumed to be one. |
halfExtents |
pc.Vec3 |
<optional> |
Half the distance across the box in each local axis. The constructor takes a reference of this parameter. |
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
worldTransform |
pc.Mat4 |
<optional> |
The world transform of the OBB |
- Source:
Methods
containsPoint(point) → {Boolean}
Test if a point is inside a OBB.
Parameters:
Name | Type | Description |
---|---|---|
point |
pc.Vec3 | Point to test. |
- Source:
Returns:
true if the point is inside the OBB and false otherwise.
- Type
- Boolean
intersectsBoundingSphere(sphere) → {Boolean}
Test if a Bounding Sphere is overlapping, enveloping, or inside this OBB.
Parameters:
Name | Type | Description |
---|---|---|
sphere |
pc.BoundingSphere | Bounding Sphere to test. |
- Source:
Returns:
true if the Bounding Sphere is overlapping, enveloping or inside this OBB and false otherwise.
- Type
- Boolean
intersectsRay(ray, pointopt) → {Boolean}
Test if a ray intersects with the OBB.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ray |
pc.Ray | Ray to test against (direction must be normalized). | |
point |
pc.Vec3 |
<optional> |
If there is an intersection, the intersection point will be copied into here. |
- Source:
Returns:
True if there is an intersection.
- Type
- Boolean