vmmlib  1.10.0
Templatized C++ vector and matrix math library
vmml::FrustumCuller< T > Class Template Reference

Helper class to perform OpenGL view frustum culling. More...

#include <frustumCuller.hpp>

+ Collaboration diagram for vmml::FrustumCuller< T >:

Public Types

typedef vector< 2, T > vec2
 
typedef vector< 3, T > vec3
 
typedef vector< 4, T > vec4
 

Public Member Functions

 FrustumCuller ()
 Construct a new frustum culler.
 
 FrustumCuller (const matrix< 4, 4, T > &projModelView)
 Construct a frustum culler using a 4x4 projection*model*view matrix. More...
 
 FrustumCuller (const vec3 &nlt, const vec3 &nrt, const vec3 &nlb, const vec3 &nrb, const vec3 &flt, const vec3 &frt, const vec3 &flb, const vec3 &frb)
 Construct a frustum culler using the eight frustum corner points. More...
 
 ~FrustumCuller ()
 Destruct this frustum culler. More...
 
Visibility test (const vec4 &sphere) const
 
Visibility test (const AABB< T > &aabb) const
 
const vec4getNearPlane () const
 

Friends

std::ostream & operator<< (std::ostream &os, const FrustumCuller &f)
 

Detailed Description

template<typename T>
class vmml::FrustumCuller< T >

Helper class to perform OpenGL view frustum culling.

Definition at line 47 of file frustumCuller.hpp.

Constructor & Destructor Documentation

template<typename T >
vmml::FrustumCuller< T >::FrustumCuller ( const matrix< 4, 4, T > &  projModelView)
explicit

Construct a frustum culler using a 4x4 projection*model*view matrix.

Setup the culler by extracting the frustum planes from the projection matrix.

The projection matrix should contain the viewing transformation.

Definition at line 117 of file frustumCuller.hpp.

template<typename T >
vmml::FrustumCuller< T >::FrustumCuller ( const vec3 nlt,
const vec3 nrt,
const vec3 nlb,
const vec3 nrb,
const vec3 flt,
const vec3 frt,
const vec3 flb,
const vec3 frb 
)

Construct a frustum culler using the eight frustum corner points.

Corner naming is n(ear)|f(ar), l(eft)|r(ight), t(op)|b(ottom)

Definition at line 141 of file frustumCuller.hpp.

template<typename T >
vmml::FrustumCuller< T >::~FrustumCuller ( )
inline

Destruct this frustum culler.

Definition at line 70 of file frustumCuller.hpp.

Member Function Documentation

template<typename T >
const vec4& vmml::FrustumCuller< T >::getNearPlane ( ) const
inline
Returns
the plane equation of the current near plane.

Definition at line 79 of file frustumCuller.hpp.

template<typename T >
Visibility vmml::FrustumCuller< T >::test ( const vec4 sphere) const
Returns
the visibility of the given sphere

Definition at line 174 of file frustumCuller.hpp.

template<typename T >
Visibility vmml::FrustumCuller< T >::test ( const AABB< T > &  aabb) const
Returns
the visibility of the axis-aligned bounding box

Definition at line 249 of file frustumCuller.hpp.

References vmml::AABB< T >::getCenter(), and vmml::AABB< T >::getSize().

+ Here is the call graph for this function:


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