Animation instance. More...

#include <Urho3D/Graphics/AnimationState.h>

Inheritance diagram for Urho3D::AnimationState:
[legend]
Collaboration diagram for Urho3D::AnimationState:
[legend]

Public Member Functions

 AnimationState (AnimatedModel *model, Animation *animation)
 Construct with animated model and animation pointers.
 
 AnimationState (Node *node, Animation *animation)
 Construct with root scene node and animation pointers.
 
 ~AnimationState () override
 Destruct.
 
void SetStartBone (Bone *startBone)
 
void SetLooped (bool looped)
 
void SetWeight (float weight)
 
void SetBlendMode (AnimationBlendMode mode)
 
void SetTime (float time)
 
void SetBoneWeight (unsigned index, float weight, bool recursive=false)
 Set per-bone blending weight by track index. Default is 1.0 (full), is multiplied with the state's blending weight when applying the animation. Optionally recurses to child bones.
 
void SetBoneWeight (const String &name, float weight, bool recursive=false)
 Set per-bone blending weight by name.
 
void SetBoneWeight (StringHash nameHash, float weight, bool recursive=false)
 Set per-bone blending weight by name hash.
 
void AddWeight (float delta)
 Modify blending weight.
 
void AddTime (float delta)
 Modify time position. Animation triggers will be fired.
 
void SetLayer (unsigned char layer)
 
AnimationGetAnimation () const
 
AnimatedModelGetModel () const
 
NodeGetNode () const
 
BoneGetStartBone () const
 
float GetBoneWeight (unsigned index) const
 Return per-bone blending weight by track index.
 
float GetBoneWeight (const String &name) const
 
float GetBoneWeight (StringHash nameHash) const
 Return per-bone blending weight by name.
 
unsigned GetTrackIndex (Node *node) const
 Return track index with matching bone node, or M_MAX_UNSIGNED if not found.
 
unsigned GetTrackIndex (const String &name) const
 Return track index by bone name, or M_MAX_UNSIGNED if not found.
 
unsigned GetTrackIndex (StringHash nameHash) const
 Return track index by bone name hash, or M_MAX_UNSIGNED if not found.
 
bool IsEnabled () const
 
bool IsLooped () const
 
float GetWeight () const
 
AnimationBlendMode GetBlendMode () const
 
float GetTime () const
 
float GetLength () const
 
unsigned char GetLayer () const
 
void Apply ()
 Apply the animation at the current time position.
 
- Public Member Functions inherited from Urho3D::RefCounted
 RefCounted ()
 Construct. Allocate the reference count structure and set an initial self weak reference.
 
virtual ~RefCounted ()
 Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
 
 RefCounted (const RefCounted &rhs)=delete
 Prevent copy construction.
 
RefCountedoperator= (const RefCounted &rhs)=delete
 Prevent assignment.
 
void AddRef ()
 Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
 
void ReleaseRef ()
 Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
 
int Refs () const
 
int WeakRefs () const
 
RefCountRefCountPtr ()
 Return pointer to the reference count structure.
 

Private Member Functions

void ApplyToModel ()
 Apply animation to a skeleton. Transform changes are applied silently, so the model needs to dirty its root model afterward.
 
void ApplyToNodes ()
 Apply animation to a scene node hierarchy.
 
void ApplyTrack (AnimationStateTrack &stateTrack, float weight, bool silent)
 Apply track.
 

Private Attributes

WeakPtr< AnimatedModelmodel_
 Animated model (model mode).
 
WeakPtr< Nodenode_
 Root scene node (node hierarchy mode).
 
SharedPtr< Animationanimation_
 Animation.
 
BonestartBone_
 Start bone.
 
Vector< AnimationStateTrackstateTracks_
 Per-track data.
 
bool looped_
 Looped flag.
 
float weight_
 Blending weight.
 
float time_
 Time position.
 
unsigned char layer_
 Blending layer.
 
AnimationBlendMode blendingMode_
 Blending mode.
 

Detailed Description

Animation instance.

Member Function Documentation

◆ GetAnimation()

Animation* Urho3D::AnimationState::GetAnimation ( ) const
inline

Return animation.

Here is the caller graph for this function:

◆ GetBlendMode()

AnimationBlendMode Urho3D::AnimationState::GetBlendMode ( ) const
inline

Return blending mode.

Here is the caller graph for this function:

◆ GetBoneWeight()

float Urho3D::AnimationState::GetBoneWeight ( const String name) const

Return per-bone blending weight by name.

Here is the call graph for this function:

◆ GetLayer()

unsigned char Urho3D::AnimationState::GetLayer ( ) const
inline

Return blending layer.

Here is the caller graph for this function:

◆ GetLength()

float Urho3D::AnimationState::GetLength ( ) const

Return animation length.

Here is the caller graph for this function:

◆ GetModel()

AnimatedModel * Urho3D::AnimationState::GetModel ( ) const

Return animated model this state belongs to (model mode).

◆ GetNode()

Node * Urho3D::AnimationState::GetNode ( ) const

Return root scene node this state controls (node hierarchy mode).

◆ GetStartBone()

Bone * Urho3D::AnimationState::GetStartBone ( ) const

Return start bone.

Here is the caller graph for this function:

◆ GetTime()

float Urho3D::AnimationState::GetTime ( ) const
inline

Return time position.

Here is the caller graph for this function:

◆ GetWeight()

float Urho3D::AnimationState::GetWeight ( ) const
inline

Return blending weight.

Here is the caller graph for this function:

◆ IsEnabled()

bool Urho3D::AnimationState::IsEnabled ( ) const
inline

Return whether weight is nonzero.

Here is the caller graph for this function:

◆ IsLooped()

bool Urho3D::AnimationState::IsLooped ( ) const
inline

Return whether looped.

Here is the caller graph for this function:

◆ SetBlendMode()

void Urho3D::AnimationState::SetBlendMode ( AnimationBlendMode  mode)

Set blending mode.

Here is the caller graph for this function:

◆ SetLayer()

void Urho3D::AnimationState::SetLayer ( unsigned char  layer)

Set blending layer.

Here is the caller graph for this function:

◆ SetLooped()

void Urho3D::AnimationState::SetLooped ( bool  looped)

Set looping enabled/disabled.

Here is the caller graph for this function:

◆ SetStartBone()

void Urho3D::AnimationState::SetStartBone ( Bone startBone)

Set start bone. Not supported in node animation mode. Resets any assigned per-bone weights.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetTime()

void Urho3D::AnimationState::SetTime ( float  time)

Set time position. Does not fire animation triggers.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetWeight()

void Urho3D::AnimationState::SetWeight ( float  weight)

Set blending weight.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files:
  • Source/Urho3D/Graphics/AnimationState.h
  • Source/Urho3D/Graphics/AnimationState.cpp