A skeleton node. More...
#include <common/common.hh>
Public Types | |
enum | SkeletonNodeType { NODE , JOINT } |
enumeration of node types More... | |
Public Member Functions | |
SkeletonNode (SkeletonNode *_parent) | |
Constructor. | |
SkeletonNode (SkeletonNode *_parent, std::string _name, std::string _id, SkeletonNodeType _type=JOINT) | |
Constructor. | |
virtual | ~SkeletonNode () |
Destructor. | |
void | AddChild (SkeletonNode *_child) |
Add a new child. | |
void | AddRawTransform (NodeTransform _t) |
Add a raw transform. | |
SkeletonNode * | GetChild (unsigned int _index) |
Find a child by index. | |
SkeletonNode * | GetChildById (std::string _id) |
Get child by string id. | |
SkeletonNode * | GetChildByName (std::string _name) |
Get child by name. | |
unsigned int | GetChildCount () |
Returns the children count. | |
unsigned int | GetHandle () |
Get the handle index. | |
std::string | GetId () |
Returns the index. | |
std::string | GetName () |
Returns the name. | |
unsigned int | GetNumRawTrans () |
Return the raw transformations count. | |
SkeletonNode * | GetParent () |
Returns the parent node. | |
NodeTransform | GetRawTransform (unsigned int _i) |
Find a raw transformation. | |
std::vector< NodeTransform > | GetRawTransforms () |
Retrieve the raw transformations. | |
std::vector< NodeTransform > | GetTransforms () |
Returns a copy of the array of transformations. | |
bool | HasInvBindTransform () |
returns true if the node has inv bind transform. | |
ignition::math::Matrix4d | InverseBindTransform () |
Retrieve the inverse of the bind pose skeletal transform. | |
bool | IsJoint () |
Is a joint query. | |
bool | IsRootNode () |
Queries wether a node has no parent parent. | |
ignition::math::Matrix4d | ModelTransform () const |
Retrieve the model transform. | |
std::string | Name () const |
Returns the name. | |
void | Reset (bool _resetChildren) |
Reset the transformation to the initial transformation. | |
void | SetHandle (unsigned int _h) |
Assign a handle number. | |
void | SetId (std::string _id) |
Change the id string. | |
void | SetInitialTransform (const ignition::math::Matrix4d &_tras) |
Sets the initial transformation. | |
void | SetInverseBindTransform (const ignition::math::Matrix4d &_invBM) |
Assign the inverse of the bind pose skeletal transform. | |
void | SetModelTransform (const ignition::math::Matrix4d &_trans, bool _updateChildren=true) |
Set the model transformation. | |
void | SetName (std::string _name) |
Change the name. | |
void | SetParent (SkeletonNode *_parent) |
Set the parent node. | |
void | SetTransform (const ignition::math::Matrix4d &_trans, bool _updateChildren=true) |
Set a transformation. | |
void | SetType (SkeletonNodeType _type) |
Change the skeleton node type. | |
ignition::math::Matrix4d | Transform () |
Get transform relative to parent. | |
void | UpdateChildrenTransforms () |
Apply model transformations in order for each node in the tree. | |
Protected Attributes | |
std::vector< SkeletonNode * > | children |
the children nodes | |
unsigned int | handle |
handle index number | |
std::string | id |
a string identifier | |
ignition::math::Matrix4d | initialTransform |
the initial transformation | |
ignition::math::Matrix4d | invBindTransform |
the inverse of the bind pose skeletal transform | |
ignition::math::Matrix4d | modelTransform |
the model transformation | |
std::string | name |
the name of the skeletal node | |
SkeletonNode * | parent |
the parent node | |
std::vector< NodeTransform > | rawTransforms |
the raw transformation | |
ignition::math::Matrix4d | transform |
the transform | |
SkeletonNodeType | type |
the type fo node | |
A skeleton node.
enum SkeletonNodeType |
|
explicit |
Constructor.
[in] | _parent | The parent node |
SkeletonNode | ( | SkeletonNode * | _parent, |
std::string | _name, | ||
std::string | _id, | ||
SkeletonNodeType | _type = JOINT ) |
Constructor.
[in] | _parent | the parent node |
[in] | _name | name of node |
[in] | _id | Id of node |
[in] | _type | The type of this node |
|
virtual |
Destructor.
void AddChild | ( | SkeletonNode * | _child | ) |
Add a new child.
[in] | _child | a child |
void AddRawTransform | ( | NodeTransform | _t | ) |
Add a raw transform.
[in] | _t | the transform |
SkeletonNode * GetChild | ( | unsigned int | _index | ) |
Find a child by index.
[in] | _index | the index |
SkeletonNode * GetChildById | ( | std::string | _id | ) |
Get child by string id.
[in] | _id | the string id |
SkeletonNode * GetChildByName | ( | std::string | _name | ) |
Get child by name.
[in] | _name | the name of the child skeleton |
unsigned int GetChildCount | ( | ) |
Returns the children count.
unsigned int GetHandle | ( | ) |
Get the handle index.
std::string GetId | ( | ) |
Returns the index.
std::string GetName | ( | ) |
Returns the name.
unsigned int GetNumRawTrans | ( | ) |
Return the raw transformations count.
SkeletonNode * GetParent | ( | ) |
Returns the parent node.
NodeTransform GetRawTransform | ( | unsigned int | _i | ) |
Find a raw transformation.
[in] | _i | the index of the transformation |
std::vector< NodeTransform > GetRawTransforms | ( | ) |
Retrieve the raw transformations.
std::vector< NodeTransform > GetTransforms | ( | ) |
Returns a copy of the array of transformations.
bool HasInvBindTransform | ( | ) |
returns true if the node has inv bind transform.
\detail to keep ABI compatibility, it checks if the inv bind transform is the default value of zero.
ignition::math::Matrix4d InverseBindTransform | ( | ) |
Retrieve the inverse of the bind pose skeletal transform.
bool IsJoint | ( | ) |
Is a joint query.
bool IsRootNode | ( | ) |
Queries wether a node has no parent parent.
ignition::math::Matrix4d ModelTransform | ( | ) | const |
Retrieve the model transform.
std::string Name | ( | ) | const |
Returns the name.
GetName
to be inline with the non-const version, however, it is decided that it should be called Name
as GetName
is being deprecated. void Reset | ( | bool | _resetChildren | ) |
Reset the transformation to the initial transformation.
[in] | _resetChildren | when true, performs the operation for every node in the tree |
void SetHandle | ( | unsigned int | _h | ) |
Assign a handle number.
[in] | _h | the handle |
void SetId | ( | std::string | _id | ) |
Change the id string.
[in] | _id | the new id string |
void SetInitialTransform | ( | const ignition::math::Matrix4d & | _tras | ) |
Sets the initial transformation.
[in] | _tras | the transfromation matrix |
void SetInverseBindTransform | ( | const ignition::math::Matrix4d & | _invBM | ) |
Assign the inverse of the bind pose skeletal transform.
[in] | _invBM | the transform |
void SetModelTransform | ( | const ignition::math::Matrix4d & | _trans, |
bool | _updateChildren = true ) |
Set the model transformation.
[in] | _trans | the transformation |
[in] | _updateChildren | when true the UpdateChildrenTransforms operation is performed |
void SetName | ( | std::string | _name | ) |
Change the name.
[in] | _name | the new name |
void SetParent | ( | SkeletonNode * | _parent | ) |
Set the parent node.
[in] | _parent | the new parent |
void SetTransform | ( | const ignition::math::Matrix4d & | _trans, |
bool | _updateChildren = true ) |
Set a transformation.
[in] | _trans | the transformation |
[in] | _updateChildren | when true the UpdateChildrenTransforms operation is performed |
void SetType | ( | SkeletonNodeType | _type | ) |
Change the skeleton node type.
[in] | _type | the new type |
ignition::math::Matrix4d Transform | ( | ) |
Get transform relative to parent.
void UpdateChildrenTransforms | ( | ) |
Apply model transformations in order for each node in the tree.
|
protected |
the children nodes
|
protected |
handle index number
|
protected |
a string identifier
|
protected |
the initial transformation
|
protected |
the inverse of the bind pose skeletal transform
|
protected |
the model transformation
|
protected |
the name of the skeletal node
|
protected |
the parent node
|
protected |
the raw transformation
|
protected |
the transform
|
protected |
the type fo node