Cafu Engine
AnimExpressionT Class Referenceabstract

Animation expressions describe the "skeleton pose" of a model. More...

#include "AnimExpr.hpp"

Inheritance diagram for AnimExpressionT:

Public Member Functions

 AnimExpressionT (const CafuModelT &Model)
 The constructor. More...
 
virtual ~AnimExpressionT ()
 The (virtual) destructor. More...
 
const CafuModelTGetModel () const
 Returns the model that this is an anim expression for. More...
 
unsigned int GetRefCount () const
 Returns the number of IntrusivePtrT<>'s that currently refer to this anim expression. More...
 
virtual void GetData (unsigned int JointNr, float &Weight, Vector3fT &Pos, cf::math::QuaternionfT &Quat, Vector3fT &Scale) const =0
 For the joint with the given JointNr, this function returns. More...
 
virtual bool AdvanceTime (float Time)
 Advances the time for this anim expression, that is, frame numbers of underlying animation sequences, cross-fades, etc. More...
 
virtual AnimExpressionPtrT Clone () const =0
 The virtual copy constructor. More...
 
virtual bool IsEqual (const AnimExpressionPtrT &AE) const =0
 Returns whether this anim expression is equal to A. More...
 

Friends

template<class T >
class IntrusivePtrT
 

Detailed Description

Animation expressions describe the "skeleton pose" of a model.

They are used as an input to AnimPoseT instances, which use the "skeleton pose" expressed by an anim expression in order to derive the "full pose", including meshes and other features such as collision detection. In other words, AnimPoseT's refer to an AnimExpressionT for the "configuration" of its pose.

AnimExpressionT's can be hierarchically composed, just like mathematical expressions, which is in fact their strongest and most important feature. They are also very easy and care-free to use and have very good performance, because when obtained from an AnimExprPoolT, the pool minimizes both the number of instances as well as the penalties from memory allocations and deletes.

Constructor & Destructor Documentation

AnimExpressionT::AnimExpressionT ( const CafuModelT Model)

The constructor.

(It's ok to have this in "public" instead of "protected": we have pure virtual methods as well.)

virtual AnimExpressionT::~AnimExpressionT ( )
inlinevirtual

The (virtual) destructor.

Member Function Documentation

virtual bool AnimExpressionT::AdvanceTime ( float  Time)
inlinevirtual

Advances the time for this anim expression, that is, frame numbers of underlying animation sequences, cross-fades, etc.

Returns true if the end of an underlying animation sequence was reached (or in case of a looping sequence, if the sequence was wrapped).

Reimplemented in AnimExprBlendT, AnimExprCombineT, AnimExprFilterT, and AnimExprStandardT.

virtual AnimExpressionPtrT AnimExpressionT::Clone ( ) const
pure virtual

The virtual copy constructor.

Creates a new anim expression that is an exact copy of this, even when called via the base class pointer (the caller doesn't need to know the exact derived class).

Implemented in AnimExprBlendT, AnimExprCombineT, AnimExprFilterT, and AnimExprStandardT.

virtual void AnimExpressionT::GetData ( unsigned int  JointNr,
float &  Weight,
Vector3fT Pos,
cf::math::QuaternionfT Quat,
Vector3fT Scale 
) const
pure virtual

For the joint with the given JointNr, this function returns.

  • the joint weight,
  • the joints position, quaternion and scale values.

Implemented in AnimExprBlendT, AnimExprCombineT, AnimExprFilterT, and AnimExprStandardT.

const CafuModelT& AnimExpressionT::GetModel ( ) const
inline

Returns the model that this is an anim expression for.

unsigned int AnimExpressionT::GetRefCount ( ) const
inline

Returns the number of IntrusivePtrT<>'s that currently refer to this anim expression.

This is especially useful for the implementation of "pools" of AnimExpressionT's, so that the pool implementation can learn if this instance is available for being re-used.

virtual bool AnimExpressionT::IsEqual ( const AnimExpressionPtrT AE) const
pure virtual

Returns whether this anim expression is equal to A.

Two anim expressions are equal if their GetData() methods return the same data.

Implemented in AnimExprBlendT, AnimExprCombineT, AnimExprFilterT, and AnimExprStandardT.


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