OGRE
14.3
Object-Oriented Graphics Rendering Engine
|
Represents the state of an animation and the weight of its influence. More...
#include <OgreAnimationState.h>
Public Types | |
typedef std::vector< float > | BoneBlendMask |
Typedef for an array of float values used as a bone blend mask. More... | |
Public Member Functions | |
AnimationState (AnimationStateSet *parent, const AnimationState &rhs) | |
Constructor to copy from an existing state with new parent. More... | |
AnimationState (const String &animName, AnimationStateSet *parent, Real timePos, Real length, Real weight=1.0, bool enabled=false) | |
Normal constructor with all params supplied. More... | |
void | _setBlendMask (const BoneBlendMask *blendMask) |
Set the blend mask. 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 String & | getAnimationName () const |
Gets the name of the animation to which this state applies. More... | |
const BoneBlendMask * | getBlendMask () const |
Get the current blend mask. 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... | |
AnimationStateSet * | getParent (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... | |
bool | operator!= (const AnimationState &rhs) const |
Inequality operator. More... | |
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... | |
Represents the state of an animation and the weight of its influence.
Other classes can hold instances of this class to store the state of any animations they are using.
typedef std::vector<float> Ogre::AnimationState::BoneBlendMask |
Typedef for an array of float values used as a bone blend mask.
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.
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.
const String& Ogre::AnimationState::getAnimationName | ( | ) | const |
Gets the name of the animation to which this state applies.
Real Ogre::AnimationState::getTimePosition | ( | void | ) | const |
Gets the time position for this animation.
Referenced by Ogre::AnimationStateControllerValue::getValue().
void Ogre::AnimationState::setTimePosition | ( | Real | timePos | ) |
Sets the time position for this animation.
Referenced by Ogre::AnimationStateControllerValue::setValue().
Real Ogre::AnimationState::getLength | ( | ) | const |
Gets the total length of this animation (may be shorter than whole animation)
Referenced by Ogre::AnimationStateControllerValue::getValue(), and Ogre::AnimationStateControllerValue::setValue().
void Ogre::AnimationState::setLength | ( | Real | len | ) |
Sets the total length of this animation (may be shorter than whole animation)
Real Ogre::AnimationState::getWeight | ( | void | ) | const |
Gets the weight (influence) of this animation.
void Ogre::AnimationState::setWeight | ( | Real | weight | ) |
Sets the weight (influence) of this animation.
void Ogre::AnimationState::addTime | ( | Real | offset | ) |
Modifies the time position, adjusting for animation length.
offset | The amount of time, in seconds, to extend the animation. |
This method loops at the edges if animation looping is enabled.
Referenced by Ogre::AnimationStateControllerValue::setValue().
bool Ogre::AnimationState::hasEnded | ( | void | ) | const |
Returns true if the animation has reached the end and is not looping.
bool Ogre::AnimationState::getEnabled | ( | void | ) | const |
Returns true if this animation is currently enabled.
void Ogre::AnimationState::setEnabled | ( | bool | enabled | ) |
Sets whether this animation is enabled.
bool Ogre::AnimationState::operator== | ( | const AnimationState & | rhs | ) | const |
Equality operator.
bool Ogre::AnimationState::operator!= | ( | const AnimationState & | rhs | ) | const |
Inequality operator.
|
inline |
Sets whether or not an animation loops at the start and end of the animation if the time continues to be altered.
|
inline |
Gets whether or not this animation loops
void Ogre::AnimationState::copyStateFrom | ( | const AnimationState & | animState | ) |
Copies the states from another animation state, preserving the animation name (unlike operator=) but copying everything else.
animState | Reference to animation state which will use as source. |
|
inline |
Get the parent animation state set.
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'.
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.
void Ogre::AnimationState::_setBlendMask | ( | const BoneBlendMask * | blendMask | ) |
Set the blend mask.
|
inline |
Get the current blend mask.
|
inline |
Return whether there is currently a valid blend mask set.
void Ogre::AnimationState::setBlendMaskEntry | ( | size_t | boneHandle, |
float | weight | ||
) |
Set the weight for the bone identified by the given handle.
|
inline |
Get the weight for the bone identified by the given handle.