Assimp  v4.1. (December 2018)
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...
 
 ~AnimEvaluator ()
 The class destructor. More...
 

Protected Attributes

const aiAnimationmAnim
 
std::vector< std::tuple< unsigned int, unsigned int, unsigned int > > mLastPositions
 
double mLastTime
 
std::vector< aiMatrix4x4mTransforms
 

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.

◆ ~AnimEvaluator()

AnimEvaluator::~AnimEvaluator ( )

The class destructor.

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

◆ mLastPositions

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

◆ mLastTime

double AssimpView::AnimEvaluator::mLastTime
protected

◆ mTransforms

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

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