diff --git a/Source/Engine/Core/Math/Double2.cs b/Source/Engine/Core/Math/Double2.cs index 825582ceb..20a8094f6 100644 --- a/Source/Engine/Core/Math/Double2.cs +++ b/Source/Engine/Core/Math/Double2.cs @@ -268,7 +268,7 @@ namespace FlaxEngine public void Normalize() { double length = Length; - if (!Mathd.IsZero(length)) + if (length >= Mathd.Epsilon) { double inv = 1.0 / length; X *= inv; diff --git a/Source/Engine/Core/Math/Double3.cs b/Source/Engine/Core/Math/Double3.cs index d38320254..85360f0ff 100644 --- a/Source/Engine/Core/Math/Double3.cs +++ b/Source/Engine/Core/Math/Double3.cs @@ -345,7 +345,7 @@ namespace FlaxEngine public void Normalize() { double length = Length; - if (!Mathd.IsZero(length)) + if (length >= Mathd.Epsilon) { double inv = 1.0 / length; X *= inv; diff --git a/Source/Engine/Core/Math/Double4.cs b/Source/Engine/Core/Math/Double4.cs index 774b3b5ed..bf69f2c72 100644 --- a/Source/Engine/Core/Math/Double4.cs +++ b/Source/Engine/Core/Math/Double4.cs @@ -322,7 +322,7 @@ namespace FlaxEngine public void Normalize() { double length = Length; - if (!Mathd.IsZero(length)) + if (length >= Mathd.Epsilon) { double inverse = 1.0 / length; X *= inverse; diff --git a/Source/Engine/Core/Math/Float2.cs b/Source/Engine/Core/Math/Float2.cs index 15f412d6e..a53fddd34 100644 --- a/Source/Engine/Core/Math/Float2.cs +++ b/Source/Engine/Core/Math/Float2.cs @@ -286,7 +286,7 @@ namespace FlaxEngine public void Normalize() { float length = Length; - if (!Mathf.IsZero(length)) + if (length >= Mathf.Epsilon) { float inv = 1.0f / length; X *= inv; diff --git a/Source/Engine/Core/Math/Float3.cs b/Source/Engine/Core/Math/Float3.cs index e0ef9b1da..9ea922c2b 100644 --- a/Source/Engine/Core/Math/Float3.cs +++ b/Source/Engine/Core/Math/Float3.cs @@ -339,7 +339,7 @@ namespace FlaxEngine public void Normalize() { float length = Length; - if (!Mathf.IsZero(length)) + if (length >= Mathf.Epsilon) { float inv = 1.0f / length; X *= inv; diff --git a/Source/Engine/Core/Math/Float4.cs b/Source/Engine/Core/Math/Float4.cs index 1504a9e03..eb10e5db4 100644 --- a/Source/Engine/Core/Math/Float4.cs +++ b/Source/Engine/Core/Math/Float4.cs @@ -304,7 +304,7 @@ namespace FlaxEngine public void Normalize() { float length = Length; - if (!Mathf.IsZero(length)) + if (length >= Mathf.Epsilon) { float inverse = 1.0f / length; X *= inverse; diff --git a/Source/Engine/Core/Math/Plane.cs b/Source/Engine/Core/Math/Plane.cs index 66d6a7376..1da997cab 100644 --- a/Source/Engine/Core/Math/Plane.cs +++ b/Source/Engine/Core/Math/Plane.cs @@ -2,8 +2,10 @@ #if USE_LARGE_WORLDS using Real = System.Double; +using Mathr = FlaxEngine.Mathd; #else using Real = System.Single; +using Mathr = FlaxEngine.Mathf; #endif // ----------------------------------------------------------------------------- @@ -175,7 +177,7 @@ namespace FlaxEngine public void Normalize() { Real length = Normal.Length; - if (!Mathf.IsZero(length)) + if (length >= Mathr.Epsilon) { Real rcp = 1.0f / length; Normal.X *= rcp; diff --git a/Source/Engine/Core/Math/Quaternion.cs b/Source/Engine/Core/Math/Quaternion.cs index 30cc39208..5fccd5941 100644 --- a/Source/Engine/Core/Math/Quaternion.cs +++ b/Source/Engine/Core/Math/Quaternion.cs @@ -336,7 +336,7 @@ namespace FlaxEngine public void Normalize() { float length = Length; - if (!Mathf.IsZero(length)) + if (length >= Mathf.Epsilon) { float inverse = 1.0f / length; X *= inverse; diff --git a/Source/Engine/Core/Math/Vector2.cs b/Source/Engine/Core/Math/Vector2.cs index cd1849383..ea84628b2 100644 --- a/Source/Engine/Core/Math/Vector2.cs +++ b/Source/Engine/Core/Math/Vector2.cs @@ -2,8 +2,10 @@ #if USE_LARGE_WORLDS using Real = System.Double; +using Mathr = FlaxEngine.Mathd; #else using Real = System.Single; +using Mathr = FlaxEngine.Mathf; #endif // ----------------------------------------------------------------------------- @@ -203,22 +205,22 @@ namespace FlaxEngine /// /// Gets a value indicting whether this instance is normalized. /// - public bool IsNormalized => Mathf.IsOne(X * X + Y * Y); + public bool IsNormalized => Mathr.IsOne(X * X + Y * Y); /// /// Gets a value indicting whether this vector is zero /// - public bool IsZero => Mathf.IsZero(X) && Mathf.IsZero(Y); + public bool IsZero => Mathr.IsZero(X) && Mathr.IsZero(Y); /// /// Gets a minimum component value /// - public Real MinValue => Mathf.Min(X, Y); + public Real MinValue => Mathr.Min(X, Y); /// /// Gets a maximum component value /// - public Real MaxValue => Mathf.Max(X, Y); + public Real MaxValue => Mathr.Max(X, Y); /// /// Gets an arithmetic average value of all vector components. @@ -233,7 +235,7 @@ namespace FlaxEngine /// /// Gets a vector with values being absolute values of that vector. /// - public Vector2 Absolute => new Vector2(Mathf.Abs(X), Mathf.Abs(Y)); + public Vector2 Absolute => new Vector2(Mathr.Abs(X), Mathr.Abs(Y)); /// /// Gets a vector with values being opposite to values of that vector. @@ -292,8 +294,8 @@ namespace FlaxEngine /// public void Normalize() { - Real length = Length; - if (!Mathf.IsZero(length)) + Real length = (Real)Math.Sqrt(X * X + Y * Y); + if (length >= Mathr.Epsilon) { Real inv = 1.0f / length; X *= inv; @@ -904,8 +906,8 @@ namespace FlaxEngine /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. public static void Lerp(ref Vector2 start, ref Vector2 end, float amount, out Vector2 result) { - result.X = Mathf.Lerp(start.X, end.X, amount); - result.Y = Mathf.Lerp(start.Y, end.Y, amount); + result.X = Mathr.Lerp(start.X, end.X, amount); + result.Y = Mathr.Lerp(start.Y, end.Y, amount); } /// @@ -932,8 +934,8 @@ namespace FlaxEngine /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. public static void Lerp(ref Vector2 start, ref Vector2 end, ref Vector2 amount, out Vector2 result) { - result.X = Mathf.Lerp(start.X, end.X, amount.X); - result.Y = Mathf.Lerp(start.Y, end.Y, amount.Y); + result.X = Mathr.Lerp(start.X, end.X, amount.X); + result.Y = Mathr.Lerp(start.Y, end.Y, amount.Y); } /// @@ -959,7 +961,7 @@ namespace FlaxEngine /// When the method completes, contains the cubic interpolation of the two vectors. public static void SmoothStep(ref Vector2 start, ref Vector2 end, float amount, out Vector2 result) { - amount = Mathf.SmoothStep(amount); + amount = Mathr.SmoothStep(amount); Lerp(ref start, ref end, amount, out result); } @@ -1552,7 +1554,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Vector2 left, Vector2 right) { - return Mathf.NearEqual(left.X, right.X) && Mathf.NearEqual(left.Y, right.Y); + return Mathr.NearEqual(left.X, right.X) && Mathr.NearEqual(left.Y, right.Y); } /// @@ -1564,7 +1566,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(Vector2 left, Vector2 right) { - return !Mathf.NearEqual(left.X, right.X) || !Mathf.NearEqual(left.Y, right.Y); + return !Mathr.NearEqual(left.X, right.X) || !Mathr.NearEqual(left.Y, right.Y); } /// @@ -1670,7 +1672,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Equals(ref Vector2 other) { - return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y); + return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y); } /// @@ -1678,7 +1680,7 @@ namespace FlaxEngine /// public static bool Equals(ref Vector2 a, ref Vector2 b) { - return Mathf.NearEqual(a.X, b.X) && Mathf.NearEqual(a.Y, b.Y); + return Mathr.NearEqual(a.X, b.X) && Mathr.NearEqual(a.Y, b.Y); } /// @@ -1689,7 +1691,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Equals(Vector2 other) { - return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y); + return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y); } /// @@ -1699,7 +1701,7 @@ namespace FlaxEngine /// true if the specified is equal to this instance; otherwise, false. public override bool Equals(object value) { - return value is Vector2 other && Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y); + return value is Vector2 other && Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y); } } } diff --git a/Source/Engine/Core/Math/Vector2.h b/Source/Engine/Core/Math/Vector2.h index cff32539d..87ced1de6 100644 --- a/Source/Engine/Core/Math/Vector2.h +++ b/Source/Engine/Core/Math/Vector2.h @@ -240,9 +240,9 @@ public: void Normalize() { const T length = Math::Sqrt(X * X + Y * Y); - if (!Math::IsZero(length)) + if (length >= ZeroTolerance) { - const T invLength = 1.0f / length; + const T invLength = (T)1.0f / length; X *= invLength; Y *= invLength; } @@ -547,9 +547,9 @@ public: { Vector2Base r = v; const T length = Math::Sqrt(r.X * r.X + r.Y * r.Y); - if (Math::Abs(length) >= ZeroTolerance) + if (length >= ZeroTolerance) { - const T inv = 1.0f / length; + const T inv = (T)1.0f / length; r.X *= inv; r.Y *= inv; } diff --git a/Source/Engine/Core/Math/Vector3.cs b/Source/Engine/Core/Math/Vector3.cs index 3c318117f..07798e9a6 100644 --- a/Source/Engine/Core/Math/Vector3.cs +++ b/Source/Engine/Core/Math/Vector3.cs @@ -2,8 +2,10 @@ #if USE_LARGE_WORLDS using Real = System.Double; +using Mathr = FlaxEngine.Mathd; #else using Real = System.Single; +using Mathr = FlaxEngine.Mathf; #endif // ----------------------------------------------------------------------------- @@ -252,7 +254,7 @@ namespace FlaxEngine /// /// Gets a value indicting whether this instance is normalized. /// - public bool IsNormalized => Mathf.IsOne(X * X + Y * Y + Z * Z); + public bool IsNormalized => Mathr.IsOne(X * X + Y * Y + Z * Z); /// /// Gets the normalized vector. Returned vector has length equal 1. @@ -270,22 +272,22 @@ namespace FlaxEngine /// /// Gets a value indicting whether this vector is zero /// - public bool IsZero => Mathf.IsZero(X) && Mathf.IsZero(Y) && Mathf.IsZero(Z); + public bool IsZero => Mathr.IsZero(X) && Mathr.IsZero(Y) && Mathr.IsZero(Z); /// /// Gets a value indicting whether this vector is one /// - public bool IsOne => Mathf.IsOne(X) && Mathf.IsOne(Y) && Mathf.IsOne(Z); + public bool IsOne => Mathr.IsOne(X) && Mathr.IsOne(Y) && Mathr.IsOne(Z); /// /// Gets a minimum component value /// - public Real MinValue => Mathf.Min(X, Mathf.Min(Y, Z)); + public Real MinValue => Mathr.Min(X, Mathr.Min(Y, Z)); /// /// Gets a maximum component value /// - public Real MaxValue => Mathf.Max(X, Mathf.Max(Y, Z)); + public Real MaxValue => Mathr.Max(X, Mathr.Max(Y, Z)); /// /// Gets an arithmetic average value of all vector components. @@ -300,7 +302,7 @@ namespace FlaxEngine /// /// Gets a vector with values being absolute values of that vector. /// - public Vector3 Absolute => new Vector3(Mathf.Abs(X), Mathf.Abs(Y), Mathf.Abs(Z)); + public Vector3 Absolute => new Vector3(Mathr.Abs(X), Mathr.Abs(Y), Mathr.Abs(Z)); /// /// Gets a vector with values being opposite to values of that vector. @@ -363,8 +365,8 @@ namespace FlaxEngine /// public void Normalize() { - Real length = Length; - if (!Mathf.IsZero(length)) + Real length = (Real)Math.Sqrt(X * X + Y * Y + Z * Z); + if (length >= Mathr.Epsilon) { Real inv = 1.0f / length; X *= inv; @@ -1020,9 +1022,9 @@ namespace FlaxEngine /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. public static void Lerp(ref Vector3 start, ref Vector3 end, float amount, out Vector3 result) { - result.X = Mathf.Lerp(start.X, end.X, amount); - result.Y = Mathf.Lerp(start.Y, end.Y, amount); - result.Z = Mathf.Lerp(start.Z, end.Z, amount); + result.X = Mathr.Lerp(start.X, end.X, amount); + result.Y = Mathr.Lerp(start.Y, end.Y, amount); + result.Z = Mathr.Lerp(start.Z, end.Z, amount); } /// @@ -1048,7 +1050,7 @@ namespace FlaxEngine /// When the method completes, contains the cubic interpolation of the two vectors. public static void SmoothStep(ref Vector3 start, ref Vector3 end, float amount, out Vector3 result) { - amount = Mathf.SmoothStep(amount); + amount = Mathr.SmoothStep(amount); Lerp(ref start, ref end, amount, out result); } @@ -1210,7 +1212,7 @@ namespace FlaxEngine public static Vector3 Project(Vector3 vector, Vector3 onNormal) { Real sqrMag = Dot(onNormal, onNormal); - if (sqrMag < Mathf.Epsilon) + if (sqrMag < Mathr.Epsilon) return Zero; return onNormal * Dot(vector, onNormal) / sqrMag; } @@ -1234,10 +1236,10 @@ namespace FlaxEngine /// The angle (in degrees). public static Real Angle(Vector3 from, Vector3 to) { - Real dot = Mathf.Clamp(Dot(from.Normalized, to.Normalized), -1.0f, 1.0f); - if (Mathf.Abs(dot) > (1.0f - Mathf.Epsilon)) + Real dot = Mathr.Clamp(Dot(from.Normalized, to.Normalized), -1.0f, 1.0f); + if (Mathr.Abs(dot) > (1.0f - Mathr.Epsilon)) return dot > 0.0f ? 0.0f : 180.0f; - return (Real)Math.Acos(dot) * Mathf.RadiansToDegrees; + return (Real)Math.Acos(dot) * Mathr.RadiansToDegrees; } /// @@ -1825,7 +1827,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Vector3 left, Vector3 right) { - return Mathf.NearEqual(left.X, right.X) && Mathf.NearEqual(left.Y, right.Y) && Mathf.NearEqual(left.Z, right.Z); + return Mathr.NearEqual(left.X, right.X) && Mathr.NearEqual(left.Y, right.Y) && Mathr.NearEqual(left.Z, right.Z); } /// @@ -1837,7 +1839,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(Vector3 left, Vector3 right) { - return !Mathf.NearEqual(left.X, right.X) || !Mathf.NearEqual(left.Y, right.Y) || !Mathf.NearEqual(left.Z, right.Z); + return !Mathr.NearEqual(left.X, right.X) || !Mathr.NearEqual(left.Y, right.Y) || !Mathr.NearEqual(left.Z, right.Z); } /// @@ -1946,7 +1948,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Equals(ref Vector3 other) { - return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z); + return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z); } /// @@ -1957,7 +1959,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Equals(Vector3 other) { - return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z); + return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z); } /// @@ -1967,7 +1969,7 @@ namespace FlaxEngine /// true if the specified is equal to this instance; otherwise, false. public override bool Equals(object value) { - return value is Vector3 other && Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z); + return value is Vector3 other && Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z); } } } diff --git a/Source/Engine/Core/Math/Vector3.h b/Source/Engine/Core/Math/Vector3.h index 590c3adb0..33be7f2d6 100644 --- a/Source/Engine/Core/Math/Vector3.h +++ b/Source/Engine/Core/Math/Vector3.h @@ -266,9 +266,9 @@ public: void Normalize() { const T length = Math::Sqrt(X * X + Y * Y + Z * Z); - if (Math::Abs(length) >= ZeroTolerance) + if (length >= ZeroTolerance) { - const T inv = 1.0f / length; + const T inv = (T)1.0f / length; X *= inv; Y *= inv; Z *= inv; @@ -645,9 +645,9 @@ public: { Vector3Base r = v; const T length = Math::Sqrt(r.X * r.X + r.Y * r.Y + r.Z * r.Z); - if (Math::Abs(length) >= ZeroTolerance) + if (length >= ZeroTolerance) { - const T inv = 1.0f / length; + const T inv = (T)1.0f / length; r.X *= inv; r.Y *= inv; r.Z *= inv; diff --git a/Source/Engine/Core/Math/Vector4.cs b/Source/Engine/Core/Math/Vector4.cs index 738fcfffb..8c83e5d3e 100644 --- a/Source/Engine/Core/Math/Vector4.cs +++ b/Source/Engine/Core/Math/Vector4.cs @@ -2,8 +2,10 @@ #if USE_LARGE_WORLDS using Real = System.Double; +using Mathr = FlaxEngine.Mathd; #else using Real = System.Single; +using Mathr = FlaxEngine.Mathf; #endif // ----------------------------------------------------------------------------- @@ -255,27 +257,27 @@ namespace FlaxEngine /// /// Gets a value indicting whether this instance is normalized. /// - public bool IsNormalized => Mathf.IsOne(X * X + Y * Y + Z * Z + W * W); + public bool IsNormalized => Mathr.IsOne(X * X + Y * Y + Z * Z + W * W); /// /// Gets a value indicting whether this vector is zero /// - public bool IsZero => Mathf.IsZero(X) && Mathf.IsZero(Y) && Mathf.IsZero(Z) && Mathf.IsZero(W); + public bool IsZero => Mathr.IsZero(X) && Mathr.IsZero(Y) && Mathr.IsZero(Z) && Mathr.IsZero(W); /// /// Gets a value indicting whether this vector is one /// - public bool IsOne => Mathf.IsOne(X) && Mathf.IsOne(Y) && Mathf.IsOne(Z) && Mathf.IsOne(W); + public bool IsOne => Mathr.IsOne(X) && Mathr.IsOne(Y) && Mathr.IsOne(Z) && Mathr.IsOne(W); /// /// Gets a minimum component value /// - public Real MinValue => Mathf.Min(X, Mathf.Min(Y, Mathf.Min(Z, W))); + public Real MinValue => Mathr.Min(X, Mathr.Min(Y, Mathr.Min(Z, W))); /// /// Gets a maximum component value /// - public Real MaxValue => Mathf.Max(X, Mathf.Max(Y, Mathf.Max(Z, W))); + public Real MaxValue => Mathr.Max(X, Mathr.Max(Y, Mathr.Max(Z, W))); /// /// Gets an arithmetic average value of all vector components. @@ -290,7 +292,7 @@ namespace FlaxEngine /// /// Gets a vector with values being absolute values of that vector. /// - public Vector4 Absolute => new Vector4(Mathf.Abs(X), Mathf.Abs(Y), Mathf.Abs(Z), Mathf.Abs(W)); + public Vector4 Absolute => new Vector4(Mathr.Abs(X), Mathr.Abs(Y), Mathr.Abs(Z), Mathr.Abs(W)); /// /// Gets a vector with values being opposite to values of that vector. @@ -357,8 +359,8 @@ namespace FlaxEngine /// public void Normalize() { - Real length = Length; - if (!Mathf.IsZero(length)) + Real length = (Real)Math.Sqrt(X * X + Y * Y + Z * Z + W * W); + if (length >= Mathr.Epsilon) { Real inverse = 1.0f / length; X *= inverse; @@ -855,10 +857,10 @@ namespace FlaxEngine /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. public static void Lerp(ref Vector4 start, ref Vector4 end, Real amount, out Vector4 result) { - result.X = Mathf.Lerp(start.X, end.X, amount); - result.Y = Mathf.Lerp(start.Y, end.Y, amount); - result.Z = Mathf.Lerp(start.Z, end.Z, amount); - result.W = Mathf.Lerp(start.W, end.W, amount); + result.X = Mathr.Lerp(start.X, end.X, amount); + result.Y = Mathr.Lerp(start.Y, end.Y, amount); + result.Z = Mathr.Lerp(start.Z, end.Z, amount); + result.W = Mathr.Lerp(start.W, end.W, amount); } /// @@ -884,7 +886,7 @@ namespace FlaxEngine /// When the method completes, contains the cubic interpolation of the two vectors. public static void SmoothStep(ref Vector4 start, ref Vector4 end, Real amount, out Vector4 result) { - amount = Mathf.SmoothStep(amount); + amount = Mathr.SmoothStep(amount); Lerp(ref start, ref end, amount, out result); } @@ -1359,7 +1361,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Vector4 left, Vector4 right) { - return Mathf.NearEqual(left.X, right.X) && Mathf.NearEqual(left.Y, right.Y) && Mathf.NearEqual(left.Z, right.Z) && Mathf.NearEqual(left.W, right.W); + return Mathr.NearEqual(left.X, right.X) && Mathr.NearEqual(left.Y, right.Y) && Mathr.NearEqual(left.Z, right.Z) && Mathr.NearEqual(left.W, right.W); } /// @@ -1480,7 +1482,7 @@ namespace FlaxEngine /// true if the specified is equal to this instance; otherwise, false. public bool Equals(ref Vector4 other) { - return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z) && Mathf.NearEqual(other.W, W); + return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z) && Mathr.NearEqual(other.W, W); } /// @@ -1491,7 +1493,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Equals(Vector4 other) { - return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z) && Mathf.NearEqual(other.W, W); + return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z) && Mathr.NearEqual(other.W, W); } /// @@ -1501,7 +1503,7 @@ namespace FlaxEngine /// true if the specified is equal to this instance; otherwise, false. public override bool Equals(object value) { - return value is Vector4 other && Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z) && Mathf.NearEqual(other.W, W); + return value is Vector4 other && Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z) && Mathr.NearEqual(other.W, W); } } }