vmmlib
1.12.0
Templatized C++ vector and matrix math library
|
Helper class to perform OpenGL view frustum culling. More...
#include <frustumCuller.hpp>
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 vec4 & | getNearPlane () const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const FrustumCuller &f) |
Helper class to perform OpenGL view frustum culling.
Definition at line 47 of file frustumCuller.hpp.
|
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.
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.
|
inline |
Destruct this frustum culler.
Definition at line 70 of file frustumCuller.hpp.
References vmml::FrustumCuller< T >::test().
|
inline |
Definition at line 79 of file frustumCuller.hpp.
Visibility vmml::FrustumCuller< T >::test | ( | const vec4 & | sphere | ) | const |
Definition at line 174 of file frustumCuller.hpp.
Referenced by vmml::FrustumCuller< T >::~FrustumCuller().
Visibility vmml::FrustumCuller< T >::test | ( | const AABB< T > & | aabb | ) | const |
Definition at line 249 of file frustumCuller.hpp.
References vmml::AABB< T >::getCenter(), and vmml::AABB< T >::getSize().