evan 2026.1.4
Evan
Loading...
Searching...
No Matches
evan::Frustum Class Reference

A view frustum represented by its six bounding planes. More...

#include <headers/evan/Frustum.hpp>

Public Member Functions

bool intersects (const utility::math::AabbF &box) const
 Test whether an axis-aligned bounding box intersects the frustum.
 
bool intersects (const glm::vec3 &center, float radius) const
 Test whether a bounding sphere intersects the frustum.
 

Static Public Member Functions

static Frustum fromViewProjection (const glm::mat4 &viewProjection)
 Build a frustum from a combined projection × view matrix.
 

Detailed Description

A view frustum represented by its six bounding planes.

A Frustum is built once per view from the combined projection × view matrix and reused to reject meshes whose bounds are fully outside. Plane extraction uses the Gribb-Hartmann method and expects a Vulkan-style clip matrix (right-handed, 0..1 depth), matching the projection produced by utility::graphic::View::getProjectionMatrix().

Definition at line 40 of file Frustum.hpp.

Member Function Documentation

◆ fromViewProjection()

static Frustum evan::Frustum::fromViewProjection ( const glm::mat4 &  viewProjection)
static

Build a frustum from a combined projection × view matrix.

Parameters
viewProjectionThe combined clip-space matrix (proj * view).
Returns
The frustum bounding the visible volume.

◆ intersects() [1/2]

bool evan::Frustum::intersects ( const glm::vec3 &  center,
float  radius 
) const

Test whether a bounding sphere intersects the frustum.

Parameters
centerCenter of the sphere.
radiusRadius of the sphere.
Returns
True when the sphere is (partially) inside the frustum.

◆ intersects() [2/2]

bool evan::Frustum::intersects ( const utility::math::AabbF &  box) const

Test whether an axis-aligned bounding box intersects the frustum.

A box is visible when it is inside or merely touching the frustum; only fully outside boxes are rejected. Empty boxes are always visible.

Parameters
boxThe bounding box to test.
Returns
True when the box is (partially) inside the frustum.

The documentation for this class was generated from the following file: