neo::animation::AnimationInstance Class Reference

#include <animation/animation.h>

Collaboration diagram for neo::animation::AnimationInstance:

Collaboration graph
[legend]
List of all members.

Detailed Description

Instance of an animation
Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 AnimationInstance (const AnimationPtr &p_anim)
 Initialize.
 AnimationInstance (const AnimationInstance &instance)
 Copy.
virtual ~AnimationInstance ()
 Free resources.
void update (float dt)
 Update animation.
void interpolate (core::HashTable< std::string, Keyframe * > &dest)
 Interpolate animation data.
void blend (core::HashTable< std::string, Keyframe * > &dest, float weight)
 Interpolate and blend animation data.
void setAnimation (const AnimationPtr &p_anim)
 Set new animation.
const AnimationPtr & getAnimation () const
 Get the animation.
void reset (float time=0.0f)
 Reset animation time.
void play (bool play=true)
 Set play flag.
void loop (bool loop=true)
 Set loop flag.
float getCurrentTime () const
 Get animation time.
bool isLooping () const
 Query if looping.
bool isPlaying () const
 Query if playing.
bool isLooped () const
 Query if looped last update.

Protected Attributes

AnimationPtr _p_animation
 Animation.
core::Array< unsigned int > _keyframeIndex
 Last keyframe indices for all channels.
float _time
 Current time.
float _timeNorm
 Current normalized time.
bool _loop
 Loop flag.
bool _play
 Play flag.
bool _looped
 Loop last update flag.


Constructor & Destructor Documentation

neo::animation::AnimationInstance::AnimationInstance ( const AnimationPtr &  p_anim  ) 

Initialize animation instance to start of given animation

Parameters:
p_anim Animation

neo::animation::AnimationInstance::AnimationInstance ( const AnimationInstance instance  ) 

Parameters:
instance Source instance


Member Function Documentation

void neo::animation::AnimationInstance::update ( float  dt  ) 

Update this animation instance

Parameters:
dt Time passed since last update

void neo::animation::AnimationInstance::interpolate ( core::HashTable< std::string, Keyframe * > &  dest  ) 

Interpolate the animation data

Parameters:
dest Destination keyframes

void neo::animation::AnimationInstance::blend ( core::HashTable< std::string, Keyframe * > &  dest,
float  weight 
)

Interpolate and blend the animation data

Parameters:
dest Destination keyframes
weight Blend weight

void neo::animation::AnimationInstance::setAnimation ( const AnimationPtr &  p_anim  ) 

Set new animation to instantiate. Will reset the animation to zero

Parameters:
p_anim Animation

const AnimationPtr & neo::animation::AnimationInstance::getAnimation (  )  const [inline]

Get the animation we instantiate

Returns:
Animation

void neo::animation::AnimationInstance::reset ( float  time = 0.0f  )  [inline]

Reset animation time to given time in [0..1] range

Parameters:
time Timestamp

void neo::animation::AnimationInstance::play ( bool  play = true  )  [inline]

Set the play flag

Parameters:
play Play flag

void neo::animation::AnimationInstance::loop ( bool  loop = true  )  [inline]

Set the loop flag

Parameters:
loop Loop flag

float neo::animation::AnimationInstance::getCurrentTime (  )  const [inline]

Get current animation time in [0..1] range

Returns:
Current timestamp

bool neo::animation::AnimationInstance::isLooping (  )  const [inline]

Returns:
Looping state

bool neo::animation::AnimationInstance::isPlaying (  )  const [inline]

Returns:
Finished state

bool neo::animation::AnimationInstance::isLooped (  )  const [inline]

Returns:
true if animation looped in last update, false if not


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