API Reference

Class List

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

worldTransformpc.Mat4

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

halfExtentspc.Vec3

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

Properties

pc.Mat4worldTransform

The world transform of the OBB.

Methods

containsPoint(point)

Test if a point is inside a OBB.

Parameters

pointpc.Vec3

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

spherepc.BoundingSphere

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

raypc.Ray

Ray to test against (direction must be normalized).

pointpc.Vec3

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

Returns

boolean

True if there is an intersection.