Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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:

Inheritance graph
[legend]
Collaboration diagram for Ogre::AnimationState:

Collaboration graph
[legend]
List of all members.

Public Methods

 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 StringgetAnimationName () 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.


Protected Attributes

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

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 43 of file OgreAnimationState.h.


Constructor & Destructor Documentation

Ogre::AnimationState::AnimationState  
 

Default constructor for STL only.

Definition at line 33 of file OgreAnimationState.cpp.

References mInvLength, mLength, mTimePos, and mWeight.

Ogre::AnimationState::~AnimationState   [virtual]
 

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

Definition at line 42 of file OgreAnimationState.cpp.

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

Normal constructor with all params supplied.

Definition at line 46 of file OgreAnimationState.cpp.

References Ogre::Real, and setLength().


Member Function Documentation

void Ogre::AnimationState::addTime Real    offset
 

Modifies the time position, adjusting for animation length.

Definition at line 100 of file OgreAnimationState.cpp.

References mLength, mTimePos, and Ogre::Real.

const String & Ogre::AnimationState::getAnimationName   const
 

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

Definition at line 52 of file OgreAnimationState.cpp.

References mAnimationName.

Referenced by Ogre::Skeleton::setAnimationState().

bool Ogre::AnimationState::getEnabled void    const
 

Returns true if this animation is currently enabled.

Definition at line 117 of file OgreAnimationState.cpp.

References mEnabled.

Referenced by Ogre::Skeleton::setAnimationState().

Real Ogre::AnimationState::getLength   const
 

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

Definition at line 72 of file OgreAnimationState.cpp.

References mLength, and Ogre::Real.

Real Ogre::AnimationState::getTimePosition void    const
 

Gets the time position for this animation.

Definition at line 62 of file OgreAnimationState.cpp.

References mTimePos, and Ogre::Real.

Referenced by Ogre::Skeleton::setAnimationState().

Real Ogre::AnimationState::getValue void    const [virtual]
 

ControllerValue implementation.

Implements Ogre::ControllerValue< Real >.

Definition at line 148 of file OgreAnimationState.cpp.

References mInvLength, mTimePos, and Ogre::Real.

Real Ogre::AnimationState::getWeight void    const
 

Gets the weight (influence) of this animation.

Definition at line 90 of file OgreAnimationState.cpp.

References mWeight, and Ogre::Real.

Referenced by Ogre::Skeleton::setAnimationState().

bool Ogre::AnimationState::operator!= const AnimationState &    rhs const
 

Definition at line 143 of file OgreAnimationState.cpp.

bool Ogre::AnimationState::operator== const AnimationState &    rhs const
 

Equality operator.

Definition at line 127 of file OgreAnimationState.cpp.

References mAnimationName, mEnabled, mLength, mTimePos, and mWeight.

void Ogre::AnimationState::setAnimationName const String   name
 

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

Definition at line 57 of file OgreAnimationState.cpp.

References mAnimationName.

void Ogre::AnimationState::setEnabled bool    enabled
 

Sets whether this animation is enabled.

Definition at line 122 of file OgreAnimationState.cpp.

References mEnabled.

void Ogre::AnimationState::setLength Real    len
 

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

Definition at line 77 of file OgreAnimationState.cpp.

References mInvLength, mLength, and Ogre::Real.

Referenced by AnimationState().

void Ogre::AnimationState::setTimePosition Real    timePos
 

Sets the time position for this animation.

Definition at line 67 of file OgreAnimationState.cpp.

References mTimePos, and Ogre::Real.

void Ogre::AnimationState::setValue Real    value [virtual]
 

ControllerValue implementation.

Implements Ogre::ControllerValue< Real >.

Definition at line 153 of file OgreAnimationState.cpp.

References mLength, mTimePos, and Ogre::Real.

void Ogre::AnimationState::setWeight Real    weight
 

Sets the weight (influence) of this animation.

Definition at line 95 of file OgreAnimationState.cpp.

References mWeight, and Ogre::Real.


Member Data Documentation

String Ogre::AnimationState::mAnimationName [protected]
 

Definition at line 92 of file OgreAnimationState.h.

Referenced by getAnimationName(), operator==(), and setAnimationName().

bool Ogre::AnimationState::mEnabled [protected]
 

Definition at line 97 of file OgreAnimationState.h.

Referenced by getEnabled(), operator==(), and setEnabled().

Real Ogre::AnimationState::mInvLength [protected]
 

Definition at line 95 of file OgreAnimationState.h.

Referenced by AnimationState(), getValue(), and setLength().

Real Ogre::AnimationState::mLength [protected]
 

Definition at line 94 of file OgreAnimationState.h.

Referenced by addTime(), AnimationState(), getLength(), operator==(), setLength(), and setValue().

Real Ogre::AnimationState::mTimePos [protected]
 

Definition at line 93 of file OgreAnimationState.h.

Referenced by addTime(), AnimationState(), getTimePosition(), getValue(), operator==(), setTimePosition(), and setValue().

Real Ogre::AnimationState::mWeight [protected]
 

Definition at line 96 of file OgreAnimationState.h.

Referenced by AnimationState(), getWeight(), operator==(), and setWeight().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:16:38 2004