Added Animator events and fixed Animator pause bug #418

Merged
Pycorax merged 3 commits from SP3-22-AnimationController into main 2023-03-10 19:07:37 +08:00
1 changed files with 6 additions and 2 deletions
Showing only changes of commit d1e1a2e31c - Show all commits

View File

@ -124,9 +124,13 @@ namespace SHADE
std::fill(boneMatrices.begin(), boneMatrices.end(), SHMatrix::Identity);
// Do not do anything if is not playing or there's nothing to animate
if (!isPlaying || !rig || !rig->GetRootNode())
if (!rig || !rig->GetRootNode())
return;
// We want to still display a paused pose, so we only prevent progression
if (!isPlaying)
dt = 0.0f;
// Update the animation controller if any, this will set the currClip
if (animController)
{
@ -270,7 +274,7 @@ namespace SHADE
void SHAnimatorComponent::updateCurrentAnimatorState(Handle<SHAnimationClip> clip, float playbackTime)
{
// Nothing to animate
if (!clip || !isPlaying || !rig || !rig->GetRootNode())
if (!clip || !rig || !rig->GetRootNode())
return;
// Check that we have animation data