playcanvas-typings
Version:
TypeScript declaration files for PlayCanvas game engine
45 lines (39 loc) • 1.95 kB
TypeScript
declare namespace pc {
/**
* @name pc.OrientedBox
* @description Create a new oriented box.
* @class Oriented Box.
* @property {pc.Mat4} [worldTransform] The world transform of the OBB
* @param {pc.Mat4} [worldTransform] Transform that has the orientation and position of the box. Scale is assumed to be one.
* @param {pc.Vec3} [halfExtents] Half the distance across the box in each local axis. The constructor takes a reference of this parameter.
*/
class OrientedBox {
constructor(worldTransform?: pc.Mat4, halfExtents?: pc.Vec3)
worldTransform: pc.Mat4;
/**
* @function
* @name pc.OrientedBox#intersectsRay
* @description Test if a ray intersects with the OBB.
* @param {pc.Ray} ray Ray to test against (direction must be normalized).
* @param {pc.Vec3} [point] If there is an intersection, the intersection point will be copied into here.
* @returns {Boolean} True if there is an intersection.
*/
intersectsRay(ray: pc.Ray, point: pc.Vec3): boolean;
/**
* @function
* @name pc.OrientedBox#containsPoint
* @description Test if a point is inside a OBB.
* @param {pc.Vec3} point Point to test.
* @returns {Boolean} true if the point is inside the OBB and false otherwise.
*/
containsPoint(point: pc.Vec3): boolean;
/**
* @function
* @name pc.OrientedBox#intersectsBoundingSphere
* @description Test if a Bounding Sphere is overlapping, enveloping, or inside this OBB.
* @param {pc.BoundingSphere} sphere Bounding Sphere to test.
* @returns {Boolean} true if the Bounding Sphere is overlapping, enveloping or inside this OBB and false otherwise.
*/
intersectsBoundingSphere(sphere: pc.BoundingSphere): boolean;
}
}