- Cal3D 0.11 API Reference -

Public Member Functions | Protected Attributes | List of all members
CalMixer Class Reference
Inheritance diagram for CalMixer:

## Public Member Functions

| CalMixer (CalModel *pModel)
| Constructs the mixer instance.
virtual | ~CalMixer ()
| Destructs the mixer instance.
virtual bool | isDefaultMixer ()
| Is the object an instance of the default mixer (i.e.
bool | blendCycle (int id, float weight, float delay)
| Interpolates the weight of an animation cycle.
bool | clearCycle (int id, float delay)
| Fades an animation cycle out.
bool | executeAction (int id, float delayIn, float delayOut, float weightTarget=1.0f, bool autoLock=false)
| Executes an animation action.
bool | removeAction (int id)
| Clears an active animation action.
virtual void | updateAnimation (float deltaTime)
| Updates all active animations.
virtual void | updateSkeleton ()
| Updates the skeleton of the corresponding CalModel (as provided to the create method) to match the current animation state (as updated by the last call to updateAnimation).
float | getAnimationTime ()
| Returns the animation time.
float | getAnimationDuration ()
| Returns the animation duration.
void | setAnimationTime (float animationTime)
| Sets the animation time.
void | setTimeFactor (float timeFactor)
| Set the time factor.
float | getTimeFactor ()
| Get the time factor.
CalModel * | getCalModel ()
| Get the model.
std::vector< CalAnimation * > & | getAnimationVector ()
| Get the animation vector.
std::list< CalAnimationAction * > & | getAnimationActionList ()
| Get the list of the action animation.
std::list< CalAnimationCycle * > & | getAnimationCycle ()
| Get the list of the cycle animation.

## Protected Attributes

CalModel * | m_pModel
std::vector< CalAnimation * > | m_vectorAnimation
std::list< CalAnimationAction * > | m_listAnimationAction
std::list< CalAnimationCycle * > | m_listAnimationCycle
float | m_animationTime
float | m_animationDuration
float | m_timeFactor

## Constructor & Destructor Documentation

## ◆ CalMixer()

CalMixer::CalMixer | ( | CalModel * | pModel | ) |

Constructs the mixer instance.

This function is the default constructor of the mixer instance.

## ◆ ~CalMixer()

CalMixer::~CalMixer | ( |  | ) |

virtual

Destructs the mixer instance.

This function is the destructor of the mixer instance.

## Member Function Documentation

## ◆ blendCycle()

bool CalMixer::blendCycle | ( | int | id,
|  | float | weight,
|  | float | delay )

Interpolates the weight of an animation cycle.

This function interpolates the weight of an animation cycle to a new value in a given amount of time. If the specified animation cycle is not active yet, it is activated.

Parameters

  id | The ID of the animation cycle that should be blended.
  weight | The weight to interpolate the animation cycle 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

## ◆ clearCycle()

bool CalMixer::clearCycle | ( | int | id,
|  | float | delay )

Fades an animation cycle out.

This function fades an animation cycle out in a given amount of time.

Parameters

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

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

## ◆ executeAction()

bool CalMixer::executeAction | ( | int | id,
|  | float | delayIn,
|  | float | delayOut,
|  | float | weightTarget = 1.0f,
|  | bool | autoLock = false )

Executes an animation action.

This function executes an animation action.

Parameters

  id | The ID of the animation action that should be blended.
  delayIn | The time in seconds until the animation action reaches the full weight from the beginning of its execution.
  delayOut | The time in seconds in which the animation action reaches zero weight at the end of its execution.
  weightTarget | The weight to interpolate the animation action to.
  autoLock | This prevents the Action from being reset and removed on the last keyframe if true.

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

## ◆ getAnimationActionList()

std::list< CalAnimationAction * > & CalMixer::getAnimationActionList | ( |  | ) |

Get the list of the action animation.

This function return the list of the action animation of the mixer instance.

## ◆ getAnimationCycle()

std::list< CalAnimationCycle * > & CalMixer::getAnimationCycle | ( |  | ) |

Get the list of the cycle animation.

This function return the list of the cycle animation of the mixer instance.

## ◆ getAnimationDuration()

float CalMixer::getAnimationDuration | ( |  | ) |

Returns the animation duration.

This function returns the animation duration of the mixer instance.

Returns
  The animation duration in seconds.

## ◆ getAnimationTime()

float CalMixer::getAnimationTime | ( |  | ) |

Returns the animation time.

This function returns the animation time of the mixer instance.

Returns
  The animation time in seconds.

## ◆ getAnimationVector()

std::vector< CalAnimation * > & CalMixer::getAnimationVector | ( |  | ) |

Get the animation vector.

This function return the animation vector of the mixer instance.

## ◆ getCalModel()

CalModel * CalMixer::getCalModel | ( |  | ) |

Get the model.

This function return the CalModel of the mixer instance.

## ◆ getTimeFactor()

float CalMixer::getTimeFactor | ( |  | ) |

Get the time factor.

This function return the time factor of the mixer instance.

## ◆ isDefaultMixer()

virtual bool CalMixer::isDefaultMixer | ( |  | ) |

inline virtual

Is the object an instance of the default mixer (i.e.

an instance of CalMixer) ?

Returns
  - true if an instance of CalMixer
  - false if not an instance of CalMixer

Reimplemented from CalAbstractMixer.

## ◆ removeAction()

bool CalMixer::removeAction | ( | int | id | ) |

Clears an active animation action.

This function removes an animation action from the blend list. This is particularly useful with auto-locked actions on their last frame.

Parameters

  id | The ID of the animation action that should be removed.

Returns
  One of the following values:
  - true if successful
  - false if an error happened or action was not found

## ◆ setAnimationTime()

void CalMixer::setAnimationTime | ( | float | animationTime | ) |

Sets the animation time.

This function sets the animation time of the mixer instance.

## ◆ setTimeFactor()

void CalMixer::setTimeFactor | ( | float | timeFactor | ) |

Set the time factor.

This function sets the time factor of the mixer instance. this time factor affect only sync animation

## ◆ updateAnimation()

void CalMixer::updateAnimation | ( | float | deltaTime | ) |

virtual

Updates all active animations.

This function updates all active animations of the mixer instance for a given amount of time.

Parameters

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

Implements CalAbstractMixer.

## ◆ updateSkeleton()

void CalMixer::updateSkeleton | ( |  | ) |

virtual

Updates the skeleton of the corresponding CalModel (as provided to the create method) to match the current animation state (as updated by the last call to updateAnimation).

The tracks of each active animation are blended to compute the position and orientation of each bone of the skeleton. The updateAnimation method should be called just before calling updateSkeleton to define the set of active animations.

The CalModel::update method will call updateSkeleton immediately after updateAnimation if the instance was allocated by CalModel::create (in which case it is a CalMixer instance) or if the instance was set via CalModel::setAbstractMixer.

Implements CalAbstractMixer.

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

- mixer.h
- mixer.cpp

Generated by The Cal3D Team with Doxygen 1.15.0