OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::Octree Class Reference

Octree datastructure for managing scene nodes. More...

#include <OgreOctree.h>

+ Inheritance diagram for Ogre::Octree:
+ Collaboration diagram for Ogre::Octree:

Public Types

typedef list< OctreeNode * >::type NodeList
 

Public Member Functions

 Octree (Octree *p)
 
 Octree (PCZone *zone, Octree *p)
 
 ~Octree ()
 
 ~Octree ()
 
void _addNode (OctreeNode *)
 Adds an Octree scene node to this octree level. More...
 
void _addNode (PCZSceneNode *)
 Adds an PCZscene node to this octree level. More...
 
void _findNodes (const AxisAlignedBox &t, PCZSceneNodeList &list, PCZSceneNode *exclude, bool includeVisitors, bool full)
 
void _findNodes (const Ray &t, PCZSceneNodeList &list, PCZSceneNode *exclude, bool includeVisitors, bool full)
 
void _findNodes (const Sphere &t, PCZSceneNodeList &list, PCZSceneNode *exclude, bool includeVisitors, bool full)
 
void _findNodes (const PlaneBoundedVolume &t, PCZSceneNodeList &list, PCZSceneNode *exclude, bool includeVisitors, bool full)
 
void _getChildIndexes (const AxisAlignedBox &, int *x, int *y, int *z) const
 Returns the appropriate indexes for the child of this octree into which the box will fit. More...
 
void _getChildIndexes (const AxisAlignedBox &, int *x, int *y, int *z) const
 Returns the appropriate indexes for the child of this octree into which the box will fit. More...
 
void _getCullBounds (AxisAlignedBox *) const
 Creates the AxisAlignedBox used for culling this octree. More...
 
void _getCullBounds (AxisAlignedBox *) const
 Creates the AxisAlignedBox used for culling this octree. More...
 
bool _isTwiceSize (const AxisAlignedBox &box) const
 Determines if this octree is twice as big as the given box. More...
 
bool _isTwiceSize (const AxisAlignedBox &box) const
 Determines if this octree is twice as big as the given box. More...
 
void _removeNode (OctreeNode *)
 Removes an Octree scene node to this octree level. More...
 
void _removeNode (PCZSceneNode *)
 Removes an PCZscene node to this octree level. More...
 
WireBoundingBoxgetWireBoundingBox ()
 Creates the wire frame bounding box for this octant. More...
 
WireBoundingBoxgetWireBoundingBox ()
 Creates the wire frame bounding box for this octant. More...
 
int numNodes ()
 Returns the number of scene nodes attached to this octree. More...
 
int numNodes ()
 Returns the number of scene nodes attached to this octree. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 

Public Attributes

AxisAlignedBox mBox
 The bounding box of the octree. More...
 
OctreemChildren [2][2][2]
 3D array of children of this octree. More...
 
Vector3 mHalfSize
 Vector containing the dimensions of this octree / 2. More...
 
NodeList mNodes
 Public list of SceneNodes attached to this particular octree. More...
 
PCZSceneNodeList mNodes
 Public list of SceneNodes attached to this particular octree. More...
 
WireBoundingBoxmWireBoundingBox
 
PCZonemZone
 

Protected Member Functions

void _ref ()
 Increments the overall node count of this octree and all its parents. More...
 
void _ref ()
 Increments the overall node count of this octree and all its parents. More...
 
void _unref ()
 Decrements the overall node count of this octree and all its parents. More...
 
void _unref ()
 Decrements the overall node count of this octree and all its parents. More...
 

Protected Attributes

int mNumNodes
 number of SceneNodes in this octree and all its children. More...
 
OctreemParent
 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.

Definition at line 59 of file OgreOctree.h.

Member Typedef Documentation

Definition at line 127 of file OgreOctree.h.

Constructor & Destructor Documentation

Ogre::Octree::Octree ( Octree p)
Ogre::Octree::~Octree ( )
Ogre::Octree::Octree ( PCZone zone,
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::_addNode ( PCZSceneNode )

Adds an PCZscene node to this octree level.

Remarks
This is called by the OctreeZone after it has determined the correct Octree to insert the node into.
void Ogre::Octree::_findNodes ( const AxisAlignedBox t,
PCZSceneNodeList list,
PCZSceneNode exclude,
bool  includeVisitors,
bool  full 
)
void Ogre::Octree::_findNodes ( const Ray t,
PCZSceneNodeList list,
PCZSceneNode exclude,
bool  includeVisitors,
bool  full 
)
void Ogre::Octree::_findNodes ( const Sphere t,
PCZSceneNodeList list,
PCZSceneNode exclude,
bool  includeVisitors,
bool  full 
)
void Ogre::Octree::_findNodes ( const PlaneBoundedVolume t,
PCZSceneNodeList list,
PCZSceneNode exclude,
bool  includeVisitors,
bool  full 
)
void Ogre::Octree::_getChildIndexes ( const AxisAlignedBox ,
int *  x,
int *  y,
int *  z 
) const

Returns the appropriate indexes for the child of this octree into which the box will fit.

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::_getChildIndexes ( const AxisAlignedBox ,
int *  x,
int *  y,
int *  z 
) const

Returns the appropriate indexes for the child of this octree into which the box will fit.

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 ) const

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.
void Ogre::Octree::_getCullBounds ( AxisAlignedBox ) const

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 ( const AxisAlignedBox box) const

Determines if this octree is twice as big as the given box.

Remarks
This method is used by the OctreeSceneManager to determine if the given box will fit into a child of this octree.
bool Ogre::Octree::_isTwiceSize ( const AxisAlignedBox box) const

Determines if this octree is twice as big as the given box.

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 ( )
inlineprotected

Increments the overall node count of this octree and all its parents.

Definition at line 136 of file OgreOctree.h.

References mNumNodes, and mParent.

Referenced by _ref().

void Ogre::Octree::_ref ( )
inlineprotected

Increments the overall node count of this octree and all its parents.

Definition at line 175 of file OgreOctreeZoneOctree.h.

References _ref(), mNumNodes, and mParent.

void Ogre::Octree::_removeNode ( OctreeNode )

Removes an Octree scene node to this octree level.

void Ogre::Octree::_removeNode ( PCZSceneNode )

Removes an PCZscene node to this octree level.

void Ogre::Octree::_unref ( )
inlineprotected

Decrements the overall node count of this octree and all its parents.

Definition at line 145 of file OgreOctree.h.

References mNumNodes, and mParent.

Referenced by _unref().

void Ogre::Octree::_unref ( )
inlineprotected

Decrements the overall node count of this octree and all its parents.

Definition at line 184 of file OgreOctreeZoneOctree.h.

References _unref(), mNumNodes, and mParent.

WireBoundingBox* Ogre::Octree::getWireBoundingBox ( )

Creates the wire frame bounding box for this octant.

WireBoundingBox* Ogre::Octree::getWireBoundingBox ( )

Creates the wire frame bounding box for this octant.

int Ogre::Octree::numNodes ( )
inline

Returns the number of scene nodes attached to this octree.

Definition at line 78 of file OgreOctree.h.

References mNumNodes.

int Ogre::Octree::numNodes ( )
inline

Returns the number of scene nodes attached to this octree.

Definition at line 84 of file OgreOctreeZoneOctree.h.

References mNumNodes.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 90 of file OgreMemoryAllocatedObject.h.

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

Definition at line 81 of file OgreOctree.h.

Octree * Ogre::Octree::mChildren

3D array of children of this octree.

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

Definition at line 103 of file OgreOctree.h.

Vector3 Ogre::Octree::mHalfSize

Vector containing the dimensions of this octree / 2.

Definition at line 96 of file OgreOctree.h.

NodeList Ogre::Octree::mNodes

Public list of SceneNodes attached to this particular octree.

Definition at line 130 of file OgreOctree.h.

PCZSceneNodeList Ogre::Octree::mNodes

Public list of SceneNodes attached to this particular octree.

Definition at line 166 of file OgreOctreeZoneOctree.h.

int Ogre::Octree::mNumNodes
protected

number of SceneNodes in this octree and all its children.

Definition at line 150 of file OgreOctree.h.

Referenced by _ref(), _unref(), and numNodes().

Octree * Ogre::Octree::mParent
protected

parent octree

Definition at line 156 of file OgreOctree.h.

Referenced by _ref(), and _unref().

WireBoundingBox * Ogre::Octree::mWireBoundingBox

Definition at line 88 of file OgreOctree.h.

PCZone* Ogre::Octree::mZone

Definition at line 169 of file OgreOctreeZoneOctree.h.


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