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;| Parameter | Description |
|---|---|
m: mat4 | The combined view-projection matrix. |
Methods
setWithViewProjection() void
Re-extracts the six planes from a view-projection matrix.
ts
setWithViewProjection(m): void;| Parameter | Description |
|---|---|
m: mat4 | The 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;| Parameter | Description |
|---|---|
box: Box3 | The world-space box to test. |