17 #ifndef _GAZEBO_SKELETON_HH_ 18 #define _GAZEBO_SKELETON_HH_ 25 #include <ignition/math/Matrix4.hh> 39 typedef std::map<unsigned int, SkeletonNode*>
NodeMap;
40 typedef std::map<unsigned int, SkeletonNode*>::iterator
NodeMapIter;
42 typedef std::map<double, std::vector<NodeTransform> >
RawNodeAnim;
45 typedef std::vector<std::vector<std::pair<std::string, double> > >
86 public:
SkeletonNode* GetNodeByHandle(
unsigned int _handle);
90 public:
unsigned int GetNumNodes();
94 public:
unsigned int GetNumJoints();
98 public:
void Scale(
double _scale);
109 public:
void SetBindShapeTransform(
110 const ignition::math::Matrix4d &_trans);
120 public: ignition::math::Matrix4d BindShapeTransform();
123 public:
void PrintTransforms();
126 public: NodeMap GetNodes();
130 public:
void SetNumVertAttached(
unsigned int _vertices);
136 public:
void AddVertNodeWeight(
unsigned int _vertex, std::string _node,
142 public:
unsigned int GetNumVertNodeWeights(
unsigned int _vertex);
148 public: std::pair<std::string, double> GetVertNodeWeight(
unsigned int _v,
153 public:
unsigned int GetNumAnimations();
167 protected:
void BuildNodeMap();
182 protected: std::vector<SkeletonAnimation*>
anims;
209 public:
void SetName(std::string _name);
213 public: std::string GetName();
217 public:
void SetId(std::string _id);
221 public: std::string GetId();
229 public:
bool IsJoint();
244 public:
void SetTransform(
const ignition::math::Matrix4d &_trans,
245 bool _updateChildren =
true);
260 public:
void SetModelTransform(
const ignition::math::Matrix4d &_trans,
261 bool _updateChildren =
true);
264 public:
void UpdateChildrenTransforms();
275 public:
void SetInitialTransform(
const ignition::math::Matrix4d &_tras);
280 public:
void Reset(
bool _resetChildren);
290 public: ignition::math::Matrix4d Transform();
302 public:
bool IsRootNode();
310 public:
unsigned int GetChildCount();
320 public:
SkeletonNode* GetChildByName(std::string _name);
329 public:
void SetHandle(
unsigned int _h);
333 public:
unsigned int GetHandle();
344 public:
void SetInverseBindTransform(
345 const ignition::math::Matrix4d &_invBM);
355 public: ignition::math::Matrix4d InverseBindTransform();
365 public: ignition::math::Matrix4d ModelTransform()
const;
369 public: std::vector<NodeTransform> GetRawTransforms();
373 public:
unsigned int GetNumRawTrans();
386 public: std::vector<NodeTransform> GetTransforms();
392 protected: std::string
id;
447 const std::string &_sid =
"_default_",
461 public:
void Set(
const ignition::math::Matrix4d &_mat);
469 public:
void SetSID(std::string _sid);
479 public: ignition::math::Matrix4d GetTransform()
const;
487 public: std::string GetSID();
492 public:
void SetComponent(
unsigned int _idx,
double _value);
502 public:
void SetSourceValues(
const ignition::math::Matrix4d &_mat);
512 public:
void SetSourceValues(
const ignition::math::Vector3d &_vec);
519 public:
void SetSourceValues(
math::Vector3 _axis,
double _angle)
525 public:
void SetSourceValues(
const ignition::math::Vector3d &_axis,
526 const double _angle);
529 public:
void RecalculateMatrix();
532 public:
void PrintSource();
536 public: ignition::math::Matrix4d operator()();
541 public: ignition::math::Matrix4d operator*(
NodeTransform _t);
552 public: ignition::math::Matrix4d operator*(
553 const ignition::math::Matrix4d &_m);
556 protected: std::string
sid;
std::map< unsigned int, SkeletonNode * > NodeMap
Definition: Skeleton.hh:37
A skeleton.
Definition: Skeleton.hh:53
Forward declarations for the common classes.
Definition: Animation.hh:33
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
ignition::math::Matrix4d invBindTransform
the inverse of the bind pose skeletal transform
Definition: Skeleton.hh:407
std::string id
a string identifier
Definition: Skeleton.hh:392
Skeleton animation.
Definition: SkeletonAnimation.hh:176
std::vector< SkeletonNode * > children
the children nodes
Definition: Skeleton.hh:413
ignition::math::Matrix4d modelTransform
the model transformation
Definition: Skeleton.hh:404
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:47
std::string name
the name of the skeletal node
Definition: Skeleton.hh:389
A 3x3 matrix class.
Definition: Matrix4.hh:40
std::vector< SkeletonAnimation * > anims
the array of animations
Definition: Skeleton.hh:182
std::vector< NodeTransform > rawTransforms
the raw transformation
Definition: Skeleton.hh:419
std::map< unsigned int, SkeletonNode * >::iterator NodeMapIter
Definition: Skeleton.hh:40
SkeletonNodeType
enumeration of node types
Definition: Skeleton.hh:190
ignition::math::Matrix4d bindShapeTransform
the bind pose skeletal transform
Definition: Skeleton.hh:176
NodeMap nodes
The dictionary of nodes, indexed by name.
Definition: Skeleton.hh:173
#define SCALE
Definition: SpaceNavPrivate.hh:20
SkeletonNodeType type
the type fo node
Definition: Skeleton.hh:395
#define GZ_COMMON_VISIBLE
Definition: system.hh:91
ignition::math::Matrix4d initialTransform
the initial transformation
Definition: Skeleton.hh:401
RawNodeWeights rawNW
the node weight table
Definition: Skeleton.hh:179
SkeletonNode * parent
the parent node
Definition: Skeleton.hh:410
std::map< double, std::vector< NodeTransform > > RawNodeAnim
Definition: Skeleton.hh:42
unsigned int handle
handle index number
Definition: Skeleton.hh:416
A skeleton node.
Definition: Skeleton.hh:187
GAZEBO_VISIBLE void Set(common::Image &_img, const msgs::Image &_msg)
Convert a msgs::Image to a common::Image.
std::vector< std::vector< std::pair< std::string, double > > > RawNodeWeights
Definition: Skeleton.hh:46
SkeletonNode * root
the root node
Definition: Skeleton.hh:170
std::map< std::string, RawNodeAnim > RawSkeletonAnim
Definition: Skeleton.hh:43
ignition::math::Matrix4d transform
the transform
Definition: Skeleton.hh:398