OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::Octree Class Reference

Octree datastructure for managing scene nodes. More...

#include <OgreOctreeZoneOctree.h>

+ Inheritance 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.
 
void _addNode (PCZSceneNode *)
 Adds an PCZscene node to this octree level.
 
void _findNodes (const AxisAlignedBox &t, PCZSceneNodeList &list, PCZSceneNode *exclude, bool includeVisitors, bool full)
 
void _findNodes (const PlaneBoundedVolume &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 _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.
 
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.
 
void _getCullBounds (AxisAlignedBox *) const
 Creates the AxisAlignedBox used for culling this octree.
 
void _getCullBounds (AxisAlignedBox *) const
 Creates the AxisAlignedBox used for culling this octree.
 
bool _isTwiceSize (const AxisAlignedBox &box) const
 Determines if this octree is twice as big as the given box.
 
bool _isTwiceSize (const AxisAlignedBox &box) const
 Determines if this octree is twice as big as the given box.
 
void _removeNode (OctreeNode *)
 Removes an Octree scene node to this octree level.
 
void _removeNode (PCZSceneNode *)
 Removes an PCZscene node to this octree level.
 
WireBoundingBox * getWireBoundingBox ()
 Creates the wire frame bounding box for this octant.
 
WireBoundingBox * getWireBoundingBox ()
 Creates the wire frame bounding box for this octant.
 
int numNodes ()
 Returns the number of scene nodes attached to this octree.
 
int numNodes ()
 Returns the number of scene nodes attached to this octree.
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
 
voidoperator new (size_t sz, void *ptr)
 placement operator new
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
 

Public Attributes

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

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.

Member Typedef Documentation

◆ NodeList

Constructor & Destructor Documentation

◆ Octree() [1/2]

Ogre::Octree::Octree ( Octree p)

◆ ~Octree() [1/2]

Ogre::Octree::~Octree ( )

◆ Octree() [2/2]

Ogre::Octree::Octree ( PCZone zone,
Octree p 
)

◆ ~Octree() [2/2]

Ogre::Octree::~Octree ( )

Member Function Documentation

◆ _addNode() [1/2]

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.

◆ _addNode() [2/2]

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.

◆ _findNodes() [1/4]

void Ogre::Octree::_findNodes ( const AxisAlignedBox t,
PCZSceneNodeList list,
PCZSceneNode exclude,
bool  includeVisitors,
bool  full 
)

◆ _findNodes() [2/4]

void Ogre::Octree::_findNodes ( const PlaneBoundedVolume t,
PCZSceneNodeList list,
PCZSceneNode exclude,
bool  includeVisitors,
bool  full 
)

◆ _findNodes() [3/4]

void Ogre::Octree::_findNodes ( const Ray t,
PCZSceneNodeList list,
PCZSceneNode exclude,
bool  includeVisitors,
bool  full 
)

◆ _findNodes() [4/4]

void Ogre::Octree::_findNodes ( const Sphere t,
PCZSceneNodeList list,
PCZSceneNode exclude,
bool  includeVisitors,
bool  full 
)

◆ _getChildIndexes() [1/2]

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.

◆ _getChildIndexes() [2/2]

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.

◆ _getCullBounds() [1/2]

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.

◆ _getCullBounds() [2/2]

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.

◆ _isTwiceSize() [1/2]

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.

◆ _isTwiceSize() [2/2]

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.

◆ _removeNode() [1/2]

void Ogre::Octree::_removeNode ( OctreeNode )

Removes an Octree scene node to this octree level.

◆ _removeNode() [2/2]

void Ogre::Octree::_removeNode ( PCZSceneNode )

Removes an PCZscene node to this octree level.

◆ getWireBoundingBox() [1/2]

WireBoundingBox * Ogre::Octree::getWireBoundingBox ( )

Creates the wire frame bounding box for this octant.

◆ getWireBoundingBox() [2/2]

WireBoundingBox * Ogre::Octree::getWireBoundingBox ( )

Creates the wire frame bounding box for this octant.

◆ numNodes() [1/2]

int Ogre::Octree::numNodes ( )
inline

Returns the number of scene nodes attached to this octree.

◆ numNodes() [2/2]

int Ogre::Octree::numNodes ( )
inline

Returns the number of scene nodes attached to this octree.

◆ operator delete() [1/3]

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

◆ operator delete() [2/3]

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

◆ operator delete() [3/3]

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

◆ operator delete[]() [1/2]

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

◆ operator delete[]() [2/2]

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

◆ operator new() [1/3]

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

◆ operator new() [2/3]

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

◆ operator new() [3/3]

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

placement operator new

◆ operator new[]() [1/2]

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

◆ operator new[]() [2/2]

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

Member Data Documentation

◆ mBox

AxisAlignedBox Ogre::Octree::mBox

The bounding box of the octree.

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

◆ mChildren

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.

◆ mHalfSize

Vector3 Ogre::Octree::mHalfSize

Vector containing the dimensions of this octree / 2.

◆ mNodes [1/2]

NodeList Ogre::Octree::mNodes

Public list of SceneNodes attached to this particular octree.

◆ mNodes [2/2]

PCZSceneNodeList Ogre::Octree::mNodes

Public list of SceneNodes attached to this particular octree.

◆ mWireBoundingBox

WireBoundingBox * Ogre::Octree::mWireBoundingBox

◆ mZone

PCZone* Ogre::Octree::mZone

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