OGRE  1.11.6
Object-Oriented Graphics Rendering Engine
Ogre::Volume::OctreeNode Class Reference

A node in the volume octree. More...

#include <OgreVolumeOctreeNode.h>

+ Inheritance diagram for Ogre::Volume::OctreeNode:

Public Member Functions

 OctreeNode (const Vector3 &from=Vector3::ZERO, const Vector3 &to=Vector3::ZERO)
 Constructor. More...
 
virtual ~OctreeNode (void)
 Destructor. More...
 
virtual OctreeNodecreateInstance (const Vector3 &from, const Vector3 &to)
 Factory method to create octree nodes. More...
 
const Vector3 getCenter (void) const
 Gets the center of this cell. More...
 
const Vector3 getCenterBack (void) const
 Gets the center of the corners 0, 1, 4, 5. More...
 
const Vector3 getCenterBackBottom (void) const
 Gets the center of the corners 0, 1. More...
 
const Vector3 getCenterBackLeft (void) const
 Gets the center of the corners 0, 4. More...
 
const Vector3 getCenterBackRight (void) const
 Gets the center of the corners 1, 5. More...
 
const Vector3 getCenterBackTop (void) const
 Gets the center of the corners 4, 5. More...
 
const Vector3 getCenterBottom (void) const
 Gets the center of the corners 0, 1, 2, 3. More...
 
const Vector3 getCenterFront (void) const
 Gets the center of the corners 2, 3, 6, 7. More...
 
const Vector3 getCenterFrontBottom (void) const
 Gets the center of the corners 2, 3. More...
 
const Vector3 getCenterFrontLeft (void) const
 Gets the center of the corners 3, 7. More...
 
const Vector3 getCenterFrontRight (void) const
 Gets the center of the corners 2, 6. More...
 
const Vector3 getCenterFrontTop (void) const
 Gets the center of the corners 6, 7. More...
 
const Vector3 getCenterLeft (void) const
 Gets the center of the corners 0, 3, 4, 6. More...
 
const Vector3 getCenterLeftBottom (void) const
 Gets the center of the corners 0, 3. More...
 
const Vector3 getCenterLeftTop (void) const
 Gets the center of the corners 4, 7. More...
 
const Vector3 getCenterRight (void) const
 Gets the center of the corners 1, 2, 5, 6. More...
 
const Vector3 getCenterRightBottom (void) const
 Gets the center of the corners 1, 2. More...
 
const Vector3 getCenterRightTop (void) const
 Gets the center of the corners 5, 6. More...
 
const Vector3 getCenterTop (void) const
 Gets the center of the corners 4, 5, 6, 7. More...
 
const Vector4 getCenterValue (void) const
 Gets the center value. More...
 
const OctreeNodegetChild (const size_t i) const
 Gets an octree child. More...
 
const Vector3 getCorner1 (void) const
 Gets the coordinate of corner 1. More...
 
const Vector3 getCorner2 (void) const
 Gets the coordinate of corner 2. More...
 
const Vector3 getCorner3 (void) const
 Gets the coordinate of corner 3. More...
 
const Vector3 getCorner4 (void) const
 Gets the coordinate of corner 4. More...
 
const Vector3 getCorner5 (void) const
 Gets the coordinate of corner 5. More...
 
const Vector3 getCorner7 (void) const
 Gets the coordinate of corner 7. More...
 
const Vector3getFrom (void) const
 Gets the back lower left corner of the cell. More...
 
EntitygetOctreeGrid (SceneManager *sceneManager)
 Getter for the octree debug visualization of the octree starting with this node. More...
 
const Vector3getTo (void) const
 Gets the front upper right corner of the cell. More...
 
bool isBorderBack (const OctreeNode &root) const
 Gets whether this cell is at the back of the given root cell. More...
 
bool isBorderBottom (const OctreeNode &root) const
 Gets whether this cell is at the bottom of the given root cell. More...
 
bool isBorderFront (const OctreeNode &root) const
 Gets whether this cell is at the front of the given root cell. More...
 
bool isBorderLeft (const OctreeNode &root) const
 Gets whether this cell is at the left of the given root cell. More...
 
bool isBorderRight (const OctreeNode &root) const
 Gets whether this cell is at the right of the given root cell. More...
 
bool isBorderTop (const OctreeNode &root) const
 Gets whether this cell is at the top of the given root cell. More...
 
bool isIsoSurfaceNear (void) const
 Gets whether the isosurface is somewhat near to this node. More...
 
bool isSubdivided (void) const
 Gets whether this cell has any children. More...
 
void setCenterValue (Vector4 value)
 Raw setter for the center value. More...
 
void setFrom (Vector3 from)
 Setter for the from-part of this cell. More...
 
void setTo (Vector3 to)
 Setter for the to-part of this cell. More...
 
void split (const OctreeNodeSplitPolicy *splitPolicy, const Source *src, const Real geometricError)
 Splits this cell if the split policy says so. More...
 

Static Public Member Functions

static void getChildrenDimensions (const Vector3 &from, const Vector3 &to, Vector3 &center, Vector3 &width, Vector3 &height, Vector3 &depth)
 Gets the center and width / height / depth vector of the children of a node. More...
 

Static Public Attributes

static const size_t OCTREE_CHILDREN_COUNT
 Even in an OCtree, the amount of children should not be hardcoded. More...
 

Detailed Description

A node in the volume octree.

Constructor & Destructor Documentation

◆ OctreeNode()

Ogre::Volume::OctreeNode::OctreeNode ( const Vector3 from = Vector3::ZERO,
const Vector3 to = Vector3::ZERO 
)

Constructor.

Parameters
fromThe back lower left corner of the cell.
toThe front upper right corner of the cell.

◆ ~OctreeNode()

virtual Ogre::Volume::OctreeNode::~OctreeNode ( void  )
virtual

Destructor.

Member Function Documentation

◆ getChildrenDimensions()

static void Ogre::Volume::OctreeNode::getChildrenDimensions ( const Vector3 from,
const Vector3 to,
Vector3 center,
Vector3 width,
Vector3 height,
Vector3 depth 
)
inlinestatic

Gets the center and width / height / depth vector of the children of a node.

Parameters
fromThe back lower left corner of the cell.
toThe front upper right corner of the cell.
centerOut parameter of the calculated center.
widthOut parameter of the width vector (width in x, rest zero).
heightOut parameter of the height vector (height in y, rest zero).
depthOut parameter of the depth vector (depth in z, rest zero).

◆ createInstance()

virtual OctreeNode* Ogre::Volume::OctreeNode::createInstance ( const Vector3 from,
const Vector3 to 
)
virtual

Factory method to create octree nodes.

Parameters
fromThe back lower left corner of the cell.
toThe front upper right corner of the cell.
Returns
The created entity. Make sure to destroy it when you don't need it anymore.

◆ split()

void Ogre::Volume::OctreeNode::split ( const OctreeNodeSplitPolicy splitPolicy,
const Source src,
const Real  geometricError 
)

Splits this cell if the split policy says so.

Parameters
splitPolicyDefines the policy deciding whether to split this node or not.
srcThe volume source.
geometricErrorThe accepted geometric error.

◆ getOctreeGrid()

Entity* Ogre::Volume::OctreeNode::getOctreeGrid ( SceneManager sceneManager)

Getter for the octree debug visualization of the octree starting with this node.

Parameters
sceneManagerThe scenemanager creating the actual entity.
Returns
The lazily created debug visualization.

◆ setFrom()

void Ogre::Volume::OctreeNode::setFrom ( Vector3  from)
inline

Setter for the from-part of this cell.

Parameters
fromThe back lower left corner of the cell.

◆ setTo()

void Ogre::Volume::OctreeNode::setTo ( Vector3  to)
inline

Setter for the to-part of this cell.

Parameters
toThe front upper right corner of the cell.

◆ isSubdivided()

bool Ogre::Volume::OctreeNode::isSubdivided ( void  ) const
inline

Gets whether this cell has any children.

Returns
True if so.

◆ getChild()

const OctreeNode* Ogre::Volume::OctreeNode::getChild ( const size_t  i) const
inline

Gets an octree child.

Enumeration: 4 5 7 6 0 1 3 2

Parameters
iThe child index.
Returns
The child.

◆ getCenter()

const Vector3 Ogre::Volume::OctreeNode::getCenter ( void  ) const
inline

Gets the center of this cell.

Returns
The center.

◆ getFrom()

const Vector3& Ogre::Volume::OctreeNode::getFrom ( void  ) const
inline

Gets the back lower left corner of the cell.

Returns
The back lower left corner of the cell.

◆ getTo()

const Vector3& Ogre::Volume::OctreeNode::getTo ( void  ) const
inline

Gets the front upper right corner of the cell.

Returns
The front upper right corner of the cell.

◆ isBorderLeft()

bool Ogre::Volume::OctreeNode::isBorderLeft ( const OctreeNode root) const
inline

Gets whether this cell is at the left of the given root cell.

Parameters
rootThe octree root node to test against.
Returns
true if so.

◆ isBorderRight()

bool Ogre::Volume::OctreeNode::isBorderRight ( const OctreeNode root) const
inline

Gets whether this cell is at the right of the given root cell.

Parameters
rootThe octree root node to test against.
Returns
true if so.

◆ isBorderBottom()

bool Ogre::Volume::OctreeNode::isBorderBottom ( const OctreeNode root) const
inline

Gets whether this cell is at the bottom of the given root cell.

Parameters
rootThe octree root node to test against.
Returns
true if so.

◆ isBorderTop()

bool Ogre::Volume::OctreeNode::isBorderTop ( const OctreeNode root) const
inline

Gets whether this cell is at the top of the given root cell.

Parameters
rootThe octree root node to test against.
Returns
true if so.

◆ isBorderBack()

bool Ogre::Volume::OctreeNode::isBorderBack ( const OctreeNode root) const
inline

Gets whether this cell is at the back of the given root cell.

Parameters
rootThe octree root node to test against.
Returns
true if so.

◆ isBorderFront()

bool Ogre::Volume::OctreeNode::isBorderFront ( const OctreeNode root) const
inline

Gets whether this cell is at the front of the given root cell.

Parameters
rootThe octree root node to test against.
Returns
true if so.

◆ getCenterBack()

const Vector3 Ogre::Volume::OctreeNode::getCenterBack ( void  ) const
inline

Gets the center of the corners 0, 1, 4, 5.

Returns
The center.

◆ getCenterFront()

const Vector3 Ogre::Volume::OctreeNode::getCenterFront ( void  ) const
inline

Gets the center of the corners 2, 3, 6, 7.

Returns
The center.

◆ getCenterLeft()

const Vector3 Ogre::Volume::OctreeNode::getCenterLeft ( void  ) const
inline

Gets the center of the corners 0, 3, 4, 6.

Returns
The center.

◆ getCenterRight()

const Vector3 Ogre::Volume::OctreeNode::getCenterRight ( void  ) const
inline

Gets the center of the corners 1, 2, 5, 6.

Returns
The center.

◆ getCenterTop()

const Vector3 Ogre::Volume::OctreeNode::getCenterTop ( void  ) const
inline

Gets the center of the corners 4, 5, 6, 7.

Returns
The center.

◆ getCenterBottom()

const Vector3 Ogre::Volume::OctreeNode::getCenterBottom ( void  ) const
inline

Gets the center of the corners 0, 1, 2, 3.

Returns
The center.

◆ getCenterBackTop()

const Vector3 Ogre::Volume::OctreeNode::getCenterBackTop ( void  ) const
inline

Gets the center of the corners 4, 5.

Returns
The center.

◆ getCenterBackBottom()

const Vector3 Ogre::Volume::OctreeNode::getCenterBackBottom ( void  ) const
inline

Gets the center of the corners 0, 1.

Returns
The center.

◆ getCenterFrontTop()

const Vector3 Ogre::Volume::OctreeNode::getCenterFrontTop ( void  ) const
inline

Gets the center of the corners 6, 7.

Returns
The center.

◆ getCenterFrontBottom()

const Vector3 Ogre::Volume::OctreeNode::getCenterFrontBottom ( void  ) const
inline

Gets the center of the corners 2, 3.

Returns
The center.

◆ getCenterLeftTop()

const Vector3 Ogre::Volume::OctreeNode::getCenterLeftTop ( void  ) const
inline

Gets the center of the corners 4, 7.

Returns
The center.

◆ getCenterLeftBottom()

const Vector3 Ogre::Volume::OctreeNode::getCenterLeftBottom ( void  ) const
inline

Gets the center of the corners 0, 3.

Returns
The center.

◆ getCenterRightTop()

const Vector3 Ogre::Volume::OctreeNode::getCenterRightTop ( void  ) const
inline

Gets the center of the corners 5, 6.

Returns
The center.

◆ getCenterRightBottom()

const Vector3 Ogre::Volume::OctreeNode::getCenterRightBottom ( void  ) const
inline

Gets the center of the corners 1, 2.

Returns
The center.

◆ getCenterBackLeft()

const Vector3 Ogre::Volume::OctreeNode::getCenterBackLeft ( void  ) const
inline

Gets the center of the corners 0, 4.

Returns
The center.

◆ getCenterFrontLeft()

const Vector3 Ogre::Volume::OctreeNode::getCenterFrontLeft ( void  ) const
inline

Gets the center of the corners 3, 7.

Returns
The center.

◆ getCenterBackRight()

const Vector3 Ogre::Volume::OctreeNode::getCenterBackRight ( void  ) const
inline

Gets the center of the corners 1, 5.

Returns
The center.

◆ getCenterFrontRight()

const Vector3 Ogre::Volume::OctreeNode::getCenterFrontRight ( void  ) const
inline

Gets the center of the corners 2, 6.

Returns
The center.

◆ getCorner1()

const Vector3 Ogre::Volume::OctreeNode::getCorner1 ( void  ) const
inline

Gets the coordinate of corner 1.

Returns
The corner.

◆ getCorner2()

const Vector3 Ogre::Volume::OctreeNode::getCorner2 ( void  ) const
inline

Gets the coordinate of corner 2.

Returns
The corner.

◆ getCorner3()

const Vector3 Ogre::Volume::OctreeNode::getCorner3 ( void  ) const
inline

Gets the coordinate of corner 3.

Returns
The corner.

◆ getCorner4()

const Vector3 Ogre::Volume::OctreeNode::getCorner4 ( void  ) const
inline

Gets the coordinate of corner 4.

Returns
The corner.

◆ getCorner5()

const Vector3 Ogre::Volume::OctreeNode::getCorner5 ( void  ) const
inline

Gets the coordinate of corner 5.

Returns
The corner.

◆ getCorner7()

const Vector3 Ogre::Volume::OctreeNode::getCorner7 ( void  ) const
inline

Gets the coordinate of corner 7.

Returns
The corner.

◆ setCenterValue()

void Ogre::Volume::OctreeNode::setCenterValue ( Vector4  value)
inline

Raw setter for the center value.

Parameters
valueThe density value.

◆ getCenterValue()

const Vector4 Ogre::Volume::OctreeNode::getCenterValue ( void  ) const
inline

Gets the center value.

Returns
The center value, one Vector4 consisting of gradient (x, y, z) and density (w).

◆ isIsoSurfaceNear()

bool Ogre::Volume::OctreeNode::isIsoSurfaceNear ( void  ) const
inline

Gets whether the isosurface is somewhat near to this node.

Returns
true if somewhat near.

References Ogre::Math::Abs().

Member Data Documentation

◆ OCTREE_CHILDREN_COUNT

const size_t Ogre::Volume::OctreeNode::OCTREE_CHILDREN_COUNT
static

Even in an OCtree, the amount of children should not be hardcoded.


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