Rebel Fork Framework
|
Animation instance. More...
#include <Urho3D/Graphics/AnimationState.h>
Public Member Functions | |
AnimationState (AnimationController *controller) | |
Construct . | |
~AnimationState () override | |
Destruct. | |
void | ConnectToAnimatedModel (AnimatedModel *model) |
Connect to AnimatedModel. | |
void | Initialize (Animation *animation, const ea::string &startBone, AnimationBlendMode blendMode) |
Initialize static properties of the state and dirty tracks if changed. | |
void | Update (bool looped, float time, float weight) |
Update dynamic properies of the state. | |
void | SetLooped (bool looped) |
void | SetWeight (float weight) |
void | SetTime (float time) |
Animation * | GetAnimation () const |
AnimatedModel * | GetModel () const |
Return connected animated model. | |
const ea::string & | GetStartBone () const |
Return name of start bone. | |
bool | IsEnabled () const |
bool | IsLooped () const |
float | GetWeight () const |
AnimationBlendMode | GetBlendMode () const |
float | GetTime () const |
float | GetLength () const |
void | CalculateModelTracks (ea::vector< ModelAnimationOutput > &output) const |
Calculate animation for the model skeleton. | |
void | CalculateNodeTracks (ea::unordered_map< Node *, NodeAnimationOutput > &output) const |
Apply animation to a scene node hierarchy. | |
void | CalculateAttributeTracks (ea::unordered_map< AnimatedAttributeReference, Variant > &output) const |
Apply animation to attributes. | |
bool | AreTracksDirty () const |
void | MarkTracksDirty () |
void | ClearAllTracks () |
void | AddModelTrack (const ModelAnimationStateTrack &track) |
void | AddNodeTrack (const NodeAnimationStateTrack &track) |
void | AddAttributeTrack (const AttributeAnimationStateTrack &track) |
void | OnTracksReady () |
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. | |
int | AddRef () |
int | ReleaseRef () |
int | Refs () const |
int | WeakRefs () const |
RefCount * | RefCountPtr () const |
Return pointer to the reference count structure. | |
bool | HasScriptObject () const |
Return true if script runtime object wrapping this native object exists. | |
bool | IsScriptStrongRef () const |
Return true if script reference is strong. | |
Private Member Functions | |
void | CalculateTransformTrack (NodeAnimationOutput &output, const AnimationTrack &track, unsigned &frame, float baseWeight) const |
Apply value of transformation track to the output. | |
void | CalculateAttributeTrack (Variant &output, const VariantAnimationTrack &track, unsigned &frame, float baseWeight) const |
Apply single attribute track to target object. Key frame hint is updated on call. | |
Private Attributes | |
WeakPtr< AnimationController > | controller_ |
Owner controller. | |
WeakPtr< AnimatedModel > | model_ |
Connected animated model. | |
SharedPtr< Animation > | animation_ |
Animation. | |
bool | tracksDirty_ { true } |
Whether the animation state tracks are dirty and should be updated. | |
unsigned | animationRevision_ {} |
Revision of Animation object. Used to detect changes in animation. | |
bool | looped_ {} |
float | weight_ {} |
float | time_ {} |
AnimationBlendMode | blendingMode_ {} |
ea::string | startBone_ |
ea::vector< ModelAnimationStateTrack > | modelTracks_ |
ea::vector< NodeAnimationStateTrack > | nodeTracks_ |
ea::vector< AttributeAnimationStateTrack > | attributeTracks_ |
Animation instance.
bool Urho3D::AnimationState::AreTracksDirty | ( | ) | const |
Modify tracks. For internal use only.
|
inline |
Return animation.
|
inline |
Return blending mode.
float Urho3D::AnimationState::GetLength | ( | ) | const |
Return animation length.
|
inline |
Return time position.
|
inline |
Return blending weight.
|
inline |
Return whether weight is nonzero.
|
inline |
Return whether looped.
void Urho3D::AnimationState::SetLooped | ( | bool | looped | ) |
Set looping enabled/disabled.
void Urho3D::AnimationState::SetTime | ( | float | time | ) |
Set time position. Does not fire animation triggers.
void Urho3D::AnimationState::SetWeight | ( | float | weight | ) |
Set blending weight.
|
private |
Dynamic properties of AnimationState.
|
private |
Tracks that are actually applied to the objects.