PoseAnimation Class Reference

A pose animation. More...

#include <Animation.hh>

Inherits Animation.

Public Member Functions

 PoseAnimation (const std::string &_name, double _length, bool _loop)
 Constructor. More...
 
virtual ~PoseAnimation ()
 Destructor. More...
 
void AddTime (double _time)
 Add time to the animation. More...
 
PoseKeyFrameCreateKeyFrame (double _time)
 Create a pose keyframe at the given time. More...
 
void GetInterpolatedKeyFrame (PoseKeyFrame &_kf) const
 Get a keyframe using the animation's current time. More...
 
KeyFrameGetKeyFrame (unsigned int _index) const
 Get a key frame using an index value. More...
 
unsigned int GetKeyFrameCount () const
 Return the number of key frames in the animation. More...
 
double GetLength () const
 Return the duration of the animation. More...
 
double GetTime () const
 Return the current time position. More...
 
void SetLength (double _len)
 Set the duration of the animation. More...
 
void SetTime (double _time)
 Set the current time position of the animation. More...
 

Protected Types

typedef std::vector< KeyFrame * > KeyFrame_V
 array of keyframe type alias More...
 

Protected Member Functions

void BuildInterpolationSplines () const
 Update the pose splines. More...
 
void GetInterpolatedKeyFrame (double _time, PoseKeyFrame &_kf) const
 Get a keyframe using a passed in time. More...
 
double GetKeyFramesAtTime (double _time, KeyFrame **_kf1, KeyFrame **_kf2, unsigned int &_firstKeyIndex) const
 Get the two key frames that bound a time value. More...
 

Protected Attributes

bool build
 determines if the interpolation splines need building More...
 
KeyFrame_V keyFrames
 array of key frames More...
 
double length
 animation duration More...
 
bool loop
 true if animation repeats More...
 
std::string name
 animation name More...
 
double timePos
 current time position More...
 

Detailed Description

A pose animation.

Member Typedef Documentation

typedef std::vector<KeyFrame*> KeyFrame_V
protectedinherited

array of keyframe type alias

Constructor & Destructor Documentation

PoseAnimation ( const std::string &  _name,
double  _length,
bool  _loop 
)

Constructor.

Parameters
[in]_nameString name of the animation. This should be unique.
[in]_lengthLength of the animation in seconds
[in]_loopTrue == loop the animation
virtual ~PoseAnimation ( )
virtual

Destructor.

Member Function Documentation

void AddTime ( double  _time)
inherited

Add time to the animation.

Parameters
[in]_timeThe amount of time to add in seconds
void BuildInterpolationSplines ( ) const
protected

Update the pose splines.

PoseKeyFrame* CreateKeyFrame ( double  _time)

Create a pose keyframe at the given time.

Parameters
[in]_timeTime at which to create the keyframe
Returns
Pointer to the new keyframe
void GetInterpolatedKeyFrame ( PoseKeyFrame _kf) const

Get a keyframe using the animation's current time.

Parameters
[out]_kfPoseKeyFrame reference to hold the interpolated result
void GetInterpolatedKeyFrame ( double  _time,
PoseKeyFrame _kf 
) const
protected

Get a keyframe using a passed in time.

Parameters
[in]_timeTime in seconds
[out]_kfPoseKeyFrame reference to hold the interpolated result
KeyFrame* GetKeyFrame ( unsigned int  _index) const
inherited

Get a key frame using an index value.

Parameters
[in]_indexThe index of the key frame
Returns
A pointer the keyframe, NULL if the _index is invalid
unsigned int GetKeyFrameCount ( ) const
inherited

Return the number of key frames in the animation.

Returns
The number of keyframes
double GetKeyFramesAtTime ( double  _time,
KeyFrame **  _kf1,
KeyFrame **  _kf2,
unsigned int &  _firstKeyIndex 
) const
protectedinherited

Get the two key frames that bound a time value.

Parameters
[in]_timeThe time in seconds
[out]_kf1Lower bound keyframe that is returned
[out]_kf2Upper bound keyframe that is returned
[out]_firstKeyIndexIndex of the lower bound key frame
Returns
The time between the two keyframe
double GetLength ( ) const
inherited

Return the duration of the animation.

Returns
Duration of the animation in seconds
double GetTime ( ) const
inherited

Return the current time position.

Returns
The time position in seconds
void SetLength ( double  _len)
inherited

Set the duration of the animation.

Parameters
[in]_lenThe length of the animation in seconds
void SetTime ( double  _time)
inherited

Set the current time position of the animation.

Parameters
[in]_timeThe time position in seconds

Member Data Documentation

bool build
mutableprotectedinherited

determines if the interpolation splines need building

KeyFrame_V keyFrames
protectedinherited

array of key frames

double length
protectedinherited

animation duration

bool loop
protectedinherited

true if animation repeats

std::string name
protectedinherited

animation name

double timePos
protectedinherited

current time position


The documentation for this class was generated from the following file: