Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::Octree Class Reference

Octree datastructure for managing scene nodes. More...

#include <OgreOctree.h>

List of all members.

Public Methods

 Octree (Octree *p)
 ~Octree ()
void _addNode (OctreeNode *)
 Adds an Octree scene node to this octree level. More...

void _removeNode (OctreeNode *)
 Removes an Octree scene node to this octree level. More...

int numNodes ()
 Returns the number of scene nodes attached to this octree. More...

bool _isTwiceSize (AxisAlignedBox &box)
 Returns true is the box will fit in a child. More...

void _getChildIndexes (AxisAlignedBox &, int *x, int *y, int *z)
 It's assumed the the given box has already been proven to fit into a child. More...

void _getCullBounds (AxisAlignedBox *)
 Creates the AxisAlignedBox used for culling this octree. More...


Public Attributes

AxisAlignedBox mBox
 The bounding box of the octree. More...

Vector3 mHalfSize
 Vector containing the dimensions of this octree / 2. More...

Octree * mChildren [2][2][2]
 3D array of children of this octree. More...

NodeList mNodes
 Public list of SceneNodes attached to this particular octree. More...


Protected Methods

void _ref ()
 Increments the overall node count of this octree and all it's parents. More...

void _unref ()
 Decrements the overall node count of this octree and all it's parents. More...


Protected Attributes

int mNumNodes
 number of SceneNodes in this octree and all it's children. More...

Octree * mParent
 parent octree. More...


Detailed Description

Octree datastructure for managing scene nodes.

Remarks:
This is a loose octree implementation, meaning that each octant child of the octree actually overlaps it's siblings by a factor of .5. This guarantees that any thing that is half the size of the parent will fit completely into a child, with no splitting necessary.


Constructor & Destructor Documentation

Ogre::Octree::Octree Octree *    p
 

Ogre::Octree::~Octree  
 


Member Function Documentation

void Ogre::Octree::_addNode OctreeNode  
 

Adds an Octree scene node to this octree level.

Remarks:
This is called by the OctreeSceneManager after it has determined the correct Octree to insert the node into.

void Ogre::Octree::_getChildIndexes AxisAlignedBox  ,
int *    x,
int *    y,
int *    z
 

It's assumed the the given box has already been proven to fit into a child.

Remarks:
This is used by the OCtreeSceneManager to determine which child to traverse next when finding the appropriate octree to insert the box. Since it is a loose octree, only the center of the box is checked to determine the octant.

void Ogre::Octree::_getCullBounds AxisAlignedBox  
 

Creates the AxisAlignedBox used for culling this octree.

Remarks:
Since it's a loose octree, the culling bounds can be different than the actual bounds of the octree.

bool Ogre::Octree::_isTwiceSize AxisAlignedBox   box
 

Returns true is the box will fit in a child.

Remarks:
This method is used by the OctreeSceneManager to determine if the given box will fit into a child of this octree.

void Ogre::Octree::_ref   [inline, protected]
 

Increments the overall node count of this octree and all it's parents.

void Ogre::Octree::_removeNode OctreeNode  
 

Removes an Octree scene node to this octree level.

void Ogre::Octree::_unref   [inline, protected]
 

Decrements the overall node count of this octree and all it's parents.

int Ogre::Octree::numNodes   [inline]
 

Returns the number of scene nodes attached to this octree.


Member Data Documentation

AxisAlignedBox Ogre::Octree::mBox
 

The bounding box of the octree.

Remarks:
This is used for octant index determination and rendering, but not culling

Octree* Ogre::Octree::mChildren[ 2 ][ 2 ][ 2 ]
 

3D array of children of this octree.

Remarks:
Children are dynamically created as needed when nodes are inserted in the Octree. If, later, the all the nodes are removed from the child, it is still kept arround.

Vector3 Ogre::Octree::mHalfSize
 

Vector containing the dimensions of this octree / 2.

NodeList Ogre::Octree::mNodes
 

Public list of SceneNodes attached to this particular octree.

int Ogre::Octree::mNumNodes [protected]
 

number of SceneNodes in this octree and all it's children.

Octree* Ogre::Octree::mParent [protected]
 

parent octree.

Copyright © 2002 by The OGRE Team