OGRE-Next
3.0.0
Object-Oriented Graphics Rendering Engine
|
A node in the volume octree. More...
#include <OgreVolumeOctreeNode.h>
Public Member Functions | |
OctreeNode (const Vector3 &from=Vector3::ZERO, const Vector3 &to=Vector3::ZERO) | |
Constructor. More... | |
virtual | ~OctreeNode () |
Destructor. More... | |
virtual OctreeNode * | createInstance (const Vector3 &from, const Vector3 &to) |
Factory method to create octree nodes. More... | |
const Vector3 | getCenter () const |
Gets the center of this cell. More... | |
const Vector3 | getCenterBack () const |
Gets the center of the corners 0, 1, 4, 5. More... | |
const Vector3 | getCenterBackBottom () const |
Gets the center of the corners 0, 1. More... | |
const Vector3 | getCenterBackLeft () const |
Gets the center of the corners 0, 4. More... | |
const Vector3 | getCenterBackRight () const |
Gets the center of the corners 1, 5. More... | |
const Vector3 | getCenterBackTop () const |
Gets the center of the corners 4, 5. More... | |
const Vector3 | getCenterBottom () const |
Gets the center of the corners 0, 1, 2, 3. More... | |
const Vector3 | getCenterFront () const |
Gets the center of the corners 2, 3, 6, 7. More... | |
const Vector3 | getCenterFrontBottom () const |
Gets the center of the corners 2, 3. More... | |
const Vector3 | getCenterFrontLeft () const |
Gets the center of the corners 3, 7. More... | |
const Vector3 | getCenterFrontRight () const |
Gets the center of the corners 2, 6. More... | |
const Vector3 | getCenterFrontTop () const |
Gets the center of the corners 6, 7. More... | |
const Vector3 | getCenterLeft () const |
Gets the center of the corners 0, 3, 4, 6. More... | |
const Vector3 | getCenterLeftBottom () const |
Gets the center of the corners 0, 3. More... | |
const Vector3 | getCenterLeftTop () const |
Gets the center of the corners 4, 7. More... | |
const Vector3 | getCenterRight () const |
Gets the center of the corners 1, 2, 5, 6. More... | |
const Vector3 | getCenterRightBottom () const |
Gets the center of the corners 1, 2. More... | |
const Vector3 | getCenterRightTop () const |
Gets the center of the corners 5, 6. More... | |
const Vector3 | getCenterTop () const |
Gets the center of the corners 4, 5, 6, 7. More... | |
const Vector4 | getCenterValue () const |
Gets the center value. More... | |
const OctreeNode * | getChild (const size_t i) const |
Gets an octree child. More... | |
const Vector3 | getCorner1 () const |
Gets the coordinate of corner 1. More... | |
const Vector3 | getCorner2 () const |
Gets the coordinate of corner 2. More... | |
const Vector3 | getCorner3 () const |
Gets the coordinate of corner 3. More... | |
const Vector3 | getCorner4 () const |
Gets the coordinate of corner 4. More... | |
const Vector3 | getCorner5 () const |
Gets the coordinate of corner 5. More... | |
const Vector3 | getCorner7 () const |
Gets the coordinate of corner 7. More... | |
const Vector3 & | getFrom () const |
Gets the back lower left corner of the cell. More... | |
Entity * | getOctreeGrid (SceneManager *sceneManager) |
Getter for the octree debug visualization of the octree starting with this node. More... | |
const Vector3 & | getTo () 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 () const |
Gets whether the isosurface is somewhat near to this node. More... | |
bool | isSubdivided () 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 ¢er, 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... | |
A node in the volume octree.
Ogre::Volume::OctreeNode::OctreeNode | ( | const Vector3 & | from = Vector3::ZERO , |
const Vector3 & | to = Vector3::ZERO |
||
) |
Constructor.
from | The back lower left corner of the cell. |
to | The front upper right corner of the cell. |
|
virtual |
Destructor.
|
virtual |
Factory method to create octree nodes.
from | The back lower left corner of the cell. |
to | The front upper right corner of the cell. |
|
inline |
Gets the center of this cell.
|
inline |
Gets the center of the corners 0, 1, 4, 5.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 0, 1.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 0, 4.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 1, 5.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 4, 5.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 0, 1, 2, 3.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 2, 3, 6, 7.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 2, 3.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 3, 7.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 2, 6.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 6, 7.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 0, 3, 4, 6.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 0, 3.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 4, 7.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 1, 2, 5, 6.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 1, 2.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 5, 6.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center of the corners 4, 5, 6, 7.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the center value.
|
inline |
Gets an octree child.
Enumeration: 4 5 7 6 0 1 3 2
i | The child index. |
|
inlinestatic |
Gets the center and width / height / depth vector of the children of a node.
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.
|
inline |
Gets the coordinate of corner 1.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the coordinate of corner 2.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the coordinate of corner 3.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the coordinate of corner 4.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the coordinate of corner 5.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the coordinate of corner 7.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Gets the back lower left corner of the cell.
Entity* Ogre::Volume::OctreeNode::getOctreeGrid | ( | SceneManager * | sceneManager | ) |
Getter for the octree debug visualization of the octree starting with this node.
sceneManager | The scenemanager creating the actual entity. |
|
inline |
Gets the front upper right corner of the cell.
|
inline |
Gets whether this cell is at the back of the given root cell.
root | The octree root node to test against. |
References Ogre::Vector3::z.
|
inline |
Gets whether this cell is at the bottom of the given root cell.
root | The octree root node to test against. |
References Ogre::Vector3::y.
|
inline |
Gets whether this cell is at the front of the given root cell.
root | The octree root node to test against. |
References Ogre::Vector3::z.
|
inline |
Gets whether this cell is at the left of the given root cell.
root | The octree root node to test against. |
References Ogre::Vector3::x.
|
inline |
Gets whether this cell is at the right of the given root cell.
root | The octree root node to test against. |
References Ogre::Vector3::x.
|
inline |
Gets whether this cell is at the top of the given root cell.
root | The octree root node to test against. |
References Ogre::Vector3::y.
|
inline |
Gets whether the isosurface is somewhat near to this node.
References Ogre::Math::Abs(), and Ogre::Vector4::w.
|
inline |
Gets whether this cell has any children.
|
inline |
Raw setter for the center value.
value | The density value. |
|
inline |
Setter for the from-part of this cell.
from | The back lower left corner of the cell. |
|
inline |
Setter for the to-part of this cell.
to | The front upper right corner of the cell. |
void Ogre::Volume::OctreeNode::split | ( | const OctreeNodeSplitPolicy * | splitPolicy, |
const Source * | src, | ||
const Real | geometricError | ||
) |
Splits this cell if the split policy says so.
splitPolicy | Defines the policy deciding whether to split this node or not. |
src | The volume source. |
geometricError | The accepted geometric error. |
|
static |
Even in an OCtree, the amount of children should not be hardcoded.