- Cal3D 0.11 API Reference -

Classes | Public Member Functions | List of all members
CalMorphTargetMixer Class Reference

Public Member Functions

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

Constructor & Destructor Documentation

◆ CalMorphTargetMixer()

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

◆ blend()

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

◆ clear()

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

◆ copy()

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.

◆ getCurrentWeight()

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.

◆ getDuration()

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.

◆ getKeyframeCount()

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.

◆ getMorphName()

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.

◆ getMorphTargetCount()

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.

◆ getMorphTracks()

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.

◆ getTrackCount()

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.

◆ manualBlend()

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

◆ update()

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.8.14