AI_SDB_OccludedFrustumVisitor Class Reference
[Spatial Database]

#include <AI_SDB_OccludedFrustumVisitor.h>

Inheritance diagram for AI_SDB_OccludedFrustumVisitor:

AI_SDB_VisibleFrustumVisitor AI_SDB_VisibilityVisitor AI_SDB_OccludedFrustumGenArray

List of all members.


Detailed Description

Visits all elements visible in a view frustum, useful for rendering to a camera.

This visitor finds all the visible elements within a view frustum, utilizing the occlusion visitor you provide to cull out occluded elements. It is assumed that you have populated the occlusion visitor with occluders already. This visitor won't modify the state of the occlusion visitor (i.e., by adding or removing occluers), it merely uses the occlusion visitor for visibility tests.

The visitor will call Visit() for every element determined possibly visible.

Since you have to populate the occlusion visitor yourself, you must basically do two visit passes, once with the occlusion visitor to collect occluders, and once with this visitor to collect visible elements:

    AI_SDB_SpatialElement *mysetofelements = GetElements();
    nMyCoolOcclusionVisitorType myocclusionvisitor(viewpoint);
    AI_SDB_OccludedFrustumVisitor ofvisitor(camera, transform, myocclusionvisitor);

    ofvisitor.Reset();    // you should also reset the occlusion visitor you provided...
    myocclusionvisitor.Reset();

    mysetofelements->Accept(myocclusionvisitor);   // gathers occluders
    mysetofelements->Accept(ofvisitor);            // finds visible, non-occluded elements

Version:
2.0 AI_SDB_OccludedFrustumVisitor was ripped from The Nebula Device and renamed to AI_SDB_OccludedFrustumVisitor. Now it is possible to use the class inside and outside Nebula projects.

Public Member Functions

 AI_SDB_OccludedFrustumVisitor (const AI_SDB_Camera &cameraprojection, const AI_Matrix44 &cameratransform, AI_SDB_OcclusionVisitor &occlusionvisitor)
 ~AI_SDB_OccludedFrustumVisitor ()
void Reset ()
 Reset any accumulated state; the view frustum is unchanged. You have to reset the occlusion visitor as well.
void Reset (const AI_SDB_Camera &newcamera, const AI_Matrix44 &newxform)
 Reset any data and reposition the frustum. You have to reset the occlusion visitor as well.
AI_SDB_VisitorFlags VisibilityTest (const AI_BBox &testbox, AI_SDB_VisitorFlags flags)
AI_SDB_VisitorFlags VisibilityTest (const AI_Sphere &testsphere, AI_SDB_VisitorFlags flags)
void EnterLocalSpace (AI_Matrix44 &warp)
void LeaveLocalSpace ()
 leave a local space

Protected Attributes

AI_SDB_OcclusionVisitorm_occlusionvisitor
AI_SDB_VisibleFrustumVisitor m_frustumvisitor

Constructor & Destructor Documentation

AI_SDB_OccludedFrustumVisitor::AI_SDB_OccludedFrustumVisitor ( const AI_SDB_Camera cameraprojection,
const AI_Matrix44 cameratransform,
AI_SDB_OcclusionVisitor occlusionvisitor 
)

AI_SDB_OccludedFrustumVisitor::~AI_SDB_OccludedFrustumVisitor (  ) 


Member Function Documentation

void AI_SDB_OccludedFrustumVisitor::Reset (  )  [virtual]

Reset any accumulated state; the view frustum is unchanged. You have to reset the occlusion visitor as well.

Reimplemented from AI_SDB_VisibleFrustumVisitor.

Reimplemented in AI_SDB_OccludedFrustumGenArray.

void AI_SDB_OccludedFrustumVisitor::Reset ( const AI_SDB_Camera newcamera,
const AI_Matrix44 newxform 
)

Reset any data and reposition the frustum. You have to reset the occlusion visitor as well.

Reimplemented from AI_SDB_VisibleFrustumVisitor.

Reimplemented in AI_SDB_OccludedFrustumGenArray.

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

Check if an element should be culled. If the returned AI_SDB_VisitorFlags produces a TestResult() of true, the element is visible. The returned AI_SDB_VisitorFlags can be used for more efficient visibility tests of primitives enclosed in this bounding box

Reimplemented from AI_SDB_VisibleFrustumVisitor.

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

Check if an element should be culled. If the returned AI_SDB_VisitorFlags produces a TestResult() of true, the element is visible. The returned AI_SDB_VisitorFlags can be used for more efficient visibility tests of primitives enclosed in this bounding AI_Sphere

Reimplemented from AI_SDB_VisibleFrustumVisitor.

void AI_SDB_OccludedFrustumVisitor::EnterLocalSpace ( AI_Matrix44 warp  )  [virtual]

entering a new local space; the matrix given will transform from the current local system into the new space local coordinate system. This is used to possibly update a transform matrix or to transform the spatial region to a new coordinate system.

Reimplemented from AI_SDB_VisibleFrustumVisitor.

void AI_SDB_OccludedFrustumVisitor::LeaveLocalSpace (  )  [virtual]

leave a local space

Reimplemented from AI_SDB_VisibleFrustumVisitor.


Member Data Documentation


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