frustum
| Type | Struct |
| Namespace | conjure::math |
| Include File Path | engine/include/conjure/core/math/frustum.h |
| Source File Path | engine/src/core/math/frustum.cpp |
| API ↗ | Math |
Syntax
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| public | planes | std:: | {} |
Functions
Public
contains
contains[[nodiscard]] bool contains(
const aabb &box) const noexcept;True when the box is entirely inside or touching all six planes (n-vertex test).
[[nodiscard]] bool contains(
vec3 point) const noexcept;True when the point is inside or on every plane.
corners
corners[[nodiscard]] static std::array<vec3, 8> corners(
const mat4 &inverseViewProjection) noexcept;The eight corners of the volume described by an inverse view-projection matrix, in the order near bottom-left, near bottom-right, near top-right, near top-left, then the same for the far plane. Requires a finite projection: an infinite projection has no finite far corners, so the call asserts once and leaves the affected corners at their undivided clip-space value. With a reverse-Z matrix the first four corners lie on the far plane and the last four on the near plane.
from_view_projection
from_view_projectionExtracts the planes from a view-projection (or projection) matrix using the Gribb-Hartmann method for clip space -w <= x <= w, -w <= y <= w, 0 <= z <= w (GLM_FORCE_DEPTH_ZERO_TO_ONE). Works for perspective, infinite and orthographic projections; planes are normalised. With a reverse-Z matrix the planes still bound the same volume, but NEAR_PLANE and FAR_PLANE are swapped; renderer::frustum_from_clip corrects the labels.
get
get[[nodiscard]] const plane &get(
frustum_plane which) const noexcept;The plane with the given index.
intersects
intersects[[nodiscard]] bool intersects(
const aabb &box) const noexcept;Conservative box test using the p-vertex (the corner furthest along each plane normal): false only when the box is entirely behind at least one plane, so boxes near an edge may report an intersection they do not have. Invalid boxes never intersect.
intersects_sphere
intersects_sphereTrue when the sphere is not entirely behind any plane (exact for the planes, so conservative near edges like intersects(aabb)). Negative radii are treated as 0.