AI_SDB_GeometryOcclusionVisitor Class Reference
[Spatial Database]
#include <AI_SDB_GeometryOcclusionVisitor.h>
Detailed Description
A simple occlusion manager using clip planes to clip out occluded objects.The geometry-based occluder does everything using geometry operations in world space. Basically, any occluder is represented as a set of clipping planes that clip out any objects behind the occluder. A visibility test is done by checking that the object or region to be tested is not occluded by any of the currently stored occluders.
The visitor can be configured to track all occluders if you want, but unless you are stingy with your occluders you will probably want to keep the N most "important" occluders, where importance is measured by potential occlusion area A, where A = (occluder size)/(occluder distance to viewpoint). Thus, bigger and closer occluders are preferred. Also, a non-visible occluder is ignored. No occluder fusion is performed.
Since the occlusion tests are all done in world space, not image space, you can do occlusion tests for non-image based views, such as finding LOS of a AI_Sphere (i.e., everything visible within 100m). It also doesn't need to figure out a good resolution
to use for an occlusion maps, hierarchical z-buffer, or any such thing.
- Version:
- 2.0 AI_SDB_GeometryOcclusionVisitor was ripped from The Nebula Device and renamed to AI_SDB_GeometryOcclusionVisitor. Now it is possible to use the class inside and outside Nebula projects.
Public Member Functions | |
AI_SDB_GeometryOcclusionVisitor (const AI_Vector3 &vp, AI_SDB_VisibilityVisitor *v=NULL) | |
~AI_SDB_GeometryOcclusionVisitor () | |
void | Reset () |
void | Reset (const AI_Vector3 &newvp) |
void | Visit (AI_SDB_SpatialElement *visitee) |
Test and possibly process an element. | |
void | AddBBoxOccluder (const AI_BBox &boxoccluder) |
Add an occluder shaped like a AABB to the occluding set. | |
void | AddSphereOccluder (const AI_Sphere &sphereoccluder) |
Add an occluder shaped like a AI_Sphere to the occluding set. | |
void | AddHullOccluder (const AI_SDB_PlaneClipper &hulloccluder) |
Add an occluder shaped like a convex hull (represented by a set of halfspaces) to the occluding set. | |
AI_SDB_VisitorFlags | VisibilityTest (const AI_BBox &testbox, AI_SDB_VisitorFlags flags) |
Test of a given object AABB is visible or occluded. | |
AI_SDB_VisitorFlags | VisibilityTest (const AI_Sphere &testsphere, AI_SDB_VisitorFlags flags) |
Test of a given object AI_Sphere is visible or occluded. | |
void | EnterLocalSpace (AI_Matrix44 &warp) |
enter a local space; typically used for entering other cells/portals | |
void | LeaveLocalSpace () |
leave a local space | |
Protected Attributes | |
AI_Array< AI_SDB_PlaneClipper > | m_occluderset |
AI_Array< AI_Vector3 > | m_debuglines |
Constructor & Destructor Documentation
AI_SDB_GeometryOcclusionVisitor::AI_SDB_GeometryOcclusionVisitor | ( | const AI_Vector3 & | vp, | |
AI_SDB_VisibilityVisitor * | v = NULL | |||
) |
AI_SDB_GeometryOcclusionVisitor::~AI_SDB_GeometryOcclusionVisitor | ( | ) |
Member Function Documentation
void AI_SDB_GeometryOcclusionVisitor::Reset | ( | ) | [virtual] |
Reset any state use during a visibility sweep. If you use a visitor multiple times, reset it between each visibility collection
Reimplemented from AI_SDB_VisibilityVisitor.
void AI_SDB_GeometryOcclusionVisitor::Reset | ( | const AI_Vector3 & | newvp | ) | [virtual] |
Reimplemented from AI_SDB_VisibilityVisitor.
void AI_SDB_GeometryOcclusionVisitor::Visit | ( | AI_SDB_SpatialElement * | visitee | ) | [virtual] |
void AI_SDB_GeometryOcclusionVisitor::AddBBoxOccluder | ( | const AI_BBox & | boxoccluder | ) | [virtual] |
void AI_SDB_GeometryOcclusionVisitor::AddSphereOccluder | ( | const AI_Sphere & | sphereoccluder | ) | [virtual] |
void AI_SDB_GeometryOcclusionVisitor::AddHullOccluder | ( | const AI_SDB_PlaneClipper & | hulloccluder | ) | [virtual] |
Add an occluder shaped like a convex hull (represented by a set of halfspaces) to the occluding set.
Implements AI_SDB_OcclusionVisitor.
AI_SDB_VisitorFlags AI_SDB_GeometryOcclusionVisitor::VisibilityTest | ( | const AI_BBox & | testbox, | |
AI_SDB_VisitorFlags | flags | |||
) | [virtual] |
AI_SDB_VisitorFlags AI_SDB_GeometryOcclusionVisitor::VisibilityTest | ( | const AI_Sphere & | testsphere, | |
AI_SDB_VisitorFlags | flags | |||
) | [virtual] |
void AI_SDB_GeometryOcclusionVisitor::EnterLocalSpace | ( | AI_Matrix44 & | warp | ) | [virtual] |
enter a local space; typically used for entering other cells/portals
Reimplemented from AI_SDB_VisibilityVisitor.
void AI_SDB_GeometryOcclusionVisitor::LeaveLocalSpace | ( | ) | [virtual] |
Member Data Documentation
The documentation for this class was generated from the following files: