|
Kemena3D
|
View frustum defined by six planes extracted from a view-projection matrix. More...
#include <koctree.h>
Public Member Functions | |
| void | extractFromMatrix (const kMat4 &viewProjection) |
| Extract the six frustum planes from a combined view-projection matrix. | |
| kFrustumTestResult | testAABB (const kAABB &aabb) const |
| Test an AABB against the frustum. | |
| bool | intersectsAABB (const kAABB &aabb) const |
| Quick reject: returns false if the AABB is fully outside. | |
View frustum defined by six planes extracted from a view-projection matrix.
Call extractFromMatrix() with (projection * view) each frame before querying.
| void kemena::kFrustum::extractFromMatrix | ( | const kMat4 & | viewProjection | ) |
Extract the six frustum planes from a combined view-projection matrix.
Uses the Gribb-Hartmann method (row combination of the VP matrix). The planes are stored in the form n·x + d = 0 where positive values are inside the frustum.
| viewProjection | projection * view matrix. |
| bool kemena::kFrustum::intersectsAABB | ( | const kAABB & | aabb | ) | const |
Quick reject: returns false if the AABB is fully outside.
| kFrustumTestResult kemena::kFrustum::testAABB | ( | const kAABB & | aabb | ) | const |
Test an AABB against the frustum.