View frustum represented as six half-space planes. More...
#include <BoundingVolumes.h>
Public Types | |
| enum | PlaneIndex : u8 { Left = 0 , Right = 1 , Bottom = 2 , Top = 3 , Near = 4 , Far = 5 } |
Public Member Functions | |
| bool | CullsSphere (const BoundingSphere &sphere) const |
| Tests whether a sphere is fully outside the frustum. | |
| bool | CullsAABB (const AABB &aabb) const |
| Tests whether an AABB is fully outside the frustum. | |
| bool | ContainsPoint (const vec3 &point) const |
| Tests whether a point lies inside all six frustum planes. | |
Static Public Member Functions | |
| static Frustum | FromViewProjection (const mat4 &vp) |
| Extracts the six frustum planes from a combined view-projection matrix. | |
Public Attributes | |
| vec4 | Planes [6] |
View frustum represented as six half-space planes.
Each plane is stored as a vec4(normal.x, normal.y, normal.z, d) where a point P satisfies the plane if dot(P, normal) + d > 0.
| enum Crux::Frustum::PlaneIndex : u8 |
|
inline |
Tests whether a point lies inside all six frustum planes.
| point | The point to test. |
|
inline |
Tests whether an AABB is fully outside the frustum.
Uses the p-vertex test: for each plane, the corner of the box most aligned with the plane normal is tested. If that corner is behind the plane, the entire box is outside.
| aabb | The bounding box to test. |
|
inline |
Tests whether a sphere is fully outside the frustum.
A sphere is culled when its center is more than one radius behind any single plane.
| sphere | The bounding sphere to test. |
Extracts the six frustum planes from a combined view-projection matrix.
Uses the Gribb-Hartmann method. Works for both perspective and orthographic projections. Planes are normalized so distances are in world-space units.
| vp | Row-major view-projection matrix. |
| vec4 Crux::Frustum::Planes[6] |