Animation serialization progress

This commit is contained in:
Antoine Pilote
2023-09-06 20:05:10 -04:00
parent 10c92feaa3
commit 1628214370
10 changed files with 170 additions and 26 deletions

View File

@@ -30,11 +30,14 @@ namespace Nuake
}
Ref<SkeletalAnimation> animation = model->GetCurrentAnimation();
float newAnimationTime = animation->GetCurrentTime() + (ts * animation->GetTicksPerSecond());
animation->SetCurrentTime(newAnimationTime);
if (animation && model->IsPlaying)
{
float newAnimationTime = animation->GetCurrentTime() + (ts * animation->GetTicksPerSecond());
animation->SetCurrentTime(newAnimationTime);
auto& rootBone = model->GetSkeletonRootNode();
UpdateBonePositionTraversal(rootBone, animation, animation->GetCurrentTime());
auto& rootBone = model->GetSkeletonRootNode();
UpdateBonePositionTraversal(rootBone, animation, animation->GetCurrentTime());
}
}
}