AI_SDB_BBoxSpatialElement Class Reference
[Spatial Database]

#include <AI_SDB_SpatialElements.h>

Inheritance diagram for AI_SDB_BBoxSpatialElement:

AI_SDB_SpatialElement AI_SDB_SpatialOccluderElement AI_SDB_SpatialPortalElement

List of all members.


Detailed Description

A class that adds bounding-box testing to a given spatial element.

This templated class adds extra stuff to a given spatial element, specifically it stores a bounding box and uses that to do visibility and containment tests on visitors, such that this element is processed only if the bounding box is visible or contained in the spatial region. Stick this onto a generic (spatially-undefined) spatial element to make the spatial element a bounding-box based element

The BBoxSpatialElement simply uses the stored AABB value for visibility and occlusion purposes. If your object is not well represented by its AABB you should implement your own Accept() methods with different visibility and occlusion code. The AABB should still be set properly so that spatial data structures have something to work with.

Example:

    typedef BBoxSpatialElement<nSpatialPortal> nBoxPortalElement;

    nBoxPortalElement portal(bboxlocation); // a bbox-based portal
    portal.Accept(viewfrustumvisitor);

Public Member Functions

 AI_SDB_BBoxSpatialElement (AI_SDB_SpatialElementType t, const AI_BBox &initialspace)
 AI_SDB_BBoxSpatialElement (const AI_BBox &initialspace)
 ~AI_SDB_BBoxSpatialElement ()
void UpdateBBox (const AI_BBox &newbox)
virtual void Accept (AI_SDB_VisibilityVisitor &visitor, int recursiondepth, AI_SDB_VisitorFlags flags)
virtual void Accept (AI_SDB_SpatialVisitor &visitor, int recursiondepth, AI_SDB_VisitorFlags flags)
virtual void Accept (AI_SDB_OcclusionVisitor &visitor, int recursiondepth, AI_SDB_VisitorFlags flags)

Constructor & Destructor Documentation

AI_SDB_BBoxSpatialElement::AI_SDB_BBoxSpatialElement ( AI_SDB_SpatialElementType  t,
const AI_BBox initialspace 
) [inline]

AI_SDB_BBoxSpatialElement::AI_SDB_BBoxSpatialElement ( const AI_BBox initialspace  )  [inline]

AI_SDB_BBoxSpatialElement::~AI_SDB_BBoxSpatialElement (  ) 


Member Function Documentation

void AI_SDB_BBoxSpatialElement::UpdateBBox ( const AI_BBox newbox  )  [inline]

void AI_SDB_BBoxSpatialElement::Accept ( AI_SDB_VisibilityVisitor visitor,
int  recursiondepth,
AI_SDB_VisitorFlags  flags 
) [virtual]

get processed by a visitor. The element can do some tests, call nested objects, etc. and then will call Visit() on the visitor if this element should be considered "visible" or "contained" as the case may be. the Visitor then processes the element in some visitor-dependent manner.

Reimplemented from AI_SDB_SpatialElement.

Reimplemented in AI_SDB_SpatialPortalElement.

void AI_SDB_BBoxSpatialElement::Accept ( AI_SDB_SpatialVisitor visitor,
int  recursiondepth,
AI_SDB_VisitorFlags  flags 
) [virtual]

Reimplemented from AI_SDB_SpatialElement.

Reimplemented in AI_SDB_SpatialPortalElement.

void AI_SDB_BBoxSpatialElement::Accept ( AI_SDB_OcclusionVisitor visitor,
int  recursiondepth,
AI_SDB_VisitorFlags  flags 
) [virtual]

Reimplemented from AI_SDB_SpatialElement.

Reimplemented in AI_SDB_SpatialOccluderElement.


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