- Cal3D 0.9 API Reference -

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

# CalMorphTargetMixer Class Reference

The morph target mixer class. More...

`#include <morphtargetmixer.h>`

List of all members.

## Public Member Functions

| CalMorphTargetMixer ()
| Constructs the morph target mixer instance.
virtual | ~CalMorphTargetMixer ()
| Destructs the morph target mixer instance.
bool | blend (int id, float weight, float delay)
| Interpolates the weight of a morph target.
bool | clear (int id, float delay)
| Fades a morph target out.
float | getCurrentWeight (int id)
| Get the weight of a morph target.
float | getCurrentWeightBase ()
| Get the weight of the base vertices.
int | getMorphTargetCount ()
| Returns the number of morph targets this morph target mixer mixes.
bool | create (CalModel *pModel)
| Creates the morph target mixer instance.
void | destroy ()
| Destroys the morph target mixer instance.
void | update (float deltaTime)
| Updates all morph targets.

## Protected Attributes

std::vector< float > | m_vectorCurrentWeight
std::vector< float > | m_vectorEndWeight
std::vector< float > | m_vectorDuration
CalModel * | m_pModel

## Detailed Description

The morph target mixer class.

## Constructor & Destructor Documentation

CalMorphTargetMixer::CalMorphTargetMixer | ( |  | ) |

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

CalMorphTargetMixer::~CalMorphTargetMixer | ( |  | ) | `[virtual]`

| Destructs the morph target mixer instance. This function is the destructor of the morph target mixer instance.

## Member Function Documentation

bool CalMorphTargetMixer::blend | ( | int | id,
|  | float | weight,
|  | float | delay
| ) |

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

Parameters:

  id | The ID of the morph target that should be blended.
  weight | The weight to interpolate the morph target to.
  delay | The time in seconds until the new weight should be reached.

Returns:
  One of the following values:
  - true if successful
  - false if an error happend

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:

  id | The ID of the morph target that should be faded out.
  delay | The time in seconds until the the morph target is completely removed.

Returns:
  One of the following values:
  - true if successful
  - false if an error happend

bool CalMorphTargetMixer::create | ( | CalModel * | pModel | ) |

| Creates the morph target mixer instance. This function creates the mixer instance.

Parameters:

  pModel | A pointer to the model that should be managed with this morph target mixer instance.

Returns:
  One of the following values:
  - true if successful
  - false if an error happend

void CalMorphTargetMixer::destroy | ( |  | ) |

| Destroys the morph target mixer instance. This function destroys all data stored in the mixer instance and frees all allocated memory.

float CalMorphTargetMixer::getCurrentWeight | ( | int | id | ) |

| Get the weight of a morph target.

Parameters:

  id | The id of the morph target which weight you want.

Returns:
  The weight of the morph target with the given id.

float CalMorphTargetMixer::getCurrentWeightBase | ( |  | ) |

| Get the weight of the base vertices.

Returns:
  The weight of the base vertices.

int CalMorphTargetMixer::getMorphTargetCount | ( |  | ) |

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

Returns:
  The number of morph targets this morph target mixer mixes.

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:

  deltaTime | The elapsed time in seconds since the last update.

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

- morphtargetmixer.h
- morphtargetmixer.cpp

Generated at Wed Apr 7 16:57:17 2004 by The Cal3D Team with 1.3.6 © 1997-2001 Dimitri van Heesch