Use float.Equals in equality checks to handle NaN cases
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
This commit is contained in:
@@ -678,7 +678,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in BoundingBox other)
|
||||
{
|
||||
return Minimum == other.Minimum && Maximum == other.Maximum;
|
||||
return Minimum.Equals(other.Minimum) && Maximum.Equals(other.Maximum);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in BoundingFrustum other)
|
||||
{
|
||||
return pMatrix == other.pMatrix;
|
||||
return pMatrix.Equals(other.pMatrix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -492,7 +492,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in BoundingSphere other)
|
||||
{
|
||||
return Center == other.Center && Radius == other.Radius;
|
||||
return Center.Equals(other.Center) && Radius.Equals(other.Radius);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Color other)
|
||||
{
|
||||
return R == other.R && G == other.G && B == other.B && A == other.A;
|
||||
return R.Equals(other.R) && G.Equals(other.G) && B.Equals(other.B) && A.Equals(other.A);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -1582,7 +1582,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Double2 other)
|
||||
{
|
||||
return X == other.X && Y == other.Y;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1880,7 +1880,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Double3 other)
|
||||
{
|
||||
return X == other.X && Y == other.Y && Z == other.Z;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1379,7 +1379,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="Double4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public bool Equals(in Double4 other)
|
||||
{
|
||||
return X == other.X && Y == other.Y && Z == other.Z && W == other.W;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z) && W.Equals(other.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1658,7 +1658,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Float2 other)
|
||||
{
|
||||
return X == other.X && Y == other.Y;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1912,7 +1912,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Float3 other)
|
||||
{
|
||||
return X == other.X && Y == other.Y && Z == other.Z;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1419,7 +1419,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="Float4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public bool Equals(in Float4 other)
|
||||
{
|
||||
return X == other.X && Y == other.Y && Z == other.Z && W == other.W;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z) && W.Equals(other.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace FlaxEngine
|
||||
/// <param name="value"></param>
|
||||
public static double InverseLerp(double a, double b, double value)
|
||||
{
|
||||
if (a == b)
|
||||
if (a.Equals(b))
|
||||
return 0d;
|
||||
return Saturate((value - a) / (b - a));
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace FlaxEngine
|
||||
/// <param name="value"></param>
|
||||
public static float InverseLerp(float a, float b, float value)
|
||||
{
|
||||
if (a == b)
|
||||
if (a.Equals(b))
|
||||
return 0f;
|
||||
return Saturate((value - a) / (b - a));
|
||||
}
|
||||
|
||||
@@ -3236,22 +3236,22 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="Matrix" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public bool Equals(in Matrix other)
|
||||
{
|
||||
return other.M11 == M11 &&
|
||||
other.M12 == M12 &&
|
||||
other.M13 == M13 &&
|
||||
other.M14 == M14 &&
|
||||
other.M21 == M21 &&
|
||||
other.M22 == M22 &&
|
||||
other.M23 == M23 &&
|
||||
other.M24 == M24 &&
|
||||
other.M31 == M31 &&
|
||||
other.M32 == M32 &&
|
||||
other.M33 == M33 &&
|
||||
other.M34 == M34 &&
|
||||
other.M41 == M41 &&
|
||||
other.M42 == M42 &&
|
||||
other.M43 == M43 &&
|
||||
other.M44 == M44;
|
||||
return other.M11.Equals(M11) &&
|
||||
other.M12.Equals(M12) &&
|
||||
other.M13.Equals(M13) &&
|
||||
other.M14.Equals(M14) &&
|
||||
other.M21.Equals(M21) &&
|
||||
other.M22.Equals(M22) &&
|
||||
other.M23.Equals(M23) &&
|
||||
other.M24.Equals(M24) &&
|
||||
other.M31.Equals(M31) &&
|
||||
other.M32.Equals(M32) &&
|
||||
other.M33.Equals(M33) &&
|
||||
other.M34.Equals(M34) &&
|
||||
other.M41.Equals(M41) &&
|
||||
other.M42.Equals(M42) &&
|
||||
other.M43.Equals(M43) &&
|
||||
other.M44.Equals(M44);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -483,7 +483,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="Matrix2x2"/> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public bool Equals(in Matrix2x2 other)
|
||||
{
|
||||
return M11 == other.M11 && M12 == other.M12 && M21 == other.M21 && M22 == other.M22;
|
||||
return M11.Equals(other.M11) && M12.Equals(other.M12) && M21.Equals(other.M21) && M22.Equals(other.M22);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2125,15 +2125,15 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="Matrix3x3"/> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public bool Equals(in Matrix3x3 other)
|
||||
{
|
||||
return M11 == other.M11 &&
|
||||
M12 == other.M12 &&
|
||||
M13 == other.M13 &&
|
||||
M21 == other.M21 &&
|
||||
M22 == other.M22 &&
|
||||
M23 == other.M23 &&
|
||||
M31 == other.M31 &&
|
||||
M32 == other.M32 &&
|
||||
M33 == other.M33;
|
||||
return M11.Equals(other.M11) &&
|
||||
M12.Equals(other.M12) &&
|
||||
M13.Equals(other.M13) &&
|
||||
M21.Equals(other.M21) &&
|
||||
M22.Equals(other.M22) &&
|
||||
M23.Equals(other.M23) &&
|
||||
M31.Equals(other.M31) &&
|
||||
M32.Equals(other.M32) &&
|
||||
M33.Equals(other.M33);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in OrientedBoundingBox value)
|
||||
{
|
||||
return Extents == value.Extents && Transformation == value.Transformation;
|
||||
return Extents.Equals(value.Extents) && Transformation.Equals(value.Transformation);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -587,7 +587,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Plane other)
|
||||
{
|
||||
return Normal == other.Normal && D == other.D;
|
||||
return Normal.Equals(other.Normal) && D.Equals(other.D);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1714,7 +1714,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Quaternion other)
|
||||
{
|
||||
return X == other.X && Y == other.Y && Z == other.Z && W == other.W;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z) && W.Equals(other.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -433,7 +433,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Ray other)
|
||||
{
|
||||
return Position == other.Position && Direction == other.Direction;
|
||||
return Position.Equals(other.Position) && Direction.Equals(other.Direction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -499,7 +499,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Rectangle other)
|
||||
{
|
||||
return Location == other.Location && Size == other.Size;
|
||||
return Location.Equals(other.Location) && Size.Equals(other.Size);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -705,7 +705,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Transform other)
|
||||
{
|
||||
return Translation == other.Translation && Orientation == other.Orientation && Scale == other.Scale;
|
||||
return Translation.Equals(other.Translation) && Orientation.Equals(other.Orientation) && Scale.Equals(other.Scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1782,7 +1782,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Vector2 other)
|
||||
{
|
||||
return X == other.X && Y == other.Y;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2141,7 +2141,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(in Vector3 other)
|
||||
{
|
||||
return X == other.X && Y == other.Y && Z == other.Z;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1493,7 +1493,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="Vector4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public bool Equals(in Vector4 other)
|
||||
{
|
||||
return X == other.X && Y == other.Y && Z == other.Z && W == other.W;
|
||||
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z) && W.Equals(other.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user