Tucano
0.1
A library for rapid prototyping with modern OpenGL and GLSL
|
#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) |
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
|
private |
|
private |
|
inline |
mvp | is the model-view-projection matrix. |
|
inline |
|
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.
|
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.
|
inline |
Updates the frustrum after changing camera.
mvp | is the model-view-projection matrix. |
|
friend |