AI_SDB_SpatialAABBTree Class Reference
[Spatial Database]
#include <AI_SDB_SpatialAABBTree.h>
Detailed Description
A collection of elements stored in an AABB tree.This is the SpatialDB representation of an AABB tree, which is a spatial data structure that manages objects using a set of nested bounding boxes. Any node in the tree has a bounding box that completely contains all of its children nodes, which makes it easy and fast to cull away large sections of the tree without having to check every object.
Typically a node contains some spatial objects and several child nodes. There exist many methods of splitting up object sets into child nodes; see "Dynamic Spatial Partitioning for Real-Time Visibility Determination," by Joshua Shagam and Joseph J. Pfeiffer, Jr. for a good survey of the various nesting heuristics. This tree simply picks a single splitting point for each node and then sorts objects into the child nodes by examining their center relative to that split point.
- Version:
- 2.0 AI_SDB_SpatialAABBTree was ripped from The Nebula Device and renamed to AI_SDB_SpatialAABBTree. Now it is possible to use the class inside and outside Nebula projects.
Public Member Functions | |
AI_SDB_SpatialAABBTree () | |
~AI_SDB_SpatialAABBTree () | |
void | ClearNodes () |
Clear out spatial element referencesw. Elements are not deleted! | |
void | AddElement (AI_SDB_SpatialElement *appendme) |
Add an element to the set of elements. | |
void | RemoveElement (AI_SDB_SpatialElement *removeme) |
Remove a given element. | |
void | MoveElement (AI_SDB_SpatialElement *moveme, const AI_BBox &newbox) |
Move a given element. | |
virtual void | Accept (AI_SDB_VisibilityVisitor &visitor, int recursiondepth, AI_SDB_VisitorFlags flags) |
Process the list of elements. | |
virtual void | Accept (AI_SDB_SpatialVisitor &visitor, int recursiondepth, AI_SDB_VisitorFlags flags) |
Process the list of elements. | |
virtual void | Accept (AI_SDB_OcclusionVisitor &visitor, int recursiondepth, AI_SDB_VisitorFlags flags) |
Process the list of elements. | |
AI_SDB_SpatialAABBTreeNode * | alloc_node () |
void | free_node (AI_SDB_SpatialAABBTreeNode *freeme) |
Protected Member Functions | |
AI_SDB_SpatialAABBTreeNode * | FindSuitableNode (const AI_Vector3 &v_center) |
void | collapse_node (AI_SDB_SpatialAABBTreeNode *collapseme) |
void | split_node (AI_SDB_SpatialAABBTreeNode *splitme) |
void | balance_tree (AI_SDB_SpatialAABBTreeNode *treeroot) |
Protected Attributes | |
AI_SDB_SpatialAABBTreeNode * | m_treenodes |
Constructor & Destructor Documentation
AI_SDB_SpatialAABBTree::AI_SDB_SpatialAABBTree | ( | ) |
AI_SDB_SpatialAABBTree::~AI_SDB_SpatialAABBTree | ( | ) |
Member Function Documentation
void AI_SDB_SpatialAABBTree::ClearNodes | ( | ) |
Clear out spatial element referencesw. Elements are not deleted!
void AI_SDB_SpatialAABBTree::AddElement | ( | AI_SDB_SpatialElement * | appendme | ) |
Add an element to the set of elements.
void AI_SDB_SpatialAABBTree::RemoveElement | ( | AI_SDB_SpatialElement * | removeme | ) |
Remove a given element.
void AI_SDB_SpatialAABBTree::MoveElement | ( | AI_SDB_SpatialElement * | moveme, | |
const AI_BBox & | newbox | |||
) |
Move a given element.
void AI_SDB_SpatialAABBTree::Accept | ( | AI_SDB_VisibilityVisitor & | visitor, | |
int | recursiondepth, | |||
AI_SDB_VisitorFlags | flags | |||
) | [virtual] |
void AI_SDB_SpatialAABBTree::Accept | ( | AI_SDB_SpatialVisitor & | visitor, | |
int | recursiondepth, | |||
AI_SDB_VisitorFlags | flags | |||
) | [virtual] |
void AI_SDB_SpatialAABBTree::Accept | ( | AI_SDB_OcclusionVisitor & | visitor, | |
int | recursiondepth, | |||
AI_SDB_VisitorFlags | flags | |||
) | [virtual] |
AI_SDB_SpatialAABBTreeNode * AI_SDB_SpatialAABBTree::alloc_node | ( | ) |
void AI_SDB_SpatialAABBTree::free_node | ( | AI_SDB_SpatialAABBTreeNode * | freeme | ) |
AI_SDB_SpatialAABBTreeNode * AI_SDB_SpatialAABBTree::FindSuitableNode | ( | const AI_Vector3 & | v_center | ) | [protected] |
void AI_SDB_SpatialAABBTree::collapse_node | ( | AI_SDB_SpatialAABBTreeNode * | collapseme | ) | [protected] |
void AI_SDB_SpatialAABBTree::split_node | ( | AI_SDB_SpatialAABBTreeNode * | splitme | ) | [protected] |
void AI_SDB_SpatialAABBTree::balance_tree | ( | AI_SDB_SpatialAABBTreeNode * | treeroot | ) | [protected] |
Member Data Documentation
The documentation for this class was generated from the following files: