Performs frustum culling test against a mesh component's bounding box. Uses optimized frustum-AABB intersection algorithm to determine visibility.
The mesh component to test for culling
false
if the mesh is completely outside the frustum (should be culled),
true
if the mesh is inside or intersects the frustum (should be rendered)
This method uses a two-phase approach:
The algorithm is based on the optimized frustum culling technique described at: https://iquilezles.org/articles/frustumcorrect/
const frustum = new Frustum();
frustum.update(viewMatrix, projectionMatrix);
if (frustum.culling(meshComponent)) {
// Render the mesh
renderMesh(meshComponent);
}
// Otherwise, skip rendering (culled)
Retrieves a specific frustum plane by index.
The plane index (0-5)
The plane as a Vector4 where (x,y,z) represents the plane normal and w represents the distance from the origin
The view frustum class. Represents a truncated pyramid (frustum) used for view culling in 3D graphics. Contains six planes (top, bottom, left, right, near, far) and eight corner vertices.