22#include <ignition/math/Spline.hh>
23#include <ignition/math/RotationSpline.hh>
49 public:
Animation(
const std::string &_name,
double _length,
bool _loop);
91 unsigned int &_firstKeyIndex)
const;
95 protected: std::string
name;
128 double _length,
bool _loop,
double _tension = 0.0);
152 private:
mutable ignition::math::Spline *positionSpline;
155 private:
mutable ignition::math::RotationSpline *rotationSpline;
158 private:
double tension = 0.0;
173 double _length,
bool _loop);
common
Definition FuelModelDatabase.hh:37
Manages an animation, which is a collection of keyframes and the ability to interpolate between the k...
Definition Animation.hh:44
Animation(const std::string &_name, double _length, bool _loop)
Constructor.
KeyFrame_V keyFrames
array of key frames
Definition Animation.hh:113
double GetTime() const
Return the current time position.
bool loop
true if animation repeats
Definition Animation.hh:107
std::vector< KeyFrame * > KeyFrame_V
array of keyframe type alias
Definition Animation.hh:110
double GetKeyFramesAtTime(double _time, KeyFrame **_kf1, KeyFrame **_kf2, unsigned int &_firstKeyIndex) const
Get the two key frames that bound a time value.
void AddTime(double _time)
Add time to the animation.
double timePos
current time position
Definition Animation.hh:101
KeyFrame * GetKeyFrame(unsigned int _index) const
Get a key frame using an index value.
void SetLength(double _len)
Set the duration of the animation.
virtual ~Animation()
Destructor.
double length
animation duration
Definition Animation.hh:98
std::string name
animation name
Definition Animation.hh:95
bool build
determines if the interpolation splines need building
Definition Animation.hh:104
unsigned int GetKeyFrameCount() const
Return the number of key frames in the animation.
double GetLength() const
Return the duration of the animation.
void SetTime(double _time)
Set the current time position of the animation.
A key frame in an animation.
Definition KeyFrame.hh:36
A numeric animation.
Definition Animation.hh:167
virtual ~NumericAnimation()
Destructor.
NumericKeyFrame * CreateKeyFrame(double _time)
Create a numeric keyframe at the given time.
void GetInterpolatedKeyFrame(NumericKeyFrame &_kf) const
Get a keyframe using the animation's current time.
NumericAnimation(const std::string &_name, double _length, bool _loop)
Constructor.
A keyframe for a NumericAnimation.
Definition KeyFrame.hh:87
A pose animation.
Definition Animation.hh:122
void GetInterpolatedKeyFrame(PoseKeyFrame &_kf) const
Get a keyframe using the animation's current time.
void BuildInterpolationSplines() const
Update the pose splines.
void GetInterpolatedKeyFrame(double _time, PoseKeyFrame &_kf) const
Get a keyframe using a passed in time.
PoseKeyFrame * CreateKeyFrame(double _time)
Create a pose keyframe at the given time.
PoseAnimation(const std::string &_name, double _length, bool _loop, double _tension=0.0)
Constructor.
virtual ~PoseAnimation()
Destructor.
A keyframe for a PoseAnimation.
Definition KeyFrame.hh:54
Forward declarations for the common classes.
Definition Animation.hh:27