Creates a new Frustum
A plane left out defaults to new Plane(): normal (1, 0, 0), constant 0.
Advanced
The six planes as 24 floats, [nx, ny, nz, c] per plane in Frustum#getPlane order
This is the frustum's own storage, not a copy: writing to it changes the frustum. Pass it to your own shader to cull on the GPU.
Returns true when point lies inside this frustum (boundary is inclusive)
The point to test
Whether the point is inside this frustum
Copies frustum into this frustum
The frustum to copy from
This frustum for chaining
Returns true when all six planes match frustum exactly, with no tolerance
The frustum to compare with
Whether all six planes match
Writes plane index into out and returns it
After Frustum#setFromProjectionMatrix the planes are ordered right, left, bottom, top, far, near.
The plane index, 0 to 5
Optionalout: Plane
Optional plane to write into; a new Plane when omitted
The written plane
Returns true when box and this frustum overlap
Like most culling tests it errs towards true: a box just outside a corner of the frustum can pass, but a box that overlaps it never fails.
The box to test
Whether the box and this frustum overlap
Returns true when sphere and this frustum overlap
Like Frustum#intersectsBox it errs towards true near the frustum's corners. Empty
spheres (radius < 0) never intersect.
The sphere to test
Whether the sphere and this frustum overlap
Sets the six planes of this frustum
Each plane's normal must be unit length and point into the volume.
This frustum for chaining
Sets the six planes to the volume that matrix maps onto the screen
The planes come out in the space the matrix maps from: world space for a view-projection
matrix, view space for a projection matrix alone. They are normalized, so distances to them are
in that space's units. The matrix must map depth to [-1, 1], as
Matrix4#makePerspective and Matrix4#makeOrthographic do.
The matrix to extract clipping planes from
This frustum for chaining
A volume bounded by six planes that face inward, most often the volume a camera sees
Each Camera3D has one as Camera3D#frustum. Test against it to skip work for things the camera can't see, or build your own from a matrix or from planes to cull against another volume.
Example