Node animation.
More...
#include <common/common.hh>
|
| NodeAnimation (const std::string &_name) |
| constructor
|
|
| ~NodeAnimation () |
| Destructor. It empties the key frames list.
|
|
void | AddKeyFrame (const double _time, const ignition::math::Matrix4d &_trans) |
| Adds a key frame at a specific time.
|
|
void | AddKeyFrame (const double _time, const ignition::math::Pose3d &_pose) |
| Adds a key frame at a specific time.
|
|
ignition::math::Matrix4d | FrameAt (double _time, bool _loop=true) const |
| Returns a frame transformation at a specific time if a node does not exist at that time (with tolerance of 1e-6 sec), the transformation is interpolated.
|
|
unsigned int | GetFrameCount () const |
| Returns the number of key frames.
|
|
void | GetKeyFrame (const unsigned int _i, double &_time, ignition::math::Matrix4d &_trans) const |
| Finds a key frame using the index.
|
|
double | GetLength () const |
| Returns the duration of the animations.
|
|
std::string | GetName () const |
| Returns the name.
|
|
double | GetTimeAtX (const double _x) const |
| Returns the time where a transformation's translational value along the X axis is equal to _x.
|
|
std::pair< double, ignition::math::Matrix4d > | KeyFrame (const unsigned int _i) const |
| Returns a key frame using the index.
|
|
void | Scale (const double _scale) |
| Scales each transformation in the key frames.
|
|
void | SetName (const std::string &_name) |
| Changes the name of the animation.
|
|
|
std::map< double, ignition::math::Matrix4d > | keyFrames |
| the dictionary of key frames, indexed by time
|
|
double | length |
| the duration of the animations (time of last key frame)
|
|
std::string | name |
| the name of the animation
|
|
◆ NodeAnimation()
constructor
- Parameters
-
[in] | _name | the name of the node |
◆ ~NodeAnimation()
Destructor. It empties the key frames list.
◆ AddKeyFrame() [1/2]
void AddKeyFrame |
( |
const double | _time, |
|
|
const ignition::math::Matrix4d & | _trans ) |
Adds a key frame at a specific time.
- Parameters
-
[in] | _time | the time of the key frame |
[in] | _trans | the transformation |
◆ AddKeyFrame() [2/2]
void AddKeyFrame |
( |
const double | _time, |
|
|
const ignition::math::Pose3d & | _pose ) |
Adds a key frame at a specific time.
- Parameters
-
[in] | _time | the time of the key frame |
[in] | _pose | the pose |
◆ FrameAt()
ignition::math::Matrix4d FrameAt |
( |
double | _time, |
|
|
bool | _loop = true ) const |
Returns a frame transformation 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] | _time | the time |
[in] | _loop | when true, the time is divided by the duration (see GetLength) |
◆ GetFrameCount()
unsigned int GetFrameCount |
( |
| ) |
const |
Returns the number of key frames.
- Returns
- the count
◆ GetKeyFrame()
void GetKeyFrame |
( |
const unsigned int | _i, |
|
|
double & | _time, |
|
|
ignition::math::Matrix4d & | _trans ) const |
Finds a key frame using the index.
Note the index of a key frame can change as frames are added.
- Parameters
-
[in] | _i | the index |
[out] | _time | the time of the frame, or -1 if the index id is out of bounds |
[out] | _trans | the transformation for this key frame |
◆ GetLength()
double GetLength |
( |
| ) |
const |
Returns the duration of the animations.
- Returns
- the time of the last animation
◆ GetName()
std::string GetName |
( |
| ) |
const |
Returns the name.
- Returns
- the name
◆ GetTimeAtX()
double GetTimeAtX |
( |
const double | _x | ) |
const |
Returns the time where a transformation's translational value along the X axis is equal to _x.
When no transformation is found (within a tolerance of 1e-6), the time is interpolated.
- Parameters
-
[in] | _x | the value along x. You must ensure that _x is within a valid range. |
◆ KeyFrame()
std::pair< double, ignition::math::Matrix4d > KeyFrame |
( |
const unsigned int | _i | ) |
const |
Returns a key frame using the index.
Note the index of a key frame can change as frames are added.
- Parameters
-
- Returns
- a pair that contains the time and transformation. Time is -1 if the index is out of bounds
◆ Scale()
void Scale |
( |
const double | _scale | ) |
|
Scales each transformation in the key frames.
This only affects the translational values.
- Parameters
-
[in] | _scale | the scaling factor |
◆ SetName()
void SetName |
( |
const std::string & | _name | ) |
|
Changes the name of the animation.
- Parameters
-
◆ keyFrames
std::map<double, ignition::math::Matrix4d> keyFrames |
|
protected |
the dictionary of key frames, indexed by time
◆ length
the duration of the animations (time of last key frame)
◆ name
the name of the animation
The documentation for this class was generated from the following file: