OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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:
+ Collaboration diagram for Ogre::AnimationState:

Public Types

typedef vector< float >::type BoneBlendMask
 typedef for an array of float values used as a bone blend mask More...
 

Public Member Functions

 AnimationState (const String &animName, AnimationStateSet *parent, Real timePos, Real length, Real weight=1.0, bool enabled=false)
 Normal constructor with all params supplied. More...
 
 AnimationState (AnimationStateSet *parent, const AnimationState &rhs)
 constructor to copy from an existing state with new parent More...
 
virtual ~AnimationState ()
 Destructor - is here because class has virtual functions and some compilers would whine if it won't exist. More...
 
void _setBlendMask (const BoneBlendMask *blendMask)
 set the blend mask More...
 
void _setBlendMaskData (const float *blendMaskData)
 set the blend mask data (might be dangerous) More...
 
void addTime (Real offset)
 Modifies the time position, adjusting for animation length. More...
 
void copyStateFrom (const AnimationState &animState)
 Copies the states from another animation state, preserving the animation name (unlike operator=) but copying everything else. More...
 
void createBlendMask (size_t blendMaskSizeHint, float initialWeight=1.0f)
 create a new blend mask with the given number of entries More...
 
void destroyBlendMask ()
 destroy the currently set blend mask More...
 
const StringgetAnimationName () const
 Gets the name of the animation to which this state applies. More...
 
const BoneBlendMaskgetBlendMask () const
 get the current blend mask (const version, may be 0) More...
 
float getBlendMaskEntry (size_t boneHandle) const
 get the weight for the bone identified by the given handle More...
 
bool getEnabled (void) const
 Returns true if this animation is currently enabled. More...
 
Real getLength () const
 Gets the total length of this animation (may be shorter than whole animation) More...
 
bool getLoop (void) const
 Gets whether or not this animation loops. More...
 
AnimationStateSetgetParent (void) const
 Get the parent animation state set. More...
 
Real getTimePosition (void) const
 Gets the time position for this animation. More...
 
Real getWeight (void) const
 Gets the weight (influence) of this animation. More...
 
bool hasBlendMask () const
 return whether there is currently a valid blend mask set More...
 
bool hasEnded (void) const
 Returns true if the animation has reached the end and is not looping. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 
bool operator!= (const AnimationState &rhs) const
 
bool operator== (const AnimationState &rhs) const
 Equality operator. More...
 
void setBlendMaskEntry (size_t boneHandle, float weight)
 set the weight for the bone identified by the given handle More...
 
void setEnabled (bool enabled)
 Sets whether this animation is enabled. More...
 
void setLength (Real len)
 Sets the total length of this animation (may be shorter than whole animation) More...
 
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. More...
 
void setTimePosition (Real timePos)
 Sets the time position for this animation. More...
 
void setWeight (Real weight)
 Sets the weight (influence) of this animation. More...
 

Protected Attributes

String mAnimationName
 
BoneBlendMaskmBlendMask
 the blend mask (containing per bone weights) More...
 
bool mEnabled
 
Real mLength
 
bool mLoop
 
AnimationStateSetmParent
 
Real mTimePos
 
Real mWeight
 

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.

Definition at line 52 of file OgreAnimationState.h.

Member Typedef Documentation

typedef for an array of float values used as a bone blend mask

Definition at line 57 of file OgreAnimationState.h.

Constructor & Destructor Documentation

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

Normal constructor with all params supplied.

Ogre::AnimationState::AnimationState ( AnimationStateSet parent,
const AnimationState rhs 
)

constructor to copy from an existing state with new parent

virtual Ogre::AnimationState::~AnimationState ( )
virtual

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

Member Function Documentation

void Ogre::AnimationState::_setBlendMask ( const BoneBlendMask blendMask)

set the blend mask

The size of the array should match the number of entries the
blend mask was created with.
Stick to the setBlendMaskEntry method if you don't know exactly what you're doing.
void Ogre::AnimationState::_setBlendMaskData ( const float *  blendMaskData)

set the blend mask data (might be dangerous)

The size of the array should match the number of entries the
blend mask was created with.
Stick to the setBlendMaskEntry method if you don't know exactly what you're doing.
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
animStateReference to animation state which will use as source.
void Ogre::AnimationState::createBlendMask ( size_t  blendMaskSizeHint,
float  initialWeight = 1.0f 
)

create a new blend mask with the given number of entries

In addition to assigning a single weight value to a skeletal animation, it may be desirable to assign animation weights per bone using a 'blend mask'.

Parameters
blendMaskSizeHintThe number of bones of the skeleton owning this AnimationState.
initialWeightThe value all the blend mask entries will be initialised with (negative to skip initialisation)
void Ogre::AnimationState::destroyBlendMask ( )

destroy the currently set blend mask

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

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

const BoneBlendMask* Ogre::AnimationState::getBlendMask ( ) const
inline

get the current blend mask (const version, may be 0)

Definition at line 148 of file OgreAnimationState.h.

float Ogre::AnimationState::getBlendMaskEntry ( size_t  boneHandle) const
inline

get the weight for the bone identified by the given handle

Definition at line 154 of file OgreAnimationState.h.

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
inline

Gets whether or not this animation loops.

Definition at line 107 of file OgreAnimationState.h.

AnimationStateSet* Ogre::AnimationState::getParent ( void  ) const
inline

Get the parent animation state set.

Definition at line 116 of file OgreAnimationState.h.

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

Gets the time position for this animation.

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

Gets the weight (influence) of this animation.

bool Ogre::AnimationState::hasBlendMask ( ) const
inline

return whether there is currently a valid blend mask set

Definition at line 150 of file OgreAnimationState.h.

bool Ogre::AnimationState::hasEnded ( void  ) const

Returns true if the animation has reached the end and is not looping.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 90 of file OgreMemoryAllocatedObject.h.

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

Equality operator.

void Ogre::AnimationState::setBlendMaskEntry ( size_t  boneHandle,
float  weight 
)

set the weight for the bone identified by the given handle

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)
inline

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

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

Sets the time position for this animation.

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

Sets the weight (influence) of this animation.

Member Data Documentation

String Ogre::AnimationState::mAnimationName
protected

Definition at line 163 of file OgreAnimationState.h.

BoneBlendMask* Ogre::AnimationState::mBlendMask
protected

the blend mask (containing per bone weights)

Definition at line 161 of file OgreAnimationState.h.

bool Ogre::AnimationState::mEnabled
protected

Definition at line 168 of file OgreAnimationState.h.

Real Ogre::AnimationState::mLength
protected

Definition at line 166 of file OgreAnimationState.h.

bool Ogre::AnimationState::mLoop
protected

Definition at line 169 of file OgreAnimationState.h.

AnimationStateSet* Ogre::AnimationState::mParent
protected

Definition at line 164 of file OgreAnimationState.h.

Real Ogre::AnimationState::mTimePos
protected

Definition at line 165 of file OgreAnimationState.h.

Real Ogre::AnimationState::mWeight
protected

Definition at line 167 of file OgreAnimationState.h.


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