Urho3D
|
Animation instance. More...
#include </home/runner/work/urho3d-doxygen.github.io/urho3d-doxygen.github.io/urho3d_repo/Source/Urho3D/Graphics/AnimationState.h>
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) |
Set start bone. Not supported in node animation mode. Resets any assigned per-bone weights. | |
void | SetLooped (bool looped) |
Set looping enabled/disabled. | |
void | SetWeight (float weight) |
Set blending weight. | |
void | SetBlendMode (AnimationBlendMode mode) |
Set blending mode. | |
void | SetTime (float time) |
Set time position. Does not fire animation triggers. | |
void | SetBoneWeight (i32 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) |
Set blending layer. | |
Animation * | GetAnimation () const |
Return animation. | |
AnimatedModel * | GetModel () const |
Return animated model this state belongs to (model mode). | |
Node * | GetNode () const |
Return root scene node this state controls (node hierarchy mode). | |
Bone * | GetStartBone () const |
Return start bone. | |
float | GetBoneWeight (i32 index) const |
Return per-bone blending weight by track index. | |
float | GetBoneWeight (const String &name) const |
Return per-bone blending weight by name. | |
float | GetBoneWeight (StringHash nameHash) const |
Return per-bone blending weight by name. | |
i32 | GetTrackIndex (Node *node) const |
Return track index with matching bone node, or NINDEX if not found. | |
i32 | GetTrackIndex (const String &name) const |
Return track index by bone name, or NINDEX if not found. | |
i32 | GetTrackIndex (StringHash nameHash) const |
Return track index by bone name hash, or NINDEX if not found. | |
bool | IsEnabled () const |
Return whether weight is nonzero. | |
bool | IsLooped () const |
Return whether looped. | |
float | GetWeight () const |
Return blending weight. | |
AnimationBlendMode | GetBlendMode () const |
Return blending mode. | |
float | GetTime () const |
Return time position. | |
float | GetLength () const |
Return animation length. | |
unsigned char | GetLayer () const |
Return blending layer. | |
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. | |
RefCounted & | operator= (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 |
Return reference count. | |
int | WeakRefs () const |
Return weak reference count. | |
RefCount * | RefCountPtr () |
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< AnimatedModel > | model_ |
Animated model (model mode). | |
WeakPtr< Node > | node_ |
Root scene node (node hierarchy mode). | |
SharedPtr< Animation > | animation_ |
Animation. | |
Bone * | startBone_ |
Start bone. | |
Vector< AnimationStateTrack > | stateTracks_ |
Per-track data. | |
bool | looped_ |
Looped flag. | |
float | weight_ |
Blending weight. | |
float | time_ |
Time position. | |
unsigned char | layer_ |
Blending layer. | |
AnimationBlendMode | blendingMode_ |
Blending mode. | |
Animation instance.