|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
#include <frustum.hpp>
Public Types | |
| enum | PlaneIndex { Left = 0 , Right , Bottom , Top , Near , Far } |
| Enumeration for the frustum planes. More... | |
Public Member Functions | |
| void | update (const glm::mat4 &view_projection) |
| Update the frustum planes from a view-projection matrix. | |
| bool | contains_point (const glm::vec3 &point) const |
| Check if a point is inside the frustum. | |
| bool | contains_sphere (const BoundingSphere &sphere) const |
| Check if a bounding sphere is inside the frustum. | |
| bool | contains_aabb (const AABB &aabb) const |
| Check if an Axis-Aligned Bounding Box (AABB) is inside the frustum. | |
| const Plane & | get_plane (PlaneIndex index) const |
| Get a specific frustum plane. | |
Frustum structure.
Represents a view frustum defined by six planes (left, right, bottom, top, near, far). Provides methods for updating the frustum from a view-projection matrix and for checking containment of points, spheres, and AABBs.
Enumeration for the frustum planes.
Defines indices for accessing the six planes of the frustum.
| bool lmgl::scene::Frustum::contains_aabb | ( | const AABB & | aabb | ) | const |
| bool lmgl::scene::Frustum::contains_point | ( | const glm::vec3 & | point | ) | const |
Check if a point is inside the frustum.
Determines whether the specified point is contained within the frustum.
| point | The point to check. |
| bool lmgl::scene::Frustum::contains_sphere | ( | const BoundingSphere & | sphere | ) | const |
Check if a bounding sphere is inside the frustum.
Determines whether the specified bounding sphere is contained within the frustum.
| sphere | The bounding sphere to check. |
|
inline |
Get a specific frustum plane.
Retrieves the plane corresponding to the given index.
| index | The index of the plane to retrieve. |
| void lmgl::scene::Frustum::update | ( | const glm::mat4 & | view_projection | ) |
Update the frustum planes from a view-projection matrix.
Extracts the six frustum planes from the provided view-projection matrix.
| view_projection | The combined view-projection matrix. |