- Cal3D 0.11 API Reference -

Classes | Public Member Functions

CalMorphTargetMixer Class Reference

List of all members.

Classes

struct  MorphAnimData

Public Member Functions

 CalMorphTargetMixer (CalModel *model)
 Constructs the morph target mixer instance.
bool blend (int id, float weight, float delayIn, float delayOut, bool looping)
 Interpolates the morph target weights based on an animation.
bool manualBlend (int id, float weight, float time)
 Interpolates the morph target weights based on an animation.
bool clear (int id, float delay)
 Fades a morph target out.
bool copy (const CalMorphTargetMixer &inOther)
 Copy data from one mixer (for the same core model) to another.
float getCurrentWeight (int id) const
 Get the weight of a morph target.
const std::string & getMorphName (int id) const
 Get the name of a morph target animation.
int getTrackCount (int id) const
 Get the number of tracks for a morph target.
const std::list
< CalCoreMorphTrack > & 
getMorphTracks (int id) const
 Get the tracks for a morph target.
int getKeyframeCount (int id) const
 Get the number of keyframes for a morph target.
float getDuration (int id) const
 Get the duration of a morph target.
int getMorphTargetCount () const
 Returns the number of morph targets this morph target mixer mixes.
void update (float deltaTime)
 Updates all morph targets.
float CalcKeyframeWeight (const std::vector< CalCoreMorphKeyframe > &keyframes, float elapsedTime)

Constructor & Destructor Documentation

CalMorphTargetMixer::CalMorphTargetMixer ( CalModel *  pModel)

Constructs the morph target mixer instance.

This function is the default constructor of the morph target mixer instance.


Member Function Documentation

bool CalMorphTargetMixer::blend ( int  id,
float  weight,
float  delayIn,
float  delayOut,
bool  looping 
)

Interpolates the morph target weights based on an animation.

This function interpolates the weight of a morph target a new value in a given amount of time.

Parameters:
idThe ID of the morph target that should be blended.
weightThe weight to interpolate the morph target to.
delayInThe time in seconds until the new weight should be reached.
delayOutThe time in seconds until the weight goes back to zero at the end of the animation.
loopingTrue if the morph animation should continuously loop.
Returns:
One of the following values:
  • true if successful
  • false if an error happened
bool CalMorphTargetMixer::clear ( int  id,
float  delay 
)

Fades a morph target out.

This function fades a morph target out in a given amount of time.

Parameters:
idThe ID of the morph target that should be faded out.
delayThe time in seconds until the the morph target is completely removed.
Returns:
One of the following values:
  • true if successful
  • false if an error happened
bool CalMorphTargetMixer::copy ( const CalMorphTargetMixer &  inOther)

Copy data from one mixer (for the same core model) to another.

Parameters:
inOtherThe mixer to copy.
Returns:
True on success.
float CalMorphTargetMixer::getCurrentWeight ( int  id) const

Get the weight of a morph target.

Parameters:
idThe id of the morph target which weight you want.
Returns:
The weight of the morph target with the given id.
float CalMorphTargetMixer::getDuration ( int  id) const

Get the duration of a morph target.

Parameters:
idThe id of the morph target.
Returns:
The duration of the morph target with the given id.
int CalMorphTargetMixer::getKeyframeCount ( int  id) const

Get the number of keyframes for a morph target.

Parameters:
idThe id of the morph target.
Returns:
The number of keyframes for the morph target with the given id.
const std::string & CalMorphTargetMixer::getMorphName ( int  id) const

Get the name of a morph target animation.

Parameters:
idThe id of the morph target.
Returns:
The morph target animation name.
int CalMorphTargetMixer::getMorphTargetCount ( ) const

Returns the number of morph targets this morph target mixer mixes.

Returns:
The number of morph targets this morph target mixer mixes.
const std::list< CalCoreMorphTrack > & CalMorphTargetMixer::getMorphTracks ( int  id) const

Get the tracks for a morph target.

Parameters:
idThe id of the morph target.
Returns:
The tracks for the morph target with the given id.
int CalMorphTargetMixer::getTrackCount ( int  id) const

Get the number of tracks for a morph target.

Parameters:
idThe id of the morph target.
Returns:
The number of tracks for the morph target with the given id.
bool CalMorphTargetMixer::manualBlend ( int  id,
float  weight,
float  time 
)

Interpolates the morph target weights based on an animation.

This function sets a morph target animation at a specific time interval.

Parameters:
idThe ID of the morph target that should be blended.
weightThe weight to interpolate the morph target to.
timeThe current time value to set the animation at.
Returns:
One of the following values:
  • true if successful
  • false if an error happened
void CalMorphTargetMixer::update ( float  deltaTime)

Updates all morph targets.

This function updates all morph targets of the mixer instance for a given amount of time.

Parameters:
deltaTimeThe elapsed time in seconds since the last update.

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

Generated by The Cal3D Team with Doxygen 1.7.3