OGRE-Next: Ogre::SceneNode Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::SceneNode Class Reference
Core | Component » Scene

Class representing a node in the scene graph. More...

`#include <OgreSceneNode.h>`

Inheritance diagram for Ogre::SceneNode:
[legend]

## Public Types
typedef ConstVectorIterator< ObjectVec > | ConstObjectIterator
typedef VectorIterator< ObjectVec > | ObjectIterator
typedef vector< MovableObject * >::type | ObjectVec
Public Types inherited from Ogre::Node
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
| SceneNode (const Transform &transformPtrs)
| Don't use this constructor unless you know what you're doing.
| SceneNode (IdType id, SceneManager *creator, NodeMemoryManager *nodeMemoryManager, SceneNode *parent)
| Constructor, only to be called by the creator SceneManager.
| ~SceneNode () override
virtual_l1 void | _attachBone (SkeletonInstance *skeletonInstance, Bone *bone)
| Attaches a bone to this SceneNode.
void | _callMemoryChangeListeners () override
| Internal use, notifies all attached objects that our memory pointers (i.e.
virtual_l1 void | _detachAllBones (SkeletonInstance *skeletonInstance)
| Detaches all bones from this SceneNode that belong to the given SkeletonInstance.
virtual_l1 void | _detachBone (SkeletonInstance *skeletonInstance, Bone *bone)
| Detaches a bone from this SceneNode.
void | _notifyStaticDirty () const override
| Called by SceneManager when it is telling we're a static node being dirty Don't call this directly.
void | _setCachedTransformOutOfDate () override
virtual_l2 void | attachObject (MovableObject *obj)
| Adds an instance of a scene object to this node.
virtual SceneNode * | createChildSceneNode (SceneMemoryMgrTypes sceneType=SCENE_DYNAMIC, const Vector3 &translate=Vector3::ZERO, const Quaternion &rotate=Quaternion::IDENTITY)
| Creates an unnamed new SceneNode as a child of this node.
virtual void | detachAllBones ()
| Detaches all bones from from this SceneNode. It is safe to use directly.
virtual void | detachAllObjects ()
| Detaches all objects attached to this node.
virtual_l2 void | detachObject (MovableObject *obj)
| Detaches an object by pointer.
virtual void | flipVisibility (bool cascade=true)
| Inverts the visibility of all objects attached to this node.
MovableObject * | getAttachedObject (const String &name)
| Retrieves a pointer to an attached object.
MovableObject * | getAttachedObject (size_t index)
| Retrieves a pointer to an attached object.
virtual ObjectIterator | getAttachedObjectIterator ()
| Retrieves an iterator which can be used to efficiently step through the objects attached to this node.
virtual ConstObjectIterator | getAttachedObjectIterator () const
| Retrieves an iterator which can be used to efficiently step through the objects attached to this node.
const ObjectVec & | getAttachments ()
SceneManager * | getCreator () const
| Gets the creator of this scene node.
NodeMemoryManager * | getDefaultNodeMemoryManager (SceneMemoryMgrTypes sceneType) override
| As Node::getDebugRenderable, except scaling is automatically determined.
SceneNode * | getParentSceneNode () const
| Gets the parent of this SceneNode.
bool | isYawFixed () const
virtual void | lookAt (const Vector3 &targetPoint, TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
| Points the local -Z direction of this node at a point in space.
size_t | numAttachedObjects () const
| Reports the number of objects attached to this node.
virtual void | removeAndDestroyAllChildren ()
| Removes and destroys all children of this node.
virtual void | removeAndDestroyChild (SceneNode *sceneNode)
| This method removes and destroys the child and all of its children.
virtual void | setAutoTracking (bool enabled, SceneNode *const target=0, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z, const Vector3 &offset=Vector3::ZERO)
| Enables / disables automatic tracking of another SceneNode.
virtual void | setDirection (const Vector3 &vec, TransformSpace relativeTo=TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
| Sets the node's direction vector ie it's local -z.
virtual void | setDirection (Real x, Real y, Real z, TransformSpace relativeTo=TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
| Sets the node's direction vector ie it's local -z.
void | setFixedYawAxis (bool useFixed, const Vector3 &fixedAxis=Vector3::UNIT_Y)
| Tells the node whether to yaw around it's own local Y axis or a fixed axis of choice.
void | setListener (Listener *listener) override
| Sets a listener for this Node.
bool | setStatic (bool bStatic) override
| Turns this Node into static or dynamic.
virtual void | setVisible (bool visible, bool cascade=true)
| Makes all objects attached to this node become visible / invisible.
void | yaw (const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
| Rotate the node around the Y-axis.
Public Member Functions inherited from Ogre::Node
| 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_l2 Quaternion | _getDerivedOrientation () const
| Gets the orientation of the node as derived from all parents.
virtual_l2 Quaternion | _getDerivedOrientationUpdated ()
| Gets the orientation of the node as derived from all parents.
virtual_l2 Vector3 | _getDerivedPosition () const
| Gets the position of the node as derived from all parents.
virtual_l2 Vector3 | _getDerivedPositionUpdated ()
| Gets the position of the node as derived from all parents.
virtual_l2 Vector3 | _getDerivedScale () const
| Gets the scaling factor of the node as derived from all parents.
virtual_l2 Vector3 | _getDerivedScaleUpdated ()
| Gets the scalling factor of the node as derived from all parents.
virtual_l2 FORCEINLINE const Matrix4 & | _getFullTransform () const
| Gets the full transformation matrix for this node.
virtual_l2 const Matrix4 & | _getFullTransformUpdated ()
| See _getDerivedScaleUpdated() remarks.
Transform & | _getTransform ()
| Returns a direct access to the Transform state.
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 ()
| Manually set the mNodeMemoryManager to a null ptr.
void | _updateChildren ()
| Helper method to update the Node and all children.
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 ()
| Retrieves an iterator for efficiently looping through all children of this node.
ConstNodeVecIterator | getChildIterator () const
| Retrieves an iterator for efficiently looping through all children of this node.
uint16 | getDepthLevel () const
| Returns how deep in the hierarchy we are (eg. 0 -> root node, 1 -> child of root).
bool | getIndestructibleByClearScene () const
virtual_l2 bool | getInheritOrientation () const
| Returns true if this node is affected by orientation applied to the parent node.
virtual_l2 bool | getInheritScale () const
| Returns true if this node is affected by scaling factors applied to the parent node.
Listener * | getListener () const
| Gets the current listener for this Node.
virtual_l2 Matrix3 | getLocalAxes () const
| Gets a matrix whose columns are the local axes based on the nodes orientation relative to it's parent.
const String & | getName () const
| Returns the name of the node.
virtual_l2 Quaternion | getOrientation () const
| Returns a quaternion representing the nodes orientation.
Node * | getParent () const
| Gets this node's parent (NULL if this is the root).
virtual_l2 Vector3 | getPosition () const
| Gets the position of the node relative to it's parent.
virtual_l2 Vector3 | getScale () 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 () 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 () const
bool | isStatic () const
| Checks whether this node is static.
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 () const
| Reports the number of child nodes under this one.
virtual_l2 void | pitch (const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
| Rotate the node around the X-axis.
virtual void | removeAllChildren ()
| Removes all child Nodes attached to this node.
virtual void | removeChild (Node *child)
| Drops the specified child from this node.
virtual_l1 void | resetOrientation ()
| 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 arbitrary 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.
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 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.
Public Member Functions inherited from Ogre::IdObject
| IdObject (IdType id)
| We don't call generateNewId() here, to prevent objects in the stack (i.e.
IdType | getId () const
| Get the unique id of this object.
bool | operator() (const IdObject &left, const IdObject &right)
bool | operator() (const IdObject *left, const IdObject *right)

## Additional Inherited Members
Static Public Member Functions inherited from Ogre::Node
static void | updateAllTransforms (const size_t numNodes, Transform t)
Public Attributes inherited from Ogre::Node
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).

## Detailed Description

Class representing a node in the scene graph.

Remarks
  A SceneNode is a type of Node which is used to organise objects in a scene. It has the same hierarchical transformation properties of the generic Node class, but also adds the ability to attach world objects to the node, and stores hierarchical bounding volumes of the nodes in the tree. Child nodes are contained within the bounds of the parent, and so on down the tree, allowing for fast culling.

## Member Typedef Documentation

## ◆ ConstObjectIterator

typedef ConstVectorIterator<ObjectVec> Ogre::SceneNode::ConstObjectIterator

## ◆ ObjectIterator

typedef VectorIterator<ObjectVec> Ogre::SceneNode::ObjectIterator

## ◆ ObjectVec

typedef vector<MovableObject*>::type Ogre::SceneNode::ObjectVec

## Constructor & Destructor Documentation

## ◆ SceneNode() [1/2]

Ogre::SceneNode::SceneNode | ( | IdType | id,
|  | SceneManager * | creator,
|  | NodeMemoryManager * | nodeMemoryManager,
|  | SceneNode * | parent )

Constructor, only to be called by the creator SceneManager.

References SceneNode().

Referenced by SceneNode(), Ogre::TagPoint::TagPoint(), createChildSceneNode(), getParentSceneNode(), removeAndDestroyChild(), and setAutoTracking().

## ◆ SceneNode() [2/2]

Ogre::SceneNode::SceneNode | ( | const Transform & | transformPtrs | ) |

Don't use this constructor unless you know what you're doing.

See also
  NodeMemoryManager::mDummyNode

## ◆ ~SceneNode()

Ogre::SceneNode::~SceneNode | ( |  | ) |
| override

## Member Function Documentation

## ◆ _attachBone()

virtual_l1 void Ogre::SceneNode::_attachBone | ( | SkeletonInstance * | skeletonInstance,
|  | Bone * | bone )

Attaches a bone to this SceneNode.

Don't use directly.

See also
  SkeletonInstance::setSceneNodeAsParentOfBone

References virtual_l1.

## ◆ _callMemoryChangeListeners()

void Ogre::SceneNode::_callMemoryChangeListeners | ( |  | ) |
| overridevirtual

Internal use, notifies all attached objects that our memory pointers (i.e.

Transform) may have changed (e.g. during cleanups, change of parent, etc)

Implements Ogre::Node.

## ◆ _detachAllBones()

virtual_l1 void Ogre::SceneNode::_detachAllBones | ( | SkeletonInstance * | skeletonInstance | ) |

Detaches all bones from this SceneNode that belong to the given SkeletonInstance.

Don't use directly.

See also
  SkeletonInstance::setSceneNodeAsParentOfBone

References virtual_l1.

## ◆ _detachBone()

virtual_l1 void Ogre::SceneNode::_detachBone | ( | SkeletonInstance * | skeletonInstance,
|  | Bone * | bone )

Detaches a bone from this SceneNode.

Don't use directly.

See also
  SkeletonInstance::setSceneNodeAsParentOfBone

References virtual_l1.

## ◆ _notifyStaticDirty()

void Ogre::SceneNode::_notifyStaticDirty | ( |  | ) | const
| overridevirtual

Called by SceneManager when it is telling we're a static node being dirty Don't call this directly.

See also
  SceneManager::notifyStaticDirty

Reimplemented from Ogre::Node.

## ◆ _setCachedTransformOutOfDate()

void Ogre::SceneNode::_setCachedTransformOutOfDate | ( |  | ) |
| overridevirtual

Reimplemented from Ogre::Node.

## ◆ attachObject()

virtual_l2 void Ogre::SceneNode::attachObject | ( | MovableObject * | obj | ) |

Adds an instance of a scene object to this node.

Remarks
  Scene objects can include Entity objects, Camera objects, Light objects, ParticleSystem objects etc. Anything that subclasses from MovableObject.

References virtual_l2.

## ◆ createChildSceneNode()

virtual SceneNode * Ogre::SceneNode::createChildSceneNode | ( | SceneMemoryMgrTypes | sceneType = SCENE_DYNAMIC,
|  | const Vector3 & | translate = Vector3::ZERO,
|  | const Quaternion & | rotate = Quaternion::IDENTITY )
| virtual

Creates an unnamed new SceneNode as a child of this node.

Parameters

  translate | Initial translation offset of child relative to parent
  rotate | Initial rotation relative to parent

References SceneNode(), Ogre::Quaternion::IDENTITY, Ogre::Node::rotate(), Ogre::SCENE_DYNAMIC, Ogre::Node::translate(), and Ogre::Vector3::ZERO.

## ◆ detachAllBones()

virtual void Ogre::SceneNode::detachAllBones | ( |  | ) |
| virtual

Detaches all bones from from this SceneNode. It is safe to use directly.

## ◆ detachAllObjects()

virtual void Ogre::SceneNode::detachAllObjects | ( |  | ) |
| virtual

Detaches all objects attached to this node.

## ◆ detachObject()

virtual_l2 void Ogre::SceneNode::detachObject | ( | MovableObject * | obj | ) |

Detaches an object by pointer.

Remarks
  It's fast, takes only O(1)

References virtual_l2.

## ◆ flipVisibility()

virtual void Ogre::SceneNode::flipVisibility | ( | bool | cascade = true | ) |
| virtual

Inverts the visibility of all objects attached to this node.

Remarks
  This is a shortcut to calling setVisible(!isVisible()) on the objects attached to this node, and optionally to all objects attached to child nodes.

Parameters

  cascade | If true, this setting cascades into child nodes too.

## ◆ getAttachedObject() [1/2]

MovableObject * Ogre::SceneNode::getAttachedObject | ( | const String & | name | ) |

Retrieves a pointer to an attached object.

Remarks
  Retrieves by object name, see alternate version to retrieve by index. Retrieving by name forces a linear search O(N), prefer using the index, which is O(1)

## ◆ getAttachedObject() [2/2]

MovableObject * Ogre::SceneNode::getAttachedObject | ( | size_t | index | ) |
| inline

Retrieves a pointer to an attached object.

Remarks
  Retrieves by index, see alternate version to retrieve by name. The index of an object may change as other objects are added / removed.

## ◆ getAttachedObjectIterator() [1/2]

virtual ObjectIterator Ogre::SceneNode::getAttachedObjectIterator | ( |  | ) |
| virtual

Retrieves an iterator which can be used to efficiently step through the objects attached to this node.

Remarks
  This is a much faster way to go through all the objects attached to the node than using getAttachedObject. But the iterator returned is only valid until a change is made to the collection (ie an addition or removal) so treat the returned iterator as transient, and don't add / remove items as you go through the iterator, save changes until the end, or retrieve a new iterator after making the change. Making changes to the object returned through the iterator is OK though.

## ◆ getAttachedObjectIterator() [2/2]

virtual ConstObjectIterator Ogre::SceneNode::getAttachedObjectIterator | ( |  | ) | const
| virtual

Retrieves an iterator which can be used to efficiently step through the objects attached to this node.

Remarks
  This is a much faster way to go through all the objects attached to the node than using getAttachedObject. But the iterator returned is only valid until a change is made to the collection (ie an addition or removal) so treat the returned iterator as transient, and don't add / remove items as you go through the iterator, save changes until the end, or retrieve a new iterator after making the change. Making changes to the object returned through the iterator is OK though.

## ◆ getAttachments()

const ObjectVec & Ogre::SceneNode::getAttachments | ( |  | ) |
| inline

## ◆ getCreator()

SceneManager * Ogre::SceneNode::getCreator | ( |  | ) | const
| inline

Gets the creator of this scene node.

Remarks
  This method returns the SceneManager which created this node. This can be useful for destroying this node.

## ◆ getDefaultNodeMemoryManager()

NodeMemoryManager * Ogre::SceneNode::getDefaultNodeMemoryManager | ( | SceneMemoryMgrTypes | sceneType | ) |
| overridevirtual

As Node::getDebugRenderable, except scaling is automatically determined.

Implements Ogre::Node.

## ◆ getParentSceneNode()

SceneNode * Ogre::SceneNode::getParentSceneNode | ( |  | ) | const

Gets the parent of this SceneNode.

References SceneNode().

## ◆ isYawFixed()

bool Ogre::SceneNode::isYawFixed | ( |  | ) | const
| inline

## ◆ lookAt()

virtual void Ogre::SceneNode::lookAt | ( | const Vector3 & | targetPoint,
|  | TransformSpace | relativeTo,
|  | const Vector3 & | localDirectionVector = Vector3::NEGATIVE_UNIT_Z )
| virtual

Points the local -Z direction of this node at a point in space.

Parameters

  targetPoint | A vector specifying the look at point.
  relativeTo | The space in which the point resides
  localDirectionVector | The vector which normally describes the natural direction of the node, usually -Z

References Ogre::Vector3::NEGATIVE_UNIT_Z.

## ◆ numAttachedObjects()

size_t Ogre::SceneNode::numAttachedObjects | ( |  | ) | const
| inline

Reports the number of objects attached to this node.

## ◆ removeAndDestroyAllChildren()

virtual void Ogre::SceneNode::removeAndDestroyAllChildren | ( |  | ) |
| virtual

Removes and destroys all children of this node.

Remarks
  Use this to destroy all child nodes of this node and remove them from the scene graph. Note that all objects attached to this node will be detached but will not be destroyed.

## ◆ removeAndDestroyChild()

virtual void Ogre::SceneNode::removeAndDestroyChild | ( | SceneNode * | sceneNode | ) |
| virtual

This method removes and destroys the child and all of its children.

Remarks
  Unlike removeChild, which removes a single child from this node but does not destroy it, this method destroys the child and all of it's children.

  Use this if you wish to recursively destroy a node as well as detaching it from it's parent. Note that any objects attached to the nodes will be detached but will not themselves be destroyed.

Parameters

  sceneNode | SceneNode, must be a child of ours

References SceneNode().

## ◆ setAutoTracking()

virtual void Ogre::SceneNode::setAutoTracking | ( | bool | enabled,
|  | SceneNode *const | target = 0,
|  | const Vector3 & | localDirectionVector = Vector3::NEGATIVE_UNIT_Z,
|  | const Vector3 & | offset = Vector3::ZERO )
| virtual

Enables / disables automatic tracking of another SceneNode.

Remarks
  If you enable auto-tracking, this SceneNode will automatically rotate to point it's -Z at the target SceneNode every frame, no matter how it or the other SceneNode move. Note that by default the -Z points at the origin of the target SceneNode, if you want to tweak this, provide a vector in the 'offset' parameter and the target point will be adjusted.

Parameters

  enabled | If true, tracking will be enabled and the next parameter cannot be null. If false tracking will be disabled and the current orientation will be maintained.
  target | Pointer to the SceneNode to track. Make sure you don't delete this SceneNode before turning off tracking (e.g. SceneManager::clearScene will delete it so be careful of this). Can be null if and only if the enabled param is false.
  localDirectionVector | The local vector considered to be the usual 'direction' of the node; normally the local -Z but can be another direction.
  offset | If supplied, this is the target point in local space of the target node instead of the origin of the target node. Good for fine tuning the look at point.

References SceneNode(), Ogre::Vector3::NEGATIVE_UNIT_Z, and Ogre::Vector3::ZERO.

## ◆ setDirection() [1/2]

virtual void Ogre::SceneNode::setDirection | ( | const Vector3 & | vec,
|  | TransformSpace | relativeTo = TS_LOCAL,
|  | const Vector3 & | localDirectionVector = Vector3::NEGATIVE_UNIT_Z )
| virtual

Sets the node's direction vector ie it's local -z.

Remarks
  Note that the 'up' vector for the orientation will automatically be recalculated based on the current 'up' vector (i.e. the roll will remain the same). If you need more control, use setOrientation.

Parameters

  vec | The direction vector
  relativeTo | The space in which this direction vector is expressed
  localDirectionVector | The vector which normally describes the natural direction of the node, usually -Z

References Ogre::Vector3::NEGATIVE_UNIT_Z, and Ogre::Node::TS_LOCAL.

## ◆ setDirection() [2/2]

virtual void Ogre::SceneNode::setDirection | ( | Real | x,
|  | Real | y,
|  | Real | z,
|  | TransformSpace | relativeTo = TS_LOCAL,
|  | const Vector3 & | localDirectionVector = Vector3::NEGATIVE_UNIT_Z )
| virtual

Sets the node's direction vector ie it's local -z.

Remarks
  Note that the 'up' vector for the orientation will automatically be recalculated based on the current 'up' vector (i.e. the roll will remain the same). If you need more control, use setOrientation.

Parameters

  x,y,z | The components of the direction vector
  relativeTo | The space in which this direction vector is expressed
  localDirectionVector | The vector which normally describes the natural direction of the node, usually -Z

References Ogre::Vector3::NEGATIVE_UNIT_Z, and Ogre::Node::TS_LOCAL.

## ◆ setFixedYawAxis()

void Ogre::SceneNode::setFixedYawAxis | ( | bool | useFixed,
|  | const Vector3 & | fixedAxis = Vector3::UNIT_Y )

Tells the node whether to yaw around it's own local Y axis or a fixed axis of choice.

Remarks
  This method allows you to change the yaw behaviour of the node - by default, it yaws around it's own local Y axis when told to yaw with TS_LOCAL, this makes it yaw around a fixed axis. You only really need this when you're using auto tracking (see setAutoTracking, because when you're manually rotating a node you can specify the TransformSpace in which you wish to work anyway.

Parameters

  useFixed | If true, the axis passed in the second parameter will always be the yaw axis no matter what the node orientation. If false, the node returns to it's default behaviour.
  fixedAxis | The axis to use if the first parameter is true.

References Ogre::Vector3::UNIT_Y.

## ◆ setListener()

void Ogre::SceneNode::setListener | ( | Listener * | listener | ) |
| overridevirtual

Sets a listener for this Node.

Remarks
  Note for size and performance reasons only one listener per node is allowed.

Reimplemented from Ogre::Node.

## ◆ setStatic()

bool Ogre::SceneNode::setStatic | ( | bool | bStatic | ) |
| overridevirtual

Turns this Node into static or dynamic.

Remarks
  Switching between dynamic and static has some overhead and forces to update all static scene when converted to static. So don't do it frequently. Static objects are not updated every frame, only when requested explicitly. Use this feature if you plan to have this object unaltered for a very long times

  Changing this attribute to a node will cause to switch the attribute to all attached entities (but not children or parent nodes; it's perfectly valid and useful to have dynamic children of a static parent; although the opposite (static children, dynamic parent) is probably a bug.

Returns
  True if setStatic made an actual change. False otherwise. Can fail because the object was already static/dynamic, or because switching is not supported

Reimplemented from Ogre::Node.

## ◆ setVisible()

virtual void Ogre::SceneNode::setVisible | ( | bool | visible,
|  | bool | cascade = true )
| virtual

Makes all objects attached to this node become visible / invisible.

Remarks
  This is a shortcut to calling setVisible() on the objects attached to this node, and optionally to all objects attached to child nodes.

Parameters

  visible | Whether the objects are to be made visible or invisible
  cascade | If true, this setting cascades into child nodes too.

## ◆ yaw()

void Ogre::SceneNode::yaw | ( | const Radian & | angle,
|  | TransformSpace | relativeTo = TS_LOCAL )

Rotate the node around the Y-axis.

References Ogre::Node::TS_LOCAL.

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

- OgreSceneNode.h