dtAnim::SequenceMixer Class Reference

The SequenceMixer's job is to manage animations and animation sequences. More...

#include <sequencemixer.h>

List of all members.

Public Types

typedef std::map< std::string,
dtCore::RefPtr< const
Animatable > > 
AnimationTable
typedef
AnimationTable::allocator_type::value_type 
TableKey

Public Member Functions

 SequenceMixer ()
void Update (float dt)
 The Update() must be call every frame, this is done automatically using an AnimationHelper.
void PlayAnimation (Animatable *pAnim)
 PlayAnimation adds the given animation to active play list.
void ClearActiveAnimations (float time)
 This function will clear all currently playing animations from the mixer over the fade out time specified.
void ClearAnimation (const std::string &pAnim, float time)
 This function will clear an animation from the play list by name and fade it out over the time specifed.
void ClearRegisteredAnimations ()
 This function will clear all animations registered with the mixer.
void RemoveRegisteredAnimation (const std::string &pAnim)
 This function will remove a registered animation by name from the mixer.
AnimatableGetActiveAnimation (const std::string &pAnim)
 This function returns a pointer to the active animation specified by name.
const AnimatableGetActiveAnimation (const std::string &pAnim) const
 This function returns a pointer to the active animation specified by name.
const AnimatableGetRegisteredAnimation (const std::string &pAnim) const
 This function returns a pointer to the registered animation specified by name.
void RegisterAnimation (const Animatable *pAnimation)
 This function registers and animation within the system.
void GetRegisteredAnimations (std::vector< const Animatable * > &toFill) const
 Fills the given vector with all of the animatables registered with the mixer.
void ForceRecalculate ()
 This function forces all non-active animations to recalculate their start and end times.

Protected Member Functions

virtual ~SequenceMixer ()


Detailed Description

The SequenceMixer's job is to manage animations and animation sequences.

Animations are registered with the SequenceMixer using an AnimationHelper on LoadModel(). Once an animation or sequence is registered the user can call PlayAnimation() by name. Alternatively the user can create an Animatable using an AnimationWrapper and call PlayAnimation using that. To clear the animation use the name specified by Animatable* GetName(), or the name used to play the animation.


Member Typedef Documentation

typedef std::map<std::string, dtCore::RefPtr<const Animatable> > dtAnim::SequenceMixer::AnimationTable

typedef AnimationTable::allocator_type::value_type dtAnim::SequenceMixer::TableKey


Constructor & Destructor Documentation

dtAnim::SequenceMixer::SequenceMixer (  ) 

dtAnim::SequenceMixer::~SequenceMixer (  )  [protected, virtual]


Member Function Documentation

void dtAnim::SequenceMixer::Update ( float  dt  ) 

The Update() must be call every frame, this is done automatically using an AnimationHelper.

Parameters:
delta time

void dtAnim::SequenceMixer::PlayAnimation ( Animatable pAnim  ) 

PlayAnimation adds the given animation to active play list.

Parameters:
The name of the animation registered with the mixer

void dtAnim::SequenceMixer::ClearActiveAnimations ( float  time  ) 

This function will clear all currently playing animations from the mixer over the fade out time specified.

Parameters:
the time to fade out over

void dtAnim::SequenceMixer::ClearAnimation ( const std::string &  pAnim,
float  time 
)

This function will clear an animation from the play list by name and fade it out over the time specifed.

Parameters:
the name of the animation to fade out
the time to fade out over

void dtAnim::SequenceMixer::ClearRegisteredAnimations (  ) 

This function will clear all animations registered with the mixer.

void dtAnim::SequenceMixer::RemoveRegisteredAnimation ( const std::string &  pAnim  ) 

This function will remove a registered animation by name from the mixer.

Animatable * dtAnim::SequenceMixer::GetActiveAnimation ( const std::string &  pAnim  ) 

This function returns a pointer to the active animation specified by name.

Parameters:
the name of the active animation
Returns:
the active animation within the system, 0 if this animation does not exist

const Animatable * dtAnim::SequenceMixer::GetActiveAnimation ( const std::string &  pAnim  )  const

This function returns a pointer to the active animation specified by name.

Parameters:
the name of the active animation
Returns:
the active animation within the system, 0 if this animation does not exist

const Animatable * dtAnim::SequenceMixer::GetRegisteredAnimation ( const std::string &  pAnim  )  const

This function returns a pointer to the registered animation specified by name.

Parameters:
the name of the active animation
Returns:
the active animation within the system, 0 if this animation does not exist

void dtAnim::SequenceMixer::RegisterAnimation ( const Animatable pAnimation  ) 

This function registers and animation within the system.

Registered animation can be configured and played by name. This animation is registered with the name specified by GetName().

Parameters:
the animation to register, the name this animation is registered with comes from calling GetName() on the animatable.

void dtAnim::SequenceMixer::GetRegisteredAnimations ( std::vector< const Animatable * > &  toFill  )  const

Fills the given vector with all of the animatables registered with the mixer.

Parameters:
toFill the vector of pointers to fill.

void dtAnim::SequenceMixer::ForceRecalculate (  ) 

This function forces all non-active animations to recalculate their start and end times.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008