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. More... | |
SkeletonNode (SkeletonNode *_parent, std::string _name, std::string _id, SkeletonNodeType _type=JOINT) | |
Constructor. More... | |
virtual | ~SkeletonNode () |
Destructor. More... | |
void | AddChild (SkeletonNode *_child) |
Add a new child. More... | |
void | AddRawTransform (NodeTransform _t) |
Add a raw transform. More... | |
SkeletonNode * | GetChild (unsigned int _index) |
Find a child by index. More... | |
SkeletonNode * | GetChildById (std::string _id) |
Get child by string id. More... | |
SkeletonNode * | GetChildByName (std::string _name) |
Get child by name. More... | |
unsigned int | GetChildCount () |
Returns the children count. More... | |
unsigned int | GetHandle () |
Get the handle index. More... | |
std::string | GetId () |
Returns the index. More... | |
math::Matrix4 | GetInverseBindTransform () |
Retrieve the inverse of the bind pose skeletal transform. More... | |
math::Matrix4 | GetModelTransform () |
Retrieve the model transform. More... | |
std::string | GetName () |
Returns the name. More... | |
unsigned int | GetNumRawTrans () |
Return the raw transformations count. More... | |
SkeletonNode * | GetParent () |
Returns the parent node. More... | |
NodeTransform | GetRawTransform (unsigned int _i) |
Find a raw transformation. More... | |
std::vector< NodeTransform > | GetRawTransforms () |
Retrieve the raw transformations. More... | |
math::Matrix4 | GetTransform () |
Get transform relative to parent. More... | |
std::vector< NodeTransform > | GetTransforms () |
Returns a copy of the array of transformations. More... | |
bool | IsJoint () |
Is a joint query. More... | |
bool | IsRootNode () |
Queries wether a node has no parent parent. More... | |
void | Reset (bool _resetChildren) |
Reset the transformation to the initial transformation. More... | |
void | SetHandle (unsigned int _h) |
Assign a handle number. More... | |
void | SetId (std::string _id) |
Change the id string. More... | |
void | SetInitialTransform (math::Matrix4 _tras) |
Sets the initial transformation. More... | |
void | SetInverseBindTransform (math::Matrix4 _invBM) |
Assign the inverse of the bind pose skeletal transform. More... | |
void | SetModelTransform (math::Matrix4 _trans, bool _updateChildren=true) |
Set the model transformation. More... | |
void | SetName (std::string _name) |
Change the name. More... | |
void | SetParent (SkeletonNode *_parent) |
Set the parent node. More... | |
void | SetTransform (math::Matrix4 _trans, bool _updateChildren=true) |
Set a transformation. More... | |
void | SetType (SkeletonNodeType _type) |
Change the skeleton node type. More... | |
void | UpdateChildrenTransforms () |
Apply model transformations in order for each node in the tree. More... | |
Protected Attributes | |
std::vector< SkeletonNode * > | children |
the children nodes More... | |
unsigned int | handle |
handle index number More... | |
std::string | id |
a string identifier More... | |
math::Matrix4 | initialTransform |
the initial transformation More... | |
math::Matrix4 | invBindTransform |
the inverse of the bind pose skeletal transform More... | |
math::Matrix4 | modelTransform |
the model transformation More... | |
std::string | name |
the name of the skeletal node More... | |
SkeletonNode * | parent |
the parent node More... | |
std::vector< NodeTransform > | rawTransforms |
the raw transformation More... | |
math::Matrix4 | transform |
the transform More... | |
SkeletonNodeType | type |
the type fo node More... | |
A skeleton node.
gazebo::common::SkeletonNode::SkeletonNode | ( | SkeletonNode * | _parent | ) |
Constructor.
[in] | _parent | The parent node |
gazebo::common::SkeletonNode::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 gazebo::common::SkeletonNode::AddChild | ( | SkeletonNode * | _child | ) |
Add a new child.
[in] | _child | a child |
void gazebo::common::SkeletonNode::AddRawTransform | ( | NodeTransform | _t | ) |
Add a raw transform.
[in] | _t | the transform |
SkeletonNode* gazebo::common::SkeletonNode::GetChild | ( | unsigned int | _index | ) |
Find a child by index.
[in] | _index | the index |
SkeletonNode* gazebo::common::SkeletonNode::GetChildById | ( | std::string | _id | ) |
Get child by string id.
[in] | _id | the string id |
SkeletonNode* gazebo::common::SkeletonNode::GetChildByName | ( | std::string | _name | ) |
Get child by name.
[in] | _name | the name of the child skeleton |
unsigned int gazebo::common::SkeletonNode::GetChildCount | ( | ) |
Returns the children count.
unsigned int gazebo::common::SkeletonNode::GetHandle | ( | ) |
Get the handle index.
std::string gazebo::common::SkeletonNode::GetId | ( | ) |
Returns the index.
math::Matrix4 gazebo::common::SkeletonNode::GetInverseBindTransform | ( | ) |
Retrieve the inverse of the bind pose skeletal transform.
math::Matrix4 gazebo::common::SkeletonNode::GetModelTransform | ( | ) |
Retrieve the model transform.
std::string gazebo::common::SkeletonNode::GetName | ( | ) |
Returns the name.
unsigned int gazebo::common::SkeletonNode::GetNumRawTrans | ( | ) |
Return the raw transformations count.
SkeletonNode* gazebo::common::SkeletonNode::GetParent | ( | ) |
Returns the parent node.
NodeTransform gazebo::common::SkeletonNode::GetRawTransform | ( | unsigned int | _i | ) |
Find a raw transformation.
[in] | _i | the index of the transformation |
std::vector<NodeTransform> gazebo::common::SkeletonNode::GetRawTransforms | ( | ) |
Retrieve the raw transformations.
math::Matrix4 gazebo::common::SkeletonNode::GetTransform | ( | ) |
Get transform relative to parent.
std::vector<NodeTransform> gazebo::common::SkeletonNode::GetTransforms | ( | ) |
Returns a copy of the array of transformations.
bool gazebo::common::SkeletonNode::IsJoint | ( | ) |
Is a joint query.
bool gazebo::common::SkeletonNode::IsRootNode | ( | ) |
Queries wether a node has no parent parent.
void gazebo::common::SkeletonNode::Reset | ( | bool | _resetChildren | ) |
Reset the transformation to the initial transformation.
[in] | _resetChildren | when true, performs the operation for every node in the tree |
void gazebo::common::SkeletonNode::SetHandle | ( | unsigned int | _h | ) |
Assign a handle number.
[in] | _h | the handle |
void gazebo::common::SkeletonNode::SetId | ( | std::string | _id | ) |
Change the id string.
[in] | _id | the new id string |
void gazebo::common::SkeletonNode::SetInitialTransform | ( | math::Matrix4 | _tras | ) |
Sets the initial transformation.
[in] | _tras | the transfromation matrix |
void gazebo::common::SkeletonNode::SetInverseBindTransform | ( | math::Matrix4 | _invBM | ) |
Assign the inverse of the bind pose skeletal transform.
[in] | _invBM | the transform |
void gazebo::common::SkeletonNode::SetModelTransform | ( | math::Matrix4 | _trans, |
bool | _updateChildren = true |
||
) |
Set the model transformation.
[in] | _trans | the transformation |
[in] | _updateChildren | when true the UpdateChildrenTransforms operation is performed |
void gazebo::common::SkeletonNode::SetName | ( | std::string | _name | ) |
Change the name.
[in] | _name | the new name |
void gazebo::common::SkeletonNode::SetParent | ( | SkeletonNode * | _parent | ) |
Set the parent node.
[in] | _parent | the new parent |
void gazebo::common::SkeletonNode::SetTransform | ( | math::Matrix4 | _trans, |
bool | _updateChildren = true |
||
) |
Set a transformation.
[in] | _trans | the transformation |
[in] | _updateChildren | when true the UpdateChildrenTransforms operation is performed |
void gazebo::common::SkeletonNode::SetType | ( | SkeletonNodeType | _type | ) |
Change the skeleton node type.
[in] | _type | the new type |
void gazebo::common::SkeletonNode::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