From a6f1dbbf32671fd3f4a896c4f2be87d88fd5b827 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 14 Oct 2024 22:16:08 +0200 Subject: [PATCH] Fix `Quaternion` error tolerance to be more reasonable due to math optimization enabled in compiler --- Source/Engine/Core/Math/Quaternion.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Core/Math/Quaternion.h b/Source/Engine/Core/Math/Quaternion.h index 1dbcda32d..cadc6730b 100644 --- a/Source/Engine/Core/Math/Quaternion.h +++ b/Source/Engine/Core/Math/Quaternion.h @@ -19,7 +19,7 @@ API_STRUCT() struct FLAXENGINE_API Quaternion /// /// Equality tolerance factor used when comparing quaternions via dot operation. /// - API_FIELD() static constexpr Real Tolerance = 0.9999999f; + API_FIELD() static constexpr Real Tolerance = 0.999999f; public: union @@ -358,7 +358,7 @@ public: /// true if the specified isn't equal to this instance; otherwise, false. FORCE_INLINE bool operator!=(const Quaternion& other) const { - return !(*this == other); + return Dot(*this, other) < Tolerance; } public: