Assimp  v3.1.1 (June 2014)
AssimpView::AnimEvaluator Class Reference

Calculates transformations for a given timestamp from a set of animation tracks. More...

Public Member Functions

 AnimEvaluator (const aiAnimation *pAnim)
 Constructor on a given animation. More...
 
void Evaluate (double pTime)
 Evaluates the animation tracks for a given time stamp. More...
 
const std::vector< aiMatrix4x4 > & GetTransformations () const
 Returns the transform matrices calculated at the last Evaluate() call. More...
 

Protected Attributes

const aiAnimationmAnim
 The animation we're working on. More...
 
std::vector< std::tuple< unsigned int, unsigned int, unsigned int > > mLastPositions
 
double mLastTime
 At which frame the last evaluation happened for each channel. More...
 
std::vector< aiMatrix4x4mTransforms
 The array to store the transformations results of the evaluation. More...
 

Detailed Description

Calculates transformations for a given timestamp from a set of animation tracks.

Not directly useful, better use the AnimPlayer class.

Constructor & Destructor Documentation

◆ AnimEvaluator()

AnimEvaluator::AnimEvaluator ( const aiAnimation pAnim)

Constructor on a given animation.

The animation is fixed throughout the lifetime of the object.

Parameters
pAnimThe animation to calculate poses for. Ownership of the animation object stays at the caller, the evaluator just keeps a reference to it as long as it persists.

Member Function Documentation

◆ Evaluate()

void AnimEvaluator::Evaluate ( double  pTime)

Evaluates the animation tracks for a given time stamp.

The calculated pose can be retrieved as a array of transformation matrices afterwards by calling GetTransformations().

Parameters
pTimeThe time for which you want to evaluate the animation, in seconds. Will be mapped into the animation cycle, so it can be an arbitrary value. Best use with ever-increasing time stamps.

◆ GetTransformations()

const std::vector<aiMatrix4x4>& AssimpView::AnimEvaluator::GetTransformations ( ) const
inline

Returns the transform matrices calculated at the last Evaluate() call.

The array matches the mChannels array of the aiAnimation.

Member Data Documentation

◆ mAnim

const aiAnimation* AssimpView::AnimEvaluator::mAnim
protected

The animation we're working on.

◆ mLastPositions

std::vector<std::tuple<unsigned int, unsigned int, unsigned int> > AssimpView::AnimEvaluator::mLastPositions
protected

◆ mLastTime

double AssimpView::AnimEvaluator::mLastTime
protected

At which frame the last evaluation happened for each channel.

Useful to quickly find the corresponding frame for slightly increased time stamps

◆ mTransforms

std::vector<aiMatrix4x4> AssimpView::AnimEvaluator::mTransforms
protected

The array to store the transformations results of the evaluation.


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