525 const Vector3& translate = Vector3::ZERO,
526 const Quaternion& rotate = Quaternion::IDENTITY );
659 virtual void _update(
bool updateChildren,
bool parentHasChanged);
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Variant type that can hold Any other type.
A viewpoint from which the scene will be rendered.
Concrete IteratorWrapper for const access to the underlying key-value container.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
A 3x3 matrix which can represent rotations around axes.
Class encapsulating a standard 4x4 homogeneous matrix.
Utility class to generate a sequentially numbered series of names.
Inner class for displaying debug renderable for Node.
const MaterialPtr & getMaterial(void) const
Retrieves a weak reference to the material this renderable object uses.
DebugRenderable(Node *parent)
Real getSquaredViewDepth(const Camera *cam) const
Returns the camera-relative squared depth of this renderable.
void getWorldTransforms(Matrix4 *xform) const
Gets the world transform matrix / matrices for this renderable object.
void getRenderOperation(RenderOperation &op)
Gets the render operation required to send this object to the frame buffer.
const LightList & getLights(void) const
Gets a list of lights, ordered relative to how close they are to this renderable.
Listener which gets called back on Node events.
virtual void nodeDestroyed(const Node *)
Node is being destroyed.
virtual void nodeDetached(const Node *)
Node has been detached from a parent.
virtual void nodeUpdated(const Node *)
Called when a node gets updated.
virtual void nodeAttached(const Node *)
Node has been attached to a parent.
Class representing a general-purpose node an articulated scene graph.
virtual void setPosition(const Vector3 &pos)
Sets the position of the node relative to it's parent.
virtual Node * removeChild(unsigned short index)
Drops the specified child from this node.
virtual void resetOrientation(void)
Resets the nodes orientation (local axes as world axes, no rotation).
virtual void updateFromParentImpl(void) const
Class-specific implementation of _updateFromParent.
virtual Vector3 convertWorldToLocalPosition(const Vector3 &worldPos)
Gets the local position, relative to this node, of the given world-space position.
virtual Node * createChildImpl(void)=0
Internal method for creating a new child node - must be overridden per subclass.
virtual void resetToInitialState(void)
Resets the position / orientation / scale of this node to it's initial state, see setInitialState for...
virtual const Quaternion & getOrientation() const
Returns a quaternion representing the nodes orientation.
virtual DebugRenderable * getDebugRenderable(Real scaling)
Get a debug renderable for rendering the Node.
UserObjectBindings mUserObjectBindings
User objects binding.
Node * mParent
Pointer to parent node.
virtual OGRE_DEPRECATED const Any & getUserAny(void) const
Quaternion mOrientation
Stores the orientation of the node relative to it's parent.
virtual bool getInheritOrientation(void) const
Returns true if this node is affected by orientation applied to the parent node.
Vector3 mDerivedScale
Cached combined scale.
virtual OGRE_DEPRECATED void setUserAny(const Any &anything)
virtual Node * getParent(void) const
Gets this node's parent (NULL if this is the root).
virtual const Quaternion & getInitialOrientation(void) const
Gets the initial orientation of this node, see setInitialState for more info.
virtual void setPosition(Real x, Real y, Real z)
Sets the position of the node relative to it's parent.
virtual Real getSquaredViewDepth(const Camera *cam) const
Helper function, get the squared view depth.
UserObjectBindings & getUserObjectBindings()
Return an instance of user objects binding associated with this class.
Node(const String &name)
Constructor, should only be called by parent, not directly.
Vector3 mInitialScale
The scale to use as a base for keyframe animation.
virtual void setOrientation(Real w, Real x, Real y, Real z)
Sets the orientation of this node via quaternion parameters.
static void queueNeedUpdate(Node *n)
Queue a 'needUpdate' call to a node safely.
virtual void translate(Real x, Real y, Real z, TransformSpace relativeTo=TS_PARENT)
Moves the node along the Cartesian axes.
virtual void translate(const Matrix3 &axes, Real x, Real y, Real z, TransformSpace relativeTo=TS_PARENT)
Moves the node along arbitrary axes.
Listener * mListener
Node listener - only one allowed (no list) for size & performance reasons.
bool mNeedChildUpdate
Flag indicating that all children need to be updated.
virtual unsigned short numChildren(void) const
Reports the number of child nodes under this one.
ChildUpdateSet mChildrenToUpdate
List of children which need updating, used if self is not out of date but children are.
virtual Vector3 convertLocalToWorldPosition(const Vector3 &localPos)
Gets the world position of a point in the node local space useful for simple transforms that don't re...
virtual void requestUpdate(Node *child, bool forceParentUpdate=false)
Called by children to notify their parent that they need an update.
virtual Matrix3 getLocalAxes(void) const
Gets a matrix whose columns are the local axes based on the nodes orientation relative to it's parent...
virtual void _update(bool updateChildren, bool parentHasChanged)
Internal method to update the Node.
virtual void setScale(Real x, Real y, Real z)
Sets the scaling factor applied to this node.
virtual Node * getChild(const String &name) const
Gets a pointer to a named child node.
virtual const Vector3 & getInitialPosition(void) const
Gets the initial position of this node, see setInitialState for more info.
bool mQueuedForUpdate
Flag indicating that the node has been queued for update.
virtual void setInheritScale(bool inherit)
Tells the node whether it should inherit scaling factors from it's parent node.
String mName
Friendly name of this node, can be automatically generated if you don't care.
virtual void translate(const Vector3 &d, TransformSpace relativeTo=TS_PARENT)
Moves the node along the Cartesian axes.
ConstMapIterator< ChildNodeMap > ConstChildNodeIterator
virtual void setParent(Node *parent)
Only available internally - notification of parent.
vector< Node * >::type QueuedUpdates
virtual void scale(Real x, Real y, Real z)
Scales the node, combining it's current scale with the passed in scaling factor.
virtual void removeAllChildren(void)
Removes all child Nodes attached to this node.
Quaternion mDerivedOrientation
Cached combined orientation.
Vector3 mDerivedPosition
Cached combined position.
virtual void setInitialState(void)
Sets the current transform of this node to be the 'initial state' ie that position / orientation / sc...
virtual const Vector3 & _getDerivedScale(void) const
Gets the scaling factor of the node as derived from all parents.
virtual void setInheritOrientation(bool inherit)
Tells the node whether it should inherit orientation from it's parent node.
virtual const Vector3 & getScale(void) const
Gets the scaling factor of this node.
Vector3 mScale
Stores the scaling factor applied to this node.
virtual void needUpdate(bool forceParentUpdate=false)
To be called in the event of transform changes to this node that require it's recalculation.
Quaternion mInitialOrientation
The orientation to use as a base for keyframe animation.
Matrix4 mCachedTransform
Cached derived transform as a 4x4 matrix.
MapIterator< ChildNodeMap > ChildNodeIterator
virtual void rotate(const Vector3 &axis, const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
Rotate the node around an arbitrary axis.
virtual Node * createChild(const String &name, const Vector3 &translate=Vector3::ZERO, const Quaternion &rotate=Quaternion::IDENTITY)
Creates a new named Node as a child of this node.
Node()
Constructor, should only be called by parent, not directly.
Vector3 mPosition
Stores the position/translation of the node relative to its parent.
virtual Quaternion convertLocalToWorldOrientation(const Quaternion &localOrientation)
Gets the world orientation of an orientation in the node local space useful for simple transforms tha...
Vector3 mInitialPosition
The position to use as a base for keyframe animation.
const UserObjectBindings & getUserObjectBindings() const
Return an instance of user objects binding associated with this class.
virtual bool getInheritScale(void) const
Returns true if this node is affected by scaling factors applied to the parent node.
virtual void setOrientation(const Quaternion &q)
Sets the orientation of this node via a quaternion.
virtual void _updateFromParent(void) const
Triggers the node to update it's combined transforms.
static QueuedUpdates msQueuedUpdates
bool mInheritScale
Stores whether this node inherits scale from it's parent.
bool mParentNotified
Flag indicating that parent has been notified about update request.
static NameGenerator msNameGenerator
Incremented count for next name extension.
virtual void _setDerivedPosition(const Vector3 &pos)
Sets the final world position of the node directly.
bool mCachedTransformOutOfDate
virtual void _setDerivedOrientation(const Quaternion &q)
Sets the final world orientation of the node directly.
virtual const Quaternion & _getDerivedOrientation(void) const
Gets the orientation of the node as derived from all parents.
TransformSpace
Enumeration denoting the spaces which a transform can be relative to.
@ TS_PARENT
Transform is relative to the space of the parent node.
@ TS_LOCAL
Transform is relative to the local space.
virtual void translate(const Matrix3 &axes, const Vector3 &move, TransformSpace relativeTo=TS_PARENT)
Moves the node along arbitrary axes.
virtual const Vector3 & _getDerivedPosition(void) const
Gets the position of the node as derived from all parents.
virtual ConstChildNodeIterator getChildIterator(void) const
Retrieves an iterator for efficiently looping through all children of this node.
virtual void pitch(const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
Rotate the node around the X-axis.
virtual Node * getChild(unsigned short index) const
Gets a pointer to a child node.
virtual const Vector3 & getPosition(void) const
Gets the position of the node relative to it's parent.
virtual void setListener(Listener *listener)
Sets a listener for this Node.
virtual void addChild(Node *child)
Adds a (precreated) child scene node to this node.
virtual void setScale(const Vector3 &scale)
Sets the scaling factor applied to this node.
ChildNodeMap mChildren
Collection of pointers to direct children; hashmap for efficiency.
virtual const Matrix4 & _getFullTransform(void) const
Gets the full transformation matrix for this node.
virtual void scale(const Vector3 &scale)
Scales the node, combining it's current scale with the passed in scaling factor.
virtual void cancelUpdate(Node *child)
Called by children to notify their parent that they no longer need an update.
virtual ChildNodeIterator getChildIterator(void)
Retrieves an iterator for efficiently looping through all children of this node.
bool mInheritOrientation
Stores whether this node inherits orientation from it's parent.
virtual Node * createChild(const Vector3 &translate=Vector3::ZERO, const Quaternion &rotate=Quaternion::IDENTITY)
Creates an unnamed new Node as a child of this node.
HashMap< String, Node * > ChildNodeMap
virtual Node * createChildImpl(const String &name)=0
Internal method for creating a new child node - must be overridden per subclass.
const String & getName(void) const
Returns the name of the node.
virtual Quaternion convertWorldToLocalOrientation(const Quaternion &worldOrientation)
Gets the local orientation, relative to this node, of the given world-space orientation.
bool mNeedParentUpdate
Flag to indicate own transform from parent is out of date.
virtual void roll(const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
Rotate the node around the Z-axis.
set< Node * >::type ChildUpdateSet
virtual void rotate(const Quaternion &q, TransformSpace relativeTo=TS_LOCAL)
Rotate the node around an aritrary axis using a Quarternion.
virtual void yaw(const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
Rotate the node around the Y-axis.
virtual Node * removeChild(Node *child)
Drops the specified child from this node.
virtual Node * removeChild(const String &name)
Drops the named child from this node.
virtual const Vector3 & getInitialScale(void) const
Gets the initial position of this node, see setInitialState for more info.
static void processQueuedUpdates(void)
Process queued 'needUpdate' calls.
virtual Listener * getListener(void) const
Gets the current listener for this Node.
Implementation of a Quaternion, i.e.
Wrapper class which indicates a given angle value is in Radians.
'New' rendering operation using vertex buffers.
Abstract class defining the interface all renderable objects must implement.
Class that provides convenient interface to establish a linkage between custom user application objec...
Standard 3-dimensional vector.
float Real
Software floating point type.