Fix Quaternion error tolerance to be more reasonable due to math optimization enabled in compiler

This commit is contained in:
Wojtek Figat
2024-10-14 22:16:08 +02:00
parent b38af8fd00
commit a6f1dbbf32

View File

@@ -19,7 +19,7 @@ API_STRUCT() struct FLAXENGINE_API Quaternion
/// <summary> /// <summary>
/// Equality tolerance factor used when comparing quaternions via dot operation. /// Equality tolerance factor used when comparing quaternions via dot operation.
/// </summary> /// </summary>
API_FIELD() static constexpr Real Tolerance = 0.9999999f; API_FIELD() static constexpr Real Tolerance = 0.999999f;
public: public:
union union
@@ -358,7 +358,7 @@ public:
/// <returns><c>true</c> if the specified <see cref="Quaternion" /> isn't equal to this instance; otherwise, <c>false</c>.</returns> /// <returns><c>true</c> if the specified <see cref="Quaternion" /> isn't equal to this instance; otherwise, <c>false</c>.</returns>
FORCE_INLINE bool operator!=(const Quaternion& other) const FORCE_INLINE bool operator!=(const Quaternion& other) const
{ {
return !(*this == other); return Dot(*this, other) < Tolerance;
} }
public: public: