neo::animation::Animator Class Reference

#include <animation/animator.h>

Inheritance diagram for neo::animation::Animator:

Inheritance graph
[legend]
Collaboration diagram for neo::animation::Animator:

Collaboration graph
[legend]
List of all members.

Detailed Description

Animator controlling animations for an object
Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 Animator ()
 Initialize.
 Animator (const Animator &animator)
 Copy animator.
virtual ~Animator ()
 Free resources.
void addAnimation (const std::string &name, const AnimationPtr &p_anim)
 Add animation.
AnimationPtr getAnimation (const std::string &name) const
 Get animation.
const core::HashTable< std::string,
AnimationPtr > & 
getAnimations () const
 Get all animations.
void addSequence (const std::string &name, const Sequence &sequence)
 Add sequence.
SequencegetSequence (const std::string &name)
 Get sequence.
void setBlendChainDepth (unsigned int depth)
 Set blend chain depth.
unsigned int getBlendChainDepth () const
 Get blend chain depth.
void playSequence (const std::string &name)
 Play a sequence.
void pauseSequence ()
 Pause the current sequence.
void resumeSequence ()
 Resume the current sequence.
void stopSequence ()
 Stop the current sequence.
void playAnimation (unsigned int stage, const std::string &name, bool loop)
 Play animation on given blend stage.
void pauseAnimation (unsigned int stage)
 Pause animation on given blend stage.
void resumeAnimation (unsigned int stage)
 Resume animation on given blend stage.
void stopAnimation (unsigned int stage)
 Stop animation on given blend stage.
virtual void update (float dt)
 Update animations in blend chain.
virtual void blend ()
 Do animation blending.
AnimationInstancegetStageAnimation (unsigned int stage)
 Get animation for blend stage.
float getStageWeight (unsigned int stage)
 Get weight for blend stage.
void setStageWeight (unsigned int stage, float weight)
 Set weight for blend stage.
float getStageTimeScale (unsigned int stage)
 Get time scaling for blend stage.
void setStageTimeScale (unsigned int stage, float scale)
 Set time scaling for blend stage.
void setStageTimeScaleAll (float scale)
 Set time scaling for all blend stages.
std::string getStageAnimationName (unsigned int stage)
 Get name of animation for blend stage.
unsigned int getNumActiveStages () const
 Get number of active stages.
const KeyframegetAnimationChannel (const core::HashString &channel) const
 Get resulting channel data.
bool isSequencePlaying () const
 Query if sequence is playing.
Animatoroperator= (const Animator &animator)
 Copy animator setup.


Constructor & Destructor Documentation

neo::animation::Animator::Animator ( const Animator animator  ) 

Parameters:
animator Source animator


Member Function Documentation

void neo::animation::Animator::addAnimation ( const std::string &  name,
const AnimationPtr &  p_anim 
)

Add an animation instance to the object

Parameters:
name Animation name
p_anim Animation

AnimationPtr neo::animation::Animator::getAnimation ( const std::string &  name  )  const

Get an named animation

Parameters:
name Animation name
Returns:
Animation

const core::HashTable< std::string, AnimationPtr > & neo::animation::Animator::getAnimations (  )  const [inline]

Get all animations as an associative name-animation hash map

Returns:
Animation hashmap

void neo::animation::Animator::addSequence ( const std::string &  name,
const Sequence sequence 
)

Add a sequence to the object

Parameters:
name Sequence name
sequence Sequence

Sequence* neo::animation::Animator::getSequence ( const std::string &  name  ) 

Get a named sequence

Parameters:
name Sequence name
Returns:
Sequence, null if not found

void neo::animation::Animator::setBlendChainDepth ( unsigned int  depth  ) 

Set blend chain depth. If the current depth is deeper than the new depth, remaining blend stages are deallocated and not used. New blend stages are initialized as empty, remaining stages are kept intact.

Parameters:
depth New blend chain depth

unsigned int neo::animation::Animator::getBlendChainDepth (  )  const [inline]

Returns:
Blend chain depth

void neo::animation::Animator::playSequence ( const std::string &  name  ) 

Play a sequence. Only one sequence can be played at a time.

Parameters:
name Sequence name

void neo::animation::Animator::pauseSequence (  ) 

Pause the current sequence. The sequence can later be resumed with a call to resumeSequence

void neo::animation::Animator::resumeSequence (  ) 

Resume the current sequence

void neo::animation::Animator::stopSequence (  ) 

Stop the current sequence and reset to no active sequence

void neo::animation::Animator::playAnimation ( unsigned int  stage,
const std::string &  name,
bool  loop 
)

Play an animation on the given blend stage

Parameters:
stage Blend stage index
name Animation name
loop Loop flag

void neo::animation::Animator::pauseAnimation ( unsigned int  stage  ) 

Pause the animation on the given blend stage. The animation can later be resumed with a call to resumeAnimation animation will only be stopped.

Parameters:
stage Blend stage index

void neo::animation::Animator::resumeAnimation ( unsigned int  stage  ) 

Resume the animation on the given blend stage

Parameters:
stage Blend stage index

void neo::animation::Animator::stopAnimation ( unsigned int  stage  ) 

Stop the animation on the given blend stage, and clear the stage

Parameters:
stage Blend stage index

virtual void neo::animation::Animator::update ( float  dt  )  [virtual]

Parameters:
dt Time passed since last update

Reimplemented in neo::scene::ChaseCamera, neo::scene::Object, and neo::scene::Skeleton.

virtual void neo::animation::Animator::blend (  )  [virtual]

Do animation blending and put final data in keyframes map

AnimationInstance* neo::animation::Animator::getStageAnimation ( unsigned int  stage  ) 

Parameters:
stage Blend stage index
Returns:
Animation instance for blend stage

float neo::animation::Animator::getStageWeight ( unsigned int  stage  ) 

Parameters:
stage Blend stage index
Returns:
Weight factor for blend stage

void neo::animation::Animator::setStageWeight ( unsigned int  stage,
float  weight 
)

Parameters:
stage Blend stage index
weight Weight factor for blend stage

float neo::animation::Animator::getStageTimeScale ( unsigned int  stage  ) 

Parameters:
stage Blend stage index
Returns:
Time scaling factor for blend stage

void neo::animation::Animator::setStageTimeScale ( unsigned int  stage,
float  scale 
)

Parameters:
stage Blend stage index
scale Time scaling factor for blend stage

void neo::animation::Animator::setStageTimeScaleAll ( float  scale  ) 

Parameters:
scale Time scaling factor

std::string neo::animation::Animator::getStageAnimationName ( unsigned int  stage  ) 

Parameters:
stage Blend stage index
Returns:
Name of animation instance for blend stage

unsigned int neo::animation::Animator::getNumActiveStages (  )  const

Returns:
Number of active stages

const Keyframe * neo::animation::Animator::getAnimationChannel ( const core::HashString channel  )  const [inline]

Get the resulting data for an animation channel

Parameters:
channel Channel name
Returns:
Blended keyframe data for channel, 0 if not found or not animated

bool neo::animation::Animator::isSequencePlaying (  )  const

Returns:
Sequence finished state

Animator& neo::animation::Animator::operator= ( const Animator animator  ) 

Copy animator setup data

Parameters:
animator Source animator
Returns:
Self-reference


The documentation for this class was generated from the following file:
Generated on Sat Feb 17 20:51:01 2007 for NeoEngine 2 - Evolution by  doxygen 1.5.1