AI_SDB_SpatialElement Class Reference
[Spatial Database]
#include <AI_SDB_SpatialElements.h>
Detailed Description
The interface for elements contained within sector.A spatial element represents some sort of object within a sector. This could be a simple object, a portal, or something else entirely.
The bounding box data member is stuck here instead of some subclass for speed since it is used by many spatial tree data structures. The AABB stored is a conservative bounding box, guaranteed to enclose the entire element. Since the actual element may be much smaller for occlusion or visibility purposes, you have the ability to write some more sophisticated code in the Accept() methods, setting the AABB value for use with octree/kd-tree/bsp processors. The BBoxSpatialElement simply uses the stored AABB value for visibility purposes.
- Version:
- 2.0 AI_SDB_SpatialElement was ripped from The Nebula Device and renamed to AI_SDB_SpatialElement. Now it is possible to use the class inside and outside Nebula projects.
Public Types | |
enum | { N_SPATIAL_PORTAL = (1<<0), N_SPATIAL_HIERARCHY = (1<<1), N_SPATIAL_OCCLUDER = (1<<2), N_SPATIAL_AABB = (1<<3) } |
typedef int | AI_SDB_SpatialElementType |
Public Member Functions | |
AI_SDB_SpatialElement (AI_SDB_SpatialElementType starttype=0) | |
AI_SDB_SpatialElement (AI_SDB_SpatialElementType starttype, const AI_BBox &initbbox) | |
virtual | ~AI_SDB_SpatialElement () |
AI_SDB_SpatialElementType | GetSpatialType () const |
bool | HasOccluder () const |
If this returns true, then there is occlusion info in this element. | |
bool | HasAABB () const |
If this returns true, then there is valid AABB info in this element. | |
AI_BBox | GetAABB () const |
void | SetAABB (const AI_BBox &newbbox) |
void * | GetPtr () const |
void | SetPtr (void *ptr) |
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) |
Protected Attributes | |
int | m_spatialtype |
AI_BBox | m_AABB |
void * | m_ptr |
Member Typedef Documentation
typedef int AI_SDB_SpatialElement::AI_SDB_SpatialElementType |
Member Enumeration Documentation
anonymous enum |
Constructor & Destructor Documentation
AI_SDB_SpatialElement::AI_SDB_SpatialElement | ( | AI_SDB_SpatialElementType | starttype = 0 |
) | [inline] |
AI_SDB_SpatialElement::AI_SDB_SpatialElement | ( | AI_SDB_SpatialElementType | starttype, | |
const AI_BBox & | initbbox | |||
) | [inline] |
virtual AI_SDB_SpatialElement::~AI_SDB_SpatialElement | ( | ) | [inline, virtual] |
Member Function Documentation
AI_SDB_SpatialElementType AI_SDB_SpatialElement::GetSpatialType | ( | ) | const [inline] |
bool AI_SDB_SpatialElement::HasOccluder | ( | ) | const [inline] |
If this returns true, then there is occlusion info in this element.
bool AI_SDB_SpatialElement::HasAABB | ( | ) | const [inline] |
If this returns true, then there is valid AABB info in this element.
AI_BBox AI_SDB_SpatialElement::GetAABB | ( | ) | const [inline] |
void AI_SDB_SpatialElement::SetAABB | ( | const AI_BBox & | newbbox | ) | [inline] |
void* AI_SDB_SpatialElement::GetPtr | ( | ) | const [inline] |
void AI_SDB_SpatialElement::SetPtr | ( | void * | ptr | ) | [inline] |
void AI_SDB_SpatialElement::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 in AI_SDB_SpatialAABBTree, AI_SDB_BBoxSpatialElement, AI_SDB_SpatialPortalElement, and AI_SDB_SpatialListHierarchy.
void AI_SDB_SpatialElement::Accept | ( | AI_SDB_SpatialVisitor & | visitor, | |
int | recursiondepth, | |||
AI_SDB_VisitorFlags | flags | |||
) | [virtual] |
Reimplemented in AI_SDB_SpatialAABBTree, AI_SDB_BBoxSpatialElement, AI_SDB_SpatialPortalElement, and AI_SDB_SpatialListHierarchy.
void AI_SDB_SpatialElement::Accept | ( | AI_SDB_OcclusionVisitor & | visitor, | |
int | recursiondepth, | |||
AI_SDB_VisitorFlags | flags | |||
) | [virtual] |
Reimplemented in AI_SDB_SpatialAABBTree, AI_SDB_BBoxSpatialElement, AI_SDB_SpatialOccluderElement, and AI_SDB_SpatialListHierarchy.
Member Data Documentation
int AI_SDB_SpatialElement::m_spatialtype [protected] |
AI_BBox AI_SDB_SpatialElement::m_AABB [protected] |
void* AI_SDB_SpatialElement::m_ptr [protected] |
The documentation for this class was generated from the following files: