Tucano  0.1
A library for rapid prototyping with modern OpenGL and GLSL
Tucano::Frustum Class Reference

#include <frustum.hpp>

Public Member Functions

 Frustum (const Matrix4f &mvp)
 
 ~Frustum ()
 
void update (const Matrix4f &mvp)
 
bool isCullable (const Box &box)
 

Private Types

using Plane = Hyperplane< float, 3 >
 
using Box = AlignedBox< float, 3 >
 

Private Member Functions

void extractPlanes (const Matrix4f &mvp, const bool &normalize)
 

Private Attributes

vector< Plane * > m_planes
 

Friends

ostream & operator<< (ostream &out, const Frustum &f)
 

Detailed Description

Camera's frustum. Provide culling of axis-aligned boxes. The camera frustum planes will be in model coordinates. To get the planes in world coordinates, pass a view-projection matrix instead of a model-view-projection

Member Typedef Documentation

using Tucano::Frustum::Box = AlignedBox< float, 3 >
private
using Tucano::Frustum::Plane = Hyperplane< float, 3 >
private

Constructor & Destructor Documentation

Tucano::Frustum::Frustum ( const Matrix4f &  mvp)
inline
Parameters
mvpis the model-view-projection matrix.
Tucano::Frustum::~Frustum ( )
inline

Member Function Documentation

void Tucano::Frustum::extractPlanes ( const Matrix4f &  mvp,
const bool &  normalize 
)
inlineprivate

Algorithm for extraction of the 6 frustum planes from the model-view-projection matrix as explained in paper Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix. Available in . normalize indicates that the final plane equation should be normalized.

bool Tucano::Frustum::isCullable ( const Box box)
inline

Performs optimized view frustum culling as explained in paper Optimized View Frustum Culling Algorithms for Bounding Boxes. Available in: Differently from the algorithm there, we don't distinguish intersection and outside cases. true if the box is outside the frustum, false otherwise.

void Tucano::Frustum::update ( const Matrix4f &  mvp)
inline

Updates the frustrum after changing camera.

Parameters
mvpis the model-view-projection matrix.

Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const Frustum f 
)
friend

Member Data Documentation

vector< Plane* > Tucano::Frustum::m_planes
private

Frustum planes.


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