Skip to content

Frustum ​

Camera view frustum defined by six world-space planes.

Frustum represents the visible region of a camera as six bounding planes. It is used for culling tests and visibility checks against bounding boxes. The planes are extracted from a view-projection matrix and normalized so distances are in world units.

Constructor ​

Creates a frustum from a view-projection matrix.

ts
new Frustum(m): Frustum;
ParameterDescription
m: mat4The combined view-projection matrix.

Methods ​

setWithViewProjection() void ​

Re-extracts the six planes from a view-projection matrix.

ts
setWithViewProjection(m): void;
ParameterDescription
m: mat4The combined view-projection matrix.

intersectsWithBox3() boolean ​

Tests whether a box is at least partly inside the frustum. The test is conservative. A box outside the frustum but near a corner can be reported as intersecting, which only costs a draw of an offscreen object.

ts
intersectsWithBox3(box): boolean;
ParameterDescription
box: Box3The world-space box to test.

Released under the MIT License