COGS
Computer Graphics Structures library
cogs::Frustum Struct Reference

Definition of a 3-dimensional view frustum - a square-based 3D pyramid truncated by parallel planes. More...

Public Member Functions

glm::vec3 Right () const
 Compute right vector from forward and up vectors.
 
geom::Plane GetNearPlane () const
 Compute near plane. The normal vector points inside the Frustum.
 
geom::Plane GetFarPlane () const
 Compute near plane. The normal vector points inside the Frustum.
 
geom::Plane GetTopPlane () const
 Compute top plane. The normal vector points inside the Frustum.
 
geom::Plane GetBottomPlane () const
 Compute bottom plane. The normal vector points inside the Frustum.
 
geom::Plane GetRightPlane () const
 Compute right plane. The normal vector points inside the Frustum.
 
geom::Plane GetLeftPlane () const
 Compute left plane. The normal vector points inside the Frustum.
 
geom::Plane GetHorizontalPlane () const
 Compute horizontal plane. The normal vector is the up vector.
 
geom::Plane GetVerticalPlane () const
 Compute vertical plane. The normal vector is the right vector.
 
std::array< glm::vec3, 4 > GetSliceCorners (float slice_distance) const
 Compute corners of frustum slice quad, made in specified distance.
 
std::array< glm::vec3, 4 > GetNearCorners () const
 Compute corners of frustum near plane quad.
 
std::array< glm::vec3, 4 > GetFarCorners () const
 Compute corners of frustum far plane quad.
 

Data Fields

glm::vec3 position
 Frustum position.
 
glm::vec3 forward
 Frustum forward vector. Points inside the Frustum from its position.
 
glm::vec3 up
 Frustum up vector.
 
float near_distance
 Distance of near plane from the Frustum's position in the direction of its forward vector.
 
float far_distance
 Distance of far plane from the Frustum's position in the direction of its forward vector.
 
float horizontal_fov
 Full horizontal field of view angle.
 
float vertical_fov
 Full vertical field of view angle.
 

Detailed Description

Definition of a 3-dimensional view frustum - a square-based 3D pyramid truncated by parallel planes.