From 7c9c6df7e48ffbe63c402b20f60ba369b34f4e98 Mon Sep 17 00:00:00 2001 From: Paul Trojahn Date: Thu, 15 Aug 2019 18:13:35 +0200 Subject: Replace is_zero_approx(A.distance_to(B)) with A==B Related to #22988 (Fixes the holes in the shape of the first comment) --- scene/resources/animation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scene/resources') diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 8c8552ac54..985b38f913 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -2870,9 +2870,9 @@ bool Animation::_transform_track_optimize_key(const TKey &t0, cons const Vector3 &v1 = t1.value.loc; const Vector3 &v2 = t2.value.loc; - if (Math::is_zero_approx(v0.distance_to(v2))) { + if (v0 == v2) { //0 and 2 are close, let's see if 1 is close - if (!Math::is_zero_approx(v0.distance_to(v1))) { + if (v0 != v1) { //not close, not optimizable return false; } @@ -2959,9 +2959,9 @@ bool Animation::_transform_track_optimize_key(const TKey &t0, cons const Vector3 &v1 = t1.value.scale; const Vector3 &v2 = t2.value.scale; - if (Math::is_zero_approx(v0.distance_to(v2))) { + if (v0 == v2) { //0 and 2 are close, let's see if 1 is close - if (!Math::is_zero_approx(v0.distance_to(v1))) { + if (v0 != v1) { //not close, not optimizable return false; } -- cgit v1.2.3