|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
#include <AnimatorComponent.hpp>
Public Member Functions | |
| AnimatorComponent (GameObject *owner, Skeleton *skeleton, std::vector< AnimationClip * > clips) | |
| virtual | ~AnimatorComponent () |
| void | AddClip (AnimationClip *clip) |
| AnimationStateMachine * | CreateStateMachine () |
| Replaces any existing state machine with a fresh, empty one. | |
| RefPtr< RenderEngine::BufferBase > | GetBoneBuffer () const |
| const std::vector< AnimationClip * > & | GetClips () const |
| const std::string & | GetCurrentClipName () const |
| float | GetCurrentTime () const |
| Skeleton * | GetSkeleton () const |
| float | GetSpeed () const |
| AnimationStateMachine * | GetStateMachine () const |
| virtual bool | Initialize () override |
| Allocates the bone constant buffer and attaches it to the sibling MeshComponent. | |
| bool | IsPlaying () const |
| void | Pause () |
| void | Play (const std::string &clipName, bool loop=true) |
| Switches to the clip by name, restarting from time zero. | |
| void | Play (int clipIndex, bool loop=true) |
| Switches to the clip by index, restarting from time zero. | |
| void | Resume () |
| void | SetSpeed (float speed) |
| void | Stop () |
| virtual void | Update (float deltaTime) override |
| Samples the active state machine or clip and pushes the resulting bone matrices to the GPU. | |
| Public Member Functions inherited from Sleak::Component | |
| Component (GameObject *object) | |
| virtual | ~Component ()=default |
| virtual void | FixedUpdate (float fixedDeltaTime) |
| GameObject * | GetOwner () |
| virtual void | LateUpdate (float deltaTime) |
| virtual void | OnDestroy () |
| Called when the component is detached or the owner is destroyed. | |
| virtual void | OnDisable () |
| virtual void | OnEnable () |
| Public Member Functions inherited from Sleak::Object | |
| Object (const std::string &name="Object") | |
| virtual | ~Object ()=default |
| const std::string & | GetName () const |
| uint64_t | GetUniqueID () const |
| void | SetName (const std::string &value) |
Additional Inherited Members | |
| Protected Attributes inherited from Sleak::Component | |
| bool | bIsInitialized |
| GameObject * | owner |
Samples a skeleton's bones from clips or a state machine and uploads the result to the sibling MeshComponent's bone buffer each frame.
Definition at line 23 of file AnimatorComponent.hpp.
| Sleak::AnimatorComponent::AnimatorComponent | ( | GameObject * | owner, |
| Skeleton * | skeleton, | ||
| std::vector< AnimationClip * > | clips ) |
Definition at line 12 of file AnimatorComponent.cpp.
|
virtual |
Definition at line 17 of file AnimatorComponent.cpp.
| void Sleak::AnimatorComponent::AddClip | ( | AnimationClip * | clip | ) |
Definition at line 114 of file AnimatorComponent.cpp.
| AnimationStateMachine * Sleak::AnimatorComponent::CreateStateMachine | ( | ) |
Replaces any existing state machine with a fresh, empty one.
Definition at line 108 of file AnimatorComponent.cpp.
| RefPtr< RenderEngine::BufferBase > Sleak::AnimatorComponent::GetBoneBuffer | ( | ) | const |
Definition at line 372 of file AnimatorComponent.cpp.
|
inline |
Definition at line 56 of file AnimatorComponent.hpp.
| const std::string & Sleak::AnimatorComponent::GetCurrentClipName | ( | ) | const |
Definition at line 365 of file AnimatorComponent.cpp.
| float Sleak::AnimatorComponent::GetCurrentTime | ( | ) | const |
Definition at line 361 of file AnimatorComponent.cpp.
|
inline |
Definition at line 55 of file AnimatorComponent.hpp.
| float Sleak::AnimatorComponent::GetSpeed | ( | ) | const |
Definition at line 353 of file AnimatorComponent.cpp.
|
inline |
Definition at line 51 of file AnimatorComponent.hpp.
|
overridevirtual |
Allocates the bone constant buffer and attaches it to the sibling MeshComponent.
Implements Sleak::Component.
Definition at line 21 of file AnimatorComponent.cpp.
| bool Sleak::AnimatorComponent::IsPlaying | ( | ) | const |
Definition at line 357 of file AnimatorComponent.cpp.
| void Sleak::AnimatorComponent::Pause | ( | ) |
Definition at line 340 of file AnimatorComponent.cpp.
| void Sleak::AnimatorComponent::Play | ( | const std::string & | clipName, |
| bool | loop = true ) |
Switches to the clip by name, restarting from time zero.
Definition at line 314 of file AnimatorComponent.cpp.
| void Sleak::AnimatorComponent::Play | ( | int | clipIndex, |
| bool | loop = true ) |
Switches to the clip by index, restarting from time zero.
Definition at line 324 of file AnimatorComponent.cpp.
| void Sleak::AnimatorComponent::Resume | ( | ) |
Definition at line 344 of file AnimatorComponent.cpp.
| void Sleak::AnimatorComponent::SetSpeed | ( | float | speed | ) |
Definition at line 349 of file AnimatorComponent.cpp.
| void Sleak::AnimatorComponent::Stop | ( | ) |
Definition at line 335 of file AnimatorComponent.cpp.
|
overridevirtual |
Samples the active state machine or clip and pushes the resulting bone matrices to the GPU.
Implements Sleak::Component.
Definition at line 57 of file AnimatorComponent.cpp.