vmmlib
1.9.0
Templatized C++ vector and matrix math library
|
Helper class for OpenGL view frustum culling. More...
#include <frustum_culler.hpp>
Public Types | |
typedef vector< 2, T > | vec2 |
typedef vector< 3, T > | vec3 |
typedef vector< 4, T > | vec4 |
Public Member Functions | |
void | setup (const matrix< 4, 4, T > &proj_modelview) |
Set up the culling state using a 4x4 projection*modelView matrix. More... | |
void | setup (const vec3 &nlt, const vec3 &nrt, const vec3 &nlb, const vec3 &nrb, const vec3 &flt, const vec3 &frt, const vec3 &flb, const vec3 &frb) |
Set up the culling state using the eight frustum corner points. More... | |
Visibility | test_sphere (const vec4 &sphere) const |
Visibility | test_aabb (const vec2 &x, const vec2 &y, const vec2 &z) const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const frustum_culler &f) |
Helper class for OpenGL view frustum culling.
Definition at line 47 of file frustum_culler.hpp.
void vmml::frustum_culler< T >::setup | ( | const matrix< 4, 4, T > & | proj_modelview | ) |
Set up the culling state using a 4x4 projection*modelView matrix.
Setup the culler by extracting the frustum planes from the projection matrix.
The projection matrix should contain the viewing transformation.
Definition at line 119 of file frustum_culler.hpp.
void vmml::frustum_culler< T >::setup | ( | const vec3 & | nlt, |
const vec3 & | nrt, | ||
const vec3 & | nlb, | ||
const vec3 & | nrb, | ||
const vec3 & | flt, | ||
const vec3 & | frt, | ||
const vec3 & | flb, | ||
const vec3 & | frb | ||
) |
Set up the culling state using the eight frustum corner points.
Corner naming is n(ear)|f(ar), l(eft)|r(ight), t(op)|b(ottom)
Definition at line 144 of file frustum_culler.hpp.