OGRE-Next: Ogre::v1::AnimationState Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::v1::AnimationState Class Reference
Core » Animation

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

`#include <OgreAnimationState.h>`

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

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

## Public Member Functions
| AnimationState (AnimationStateSet *parent, const AnimationState &rhs)
| Constructor to copy from an existing state with new parent.
| AnimationState (const String &animName, AnimationStateSet *parent, Real timePos, Real length, Real weight=1.0, bool enabled=false)
| Normal constructor with all params supplied.
virtual | ~AnimationState ()
void | _setBlendMask (const BoneBlendMask *blendMask)
| Set the blend mask.
void | _setBlendMaskData (const float *blendMaskData)
| Set the blend mask data (might be dangerous).
void | addTime (Real offset)
| Modifies the time position, adjusting for animation length.
void | copyStateFrom (const AnimationState &animState)
| Copies the states from another animation state, preserving the animation name (unlike operator=) but copying everything else.
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.
const String & | getAnimationName () const
| Gets the name of the animation to which this state applies.
const BoneBlendMask * | getBlendMask () const
| Get the current blend mask (const version, may be 0).
float | getBlendMaskEntry (size_t boneHandle) const
| Get the weight for the bone identified by the given handle.
bool | getEnabled () const
| Returns true if this animation is currently enabled.
Real | getLength () const
| Gets the total length of this animation (may be shorter than whole animation).
bool | getLoop () const
| Gets whether or not this animation loops.
AnimationStateSet * | getParent () const
| Get the parent animation state set.
Real | getTimePosition () const
| Gets the time position for this animation.
Real | getWeight () const
| Gets the weight (influence) of this animation.
bool | hasBlendMask () const
| Return whether there is currently a valid blend mask set.
bool | hasEnded () const
| Returns true if the animation has reached the end and is not looping.
bool | operator!= (const AnimationState &rhs) const
| Inequality operator.
bool | operator== (const AnimationState &rhs) const
| Equality operator.
void | setBlendMaskEntry (size_t boneHandle, float weight)
| Set the weight for the bone identified by the given handle.
void | setEnabled (bool enabled)
| Sets whether this animation is enabled.
void | setLength (Real len)
| Sets the total length of this animation (may be shorter than whole animation).
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.
void | setTimePosition (Real timePos)
| Sets the time position for this animation.
void | setWeight (Real weight)
| Sets the weight (influence) of this animation.

## 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.

## Member Typedef Documentation

## ◆ BoneBlendMask

typedef vector<float>::type Ogre::v1::AnimationState::BoneBlendMask

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

## Constructor & Destructor Documentation

## ◆ AnimationState() [1/2]

Ogre::v1::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.

Referenced by AnimationState(), copyStateFrom(), operator!=(), and operator==().

## ◆ AnimationState() [2/2]

Ogre::v1::AnimationState::AnimationState | ( | AnimationStateSet * | parent,
|  | const AnimationState & | rhs )

Constructor to copy from an existing state with new parent.

References AnimationState().

## ◆ ~AnimationState()

virtual Ogre::v1::AnimationState::~AnimationState | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ _setBlendMask()

void Ogre::v1::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.

## ◆ _setBlendMaskData()

void Ogre::v1::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.

## ◆ addTime()

void Ogre::v1::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.

## ◆ copyStateFrom()

void Ogre::v1::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.

References AnimationState().

## ◆ createBlendMask()

void Ogre::v1::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)

## ◆ destroyBlendMask()

void Ogre::v1::AnimationState::destroyBlendMask | ( |  | ) |

Destroy the currently set blend mask.

## ◆ getAnimationName()

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

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

## ◆ getBlendMask()

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

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

## ◆ getBlendMaskEntry()

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

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

## ◆ getEnabled()

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

Returns true if this animation is currently enabled.

## ◆ getLength()

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

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

## ◆ getLoop()

bool Ogre::v1::AnimationState::getLoop | ( |  | ) | const
| inline

Gets whether or not this animation loops.

## ◆ getParent()

AnimationStateSet * Ogre::v1::AnimationState::getParent | ( |  | ) | const
| inline

Get the parent animation state set.

## ◆ getTimePosition()

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

Gets the time position for this animation.

## ◆ getWeight()

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

Gets the weight (influence) of this animation.

## ◆ hasBlendMask()

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

Return whether there is currently a valid blend mask set.

## ◆ hasEnded()

bool Ogre::v1::AnimationState::hasEnded | ( |  | ) | const

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

## ◆ operator!=()

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

Inequality operator.

References AnimationState().

## ◆ operator==()

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

Equality operator.

References AnimationState().

## ◆ setBlendMaskEntry()

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

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

## ◆ setEnabled()

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

Sets whether this animation is enabled.

## ◆ setLength()

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

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

## ◆ setLoop()

void Ogre::v1::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.

## ◆ setTimePosition()

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

Sets the time position for this animation.

## ◆ setWeight()

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

Sets the weight (influence) of this animation.

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

- OgreAnimationState.h