#include <SkeletonAnimation.hh>
Public Member Functions | |
SkeletonAnimation (const std::string &_name) | |
The Constructor. More... | |
~SkeletonAnimation () | |
The destructor. Clears the list without destroying the animations. More... | |
void | AddKeyFrame (const std::string &_node, const double _time, const math::Matrix4d &_mat) |
Adds or replaces a named key frame at a specific time. More... | |
void | AddKeyFrame (const std::string &_node, const double _time, const math::Pose3d &_pose) |
Adds or replaces a named key frame at a specific time. More... | |
bool | HasNode (const std::string &_node) const |
Looks for a node with a specific name in the animations. More... | |
double | Length () const |
Returns the duration of the animations. More... | |
std::string | Name () const |
Returns the name. More... | |
NodeAnimation * | NodeAnimationByName (const std::string &_name) const |
Returns the node animation for given node name. More... | |
unsigned int | NodeCount () const |
Returns the number of animation nodes. More... | |
math::Matrix4d | NodePoseAt (const std::string &_node, const double _time, const bool _loop=true) const |
Returns the key frame transformation for a named animation at a specific time if a node does not exist at that time (with tolerance of 1e-6 sec), the transformation is interpolated. More... | |
std::map< std::string, math::Matrix4d > | PoseAt (const double _time, const bool _loop=true) const |
Returns a dictionary of transformations indexed by name at a specific time if a node does not exist at that specific time (with tolerance of 1e-6 sec), the transformation is interpolated. More... | |
std::map< std::string, math::Matrix4d > | PoseAtX (const double _x, const std::string &_node, const bool _loop=true) const |
Returns a dictionary of transformations indexed by name where a named node transformation's translational value along the X axis is equal to _x. More... | |
void | Scale (const double _scale) |
Scales every animation in the animations list. More... | |
void | SetName (const std::string &_name) |
Changes the name. More... | |
Detailed Description
Skeleton animation.
Constructor & Destructor Documentation
◆ SkeletonAnimation()
|
explicit |
The Constructor.
- Parameters
-
[in] _name the name of the animation
◆ ~SkeletonAnimation()
~SkeletonAnimation | ( | ) |
The destructor. Clears the list without destroying the animations.
Member Function Documentation
◆ AddKeyFrame() [1/2]
void AddKeyFrame | ( | const std::string & | _node, |
const double | _time, | ||
const math::Matrix4d & | _mat | ||
) |
Adds or replaces a named key frame at a specific time.
- Parameters
-
[in] _node the name of the new or existing node [in] _time the time [in] _mat the key frame transformation
◆ AddKeyFrame() [2/2]
void AddKeyFrame | ( | const std::string & | _node, |
const double | _time, | ||
const math::Pose3d & | _pose | ||
) |
Adds or replaces a named key frame at a specific time.
- Parameters
-
[in] _node the name of the new or existing node [in] _time the time [in] _pose the key frame transformation as a math::Pose
◆ HasNode()
bool HasNode | ( | const std::string & | _node | ) | const |
Looks for a node with a specific name in the animations.
- Parameters
-
[in] _node the name of the node
- Returns
- true if the node exits
◆ Length()
double Length | ( | ) | const |
Returns the duration of the animations.
- Returns
- the duration in seconds
◆ Name()
std::string Name | ( | ) | const |
Returns the name.
- Returns
- the name
◆ NodeAnimationByName()
NodeAnimation* NodeAnimationByName | ( | const std::string & | _name | ) | const |
Returns the node animation for given node name.
- Parameters
-
[in] _name Name of node
- Returns
- NodeAnimation object
◆ NodeCount()
unsigned int NodeCount | ( | ) | const |
Returns the number of animation nodes.
- Returns
- the count
◆ NodePoseAt()
math::Matrix4d NodePoseAt | ( | const std::string & | _node, |
const double | _time, | ||
const bool | _loop = true |
||
) | const |
Returns the key frame transformation for a named animation at a specific time if a node does not exist at that time (with tolerance of 1e-6 sec), the transformation is interpolated.
- Parameters
-
[in] _node the name of the animation node [in] _time the time [in] _loop when true, the time is divided by the duration (see GetLength)
- Returns
- the transformation
◆ PoseAt()
std::map<std::string, math::Matrix4d> PoseAt | ( | const double | _time, |
const bool | _loop = true |
||
) | const |
Returns a dictionary of transformations indexed by name at a specific time if a node does not exist at that specific time (with tolerance of 1e-6 sec), the transformation is interpolated.
- Parameters
-
[in] _time the time [in] _loop when true, the time is divided by the duration (see GetLength)
- Returns
- the transformation for every node
◆ PoseAtX()
std::map<std::string, math::Matrix4d> PoseAtX | ( | const double | _x, |
const std::string & | _node, | ||
const bool | _loop = true |
||
) | const |
Returns a dictionary of transformations indexed by name where a named node transformation's translational value along the X axis is equal to _x.
- Parameters
-
[in] _x the value along x. You must ensure that _x is within a valid range. [in] _node the name of the animation node [in] _loop when true, the time is divided by the duration (see GetLength)
◆ Scale()
void Scale | ( | const double | _scale | ) |
Scales every animation in the animations list.
- Parameters
-
[in] _scale the scaling factor
◆ SetName()
void SetName | ( | const std::string & | _name | ) |
Changes the name.
- Parameters
-
[in] _name the new name
The documentation for this class was generated from the following file: