AI_SDB_OcclusionVisitor Class Reference

#include <AI_SDB_VisitorBase.h>

Inheritance diagram for AI_SDB_OcclusionVisitor:

AI_SDB_VisibilityVisitor AI_SDB_GeometryOcclusionVisitor

List of all members.


Detailed Description

Visitor to collect occluders and provide visibility testing using those occluders.

The OcclusionVisitor is a general visitor class that processes occluders and construct some sort of occlusiong representation so that it can determine if other objects are occluder or not. This may be acheived by simply recording all the occluding objects and doing a geometrical inspection of potentially visible objects, or it may be acheive with occlusion maps or some other method. The keys attributes of the occlusion visitor are:

1. Non-compiled. You can add an occluder, test to see if an object is occluded so far, and then add another occluder. If the occlusion determination needs to compile some sort of internal data, it must be able to do so multiple times; there is no requirement to add all the occluders and then start doing occlusion tests. This means you may need to have a flag that forces a recompilation of internal data structures whenever a new occluder is added.

2. Conservative. If the occlusion determination is not sure a given object is totally occluded, it should consider an object visible. A specific occlusion method can do "aggressive culling" and remove objects that are possibly or partially visible, but this should be noted in the documentation. Also, the degree of aggressive culling should be controllable through some user parameters.

3. Deterministic. If I perform an occlusion test on and object, and then do another occlusion test on that same object, it should return the same result unless I have modified the occlusion state (for instance, by adding another occluder). However, if I reset the occlusion state and add in all the same occluders again, you can return a different result. This allows the use of temporal coherence if you really want it.

This visitor doesn't put any spatial bounds on the occluders it will use. If you only want occluders in a specific region--such as a view frustum--you will have to provide a properly configured AI_SDB_VisibilityVisitor using SetVisibilityVisitor. Then potential occluding objects are checked against the visibilitytest() of the visibilityvisitor. The occlusion visitor will tell it's restricting visibility visitor about local space enter/leave events.

Public Member Functions

 AI_SDB_OcclusionVisitor (const AI_Vector3 &viewpoint)
virtual ~AI_SDB_OcclusionVisitor ()
void SetRestrictingVisitor (AI_SDB_VisibilityVisitor *vv)
virtual void AddBBoxOccluder (const AI_BBox &boxoccluder)=0
 Add an occluder shape like an AABB to the occluding set.
virtual void AddSphereOccluder (const AI_Sphere &sphereoccluder)=0
 Add an occluder shaped like a AI_Sphere to the occluding set.
virtual void AddHullOccluder (const AI_SDB_PlaneClipper &hulloccluder)=0
 Add an occluder shaped like a convex hull (represented by a set of halfspaces) to the occluding set.
virtual AI_SDB_VisitorFlags VisibilityTest (const AI_BBox &testbox, AI_SDB_VisitorFlags flags)=0
 Test of a given object AABB is visible or occluded.
virtual AI_SDB_VisitorFlags VisibilityTest (const AI_Sphere &testsphere, AI_SDB_VisitorFlags flags)=0
 Test of a given object AI_Sphere is visible or occluded.

Protected Attributes

AI_SDB_VisibilityVisitorm_restrictingvisitor


Constructor & Destructor Documentation

AI_SDB_OcclusionVisitor::AI_SDB_OcclusionVisitor ( const AI_Vector3 viewpoint  ) 

AI_SDB_OcclusionVisitor::~AI_SDB_OcclusionVisitor (  )  [virtual]


Member Function Documentation

void AI_SDB_OcclusionVisitor::SetRestrictingVisitor ( AI_SDB_VisibilityVisitor vv  )  [inline]

virtual void AI_SDB_OcclusionVisitor::AddBBoxOccluder ( const AI_BBox boxoccluder  )  [pure virtual]

Add an occluder shape like an AABB to the occluding set.

Implemented in AI_SDB_GeometryOcclusionVisitor.

virtual void AI_SDB_OcclusionVisitor::AddSphereOccluder ( const AI_Sphere sphereoccluder  )  [pure virtual]

Add an occluder shaped like a AI_Sphere to the occluding set.

Implemented in AI_SDB_GeometryOcclusionVisitor.

virtual void AI_SDB_OcclusionVisitor::AddHullOccluder ( const AI_SDB_PlaneClipper hulloccluder  )  [pure virtual]

Add an occluder shaped like a convex hull (represented by a set of halfspaces) to the occluding set.

Implemented in AI_SDB_GeometryOcclusionVisitor.

virtual AI_SDB_VisitorFlags AI_SDB_OcclusionVisitor::VisibilityTest ( const AI_BBox testbox,
AI_SDB_VisitorFlags  flags 
) [pure virtual]

Test of a given object AABB is visible or occluded.

Implements AI_SDB_VisibilityVisitor.

Implemented in AI_SDB_GeometryOcclusionVisitor.

virtual AI_SDB_VisitorFlags AI_SDB_OcclusionVisitor::VisibilityTest ( const AI_Sphere testsphere,
AI_SDB_VisitorFlags  flags 
) [pure virtual]

Test of a given object AI_Sphere is visible or occluded.

Implements AI_SDB_VisibilityVisitor.

Implemented in AI_SDB_GeometryOcclusionVisitor.


Member Data Documentation


The documentation for this class was generated from the following files: