OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::Bone Class Reference

Class representing a Bone in the join hierarchy of a skeleton. More...

#include <OgreBone.h>

+ Inheritance diagram for Ogre::Bone:
+ Collaboration diagram for Ogre::Bone:

Public Member Functions

 Bone ()
 
virtual ~Bone ()
 
void _deinitialize (void)
 
FORCEINLINE const
SimpleMatrixAf4x3
_getFullTransform (void) const
 Gets the full transformation matrix for this node. More...
 
const SimpleMatrixAf4x3_getFullTransformUpdated (void)
 _getDerivedScaleUpdated remarks. More...
 
FORCEINLINE const
SimpleMatrixAf4x3
_getLocalSpaceTransform (void) const
 Gets the transformation matrix for this bone in local space (i.e. More...
 
BoneTransform_getTransform ()
 Returns a direct access to the Transform state. More...
 
void _initialize (IdType id, BoneMemoryManager *boneMemoryManager, Bone *parent, ArrayMatrixAf4x3 const *RESTRICT_ALIAS reverseBind)
 
void _memoryRebased (void)
 Internal use. Called from BoneMemoryManager's rebases (i.e. cleanups, grows) More...
 
void _setNodeParent (Node *nodeParent)
 Sets a regular Node to be parent of this Bone. More...
 
void _setReverseBindPtr (const ArrayMatrixAf4x3 *ptr)
 
uint16 getDepthLevel () const
 Returns how deep in the hierarchy we are (eg. 0 -> root node, 1 -> child of root) More...
 
IdType getId () const
 Get the unique id of this object. More...
 
bool getInheritOrientation (void) const
 Returns true if this node is affected by orientation applied to the parent node. More...
 
bool getInheritScale (void) const
 Returns true if this node is affected by scaling factors applied to the parent node. More...
 
const StringgetName (void) const
 Returns the name of the node. More...
 
Quaternion getOrientation () const
 Returns a quaternion representing the nodes orientation. More...
 
BonegetParent (void) const
 Gets this Bones's parent (NULL if this is the root). More...
 
Vector3 getPosition (void) const
 Gets the position of the node relative to its parent. More...
 
Vector3 getScale (void) const
 Gets the scale of the node relative to its parent. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 
bool operator() (const IdObject *left, const IdObject *right)
 
bool operator() (const IdObject &left, const IdObject &right)
 
void setInheritOrientation (bool inherit)
 Tells the Bone whether it should inherit orientation from it's parent node. More...
 
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. Doesn't have to be unique. More...
 
void setOrientation (Quaternion q)
 Sets a given orientation in local space (ie. More...
 
void setPosition (const Vector3 &pos)
 Sets the position of the node relative to its parent. More...
 
void setScale (const Vector3 &pos)
 Sets the scale of the node relative to its parent. More...
 

Static Public Member Functions

static void updateAllTransforms (const size_t numNodes, BoneTransform t, ArrayMatrixAf4x3 const *RESTRICT_ALIAS reverseBind, size_t numBinds)
 TODO. More...
 

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). 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...
 

Protected Member Functions

void _setId (IdType newId)
 In the rare case our derived class wants to override our Id (normally we don't want that, that's why it's private). More...
 
void _updateFromParent (void)
 Triggers the node to update it's combined transforms. More...
 
void removeChild (Bone *child)
 For debug use ONLY. More...
 
void resetParentTransformPtr (void)
 
void setCachedTransformOutOfDate (void) const
 
void updateFromParentImpl (void)
 

Protected Attributes

BoneMemoryManagermBoneMemoryManager
 The memory manager used to allocate the Transform. More...
 
bool mCachedTransformOutOfDate
 
BoneVec mChildren
 Collection of pointers to direct children. More...
 
NodemDebugParentNode
 
uint16 mDepthLevel
 Depth level in the hierarchy tree (0: Root node, 1: Child of root, etc) More...
 
bool mInitialized
 
String mName
 
BonemParent
 Pointer to parent node. More...
 
ArrayMatrixAf4x3 const
*RESTRICT_ALIAS 
mReverseBind
 
BoneTransform mTransform
 

Private Types

typedef vector< Bone * >::type BoneVec
 

Detailed Description

Class representing a Bone in the join hierarchy of a skeleton.

Remarks
Unlike 1.9; a Bone is practically a SceneNode in all purposes. It can even have objects directly attached to them. The only reason we need to overload is because the mDerivedTransform matrix is constructed differently, since it is not in world space, but rather in "offset space" (world space minus the reverse transform of the original bind pose). mDerivedPosition, mDeriverdOrientation and mDerivedScale are still in world space though, it's only the 4x4 matrix we send to the GPU that is in a different space.

Definition at line 61 of file OgreBone.h.

Member Typedef Documentation

typedef vector<Bone*>::type Ogre::Bone::BoneVec
private

Definition at line 63 of file OgreBone.h.

Constructor & Destructor Documentation

Ogre::Bone::Bone ( )
virtual Ogre::Bone::~Bone ( )
virtual

Member Function Documentation

void Ogre::Bone::_deinitialize ( void  )
FORCEINLINE const SimpleMatrixAf4x3& Ogre::Bone::_getFullTransform ( void  ) const
inline

Gets the full transformation matrix for this node.

Remarks
This method returns the full transformation matrix for this node, including the effect of any parent Bone transformations.
Assumes the caches are already updated.
The transform is in "world bone" space, unless our root parent called _setNodeParent( nullptr ) in which case the transform will be in local bone space.

Definition at line 250 of file OgreBone.h.

const SimpleMatrixAf4x3& Ogre::Bone::_getFullTransformUpdated ( void  )

_getDerivedScaleUpdated remarks.

_getFullTransform

FORCEINLINE const SimpleMatrixAf4x3& Ogre::Bone::_getLocalSpaceTransform ( void  ) const
inline

Gets the transformation matrix for this bone in local space (i.e.

as if the skeleton wasn't attached to a SceneNode).

Remarks
This method returns the full transformation matrix for this node, including the effect of any parent Bone transformations.
Assumes the caches are already updated.

Definition at line 232 of file OgreBone.h.

BoneTransform& Ogre::Bone::_getTransform ( )
inline

Returns a direct access to the Transform state.

Definition at line 123 of file OgreBone.h.

void Ogre::Bone::_initialize ( IdType  id,
BoneMemoryManager boneMemoryManager,
Bone parent,
ArrayMatrixAf4x3 const *RESTRICT_ALIAS  reverseBind 
)
void Ogre::Bone::_memoryRebased ( void  )

Internal use. Called from BoneMemoryManager's rebases (i.e. cleanups, grows)

void Ogre::IdObject::_setId ( IdType  newId)
inlineprotectedinherited

In the rare case our derived class wants to override our Id (normally we don't want that, that's why it's private).

Definition at line 63 of file OgreId.h.

void Ogre::Bone::_setNodeParent ( Node nodeParent)

Sets a regular Node to be parent of this Bone.

Remarks
  1. Multiple calls to _setNodeParent with different arguments will silently override previous calls.
  2. By the time we update, we assume the Node has already been updated. (even when calling _getDerivedPositionUpdated and Co)
  3. Null pointers will "detach", causing derived updates to be in local space
  4. Ogre must ensure that when a NodeMemoryManager performs a cleanup (or resizes), this function is called again (to update our pointers).
void Ogre::Bone::_setReverseBindPtr ( const ArrayMatrixAf4x3 ptr)
inline

Definition at line 128 of file OgreBone.h.

void Ogre::Bone::_updateFromParent ( void  )
protected

Triggers the node to update it's combined transforms.

This method is called internally by Ogre to ask the node to update it's complete transformation based on it's parents derived transform.
uint16 Ogre::Bone::getDepthLevel ( ) const
inline

Returns how deep in the hierarchy we are (eg. 0 -> root node, 1 -> child of root)

Definition at line 120 of file OgreBone.h.

IdType Ogre::IdObject::getId ( ) const
inlineinherited

Get the unique id of this object.

Definition at line 74 of file OgreId.h.

bool Ogre::Bone::getInheritOrientation ( void  ) const

Returns true if this node is affected by orientation applied to the parent node.

Remarks
setInheritOrientation for more info.
bool Ogre::Bone::getInheritScale ( void  ) const

Returns true if this node is affected by scaling factors applied to the parent node.

Remarks
setInheritOrientation for more info.
const String& Ogre::Bone::getName ( void  ) const
inline

Returns the name of the node.

Definition at line 134 of file OgreBone.h.

Quaternion Ogre::Bone::getOrientation ( ) const
inline

Returns a quaternion representing the nodes orientation.

Remarks
Don't call this function too often, as we need to convert from SoA
Bone* Ogre::Bone::getParent ( void  ) const
inline

Gets this Bones's parent (NULL if this is the root).

Definition at line 137 of file OgreBone.h.

Vector3 Ogre::Bone::getPosition ( void  ) const
inline

Gets the position of the node relative to its parent.

Remarks
Don't call this function too often, as we need to convert from SoA
Vector3 Ogre::Bone::getScale ( void  ) const
inline

Gets the scale of the node relative to its parent.

Remarks
Don't call this function too often, as we need to convert from SoA
template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

bool Ogre::IdObject::operator() ( const IdObject left,
const IdObject right 
)
inlineinherited

Definition at line 76 of file OgreId.h.

References Ogre::IdObject::mId.

bool Ogre::IdObject::operator() ( const IdObject left,
const IdObject right 
)
inlineinherited

Definition at line 81 of file OgreId.h.

References Ogre::IdObject::mId.

void Ogre::Bone::removeChild ( Bone child)
protected

For debug use ONLY.

Bones don't support dynamically changing their hierarchy structure. It can mess with the memory layout of neighbouring SkeletonInstances

void Ogre::Bone::resetParentTransformPtr ( void  )
protected
void Ogre::Bone::setCachedTransformOutOfDate ( void  ) const
protected
void Ogre::Bone::setInheritOrientation ( bool  inherit)

Tells the Bone whether it should inherit orientation from it's parent node.

Remarks
Node::setInheritOrientation remarks. Note that Nodes and bones inherit scale and orientation differently, because Bones support non-uniform scaling, whereas Nodes don't.
They may behave differently, because we assume inherited scale is never negative (due to this information being lost when embedded into a matrix. This mimics the behavior of major 3D modeling tools. i.e. scaling by x = -1 & y = -1 is the same as rotating 180° around Z axis) Default is true.
Parameters
inheritIf true, this node's orientation will be affected by its parent's orientation. If false, it will not be affected.
void Ogre::Bone::setInheritScale ( bool  inherit)

Tells the node whether it should inherit scaling factors from it's parent node.

Remarks
setInheritOrientation.
Parameters
inheritIf true, this node's scale will be affected by its parent's scale. If false, it will not be affected.
void Ogre::Bone::setName ( const String name)
inline

Sets a custom name for this node. Doesn't have to be unique.

Definition at line 131 of file OgreBone.h.

void Ogre::Bone::setOrientation ( Quaternion  q)
inline

Sets a given orientation in local space (ie.

relative to its parent)

Remarks
Don't call this function too often, as we need to convert to SoA
void Ogre::Bone::setPosition ( const Vector3 pos)
inline

Sets the position of the node relative to its parent.

Remarks
Don't call this function too often, as we need to convert to SoA
void Ogre::Bone::setScale ( const Vector3 pos)
inline

Sets the scale of the node relative to its parent.

Remarks
Don't call this function too often, as we need to convert to SoA
static void Ogre::Bone::updateAllTransforms ( const size_t  numNodes,
BoneTransform  t,
ArrayMatrixAf4x3 const *RESTRICT_ALIAS  reverseBind,
size_t  numBinds 
)
static
void Ogre::Bone::updateFromParentImpl ( void  )
protected

Member Data Documentation

BoneMemoryManager* Ogre::Bone::mBoneMemoryManager
protected

The memory manager used to allocate the Transform.

Definition at line 84 of file OgreBone.h.

bool Ogre::Bone::mCachedTransformOutOfDate
mutableprotected

Definition at line 69 of file OgreBone.h.

BoneVec Ogre::Bone::mChildren
protected

Collection of pointers to direct children.

Definition at line 79 of file OgreBone.h.

Node* Ogre::Bone::mDebugParentNode
protected

Definition at line 70 of file OgreBone.h.

uint16 Ogre::Bone::mDepthLevel
protected

Depth level in the hierarchy tree (0: Root node, 1: Child of root, etc)

Definition at line 75 of file OgreBone.h.

size_t Ogre::Bone::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.

Remarks
It is the parent (or our creator) the one that sets this value, not ourselves. Do NOT modify it manually.

Definition at line 108 of file OgreBone.h.

bool Ogre::Bone::mInitialized
protected

Definition at line 71 of file OgreBone.h.

String Ogre::Bone::mName
protected

Definition at line 81 of file OgreBone.h.

Bone* Ogre::Bone::mParent
protected

Pointer to parent node.

Definition at line 77 of file OgreBone.h.

size_t Ogre::Bone::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.

Remarks
It is the parent (or our creator) the one that sets this value, not ourselves. Do NOT modify it manually.

Definition at line 110 of file OgreBone.h.

ArrayMatrixAf4x3 const* RESTRICT_ALIAS Ogre::Bone::mReverseBind
protected

Definition at line 65 of file OgreBone.h.

BoneTransform Ogre::Bone::mTransform
protected

Definition at line 66 of file OgreBone.h.


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