diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index eb152bc41ebd..ccb0a9aab8c3 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -890,7 +890,6 @@ void AnimationTree::_process_graph(float p_delta) { t->process_pass = process_pass; t->loc = Vector3(); t->rot = Quat(); - t->rot_blend_accum = 0; t->scale = Vector3(1, 1, 1); } @@ -949,25 +948,17 @@ void AnimationTree::_process_graph(float p_delta) { if (t->process_pass != process_pass) { t->process_pass = process_pass; - t->loc = loc; - t->rot = rot; - t->rot_blend_accum = 0; - t->scale = scale; + t->loc = Vector3(); + t->rot = Quat(); + t->scale = Vector3(); } if (err != OK) continue; - t->loc = t->loc.linear_interpolate(loc, blend); - if (t->rot_blend_accum == 0) { - t->rot = rot; - t->rot_blend_accum = blend; - } else { - float rot_total = t->rot_blend_accum + blend; - t->rot = rot.slerp(t->rot, t->rot_blend_accum / rot_total).normalized(); - t->rot_blend_accum = rot_total; - } - t->scale = t->scale.linear_interpolate(scale, blend); + t->loc += loc * blend; + t->rot = (t->rot * Quat().slerp(rot, blend)).normalized(); + t->scale += scale * blend; } } break; diff --git a/scene/animation/animation_tree.h b/scene/animation/animation_tree.h index e22d6e4c2da3..f197ef0cdbff 100644 --- a/scene/animation/animation_tree.h +++ b/scene/animation/animation_tree.h @@ -198,7 +198,6 @@ class AnimationTree : public Node { int bone_idx; Vector3 loc; Quat rot; - float rot_blend_accum; Vector3 scale; TrackCacheTransform() {