OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::TagPoint Class Reference

TagPoints are like SceneNodes, that can be children of a Bone. More...

#include <OgreTagPoint.h>

+ Inheritance diagram for Ogre::TagPoint:

Public Member Functions

 TagPoint (IdType id, SceneManager *creator, NodeMemoryManager *nodeMemoryManager, SceneNode *parent)
 
 ~TagPoint () override
 
Matrix3 _getDerivedOrientationMatrix () const
 
void _setParentBone (Bone *bone)
 Don't call directly. More...
 
void _unsetParentBone ()
 
virtual TagPointcreateChildTagPoint (const Vector3 &vPos=Vector3::ZERO, const Quaternion &qRot=Quaternion::IDENTITY)
 
BonegetParentBone () const
 Gets this Bones's parent (NULL if no parent). More...
 
- Public Member Functions inherited from Ogre::SceneNode
 SceneNode (const Transform &transformPtrs)
 Don't use this constructor unless you know what you're doing. More...
 
 SceneNode (IdType id, SceneManager *creator, NodeMemoryManager *nodeMemoryManager, SceneNode *parent)
 Constructor, only to be called by the creator SceneManager. More...
 
 ~SceneNode () override
 
virtual_l1 void _attachBone (SkeletonInstance *skeletonInstance, Bone *bone)
 Attaches a bone to this SceneNode. More...
 
void _callMemoryChangeListeners () override
 Internal use, notifies all attached objects that our memory pointers (i.e. More...
 
virtual_l1 void _detachAllBones (SkeletonInstance *skeletonInstance)
 Detaches all bones from this SceneNode that belong to the given SkeletonInstance. More...
 
virtual_l1 void _detachBone (SkeletonInstance *skeletonInstance, Bone *bone)
 Detaches a bone from this SceneNode. More...
 
void _notifyStaticDirty () const override
 Called by SceneManager when it is telling we're a static node being dirty Don't call this directly. More...
 
virtual_l2 void attachObject (MovableObject *obj)
 Adds an instance of a scene object to this node. More...
 
virtual SceneNodecreateChildSceneNode (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. More...
 
virtual void detachAllBones ()
 Detaches all bones from from this SceneNode. It is safe to use directly. More...
 
virtual void detachAllObjects ()
 Detaches all objects attached to this node. More...
 
virtual_l2 void detachObject (MovableObject *obj)
 Detaches an object by pointer. More...
 
virtual void flipVisibility (bool cascade=true)
 Inverts the visibility of all objects attached to this node. More...
 
MovableObjectgetAttachedObject (const String &name)
 Retrieves a pointer to an attached object. More...
 
MovableObjectgetAttachedObject (size_t index)
 Retrieves a pointer to an attached object. More...
 
virtual ObjectIterator getAttachedObjectIterator ()
 Retrieves an iterator which can be used to efficiently step through the objects attached to this node. More...
 
virtual ConstObjectIterator getAttachedObjectIterator () const
 Retrieves an iterator which can be used to efficiently step through the objects attached to this node. More...
 
const ObjectVecgetAttachments ()
 
SceneManagergetCreator () const
 Gets the creator of this scene node. More...
 
NodeMemoryManagergetDefaultNodeMemoryManager (SceneMemoryMgrTypes sceneType) override
 As Node::getDebugRenderable, except scaling is automatically determined. More...
 
SceneNodegetParentSceneNode () const
 Gets the parent of this SceneNode. More...
 
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. More...
 
size_t numAttachedObjects () const
 Reports the number of objects attached to this node. More...
 
virtual void removeAndDestroyAllChildren ()
 Removes and destroys all children of this node. More...
 
virtual void removeAndDestroyChild (SceneNode *sceneNode)
 This method removes and destroys the child and all of its children. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void setListener (Listener *listener) override
 Sets a listener for this Node. More...
 
bool setStatic (bool bStatic) override
 Turns this Node into static or dynamic. More...
 
virtual void setVisible (bool visible, bool cascade=true)
 Makes all objects attached to this node become visible / invisible. More...
 
void yaw (const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
 Rotate the node around the Y-axis. More...
 
- Public Member Functions inherited from Ogre::Node
 Node (const Transform &transformPtrs)
 Don't use this constructor unless you know what you're doing. More...
 
 Node (IdType id, NodeMemoryManager *nodeMemoryManager, Node *parent)
 Constructor, should only be called by parent, not directly. More...
 
virtual ~Node ()
 
virtual_l2 Quaternion _getDerivedOrientation () const
 Gets the orientation of the node as derived from all parents. More...
 
virtual_l2 Quaternion _getDerivedOrientationUpdated ()
 Gets the orientation of the node as derived from all parents. More...
 
virtual_l2 Vector3 _getDerivedPosition () const
 Gets the position of the node as derived from all parents. More...
 
virtual_l2 Vector3 _getDerivedPositionUpdated ()
 Gets the position of the node as derived from all parents. More...
 
virtual_l2 Vector3 _getDerivedScale () const
 Gets the scaling factor of the node as derived from all parents. More...
 
virtual_l2 Vector3 _getDerivedScaleUpdated ()
 Gets the scalling factor of the node as derived from all parents. More...
 
virtual_l2 FORCEINLINE const Matrix4_getFullTransform () const
 Gets the full transformation matrix for this node. More...
 
virtual_l2 const Matrix4_getFullTransformUpdated ()
 See _getDerivedScaleUpdated() remarks. More...
 
Transform_getTransform ()
 Returns a direct access to the Transform state. More...
 
virtual_l2 void _setDerivedOrientation (const Quaternion &q)
 Sets the final world orientation of the node directly. More...
 
virtual_l2 void _setDerivedPosition (const Vector3 &pos)
 Sets the final world position of the node directly. More...
 
void _setNullNodeMemoryManager ()
 Manually set the mNodeMemoryManager to a null ptr. More...
 
void _updateChildren ()
 Helper method to update the Node and all children. More...
 
void addChild (Node *child)
 Adds a (precreated) child scene node to this node. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
Vector3 convertWorldToLocalPositionUpdated (const Vector3 &worldPos)
 
virtual NodecreateChild (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. More...
 
NodegetChild (size_t index)
 Gets a pointer to a child node. More...
 
const NodegetChild (size_t index) const
 
NodeVecIterator getChildIterator ()
 Retrieves an iterator for efficiently looping through all children of this node. More...
 
ConstNodeVecIterator getChildIterator () const
 Retrieves an iterator for efficiently looping through all children of this node. More...
 
uint16 getDepthLevel () const
 Returns how deep in the hierarchy we are (eg. 0 -> root node, 1 -> child of root) More...
 
bool getIndestructibleByClearScene () const
 
virtual_l2 bool getInheritOrientation () const
 Returns true if this node is affected by orientation applied to the parent node. More...
 
virtual_l2 bool getInheritScale () const
 Returns true if this node is affected by scaling factors applied to the parent node. More...
 
ListenergetListener () const
 Gets the current listener for this Node. More...
 
virtual_l2 Matrix3 getLocalAxes () const
 Gets a matrix whose columns are the local axes based on the nodes orientation relative to it's parent. More...
 
const StringgetName () const
 Returns the name of the node. More...
 
virtual_l2 Quaternion getOrientation () const
 Returns a quaternion representing the nodes orientation. More...
 
NodegetParent () const
 Gets this node's parent (NULL if this is the root). More...
 
virtual_l2 Vector3 getPosition () const
 Gets the position of the node relative to it's parent. More...
 
virtual_l2 Vector3 getScale () const
 Gets the scaling factor of this node. More...
 
virtual Real getSquaredViewDepth (const Camera *cam) const
 Helper function, get the squared view depth. More...
 
virtual OGRE_DEPRECATED const AnygetUserAny () const
 
UserObjectBindingsgetUserObjectBindings ()
 Return an instance of user objects binding associated with this class. More...
 
const UserObjectBindingsgetUserObjectBindings () const
 Return an instance of user objects binding associated with this class. More...
 
bool isStatic () const
 Checks whether this node is static. More...
 
void migrateTo (NodeMemoryManager *nodeMemoryManager)
 Migrates the node and all of its children to the new memory manager, at the same depth level. More...
 
size_t numChildren () const
 Reports the number of child nodes under this one. More...
 
virtual_l2 void pitch (const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
 Rotate the node around the X-axis. More...
 
virtual void removeAllChildren ()
 Removes all child Nodes attached to this node. More...
 
virtual void removeChild (Node *child)
 Drops the specified child from this node. More...
 
virtual_l1 void resetOrientation ()
 Resets the nodes orientation (local axes as world axes, no rotation). More...
 
virtual_l2 void roll (const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
 Rotate the node around the Z-axis. More...
 
virtual_l2 void rotate (const Quaternion &q, TransformSpace relativeTo=TS_LOCAL)
 Rotate the node around an arbitrary axis using a Quarternion. More...
 
virtual_l2 void rotate (const Vector3 &axis, const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
 Rotate the node around an arbitrary axis. More...
 
virtual_l2 void scale (const Vector3 &scale)
 Scales the node, combining it's current scale with the passed in scaling factor. More...
 
virtual_l2 void scale (Real x, Real y, Real z)
 Scales the node, combining it's current scale with the passed in scaling factor. More...
 
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. More...
 
virtual_l2 void setInheritOrientation (bool inherit)
 Tells the node whether it should inherit orientation from it's parent node. More...
 
virtual_l2 void setInheritScale (bool inherit)
 Tells the node whether it should inherit scaling factors from it's parent node. More...
 
void setName (const String &name)
 Sets a custom name for this node. More...
 
virtual_l1 void setOrientation (Quaternion q)
 Sets the orientation of this node via a quaternion. More...
 
virtual_l1 void setOrientation (Real w, Real x, Real y, Real z)
 Sets the orientation of this node via quaternion parameters. More...
 
virtual_l1 void setPosition (const Vector3 &pos)
 Sets the position of the node relative to it's parent. More...
 
virtual_l1 void setPosition (Real x, Real y, Real z)
 Sets the position of the node relative to it's parent. More...
 
virtual_l1 void setScale (const Vector3 &scale)
 Sets the scaling factor applied to this node. More...
 
virtual_l1 void setScale (Real x, Real y, Real z)
 Sets the scaling factor applied to this node. More...
 
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. More...
 
virtual_l2 void translate (const Matrix3 &axes, Real x, Real y, Real z, TransformSpace relativeTo=TS_PARENT)
 Moves the node along arbitrary axes. More...
 
virtual_l2 void translate (const Vector3 &d, TransformSpace relativeTo=TS_PARENT)
 Moves the node along the Cartesian axes. More...
 
virtual_l2 void translate (Real x, Real y, Real z, TransformSpace relativeTo=TS_PARENT)
 Moves the node along the Cartesian axes. More...
 
virtual_l2 void yaw (const Radian &angle, TransformSpace relativeTo=TS_LOCAL)
 Rotate the node around the Y-axis. More...
 
- Public Member Functions inherited from Ogre::IdObject
 IdObject (IdType id)
 We don't call generateNewId() here, to prevent objects in the stack (i.e. More...
 
IdType getId () const
 Get the unique id of this object. More...
 
bool operator() (const IdObject &left, const IdObject &right)
 
bool operator() (const IdObject *left, const IdObject *right)
 

Static Public Member Functions

static void updateAllTransformsBoneToTag (const size_t numNodes, Transform t)
 See Node::updateAllTransforms. More...
 
static void updateAllTransformsTagOnTag (const size_t numNodes, Transform t)
 See Node::updateAllTransforms. More...
 
- Static Public Member Functions inherited from Ogre::Node
static void updateAllTransforms (const size_t numNodes, Transform t)
 

Additional Inherited Members

- Public Types inherited from Ogre::SceneNode
typedef ConstVectorIterator< ObjectVecConstObjectIterator
 
typedef VectorIterator< ObjectVecObjectIterator
 
typedef vector< MovableObject * >::type ObjectVec
 
- Public Types inherited from Ogre::Node
typedef ConstVectorIterator< NodeVecConstNodeVecIterator
 
typedef vector< Node * >::type NodeVec
 
typedef VectorIterator< NodeVecNodeVecIterator
 
enum  TransformSpace { TS_LOCAL , TS_PARENT , TS_WORLD }
 Enumeration denoting the spaces which a transform can be relative to. More...
 
- 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). More...
 
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). More...
 

Detailed Description

TagPoints are like SceneNodes, that can be children of a Bone.

Q: Can I use a SceneNode as child of a Bone? A: No.

Q: Can I use a TagPoint as child of a Bone? A: Yes. That's the idea.

Q: Can I use a SceneNode as child of a TagPoint? A: Yes.

Q: Can I use a TagPoint as child of a TagPoint? A: Yes.

Q: Can I use a TagPoint as child of a SceneNode? A: Yes.

Q: Is there a performance hit for using a TagPoint as a SceneNode? A: No, though there is higher memory consumption (and indirectly could decrease performance by affecting the cache or the bandwidth)

Q: So... TagPoints are better than SceneNodes, because they can be used like SceneNodes, but also be used with bones? A: Yes.

Q: Why not merge TagPoints into SceneNodes then, and remove TagPoints? A: Good question. Theoretically the TagPoint functionality does not belong to SceneNode (more dependencies, more clutter in the same cpp files). Also TagPoints require more memory; which can add up when you have tens of thousands (or +100k's) of nodes. Only pay for what you use.

Q: Can I attach a TagPoint to Skeleton 'A' bone, and then attach an Item/Entity with Skeleton 'B' to this TagPoint? A: Yesish. It will work, but Skeleton B will see the changes from Skeleton A with one frame of latency (i.e. lag behind). If the animation is too fast or too different between frames, it may be noticeable. That's because we update Skeleton A, then B, then the TagPoints. To fix this we would have to update Skeleton 'A', then the TagPoints, then Skeleton 'B'; which is too cumbersome for such rare corner case.

Q: What happens on circular dependencies? i.e. Skeleton gets attached to TagPoint, TagPoint gets attached to bone of said Skeleton? A: Undefined. Probably very wonky behavior.

Q: What happens if I call setStatic( true )? A: If the TagPoint is ultimately the child of a Bone, then nothing happens. If the TagPoint is ultimately the child of the Root SceneNode, then it works as usual.

Q: What happens if I called setStatic( true ) on a TagPoint that belonged to the Root SceneNode, and now I've detached, and attached it to a bone? A: The information about being static is completely lost (i.e. it's like calling setStatic( false ) prior to attaching to the bone)

Constructor & Destructor Documentation

◆ TagPoint()

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

◆ ~TagPoint()

Ogre::TagPoint::~TagPoint ( )
override

Member Function Documentation

◆ _getDerivedOrientationMatrix()

Matrix3 Ogre::TagPoint::_getDerivedOrientationMatrix ( ) const

◆ _setParentBone()

void Ogre::TagPoint::_setParentBone ( Bone bone)

Don't call directly.

See also
Bone::addTagPoint

◆ _unsetParentBone()

void Ogre::TagPoint::_unsetParentBone ( )

◆ createChildTagPoint()

virtual TagPoint* Ogre::TagPoint::createChildTagPoint ( const Vector3 vPos = Vector3::ZERO,
const Quaternion qRot = Quaternion::IDENTITY 
)
virtual

◆ getParentBone()

Bone* Ogre::TagPoint::getParentBone ( ) const
inline

Gets this Bones's parent (NULL if no parent).

◆ updateAllTransformsBoneToTag()

static void Ogre::TagPoint::updateAllTransformsBoneToTag ( const size_t  numNodes,
Transform  t 
)
static

See Node::updateAllTransforms.

This version grabs the parent Bone of a TagPoint, derives the final transform in world space (supporting non-uniform scaling), and decomposes the matrix into derived position/quaternion/scale (the quaternion and scale aren't very useful if the skeleton is actually using non-uniform scaling though)

◆ updateAllTransformsTagOnTag()

static void Ogre::TagPoint::updateAllTransformsTagOnTag ( const size_t  numNodes,
Transform  t 
)
static

See Node::updateAllTransforms.

This version grabs the parent of a TagPoint, and derives the final transform of another TagPoint, respecting non-uniform scaling.


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