Cafu Engine
AnimExprStandardT Class Reference

This class implements the "standard" skeleton pose based on a sequence number and frame number. More...

#include "AnimExpr.hpp"

Inheritance diagram for AnimExprStandardT:

Public Member Functions

 AnimExprStandardT (const CafuModelT &Model, int SequNr, float FrameNr)
 Create a new "standard" expression from the given parameters. More...
 
virtual void GetData (unsigned int JointNr, float &Weight, Vector3fT &Pos, cf::math::QuaternionfT &Quat, Vector3fT &Scale) const
 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
 The virtual copy constructor. More...
 
virtual bool IsEqual (const AnimExpressionPtrT &AE) const
 Returns whether this anim expression is equal to A. More...
 
int GetSequNr () const
 Returns the sequence number that is currently set in this expression. More...
 
void SetSequNr (int SequNr)
 Sets the number of the animation sequence that is used by this expression. More...
 
float GetFrameNr () const
 Returns the frame number that is currently set in this expression. More...
 
void SetFrameNr (float FrameNr)
 Sets the frame number in the current animation sequence. More...
 
bool GetForceLoop () const
 Returns if this expression will override the "next" setting at the end of the current animation sequence. More...
 
void SetForceLoop (bool ForceLoop)
 Sets whether this expression should override the "next" setting at the end of the current animation sequence. More...
 
- Public Member Functions inherited from AnimExpressionT
 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...
 

Detailed Description

This class implements the "standard" skeleton pose based on a sequence number and frame number.

Note that for backwards-compatibility reasons, this expression never progresses into "other" sequences. That is, for any Model.GetAnims()[SequNr].Next, only the values -1 and SequNr are supported; any other non-negative value is treated as if it was SequNr. This restriction is in place because we have a lot of non-trivial user code that relies on obtaining the same value from GetSequNr() that was last set with SetSequNr(). If in the future any user code requires following the "Next" sequences properly, a new AnimExpressionT- derived class is required that fully implements this.

Constructor & Destructor Documentation

AnimExprStandardT::AnimExprStandardT ( const CafuModelT Model,
int  SequNr,
float  FrameNr 
)

Create a new "standard" expression from the given parameters.

The "force loop" setting for the newly created expression is false.

Member Function Documentation

bool AnimExprStandardT::AdvanceTime ( float  Time)
virtual

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 from AnimExpressionT.

AnimExpressionPtrT AnimExprStandardT::Clone ( ) const
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).

Implements AnimExpressionT.

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

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

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

Implements AnimExpressionT.

bool AnimExprStandardT::GetForceLoop ( ) const
inline

Returns if this expression will override the "next" setting at the end of the current animation sequence.

float AnimExprStandardT::GetFrameNr ( ) const
inline

Returns the frame number that is currently set in this expression.

int AnimExprStandardT::GetSequNr ( ) const
inline

Returns the sequence number that is currently set in this expression.

bool AnimExprStandardT::IsEqual ( const AnimExpressionPtrT AE) const
virtual

Returns whether this anim expression is equal to A.

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

Implements AnimExpressionT.

void AnimExprStandardT::SetForceLoop ( bool  ForceLoop)

Sets whether this expression should override the "next" setting at the end of the current animation sequence.

Parameters
ForceLoopOverride the "next" setting at the end of the current animation sequence?
void AnimExprStandardT::SetFrameNr ( float  FrameNr)

Sets the frame number in the current animation sequence.

Parameters
FrameNrThe frame number in the animation sequence to use.
void AnimExprStandardT::SetSequNr ( int  SequNr)

Sets the number of the animation sequence that is used by this expression.

Parameters
SequNrThe number of the animation sequence to use, -1 for the bind pose.

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