From f7dd83ce604494550b03a7b3ff09d5e458f01950 Mon Sep 17 00:00:00 2001 From: Silc Renew Date: Sun, 21 Aug 2022 09:30:18 +0900 Subject: Fix Quaternion Tween and implement ease baker --- scene/animation/tween.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'scene/animation') diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index dbc71cd9e7..7d9f83b7a2 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -479,12 +479,8 @@ Variant Tween::interpolate_variant(Variant p_initial_val, Variant p_delta_val, f case Variant::QUATERNION: { Quaternion i = p_initial_val; Quaternion d = p_delta_val; - Quaternion r; - - APPLY_EQUATION(x); - APPLY_EQUATION(y); - APPLY_EQUATION(z); - APPLY_EQUATION(w); + Quaternion r = i * d; + r = i.slerp(r, run_equation(p_trans, p_ease, p_time, 0.0, 1.0, p_duration)); return r; } -- cgit v1.2.3