#include <frustum.h>
Public Types | |
| typedef GLPlaned | TPlane |
| enum | TPlaneID { PL_LEFT = 0, PL_RIGHT, PL_TOP, PL_BOTTOM, PL_NEAR, PL_FAR } |
| enum | ClipState { OUTSIDE, INSIDE, INTERSECT } |
| enum | Halfspace { NEGATIVE = -1, POSITIVE = +1, ON_PLANE = 0 } |
Public Member Functions | |
| Frustum () | |
| Frustum (const Frustum &f) | |
| Frustum (const GLMatrix4d &m) | |
| void | set (const GLMatrix4d &m, bool normalize=true) |
Sets the frustrum clipping planes from matrix m. | |
| void | transform (const GLMatrix4d &m, bool normalize=true) |
| Transforms frustum planes to test objects in object space. | |
| const TPlane & | getPlane (TPlaneID planeID) |
| Gets one frustum plane. | |
| void | normalizePlane (TPlaneID planeID) |
| Normalizes given plane. | |
| void | normalizeAllPlanes (void) |
| Normalizes all frustum planes. | |
| bool | testPoint (const GLVector3d &p) |
| ClipState | testSphere (const GLVector3d ¢er, const double r) const |
| ClipState | testBox (const GLVector3d ¢er, const GLVector3d &extent) const |
Static Public Member Functions | |
| static Halfspace | classifyPoint (const TPlane &plane, const GLVector3d &point, const double eps=0.0f) |
Private Types | |
| typedef std::vector< TPlane > | TPlaneContainer |
Private Member Functions | |
| int | mi (int row, int col) |
| "matrix index" - helper method | |
Private Attributes | |
| TPlaneContainer | mPlanes |
| six clipping planes of frustum | |
Definition at line 11 of file frustum.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 6 of file frustum.cpp. References mPlanes. |
|
|
Definition at line 34 of file frustum.h. References set(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Definition at line 109 of file frustum.cpp. References NEGATIVE, ON_PLANE, and POSITIVE. Referenced by TerrainRoetger::build_quadtree(), testBox(), and testPoint(). |
|
|
Gets one frustum plane.
Definition at line 64 of file frustum.h. References mPlanes. Referenced by TerrainRoetger::build_quadtree(), and testPoint(). |
|
||||||||||||
|
"matrix index" - helper method
computes index to GLMatrix4d from
Definition at line 103 of file frustum.h. References assertL. Referenced by set(). |
|
|
Normalizes all frustum planes.
Definition at line 23 of file frustum.cpp. References normalizePlane(), PL_BOTTOM, PL_FAR, PL_LEFT, PL_NEAR, PL_RIGHT, and PL_TOP. Referenced by set(). Here is the call graph for this function: ![]() |
|
|
Normalizes given plane. Divides the normal vector and D by normal vector length.
Definition at line 12 of file frustum.cpp. References assertL, and mPlanes. Referenced by normalizeAllPlanes(). |
|
||||||||||||
|
Sets the frustrum clipping planes from matrix
Initializes 6 frustum clipping planes
Definition at line 33 of file frustum.cpp. References mi(), mPlanes, normalizeAllPlanes(), PL_BOTTOM, PL_FAR, PL_LEFT, PL_NEAR, PL_RIGHT, and PL_TOP. Referenced by Camera::computeFrustum(), and Frustum(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 157 of file frustum.cpp. References classifyPoint(), mPlanes, NEGATIVE, and OUTSIDE. Referenced by TerrainGeoMipMap::frustumCulling(). Here is the call graph for this function: ![]() |
|
|
Definition at line 121 of file frustum.cpp. References classifyPoint(), getPlane(), PL_BOTTOM, PL_FAR, PL_LEFT, PL_NEAR, PL_RIGHT, and PL_TOP. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 138 of file frustum.cpp. |
|
||||||||||||
|
Transforms frustum planes to test objects in object space. In many cases, the frustum is defined by projection a transformation matrix of the camera. But there can be other transformations that transforms objects from object space to world space. If we would like to test those objects to frustum intersection, we should apply the OS->WS transformations to objects and test these transformed objects. Instead, for each object we transform the frustum with the same OS->WS matrix and test the object against the frustum in OS. Definition at line 93 of file frustum.cpp. References mPlanes. Referenced by TerrainRoetger::update(), and TerrainGeoMipMap::update(). |
|
|
six clipping planes of frustum
Definition at line 110 of file frustum.h. Referenced by Frustum(), getPlane(), normalizePlane(), set(), testBox(), testSphere(), and transform(). |
1.4.5