Go to the documentation of this file.
17 #ifndef _ANIMATION_HH_
18 #define _ANIMATION_HH_
22 #include <ignition/math/Spline.hh>
23 #include <ignition/math/RotationSpline.hh>
49 public:
Animation(
const std::string &_name,
double _length,
bool _loop);
56 public:
double GetLength()
const;
60 public:
void SetLength(
double _len);
64 public:
void SetTime(
double _time);
68 public:
void AddTime(
double _time);
72 public:
double GetTime()
const;
76 public:
unsigned int GetKeyFrameCount()
const;
81 public:
KeyFrame* GetKeyFrame(
unsigned int _index)
const;
89 protected:
double GetKeyFramesAtTime(
double _time,
KeyFrame **_kf1,
91 unsigned int &_firstKeyIndex)
const;
95 protected: std::string
name;
128 double _length,
bool _loop);
140 public:
void GetInterpolatedKeyFrame(
PoseKeyFrame &_kf)
const;
145 protected:
void GetInterpolatedKeyFrame(
double _time,
149 protected:
void BuildInterpolationSplines()
const;
152 private:
mutable ignition::math::Spline *positionSpline;
155 private:
mutable ignition::math::RotationSpline *rotationSpline;
170 double _length,
bool _loop);
bool build
determines if the interpolation splines need building
Definition: Animation.hh:104
double GetTime() const
Return the current time position.
Forward declarations for the common classes.
Definition: Animation.hh:26
KeyFrame_V keyFrames
array of key frames
Definition: Animation.hh:113
bool loop
true if animation repeats
Definition: Animation.hh:107
virtual ~Animation()
Destructor.
std::string name
animation name
Definition: Animation.hh:95
double length
animation duration
Definition: Animation.hh:98
double timePos
current time position
Definition: Animation.hh:101
unsigned int GetKeyFrameCount() const
Return the number of key frames in the animation.
common
Definition: FuelModelDatabase.hh:37
double GetKeyFramesAtTime(double _time, KeyFrame **_kf1, KeyFrame **_kf2, unsigned int &_firstKeyIndex) const
Get the two key frames that bound a time value.
Manages an animation, which is a collection of keyframes and the ability to interpolate between the k...
Definition: Animation.hh:43
void GetInterpolatedKeyFrame(PoseKeyFrame &_kf) const
Get a keyframe using the animation's current time.
void SetTime(double _time)
Set the current time position of the animation.
A keyframe for a NumericAnimation.
Definition: KeyFrame.hh:86
void GetInterpolatedKeyFrame(NumericKeyFrame &_kf) const
Get a keyframe using the animation's current time.
Animation(const std::string &_name, double _length, bool _loop)
Constructor.
std::vector< KeyFrame * > KeyFrame_V
array of keyframe type alias
Definition: Animation.hh:110
KeyFrame * GetKeyFrame(unsigned int _index) const
Get a key frame using an index value.
double GetLength() const
Return the duration of the animation.
PoseAnimation(const std::string &_name, double _length, bool _loop)
Constructor.
void AddTime(double _time)
Add time to the animation.
A pose animation.
Definition: Animation.hh:121
NumericAnimation(const std::string &_name, double _length, bool _loop)
Constructor.
NumericKeyFrame * CreateKeyFrame(double _time)
Create a numeric keyframe at the given time.
void SetLength(double _len)
Set the duration of the animation.
virtual ~NumericAnimation()
Destructor.
A numeric animation.
Definition: Animation.hh:163
PoseKeyFrame * CreateKeyFrame(double _time)
Create a pose keyframe at the given time.
void BuildInterpolationSplines() const
Update the pose splines.
virtual ~PoseAnimation()
Destructor.
A key frame in an animation.
Definition: KeyFrame.hh:35
A keyframe for a PoseAnimation.
Definition: KeyFrame.hh:53