# Ogre::AnimationState Class Reference

Represents the state of an animation and the weight of it's influence. More...

`#include <OgreAnimationState.h>`

Inheritance diagram for Ogre::AnimationState:

List of all members.

## Public Member Functions

| AnimationState ()
| Default constructor for STL only.
virtual | ~AnimationState ()
| Destructor - is here because class has virtual functions and some compilers would whine if it won't exist.
| AnimationState (const String &animName, Real timePos, Real length, Real weight=1.0, bool enabled=false)
| Normal constructor with all params supplied.
const String & | getAnimationName () const
| Gets the name of the animation to which this state applies.
void | setAnimationName (const String &name)
| Sets the name of the animation to which this state applies.
Real | getTimePosition (void) const
| Gets the time position for this animation.
void | setTimePosition (Real timePos)
| Sets the time position for this animation.
Real | getLength () const
| Gets the total length of this animation (may be shorter than whole animation).
void | setLength (Real len)
| Sets the total length of this animation (may be shorter than whole animation).
Real | getWeight (void) const
| Gets the weight (influence) of this animation.
void | setWeight (Real weight)
| Sets the weight (influence) of this animation.
void | addTime (Real offset)
| Modifies the time position, adjusting for animation length.
bool | getEnabled (void) const
| Returns true if this animation is currently enabled.
void | setEnabled (bool enabled)
| Sets whether this animation is enabled.
bool | operator== (const AnimationState &rhs) const
| Equality operator.
bool | operator!= (const AnimationState &rhs) const
Real | getValue (void) const
| ControllerValue implementation.
void | setValue (Real value)
| ControllerValue implementation.
void | setLoop (bool loop)
| Sets whether or not an animation loops at the start and end of the animation if the time continues to be altered.
bool | getLoop (void) const
| Gets whether or not this animation loops.
void | copyStateFrom (const AnimationState &animState)
| Copies the states from another animation state, preserving the animation name (unlike operator=) but copying everything else.

## Protected Attributes

String | mAnimationName
Real | mTimePos
Real | mLength
Real | mInvLength
Real | mWeight
bool | mEnabled
bool | mLoop

## Detailed Description

Represents the state of an animation and the weight of it's influence.

Remarks:
  Other classes can hold instances of this class to store the state of any animations they are using. This class implements the ControllerValue interface to enable automatic update of animation state through controllers.

Definition at line 44 of file OgreAnimationState.h.

## Constructor & Destructor Documentation

Ogre::AnimationState::AnimationState | ( |  | ) |

| Default constructor for STL only.

virtual Ogre::AnimationState::~AnimationState | ( |  | ) | `[virtual]`

| Destructor - is here because class has virtual functions and some compilers would whine if it won't exist.

Ogre::AnimationState::AnimationState | ( | const String & | animName,
|  | Real | timePos,
|  | Real | length,
|  | Real | weight = 1.0,
|  | bool | enabled = false
| ) |

| Normal constructor with all params supplied.

## Member Function Documentation

void Ogre::AnimationState::addTime | ( | Real | offset | ) |

Modifies the time position, adjusting for animation length.

Remarks:
  This method loops at the edges if animation looping is enabled.

void Ogre::AnimationState::copyStateFrom | ( | const AnimationState & | animState | ) |

Copies the states from another animation state, preserving the animation name (unlike operator=) but copying everything else.

Parameters:

  animState | Reference to animation state which will use as source.

const String& Ogre::AnimationState::getAnimationName | ( |  | ) | const

| Gets the name of the animation to which this state applies.

bool Ogre::AnimationState::getEnabled | ( | void |  | ) | const

| Returns true if this animation is currently enabled.

Real Ogre::AnimationState::getLength | ( |  | ) | const

| Gets the total length of this animation (may be shorter than whole animation).

bool Ogre::AnimationState::getLoop | ( | void |  | ) | const

| Gets whether or not this animation loops. Definition at line 98 of file OgreAnimationState.h.

Real Ogre::AnimationState::getTimePosition | ( | void |  | ) | const

| Gets the time position for this animation.

Real Ogre::AnimationState::getValue | ( | void |  | ) | const`[virtual]`

| ControllerValue implementation. Implements Ogre::ControllerValue< Real >.

Real Ogre::AnimationState::getWeight | ( | void |  | ) | const

| Gets the weight (influence) of this animation.

bool Ogre::AnimationState::operator!= | ( | const AnimationState & | rhs | ) | const

bool Ogre::AnimationState::operator== | ( | const AnimationState & | rhs | ) | const

| Equality operator.

void Ogre::AnimationState::setAnimationName | ( | const String & | name | ) |

| Sets the name of the animation to which this state applies.

void Ogre::AnimationState::setEnabled | ( | bool | enabled | ) |

| Sets whether this animation is enabled.

void Ogre::AnimationState::setLength | ( | Real | len | ) |

| Sets the total length of this animation (may be shorter than whole animation).

void Ogre::AnimationState::setLoop | ( | bool | loop | ) |

| Sets whether or not an animation loops at the start and end of the animation if the time continues to be altered. Definition at line 96 of file OgreAnimationState.h.

void Ogre::AnimationState::setTimePosition | ( | Real | timePos | ) |

| Sets the time position for this animation.

void Ogre::AnimationState::setValue | ( | Real | value | ) | `[virtual]`

| ControllerValue implementation. Implements Ogre::ControllerValue< Real >.

void Ogre::AnimationState::setWeight | ( | Real | weight | ) |

| Sets the weight (influence) of this animation.

## Member Data Documentation

String Ogre::AnimationState::mAnimationName `[protected]`

| Definition at line 107 of file OgreAnimationState.h.

bool Ogre::AnimationState::mEnabled `[protected]`

| Definition at line 112 of file OgreAnimationState.h.

Real Ogre::AnimationState::mInvLength `[protected]`

| Definition at line 110 of file OgreAnimationState.h.

Real Ogre::AnimationState::mLength `[protected]`

| Definition at line 109 of file OgreAnimationState.h.

bool Ogre::AnimationState::mLoop `[protected]`

| Definition at line 113 of file OgreAnimationState.h.

Real Ogre::AnimationState::mTimePos `[protected]`

| Definition at line 108 of file OgreAnimationState.h.

Real Ogre::AnimationState::mWeight `[protected]`

| Definition at line 111 of file OgreAnimationState.h.

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

- OgreAnimationState.h

Copyright © 2000-2005 by The OGRE Team
Last modified Sun Nov 20 12:36:19 2005