|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
#include <AnimationStateMachine.hpp>
Public Member Functions | |
| AnimationStateMachine ()=default | |
| ~AnimationStateMachine ()=default | |
| int | AddState (const std::string &name, AnimationClip *clip, bool loop=true, float speed=1.0f) |
| Adds a state bound to clip, returning its index for use in AddTransition. | |
| int | AddTransition (int from, int to, float blendDuration=0.3f, bool waitForClipEnd=false) |
| Adds a transition edge from -> to, returning its index. | |
| void | AddTransitionCondition (int transIndex, const std::string ¶mName, CompareOp op, ParamValue threshold) |
| Appends a guard condition to the transition at transIndex. | |
| const std::string & | GetCurrentStateName () const |
| bool | IsBlending () const |
| void | SetBool (const std::string &name, bool value) |
| void | SetDefaultState (int stateIndex) |
| Sets the state the machine starts in, with no blend. | |
| void | SetFloat (const std::string &name, float value) |
| void | SetInt (const std::string &name, int value) |
| SampleRequest | Update (float deltaTime) |
| Advances playback/blend time, evaluates transitions, and returns what to sample this frame. | |
Graph of animation states and blended transitions, driven by named bool/float/int parameters set from gameplay code.
Definition at line 67 of file AnimationStateMachine.hpp.
|
default |
|
default |
| int Sleak::AnimationStateMachine::AddState | ( | const std::string & | name, |
| AnimationClip * | clip, | ||
| bool | loop = true, | ||
| float | speed = 1.0f ) |
Adds a state bound to clip, returning its index for use in AddTransition.
Definition at line 9 of file AnimationStateMachine.cpp.
| int Sleak::AnimationStateMachine::AddTransition | ( | int | from, |
| int | to, | ||
| float | blendDuration = 0.3f, | ||
| bool | waitForClipEnd = false ) |
Adds a transition edge from -> to, returning its index.
Definition at line 16 of file AnimationStateMachine.cpp.
| void Sleak::AnimationStateMachine::AddTransitionCondition | ( | int | transIndex, |
| const std::string & | paramName, | ||
| CompareOp | op, | ||
| ParamValue | threshold ) |
Appends a guard condition to the transition at transIndex.
Definition at line 28 of file AnimationStateMachine.cpp.
| const std::string & Sleak::AnimationStateMachine::GetCurrentStateName | ( | ) | const |
Definition at line 55 of file AnimationStateMachine.cpp.
|
inline |
Definition at line 96 of file AnimationStateMachine.hpp.
| void Sleak::AnimationStateMachine::SetBool | ( | const std::string & | name, |
| bool | value ) |
Definition at line 43 of file AnimationStateMachine.cpp.
| void Sleak::AnimationStateMachine::SetDefaultState | ( | int | stateIndex | ) |
Sets the state the machine starts in, with no blend.
Definition at line 37 of file AnimationStateMachine.cpp.
| void Sleak::AnimationStateMachine::SetFloat | ( | const std::string & | name, |
| float | value ) |
Definition at line 47 of file AnimationStateMachine.cpp.
| void Sleak::AnimationStateMachine::SetInt | ( | const std::string & | name, |
| int | value ) |
Definition at line 51 of file AnimationStateMachine.cpp.
| SampleRequest Sleak::AnimationStateMachine::Update | ( | float | deltaTime | ) |
Advances playback/blend time, evaluates transitions, and returns what to sample this frame.
Definition at line 62 of file AnimationStateMachine.cpp.