OGRE 2.1
Object-Oriented Graphics Rendering Engine
|
Class representing a general-purpose node an articulated scene graph. More...
#include <OgreNode.h>
Classes | |
class | Listener |
Listener which gets called back on Node events. More... | |
Public Types | |
typedef ConstVectorIterator< NodeVec > | ConstNodeVecIterator |
typedef vector< Node * >::type | NodeVec |
typedef VectorIterator< NodeVec > | NodeVecIterator |
enum | TransformSpace { TS_LOCAL , TS_PARENT , TS_WORLD } |
Enumeration denoting the spaces which a transform can be relative to. More... | |
Public Member Functions | |
Node (const Transform &transformPtrs) | |
Don't use this constructor unless you know what you're doing. | |
Node (IdType id, NodeMemoryManager *nodeMemoryManager, Node *parent) | |
Constructor, should only be called by parent, not directly. | |
virtual | ~Node () |
virtual void | _callMemoryChangeListeners (void)=0 |
Internal use, notifies all attached objects that our memory pointers (i.e. | |
virtual_l2 Quaternion | _getDerivedOrientation (void) const |
Gets the orientation of the node as derived from all parents. | |
virtual_l2 Quaternion | _getDerivedOrientationUpdated (void) |
Gets the orientation of the node as derived from all parents. | |
virtual_l2 Vector3 | _getDerivedPosition (void) const |
Gets the position of the node as derived from all parents. | |
virtual_l2 Vector3 | _getDerivedPositionUpdated (void) |
Gets the position of the node as derived from all parents. | |
virtual_l2 Vector3 | _getDerivedScale (void) const |
Gets the scaling factor of the node as derived from all parents. | |
virtual_l2 Vector3 | _getDerivedScaleUpdated (void) |
Gets the scalling factor of the node as derived from all parents. | |
virtual_l2 FORCEINLINE const Matrix4 & | _getFullTransform (void) const |
Gets the full transformation matrix for this node. | |
virtual_l2 const Matrix4 & | _getFullTransformUpdated (void) |
@See _getDerivedScaleUpdated remarks. | |
Transform & | _getTransform () |
Returns a direct access to the Transform state. | |
virtual void | _notifyStaticDirty (void) const |
Called by SceneManager when it is telling we're a static node being dirty Don't call this directly. | |
virtual void | _setCachedTransformOutOfDate (void) |
virtual_l2 void | _setDerivedOrientation (const Quaternion &q) |
Sets the final world orientation of the node directly. | |
virtual_l2 void | _setDerivedPosition (const Vector3 &pos) |
Sets the final world position of the node directly. | |
void | _setNullNodeMemoryManager (void) |
Manually set the mNodeMemoryManager to a null ptr. | |
void | addChild (Node *child) |
Adds a (precreated) child scene node to this node. | |
virtual_l2 Vector3 | convertLocalToWorldDirection (const Vector3 &localDir, bool useScale) |
Gets the world direction of a point in the node local space useful for simple transforms that don't require a child node. | |
Vector3 | convertLocalToWorldDirectionUpdated (const Vector3 &localDir, bool useScale) |
virtual_l2 Quaternion | convertLocalToWorldOrientation (const Quaternion &localOrientation) |
Gets the world orientation of an orientation in the node local space useful for simple transforms that don't require a child node. | |
Quaternion | convertLocalToWorldOrientationUpdated (const Quaternion &localOrientation) |
virtual_l2 Vector3 | convertLocalToWorldPosition (const Vector3 &localPos) |
Gets the world position of a point in the node local space useful for simple transforms that don't require a child node. | |
Vector3 | convertLocalToWorldPositionUpdated (const Vector3 &localPos) |
virtual_l2 Vector3 | convertWorldToLocalDirection (const Vector3 &worldDir, bool useScale) |
Gets the local direction, relative to this node, of the given world-space direction. | |
Vector3 | convertWorldToLocalDirectionUpdated (const Vector3 &worldDir, bool useScale) |
virtual_l2 Quaternion | convertWorldToLocalOrientation (const Quaternion &worldOrientation) |
Gets the local orientation, relative to this node, of the given world-space orientation. | |
Quaternion | convertWorldToLocalOrientationUpdated (const Quaternion &worldOrientation) |
virtual_l2 Vector3 | convertWorldToLocalPosition (const Vector3 &worldPos) |
Gets the local position, relative to this node, of the given world-space position. | |
Vector3 | convertWorldToLocalPositionUpdated (const Vector3 &worldPos) |
virtual Node * | createChild (SceneMemoryMgrTypes sceneType=SCENE_DYNAMIC, const Vector3 &translate=Vector3::ZERO, const Quaternion &rotate=Quaternion::IDENTITY) |
Creates an unnamed new Node as a child of this node. | |
Node * | getChild (size_t index) |
Gets a pointer to a child node. | |
const Node * | getChild (size_t index) const |
NodeVecIterator | getChildIterator (void) |
Retrieves an iterator for efficiently looping through all children of this node. | |
ConstNodeVecIterator | getChildIterator (void) const |
Retrieves an iterator for efficiently looping through all children of this node. | |
virtual NodeMemoryManager * | getDefaultNodeMemoryManager (SceneMemoryMgrTypes sceneType)=0 |
uint16 | getDepthLevel () const |
Returns how deep in the hierarchy we are (eg. 0 -> root node, 1 -> child of root) | |
IdType | getId () const |
Get the unique id of this object. | |
bool | getIndestructibleByClearScene (void) const |
virtual_l2 bool | getInheritOrientation (void) const |
Returns true if this node is affected by orientation applied to the parent node. | |
virtual_l2 bool | getInheritScale (void) const |
Returns true if this node is affected by scaling factors applied to the parent node. | |
Listener * | getListener (void) const |
Gets the current listener for this Node. | |
virtual_l2 Matrix3 | getLocalAxes (void) const |
Gets a matrix whose columns are the local axes based on the nodes orientation relative to it's parent. | |
const String & | getName (void) const |
Returns the name of the node. | |
virtual_l2 Quaternion | getOrientation () const |
Returns a quaternion representing the nodes orientation. | |
Node * | getParent (void) const |
Gets this node's parent (NULL if this is the root). | |
virtual_l2 Vector3 | getPosition (void) const |
Gets the position of the node relative to it's parent. | |
virtual_l2 Vector3 | getScale (void) const |
Gets the scaling factor of this node. | |
virtual Real | getSquaredViewDepth (const Camera *cam) const |
Helper function, get the squared view depth. | |
virtual OGRE_DEPRECATED const Any & | getUserAny (void) const |
UserObjectBindings & | getUserObjectBindings () |
Return an instance of user objects binding associated with this class. | |
const UserObjectBindings & | getUserObjectBindings () const |
Return an instance of user objects binding associated with this class. | |
bool | isCachedTransformOutOfDate (void) const |
bool | isStatic () const |
Checks whether this node is static. @See setStatic. | |
void | migrateTo (NodeMemoryManager *nodeMemoryManager) |
Migrates the node and all of its children to the new memory manager, at the same depth level. | |
size_t | numChildren (void) const |
Reports the number of child nodes under this one. | |
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 *) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info | |
void * | operator new (size_t sz, void *ptr) |
placement operator new | |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info | |
bool | operator() (const IdObject &left, const IdObject &right) |
bool | operator() (const IdObject *left, const IdObject *right) |
virtual_l2 void | pitch (const Radian &angle, TransformSpace relativeTo=TS_LOCAL) |
Rotate the node around the X-axis. | |
virtual void | removeAllChildren (void) |
Removes all child Nodes attached to this node. | |
virtual void | removeChild (Node *child) |
Drops the specified child from this node. | |
virtual_l1 void | resetOrientation (void) |
Resets the nodes orientation (local axes as world axes, no rotation). | |
virtual_l2 void | roll (const Radian &angle, TransformSpace relativeTo=TS_LOCAL) |
Rotate the node around the Z-axis. | |
virtual_l2 void | rotate (const Quaternion &q, TransformSpace relativeTo=TS_LOCAL) |
Rotate the node around an aritrary axis using a Quarternion. | |
virtual_l2 void | rotate (const Vector3 &axis, const Radian &angle, TransformSpace relativeTo=TS_LOCAL) |
Rotate the node around an arbitrary axis. | |
virtual_l2 void | scale (const Vector3 &scale) |
Scales the node, combining it's current scale with the passed in scaling factor. | |
virtual_l2 void | scale (Real x, Real y, Real z) |
Scales the node, combining it's current scale with the passed in scaling factor. | |
void | setIndestructibleByClearScene (bool indestructible) |
Calling SceneManager::clearScene won't destroy this node nor detach its objects (but may still destroy parent and children nodes if they're not indestructible) when this is true. | |
virtual_l2 void | setInheritOrientation (bool inherit) |
Tells the node whether it should inherit orientation from it's parent node. | |
virtual_l2 void | setInheritScale (bool inherit) |
Tells the node whether it should inherit scaling factors from it's parent node. | |
virtual void | setListener (Listener *listener) |
Sets a listener for this Node. | |
void | setName (const String &name) |
Sets a custom name for this node. | |
virtual_l1 void | setOrientation (Quaternion q) |
Sets the orientation of this node via a quaternion. | |
virtual_l1 void | setOrientation (Real w, Real x, Real y, Real z) |
Sets the orientation of this node via quaternion parameters. | |
virtual_l1 void | setPosition (const Vector3 &pos) |
Sets the position of the node relative to it's parent. | |
virtual_l1 void | setPosition (Real x, Real y, Real z) |
Sets the position of the node relative to it's parent. | |
virtual_l1 void | setScale (const Vector3 &scale) |
Sets the scaling factor applied to this node. | |
virtual_l1 void | setScale (Real x, Real y, Real z) |
Sets the scaling factor applied to this node. | |
virtual bool | setStatic (bool bStatic) |
Turns this Node into static or dynamic. | |
virtual OGRE_DEPRECATED void | setUserAny (const Any &anything) |
virtual_l2 void | translate (const Matrix3 &axes, const Vector3 &move, TransformSpace relativeTo=TS_PARENT) |
Moves the node along arbitrary axes. | |
virtual_l2 void | translate (const Matrix3 &axes, Real x, Real y, Real z, TransformSpace relativeTo=TS_PARENT) |
Moves the node along arbitrary axes. | |
virtual_l2 void | translate (const Vector3 &d, TransformSpace relativeTo=TS_PARENT) |
Moves the node along the Cartesian axes. | |
virtual_l2 void | translate (Real x, Real y, Real z, TransformSpace relativeTo=TS_PARENT) |
Moves the node along the Cartesian axes. | |
virtual_l2 void | yaw (const Radian &angle, TransformSpace relativeTo=TS_LOCAL) |
Rotate the node around the Y-axis. | |
Static Public Member Functions | |
static void | updateAllTransforms (const size_t numNodes, Transform t) |
@See SceneManager::updateAllTransforms() | |
Public Attributes | |
size_t | mGlobalIndex |
Index in the vector holding this node reference (could be our parent node, or a global array tracking all created nodes to avoid memory leaks). | |
size_t | mParentIndex |
Index in the vector holding this node reference (could be our parent node, or a global array tracking all created nodes to avoid memory leaks). | |
Friends | |
class | TagPoint |
Class representing a general-purpose node an articulated scene graph.
typedef vector<Node*>::type Ogre::Node::NodeVec |
Ogre::Node::Node | ( | IdType | id, |
NodeMemoryManager * | nodeMemoryManager, | ||
Node * | parent | ||
) |
Constructor, should only be called by parent, not directly.
Don't use this constructor unless you know what you're doing.
@See NodeMemoryManager::mDummyNode
|
virtual |
Internal use, notifies all attached objects that our memory pointers (i.e.
Transform) may have changed (e.g. during cleanups, change of parent, etc)
Implemented in Ogre::SceneNode.
virtual_l2 Quaternion Ogre::Node::_getDerivedOrientation | ( | void | ) | const |
Gets the orientation of the node as derived from all parents.
virtual_l2 Quaternion Ogre::Node::_getDerivedOrientationUpdated | ( | void | ) |
Gets the orientation of the node as derived from all parents.
virtual_l2 Vector3 Ogre::Node::_getDerivedPosition | ( | void | ) | const |
Gets the position of the node as derived from all parents.
virtual_l2 Vector3 Ogre::Node::_getDerivedPositionUpdated | ( | void | ) |
Gets the position of the node as derived from all parents.
virtual_l2 Vector3 Ogre::Node::_getDerivedScale | ( | void | ) | const |
Gets the scaling factor of the node as derived from all parents.
virtual_l2 Vector3 Ogre::Node::_getDerivedScaleUpdated | ( | void | ) |
Gets the scalling factor of the node as derived from all parents.
|
inline |
Gets the full transformation matrix for this node.
References Ogre::Transform::mDerivedTransform, and Ogre::Transform::mIndex.
virtual_l2 const Matrix4 & Ogre::Node::_getFullTransformUpdated | ( | void | ) |
@See _getDerivedScaleUpdated remarks.
@See _getFullTransform
Called by SceneManager when it is telling we're a static node being dirty Don't call this directly.
Reimplemented in Ogre::SceneNode.
virtual_l2 void Ogre::Node::_setDerivedOrientation | ( | const Quaternion & | q | ) |
Sets the final world orientation of the node directly.
virtual_l2 void Ogre::Node::_setDerivedPosition | ( | const Vector3 & | pos | ) |
Sets the final world position of the node directly.
Manually set the mNodeMemoryManager to a null ptr.
Adds a (precreated) child scene node to this node.
If it is attached to another node, it must be detached first.
child | The Node which is to become a child node of this one |
virtual_l2 Vector3 Ogre::Node::convertLocalToWorldDirection | ( | const Vector3 & | localDir, |
bool | useScale | ||
) |
Gets the world direction of a point in the node local space useful for simple transforms that don't require a child node.
|
inline |
virtual_l2 Quaternion Ogre::Node::convertLocalToWorldOrientation | ( | const Quaternion & | localOrientation | ) |
Gets the world orientation of an orientation in the node local space useful for simple transforms that don't require a child node.
|
inline |
virtual_l2 Vector3 Ogre::Node::convertLocalToWorldPosition | ( | const Vector3 & | localPos | ) |
Gets the world position of a point in the node local space useful for simple transforms that don't require a child node.
virtual_l2 Vector3 Ogre::Node::convertWorldToLocalDirection | ( | const Vector3 & | worldDir, |
bool | useScale | ||
) |
Gets the local direction, relative to this node, of the given world-space direction.
|
inline |
virtual_l2 Quaternion Ogre::Node::convertWorldToLocalOrientation | ( | const Quaternion & | worldOrientation | ) |
Gets the local orientation, relative to this node, of the given world-space orientation.
|
inline |
virtual_l2 Vector3 Ogre::Node::convertWorldToLocalPosition | ( | const Vector3 & | worldPos | ) |
Gets the local position, relative to this node, of the given world-space position.
|
virtual |
Creates an unnamed new Node as a child of this node.
translate | Initial translation offset of child relative to parent |
rotate | Initial rotation relative to parent |
NodeVecIterator Ogre::Node::getChildIterator | ( | void | ) |
Retrieves an iterator for efficiently looping through all children of this node.
ConstNodeVecIterator Ogre::Node::getChildIterator | ( | void | ) | const |
Retrieves an iterator for efficiently looping through all children of this node.
|
pure virtual |
Implemented in Ogre::SceneNode.
|
inline |
Returns how deep in the hierarchy we are (eg. 0 -> root node, 1 -> child of root)
|
inlineinherited |
Get the unique id of this object.
virtual_l2 bool Ogre::Node::getInheritOrientation | ( | void | ) | const |
Returns true if this node is affected by orientation applied to the parent node.
virtual_l2 bool Ogre::Node::getInheritScale | ( | void | ) | const |
Returns true if this node is affected by scaling factors applied to the parent node.
virtual_l2 Matrix3 Ogre::Node::getLocalAxes | ( | void | ) | const |
Gets a matrix whose columns are the local axes based on the nodes orientation relative to it's parent.
virtual_l2 Quaternion Ogre::Node::getOrientation | ( | ) | const |
Returns a quaternion representing the nodes orientation.
virtual_l2 Vector3 Ogre::Node::getPosition | ( | void | ) | const |
Gets the position of the node relative to it's parent.
virtual_l2 Vector3 Ogre::Node::getScale | ( | void | ) | const |
Gets the scaling factor of this node.
Helper function, get the squared view depth.
|
inlinevirtual |
|
inline |
Return an instance of user objects binding associated with this class.
You can use it to associate one or more custom objects with this class instance.
|
inline |
Return an instance of user objects binding associated with this class.
You can use it to associate one or more custom objects with this class instance.
bool Ogre::Node::isStatic | ( | ) | const |
Checks whether this node is static. @See setStatic.
void Ogre::Node::migrateTo | ( | NodeMemoryManager * | nodeMemoryManager | ) |
Migrates the node and all of its children to the new memory manager, at the same depth level.
nodeMemoryManager | New memory manager to migrate to. |
Reports the number of child nodes under this one.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
virtual_l2 void Ogre::Node::pitch | ( | const Radian & | angle, |
TransformSpace | relativeTo = TS_LOCAL |
||
) |
Rotate the node around the X-axis.
Removes all child Nodes attached to this node.
Does not delete the nodes, just detaches them from this parent, potentially to be reattached elsewhere.
Reimplemented in Ogre::OctreeNode.
Drops the specified child from this node.
Reimplemented in Ogre::OctreeNode.
virtual_l1 void Ogre::Node::resetOrientation | ( | void | ) |
Resets the nodes orientation (local axes as world axes, no rotation).
virtual_l2 void Ogre::Node::roll | ( | const Radian & | angle, |
TransformSpace | relativeTo = TS_LOCAL |
||
) |
Rotate the node around the Z-axis.
virtual_l2 void Ogre::Node::rotate | ( | const Quaternion & | q, |
TransformSpace | relativeTo = TS_LOCAL |
||
) |
Rotate the node around an aritrary axis using a Quarternion.
virtual_l2 void Ogre::Node::rotate | ( | const Vector3 & | axis, |
const Radian & | angle, | ||
TransformSpace | relativeTo = TS_LOCAL |
||
) |
Rotate the node around an arbitrary axis.
virtual_l2 void Ogre::Node::scale | ( | const Vector3 & | scale | ) |
Scales the node, combining it's current scale with the passed in scaling factor.
virtual_l2 void Ogre::Node::scale | ( | Real | x, |
Real | y, | ||
Real | z | ||
) |
Scales the node, combining it's current scale with the passed in scaling factor.
Calling SceneManager::clearScene won't destroy this node nor detach its objects (but may still destroy parent and children nodes if they're not indestructible) when this is true.
virtual_l2 void Ogre::Node::setInheritOrientation | ( | bool | inherit | ) |
Tells the node whether it should inherit orientation from it's parent node.
inherit | If true, this node's orientation will be affected by its parent's orientation. If false, it will not be affected. |
virtual_l2 void Ogre::Node::setInheritScale | ( | bool | inherit | ) |
Tells the node whether it should inherit scaling factors from it's parent node.
inherit | If true, this node's scale will be affected by its parent's scale. If false, it will not be affected. |
Sets a listener for this Node.
Reimplemented in Ogre::SceneNode.
Sets a custom name for this node.
Doesn't have to be unique
virtual_l1 void Ogre::Node::setOrientation | ( | Quaternion | q | ) |
Sets the orientation of this node via a quaternion.
Sets the orientation of this node via quaternion parameters.
virtual_l1 void Ogre::Node::setPosition | ( | const Vector3 & | pos | ) |
Sets the position of the node relative to it's parent.
virtual_l1 void Ogre::Node::setPosition | ( | Real | x, |
Real | y, | ||
Real | z | ||
) |
Sets the position of the node relative to it's parent.
virtual_l1 void Ogre::Node::setScale | ( | const Vector3 & | scale | ) |
Sets the scaling factor applied to this node.
virtual_l1 void Ogre::Node::setScale | ( | Real | x, |
Real | y, | ||
Real | z | ||
) |
Sets the scaling factor applied to this node.
Turns this Node into static or dynamic.
Reimplemented in Ogre::SceneNode.
|
inlinevirtual |
virtual_l2 void Ogre::Node::translate | ( | const Matrix3 & | axes, |
const Vector3 & | move, | ||
TransformSpace | relativeTo = TS_PARENT |
||
) |
Moves the node along arbitrary axes.
axes | A 3x3 Matrix containing 3 column vectors each representing the axes X, Y and Z respectively. In this format the standard cartesian axes would be expressed as: 1 0 0 0 1 0 0 0 1i.e. the identity matrix. |
move | Vector relative to the axes above. |
relativeTo | The space which this transform is relative to. |
virtual_l2 void Ogre::Node::translate | ( | const Matrix3 & | axes, |
Real | x, | ||
Real | y, | ||
Real | z, | ||
TransformSpace | relativeTo = TS_PARENT |
||
) |
Moves the node along arbitrary axes.
axes | A 3x3 Matrix containing 3 column vectors each representing the axes X, Y and Z respectively. In this format the standard cartesian axes would be expressed as 1 0 0 0 1 0 0 0 1i.e. the identity matrix. |
x | The x translation component relative to the axes above. |
y | The y translation component relative to the axes above. |
z | The z translation component relative to the axes above. |
relativeTo | The space which this transform is relative to. |
virtual_l2 void Ogre::Node::translate | ( | const Vector3 & | d, |
TransformSpace | relativeTo = TS_PARENT |
||
) |
Moves the node along the Cartesian axes.
d | Vector with x,y,z values representing the translation. |
relativeTo | The space which this transform is relative to. |
virtual_l2 void Ogre::Node::translate | ( | Real | x, |
Real | y, | ||
Real | z, | ||
TransformSpace | relativeTo = TS_PARENT |
||
) |
Moves the node along the Cartesian axes.
x | Real x value representing the translation. |
y | Real y value representing the translation. |
z | Real z value representing the translation. |
relativeTo | The space which this transform is relative to. |
@See SceneManager::updateAllTransforms()
virtual_l2 void Ogre::Node::yaw | ( | const Radian & | angle, |
TransformSpace | relativeTo = TS_LOCAL |
||
) |
Rotate the node around the Y-axis.
size_t Ogre::Node::mGlobalIndex |
Index in the vector holding this node reference (could be our parent node, or a global array tracking all created nodes to avoid memory leaks).
Used for O(1) removals.
size_t Ogre::Node::mParentIndex |
Index in the vector holding this node reference (could be our parent node, or a global array tracking all created nodes to avoid memory leaks).
Used for O(1) removals.