Ogre::AnimationState Class Reference
[Animation]

Represents the state of an animation and the weight of its influence. More...

#include <OgreAnimationState.h>

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

List of all members.

Public Types

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

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.
 AnimationState (AnimationStateSet *parent, const AnimationState &rhs)
 Constructor to copy from an existing state with new parent.
virtual ~AnimationState ()
const StringgetAnimationName () const
 Gets 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 hasEnded (void) const
 Returns true if the animation has reached the end and is not looping.
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
 Inequality operator.
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.
AnimationStateSetgetParent (void) const
 Get the parent animation state set.
void createBlendMask (size_t blendMaskSizeHint, float initialWeight=1.0f)
 Create a new blend mask with the given number of entries.
void destroyBlendMask ()
 Destroy the currently set blend mask.
void _setBlendMaskData (const float *blendMaskData)
 Set the blend mask data (might be dangerous).
void _setBlendMask (const BoneBlendMask *blendMask)
 Set the blend mask.
const BoneBlendMaskgetBlendMask () const
 Get the current blend mask (const version, may be 0).
bool hasBlendMask () const
 Return whether there is currently a valid blend mask set.
void setBlendMaskEntry (size_t boneHandle, float weight)
 Set the weight for the bone identified by the given handle.
float getBlendMaskEntry (size_t boneHandle) const
 Get the weight for the bone identified by the given handle.
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
void * operator new (size_t sz)
void * operator new (size_t sz, void *ptr)
 placement operator new
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
void * operator new[] (size_t sz)
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 *)

Protected Attributes

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

Detailed Description

Represents the state of an animation and the weight of its 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.

Parameters:
animName The name of this state.
parent The parent AnimationStateSet that this state will belong to.
timePos The position, in seconds, where this state will begin.
length The length, in seconds, of this animation state.
weight Weight to apply the animation state with.
enabled Whether the animation state is enabled.
Ogre::AnimationState::AnimationState ( AnimationStateSet parent,
const AnimationState rhs 
)

Constructor to copy from an existing state with new parent.

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

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.

Parameters:
offset The amount of time, in seconds, to extend the animation.
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.
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:
blendMaskSizeHint The number of bones of the skeleton owning this AnimationState.
initialWeight The 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

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

Definition at line 159 of file OgreAnimationState.h.

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

Get the weight for the bone identified by the given handle.

Definition at line 165 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

Gets whether or not this animation loops.

Definition at line 118 of file OgreAnimationState.h.

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

Get the parent animation state set.

Definition at line 127 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

Return whether there is currently a valid blend mask set.

Definition at line 161 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,
const char *  ,
int  ,
const char *   
) [inherited]

Definition at line 107 of file OgreMemoryAllocatedObject.h.

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

Definition at line 101 of file OgreMemoryAllocatedObject.h.

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

Definition at line 95 of file OgreMemoryAllocatedObject.h.

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

Definition at line 118 of file OgreMemoryAllocatedObject.h.

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

Definition at line 112 of file OgreMemoryAllocatedObject.h.

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

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

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

Definition at line 72 of file OgreMemoryAllocatedObject.h.

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

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  )  [inherited]

Definition at line 90 of file OgreMemoryAllocatedObject.h.

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

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

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

Inequality operator.

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  ) 

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 116 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

Definition at line 174 of file OgreAnimationState.h.

The blend mask (containing per bone weights).

Definition at line 172 of file OgreAnimationState.h.

Definition at line 179 of file OgreAnimationState.h.

Definition at line 177 of file OgreAnimationState.h.

bool Ogre::AnimationState::mLoop [protected]

Definition at line 180 of file OgreAnimationState.h.

Definition at line 175 of file OgreAnimationState.h.

Definition at line 176 of file OgreAnimationState.h.

Definition at line 178 of file OgreAnimationState.h.


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

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:37:05 2012