A skeleton. More...
#include <common/common.hh>
Public Member Functions | |
Skeleton () | |
Constructor. More... | |
Skeleton (SkeletonNode *_root) | |
Constructor. More... | |
virtual | ~Skeleton () |
Destructor. More... | |
void | AddAnimation (SkeletonAnimation *_anim) |
Add an animation. More... | |
void | AddVertNodeWeight (unsigned int _vertex, std::string _node, double _weight) |
Add a new weight to a node (bone) More... | |
ignition::math::Matrix4d | BindShapeTransform () |
Return bind pose skeletal transform. More... | |
SkeletonAnimation * | GetAnimation (const unsigned int _i) |
Find animation. More... | |
SkeletonNode * | GetNodeByHandle (unsigned int _handle) |
Find or create node with handle. More... | |
SkeletonNode * | GetNodeById (std::string _id) |
Find node by index. More... | |
SkeletonNode * | GetNodeByName (std::string _name) |
Find a node. More... | |
NodeMap | GetNodes () |
Get a copy or the node dictionary. More... | |
unsigned int | GetNumAnimations () |
Returns the number of animations. More... | |
unsigned int | GetNumJoints () |
Returns the number of joints. More... | |
unsigned int | GetNumNodes () |
Returns the node count. More... | |
unsigned int | GetNumVertNodeWeights (unsigned int _vertex) |
Returns the number of bone weights for a vertex. More... | |
SkeletonNode * | GetRootNode () |
Return the root. More... | |
std::pair< std::string, double > | GetVertNodeWeight (unsigned int _v, unsigned int _i) |
Weight of a bone for a vertex. More... | |
void | PrintTransforms () |
Outputs the transforms to std::err stream. More... | |
void | Scale (double _scale) |
Scale all nodes, transforms and animation data. More... | |
void | SetBindShapeTransform (const ignition::math::Matrix4d &_trans) |
Set the bind pose skeletal transform. More... | |
void | SetNumVertAttached (unsigned int _vertices) |
Resizes the raw node weight array. More... | |
void | SetRootNode (SkeletonNode *_node) |
Change the root node. More... | |
Protected Member Functions | |
void | BuildNodeMap () |
Initializes the hande numbers for each node in the map using breadth first traversal. More... | |
Protected Attributes | |
std::vector< SkeletonAnimation * > | anims |
the array of animations More... | |
ignition::math::Matrix4d | bindShapeTransform |
the bind pose skeletal transform More... | |
NodeMap | nodes |
The dictionary of nodes, indexed by name. More... | |
RawNodeWeights | rawNW |
the node weight table More... | |
SkeletonNode * | root |
the root node More... | |
A skeleton.
Skeleton | ( | ) |
Constructor.
|
explicit |
Constructor.
[in] | _root | node |
|
virtual |
Destructor.
void AddAnimation | ( | SkeletonAnimation * | _anim | ) |
Add an animation.
The skeleton does not take ownership of the animation
[in] | _anim | the animation to add |
void AddVertNodeWeight | ( | unsigned int | _vertex, |
std::string | _node, | ||
double | _weight | ||
) |
Add a new weight to a node (bone)
[in] | _vertex | index of the vertex |
[in] | _node | name of the bone |
[in] | _weight | the new weight (range 0 to 1) |
ignition::math::Matrix4d BindShapeTransform | ( | ) |
Return bind pose skeletal transform.
|
protected |
Initializes the hande numbers for each node in the map using breadth first traversal.
SkeletonAnimation* GetAnimation | ( | const unsigned int | _i | ) |
Find animation.
[in] | _i | the animation index |
SkeletonNode* GetNodeByHandle | ( | unsigned int | _handle | ) |
Find or create node with handle.
[in] | _handle |
SkeletonNode* GetNodeById | ( | std::string | _id | ) |
Find node by index.
[in] | _id | the index |
SkeletonNode* GetNodeByName | ( | std::string | _name | ) |
Find a node.
[in] | _name | the name of the node to look for |
NodeMap GetNodes | ( | ) |
Get a copy or the node dictionary.
unsigned int GetNumAnimations | ( | ) |
Returns the number of animations.
unsigned int GetNumJoints | ( | ) |
Returns the number of joints.
unsigned int GetNumNodes | ( | ) |
Returns the node count.
unsigned int GetNumVertNodeWeights | ( | unsigned int | _vertex | ) |
Returns the number of bone weights for a vertex.
[in] | _vertex | the index of the vertex |
SkeletonNode* GetRootNode | ( | ) |
Return the root.
std::pair<std::string, double> GetVertNodeWeight | ( | unsigned int | _v, |
unsigned int | _i | ||
) |
Weight of a bone for a vertex.
[in] | _v | the index of the vertex |
[in] | _i | the index of the weight for that vertex |
void PrintTransforms | ( | ) |
Outputs the transforms to std::err stream.
void Scale | ( | double | _scale | ) |
Scale all nodes, transforms and animation data.
[in] | the | scaling factor |
void SetBindShapeTransform | ( | const ignition::math::Matrix4d & | _trans | ) |
Set the bind pose skeletal transform.
[in] | _trans | the transform |
void SetNumVertAttached | ( | unsigned int | _vertices | ) |
Resizes the raw node weight array.
[in] | _vertices | the new size |
void SetRootNode | ( | SkeletonNode * | _node | ) |
Change the root node.
[in] | _node | the new node |
|
protected |
the array of animations
|
protected |
the bind pose skeletal transform
|
protected |
The dictionary of nodes, indexed by name.
|
protected |
the node weight table
|
protected |
the root node