OGRE-Next: Ogre::Volume::OctreeNode Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Ogre::Volume::OctreeNode Class Reference

A node in the volume octree. More...

`#include <OgreVolumeOctreeNode.h>`

Inheritance diagram for Ogre::Volume::OctreeNode:
[legend]

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

## 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.

## Static Public Attributes
static const size_t | OCTREE_CHILDREN_COUNT
| Even in an OCtree, the amount of children should not be hardcoded.

## 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

  from | The back lower left corner of the cell.
  to | The front upper right corner of the cell.

References Ogre::Vector3::ZERO.

Referenced by createInstance(), getChild(), isBorderBack(), isBorderBottom(), isBorderFront(), isBorderLeft(), isBorderRight(), and isBorderTop().

## ◆ ~OctreeNode()

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

Destructor.

## Member Function Documentation

## ◆ createInstance()

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

Factory method to create octree nodes.

Parameters

  from | The back lower left corner of the cell.
  to | The front upper right corner of the cell.

Returns
  The created entity. Make sure to destroy it when you don't need it anymore.

References OctreeNode().

## ◆ getCenter()

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

Gets the center of this cell.

Returns
  The center.

## ◆ getCenterBack()

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

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

Returns
  The center.

## ◆ getCenterBackBottom()

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

Gets the center of the corners 0, 1.

Returns
  The center.

## ◆ getCenterBackLeft()

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

Gets the center of the corners 0, 4.

Returns
  The center.

## ◆ getCenterBackRight()

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

Gets the center of the corners 1, 5.

Returns
  The center.

## ◆ getCenterBackTop()

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

Gets the center of the corners 4, 5.

Returns
  The center.

## ◆ getCenterBottom()

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

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

Returns
  The center.

## ◆ getCenterFront()

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

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

Returns
  The center.

## ◆ getCenterFrontBottom()

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

Gets the center of the corners 2, 3.

Returns
  The center.

## ◆ getCenterFrontLeft()

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

Gets the center of the corners 3, 7.

Returns
  The center.

## ◆ getCenterFrontRight()

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

Gets the center of the corners 2, 6.

Returns
  The center.

## ◆ getCenterFrontTop()

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

Gets the center of the corners 6, 7.

Returns
  The center.

## ◆ getCenterLeft()

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

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

Returns
  The center.

## ◆ getCenterLeftBottom()

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

Gets the center of the corners 0, 3.

Returns
  The center.

## ◆ getCenterLeftTop()

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

Gets the center of the corners 4, 7.

Returns
  The center.

## ◆ getCenterRight()

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

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

Returns
  The center.

## ◆ getCenterRightBottom()

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

Gets the center of the corners 1, 2.

Returns
  The center.

## ◆ getCenterRightTop()

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

Gets the center of the corners 5, 6.

Returns
  The center.

## ◆ getCenterTop()

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

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

Returns
  The center.

## ◆ getCenterValue()

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

Gets the center value.

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

## ◆ 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

  i | The child index.

Returns
  The child.

References OctreeNode().

## ◆ 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

  from | The back lower left corner of the cell.
  to | The front upper right corner of the cell.
  center | Out parameter of the calculated center.
  width | Out parameter of the width vector (width in x, rest zero).
  height | Out parameter of the height vector (height in y, rest zero).
  depth | Out parameter of the depth vector (depth in z, rest zero).

References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

## ◆ getCorner1()

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

Gets the coordinate of corner 1.

Returns
  The corner.

## ◆ getCorner2()

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

Gets the coordinate of corner 2.

Returns
  The corner.

## ◆ getCorner3()

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

Gets the coordinate of corner 3.

Returns
  The corner.

## ◆ getCorner4()

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

Gets the coordinate of corner 4.

Returns
  The corner.

## ◆ getCorner5()

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

Gets the coordinate of corner 5.

Returns
  The corner.

## ◆ getCorner7()

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

Gets the coordinate of corner 7.

Returns
  The corner.

## ◆ getFrom()

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

Gets the back lower left corner of the cell.

Returns
  The back lower left corner of the cell.

## ◆ getOctreeGrid()

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

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

Parameters

  sceneManager | The scenemanager creating the actual entity.

Returns
  The lazily created debug visualization.

## ◆ getTo()

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

Gets the front upper right corner of the cell.

Returns
  The front upper right corner of the cell.

## ◆ 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

  root | The octree root node to test against.

Returns
  true if so.

References OctreeNode(), and Ogre::Vector3::z.

## ◆ 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

  root | The octree root node to test against.

Returns
  true if so.

References OctreeNode(), and Ogre::Vector3::y.

## ◆ 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

  root | The octree root node to test against.

Returns
  true if so.

References OctreeNode(), and Ogre::Vector3::z.

## ◆ 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

  root | The octree root node to test against.

Returns
  true if so.

References OctreeNode(), and Ogre::Vector3::x.

## ◆ 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

  root | The octree root node to test against.

Returns
  true if so.

References OctreeNode(), and Ogre::Vector3::x.

## ◆ 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

  root | The octree root node to test against.

Returns
  true if so.

References OctreeNode(), and Ogre::Vector3::y.

## ◆ isIsoSurfaceNear()

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

Gets whether the isosurface is somewhat near to this node.

Returns
  true if somewhat near.

References Ogre::Math::Abs().

## ◆ isSubdivided()

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

Gets whether this cell has any children.

Returns
  True if so.

## ◆ setCenterValue()

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

Raw setter for the center value.

Parameters

  value | The density value.

## ◆ setFrom()

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

Setter for the from-part of this cell.

Parameters

  from | The 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

  to | The front upper right corner of the cell.

## ◆ 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

  splitPolicy | Defines the policy deciding whether to split this node or not.
  src | The volume source.
  geometricError | The accepted geometric error.

## 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:

- OgreVolumeOctreeNode.h