Expands this frustum to also contain another frustum. The other frustum's 8 corner points are computed, and each of this frustum's planes is pushed outwards just far enough to contain them all. The result is a conservative convex volume that contains both frustums. This is useful for multi-view rendering such as stereo XR, where culling should keep objects visible in any view.
Note: keeping each plane's orientation makes this correct for arbitrary frusta, including the asymmetric per-eye projections of XR headsets, where matching planes of the two eyes have different normals and a per-plane "outermost" selection would wrongly cut into the combined volume at a distance.
The other frustum to add.
Self for chaining.
Tests whether a point is inside the frustum. Note that points lying in a frustum plane are considered to be outside the frustum.
The point to test.
True if the point is inside the frustum, false otherwise.
Tests whether a bounding sphere intersects the frustum. If the sphere is outside the frustum, zero is returned. If the sphere intersects the frustum, 1 is returned. If the sphere is completely inside the frustum, 2 is returned. Note that a sphere touching a frustum plane from the outside is considered to be outside the frustum.
The sphere to test.
0 if the bounding sphere is outside the frustum, 1 if it intersects the frustum and 2 if it is contained by the frustum.
Updates the frustum shape based on the supplied 4x4 matrix.
The matrix describing the shape of the frustum.
Sets one of the frustum's six planes. The plane is normalized as it is stored, as the frustum's tests require unit length normals. The planes are ordered right, left, bottom, top, far, near, and their normals must point inwards.
The index of the plane, from 0 to 5.
The plane to store.
Self for chaining.
A frustum is a shape that defines the viewing space of a camera. It can be used to determine visibility of points and bounding spheres. Typically, you would not create a Frustum shape directly, but instead query CameraComponent#frustum.
Example