Use exact component value equality checks in equality comparisons
(cherry picked from commit 2cddf3de97943844512b2d84aa6be122c6f0d409)
This commit is contained in:
@@ -58,7 +58,7 @@ public:
|
||||
|
||||
bool operator==(const StepCurveKeyframe& other) const
|
||||
{
|
||||
return Math::NearEqual(Time, other.Time) && Math::NearEqual(Value, other.Value);
|
||||
return Time == other.Time && Value == other.Value;
|
||||
}
|
||||
} PACK_END();
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
|
||||
bool operator==(const LinearCurveKeyframe& other) const
|
||||
{
|
||||
return Math::NearEqual(Time, other.Time) && Math::NearEqual(Value, other.Value);
|
||||
return Time == other.Time && Value == other.Value;
|
||||
}
|
||||
} PACK_END();
|
||||
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
|
||||
bool operator==(const HermiteCurveKeyframe& other) const
|
||||
{
|
||||
return Math::NearEqual(Time, other.Time) && Math::NearEqual(Value, other.Value) && Math::NearEqual(TangentIn, other.TangentIn) && Math::NearEqual(TangentOut, other.TangentOut);
|
||||
return Time == other.Time && Value == other.Value && TangentIn == other.TangentIn && TangentOut == other.TangentOut;
|
||||
}
|
||||
} PACK_END();
|
||||
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
|
||||
bool operator==(const BezierCurveKeyframe& other) const
|
||||
{
|
||||
return Math::NearEqual(Time, other.Time) && Math::NearEqual(Value, other.Value) && Math::NearEqual(TangentIn, other.TangentIn) && Math::NearEqual(TangentOut, other.TangentOut);
|
||||
return Time == other.Time && Value == other.Value && TangentIn == other.TangentIn && TangentOut == other.TangentOut;
|
||||
}
|
||||
} PACK_END();
|
||||
|
||||
|
||||
@@ -673,23 +673,23 @@ namespace FlaxEngine
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="Vector4" /> is equal to this instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <param name="other">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <returns><c>true</c> if the specified <see cref="Vector4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref BoundingBox value)
|
||||
public bool Equals(ref BoundingBox other)
|
||||
{
|
||||
return Minimum == value.Minimum && Maximum == value.Maximum;
|
||||
return Minimum == other.Minimum && Maximum == other.Maximum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="Vector4" /> is equal to this instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <param name="other">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <returns><c>true</c> if the specified <see cref="Vector4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(BoundingBox value)
|
||||
public bool Equals(BoundingBox other)
|
||||
{
|
||||
return Equals(ref value);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -487,23 +487,23 @@ namespace FlaxEngine
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="Vector4" /> is equal to this instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <param name="other">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <returns><c>true</c> if the specified <see cref="Vector4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref BoundingSphere value)
|
||||
public bool Equals(ref BoundingSphere other)
|
||||
{
|
||||
return (Center == value.Center) && (Radius == value.Radius);
|
||||
return Center == other.Center && Radius == other.Radius;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="Vector4" /> is equal to this instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <param name="other">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <returns><c>true</c> if the specified <see cref="Vector4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(BoundingSphere value)
|
||||
public bool Equals(BoundingSphere other)
|
||||
{
|
||||
return Equals(ref value);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -197,12 +197,9 @@ namespace FlaxEngine
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object other)
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
if (!(other is Color))
|
||||
return false;
|
||||
var color = (Color)other;
|
||||
return Equals(ref color);
|
||||
return value is Color other && Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -213,7 +210,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Color other)
|
||||
{
|
||||
return Mathf.NearEqual(other.R, R) && Mathf.NearEqual(other.G, G) && Mathf.NearEqual(other.B, B) && Mathf.NearEqual(other.A, A);
|
||||
return R == other.R && G == other.G && B == other.B && A == other.A;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -661,23 +658,23 @@ namespace FlaxEngine
|
||||
/// <summary>
|
||||
/// Compares two colors.
|
||||
/// </summary>
|
||||
/// <param name="lhs">The left.</param>
|
||||
/// <param name="rhs">The right.</param>
|
||||
/// <param name="left">The left.</param>
|
||||
/// <param name="right">The right.</param>
|
||||
/// <returns>True if colors are equal, otherwise false.</returns>
|
||||
public static bool operator ==(Color lhs, Color rhs)
|
||||
public static bool operator ==(Color left, Color right)
|
||||
{
|
||||
return lhs.Equals(ref rhs);
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two colors.
|
||||
/// </summary>
|
||||
/// <param name="lhs">The left.</param>
|
||||
/// <param name="rhs">The right.</param>
|
||||
/// <param name="left">The left.</param>
|
||||
/// <param name="right">The right.</param>
|
||||
/// <returns>True if colors are not equal, otherwise false.</returns>
|
||||
public static bool operator !=(Color lhs, Color rhs)
|
||||
public static bool operator !=(Color left, Color right)
|
||||
{
|
||||
return !lhs.Equals(ref rhs);
|
||||
return !left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1464,7 +1464,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Double2 left, Double2 right)
|
||||
{
|
||||
return Mathd.NearEqual(left.X, right.X) && Mathd.NearEqual(left.Y, right.Y);
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1476,7 +1476,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(Double2 left, Double2 right)
|
||||
{
|
||||
return !Mathd.NearEqual(left.X, right.X) || !Mathd.NearEqual(left.Y, right.Y);
|
||||
return !left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1582,7 +1582,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Double2 other)
|
||||
{
|
||||
return Mathd.NearEqual(other.X, X) && Mathd.NearEqual(other.Y, Y);
|
||||
return X == other.X && Y == other.Y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1590,7 +1590,7 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
public static bool Equals(ref Double2 a, ref Double2 b)
|
||||
{
|
||||
return Mathd.NearEqual(a.X, b.X) && Mathd.NearEqual(a.Y, b.Y);
|
||||
return a.Equals(ref b);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1601,7 +1601,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Double2 other)
|
||||
{
|
||||
return Mathd.NearEqual(other.X, X) && Mathd.NearEqual(other.Y, Y);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1611,7 +1611,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return value is Double2 other && Mathd.NearEqual(other.X, X) && Mathd.NearEqual(other.Y, Y);
|
||||
return value is Double2 other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1759,7 +1759,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Double3 left, Double3 right)
|
||||
{
|
||||
return Mathd.NearEqual(left.X, right.X) && Mathd.NearEqual(left.Y, right.Y) && Mathd.NearEqual(left.Z, right.Z);
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1771,7 +1771,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(Double3 left, Double3 right)
|
||||
{
|
||||
return !Mathd.NearEqual(left.X, right.X) || !Mathd.NearEqual(left.Y, right.Y) || !Mathd.NearEqual(left.Z, right.Z);
|
||||
return !left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1880,7 +1880,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Double3 other)
|
||||
{
|
||||
return Mathd.NearEqual(other.X, X) && Mathd.NearEqual(other.Y, Y) && Mathd.NearEqual(other.Z, Z);
|
||||
return X == other.X && Y == other.Y && Z == other.Z;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1891,7 +1891,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Double3 other)
|
||||
{
|
||||
return Mathd.NearEqual(other.X, X) && Mathd.NearEqual(other.Y, Y) && Mathd.NearEqual(other.Z, Z);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1901,7 +1901,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return value is Double3 other && Mathd.NearEqual(other.X, X) && Mathd.NearEqual(other.Y, Y) && Mathd.NearEqual(other.Z, Z);
|
||||
return value is Double3 other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1258,7 +1258,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Double4 left, Double4 right)
|
||||
{
|
||||
return Mathd.NearEqual(left.X, right.X) && Mathd.NearEqual(left.Y, right.Y) && Mathd.NearEqual(left.Z, right.Z) && Mathd.NearEqual(left.W, right.W);
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <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(ref Double4 other)
|
||||
{
|
||||
return Mathd.NearEqual(other.X, X) && Mathd.NearEqual(other.Y, Y) && Mathd.NearEqual(other.Z, Z) && Mathd.NearEqual(other.W, W);
|
||||
return X == other.X && Y == other.Y && Z == other.Z && W == other.W;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1390,7 +1390,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Double4 other)
|
||||
{
|
||||
return Mathd.NearEqual(other.X, X) && Mathd.NearEqual(other.Y, Y) && Mathd.NearEqual(other.Z, Z) && Mathd.NearEqual(other.W, W);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1400,7 +1400,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return value is Double4 other && Mathd.NearEqual(other.X, X) && Mathd.NearEqual(other.Y, Y) && Mathd.NearEqual(other.Z, Z) && Mathd.NearEqual(other.W, W);
|
||||
return value is Double4 other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1540,7 +1540,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Float2 left, Float2 right)
|
||||
{
|
||||
return Mathf.NearEqual(left.X, right.X) && Mathf.NearEqual(left.Y, right.Y);
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1552,7 +1552,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(Float2 left, Float2 right)
|
||||
{
|
||||
return !Mathf.NearEqual(left.X, right.X) || !Mathf.NearEqual(left.Y, right.Y);
|
||||
return !left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1658,7 +1658,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Float2 other)
|
||||
{
|
||||
return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y);
|
||||
return X == other.X && Y == other.Y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1666,7 +1666,7 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
public static bool Equals(ref Float2 a, ref Float2 b)
|
||||
{
|
||||
return Mathf.NearEqual(a.X, b.X) && Mathf.NearEqual(a.Y, b.Y);
|
||||
return a.Equals(ref b);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1677,7 +1677,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Float2 other)
|
||||
{
|
||||
return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1687,7 +1687,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return value is Float2 other && Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y);
|
||||
return value is Float2 other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1791,7 +1791,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Float3 left, Float3 right)
|
||||
{
|
||||
return Mathf.NearEqual(left.X, right.X) && Mathf.NearEqual(left.Y, right.Y) && Mathf.NearEqual(left.Z, right.Z);
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1803,7 +1803,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(Float3 left, Float3 right)
|
||||
{
|
||||
return !Mathf.NearEqual(left.X, right.X) || !Mathf.NearEqual(left.Y, right.Y) || !Mathf.NearEqual(left.Z, right.Z);
|
||||
return !left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1912,7 +1912,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Float3 other)
|
||||
{
|
||||
return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z);
|
||||
return X == other.X && Y == other.Y && Z == other.Z;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1923,7 +1923,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Float3 other)
|
||||
{
|
||||
return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1933,7 +1933,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return value is Float3 other && Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z);
|
||||
return value is Float3 other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1288,7 +1288,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Float4 left, Float4 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 left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <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(ref Float4 other)
|
||||
{
|
||||
return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z) && Mathf.NearEqual(other.W, W);
|
||||
return X == other.X && Y == other.Y && Z == other.Z && W == other.W;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1430,7 +1430,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Float4 other)
|
||||
{
|
||||
return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z) && Mathf.NearEqual(other.W, W);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1440,7 +1440,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return value is Float4 other && Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z) && Mathf.NearEqual(other.W, W);
|
||||
return value is Float4 other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ bool Matrix::operator==(const Matrix& other) const
|
||||
{
|
||||
for (int32 i = 0; i < 16; i++)
|
||||
{
|
||||
if (Math::NotNearEqual(other.Raw[i], Raw[i]))
|
||||
if (other.Raw[i] != Raw[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -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(ref Matrix other)
|
||||
{
|
||||
return Mathf.NearEqual(other.M11, M11) &&
|
||||
Mathf.NearEqual(other.M12, M12) &&
|
||||
Mathf.NearEqual(other.M13, M13) &&
|
||||
Mathf.NearEqual(other.M14, M14) &&
|
||||
Mathf.NearEqual(other.M21, M21) &&
|
||||
Mathf.NearEqual(other.M22, M22) &&
|
||||
Mathf.NearEqual(other.M23, M23) &&
|
||||
Mathf.NearEqual(other.M24, M24) &&
|
||||
Mathf.NearEqual(other.M31, M31) &&
|
||||
Mathf.NearEqual(other.M32, M32) &&
|
||||
Mathf.NearEqual(other.M33, M33) &&
|
||||
Mathf.NearEqual(other.M34, M34) &&
|
||||
Mathf.NearEqual(other.M41, M41) &&
|
||||
Mathf.NearEqual(other.M42, M42) &&
|
||||
Mathf.NearEqual(other.M43, M43) &&
|
||||
Mathf.NearEqual(other.M44, M44);
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -3272,10 +3272,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
if (!(value is Matrix))
|
||||
return false;
|
||||
var v = (Matrix)value;
|
||||
return Equals(ref v);
|
||||
return value is Matrix other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(ref Matrix2x2 other)
|
||||
{
|
||||
return Mathf.NearEqual(other.M11, M11) && Mathf.NearEqual(other.M12, M12) && Mathf.NearEqual(other.M21, M21) && Mathf.NearEqual(other.M22, M22);
|
||||
return M11 == other.M11 && M12 == other.M12 && M21 == other.M21 && M22 == other.M22;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -502,7 +502,7 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
public static bool Equals(ref Matrix2x2 a, ref Matrix2x2 b)
|
||||
{
|
||||
return Mathf.NearEqual(a.M11, b.M11) && Mathf.NearEqual(a.M12, b.M12) && Mathf.NearEqual(a.M21, b.M21) && Mathf.NearEqual(a.M22, b.M22);
|
||||
return a.Equals(ref b);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -242,14 +242,13 @@ void Matrix3x3::Decompose(Float3& scale, Quaternion& rotation) const
|
||||
|
||||
bool Matrix3x3::operator==(const Matrix3x3& other) const
|
||||
{
|
||||
return
|
||||
Math::NearEqual(M11, other.M11) &&
|
||||
Math::NearEqual(M12, other.M12) &&
|
||||
Math::NearEqual(M13, other.M13) &&
|
||||
Math::NearEqual(M21, other.M21) &&
|
||||
Math::NearEqual(M22, other.M22) &&
|
||||
Math::NearEqual(M23, other.M23) &&
|
||||
Math::NearEqual(M31, other.M31) &&
|
||||
Math::NearEqual(M32, other.M32) &&
|
||||
Math::NearEqual(M33, other.M33);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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(ref Matrix3x3 other)
|
||||
{
|
||||
return (Mathf.NearEqual(other.M11, M11) &&
|
||||
Mathf.NearEqual(other.M12, M12) &&
|
||||
Mathf.NearEqual(other.M13, M13) &&
|
||||
Mathf.NearEqual(other.M21, M21) &&
|
||||
Mathf.NearEqual(other.M22, M22) &&
|
||||
Mathf.NearEqual(other.M23, M23) &&
|
||||
Mathf.NearEqual(other.M31, M31) &&
|
||||
Mathf.NearEqual(other.M32, M32) &&
|
||||
Mathf.NearEqual(other.M33, M33));
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2152,17 +2152,7 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
public static bool Equals(ref Matrix3x3 a, ref Matrix3x3 b)
|
||||
{
|
||||
return
|
||||
Mathf.NearEqual(a.M11, b.M11) &&
|
||||
Mathf.NearEqual(a.M12, b.M12) &&
|
||||
Mathf.NearEqual(a.M13, b.M13) &&
|
||||
Mathf.NearEqual(a.M21, b.M21) &&
|
||||
Mathf.NearEqual(a.M22, b.M22) &&
|
||||
Mathf.NearEqual(a.M23, b.M23) &&
|
||||
Mathf.NearEqual(a.M31, b.M31) &&
|
||||
Mathf.NearEqual(a.M32, b.M32) &&
|
||||
Mathf.NearEqual(a.M33, b.M33)
|
||||
;
|
||||
return a.Equals(ref b);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref OrientedBoundingBox value)
|
||||
{
|
||||
return (Extents == value.Extents) && (Transformation == value.Transformation);
|
||||
return Extents == value.Extents && Transformation == value.Transformation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -582,23 +582,23 @@ namespace FlaxEngine
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="Vector4" /> is equal to this instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <param name="other">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <returns><c>true</c> if the specified <see cref="Vector4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Plane value)
|
||||
public bool Equals(ref Plane other)
|
||||
{
|
||||
return Normal == value.Normal && D == value.D;
|
||||
return Normal == other.Normal && D == other.D;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="Vector4" /> is equal to this instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <param name="other">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <returns><c>true</c> if the specified <see cref="Vector4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Plane value)
|
||||
public bool Equals(Plane other)
|
||||
{
|
||||
return Equals(ref value);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -608,10 +608,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
if (!(value is Plane))
|
||||
return false;
|
||||
var strongValue = (Plane)value;
|
||||
return Equals(ref strongValue);
|
||||
return value is Plane other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1602,7 +1602,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Quaternion left, Quaternion right)
|
||||
{
|
||||
return Dot(ref left, ref right) > Tolerance;
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1614,7 +1614,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(Quaternion left, Quaternion right)
|
||||
{
|
||||
return Dot(ref left, ref right) <= Tolerance;
|
||||
return !left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1714,8 +1714,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Quaternion other)
|
||||
{
|
||||
//return Dot(ref this, ref other) > Tolerance;
|
||||
return Mathf.NearEqual(other.X, X) && Mathf.NearEqual(other.Y, Y) && Mathf.NearEqual(other.Z, Z) && Mathf.NearEqual(other.W, W);
|
||||
return X == other.X && Y == other.Y && Z == other.Z && W == other.W;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1736,10 +1735,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
if (!(value is Quaternion))
|
||||
return false;
|
||||
var strongValue = (Quaternion)value;
|
||||
return Equals(ref strongValue);
|
||||
return value is Quaternion other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ public:
|
||||
/// <returns><c>true</c> if the specified <see cref="Quaternion" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
FORCE_INLINE bool operator==(const Quaternion& other) const
|
||||
{
|
||||
return Dot(*this, other) > Tolerance;
|
||||
return X == other.X && Y == other.Y && Z == other.Z && W == other.W;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -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>
|
||||
FORCE_INLINE bool operator!=(const Quaternion& other) const
|
||||
{
|
||||
return Dot(*this, other) < Tolerance;
|
||||
return X != other.X || Y != other.Y || Z != other.Z || W != other.W;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@@ -428,23 +428,23 @@ namespace FlaxEngine
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="Vector4" /> is equal to this instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <param name="other">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <returns><c>true</c> if the specified <see cref="Vector4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Ray value)
|
||||
public bool Equals(ref Ray other)
|
||||
{
|
||||
return (Position == value.Position) && (Direction == value.Direction);
|
||||
return Position == other.Position && Direction == other.Direction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="Vector4" /> is equal to this instance.
|
||||
/// </summary>
|
||||
/// <param name="value">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <param name="other">The <see cref="Vector4" /> to compare with this instance.</param>
|
||||
/// <returns><c>true</c> if the specified <see cref="Vector4" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Ray value)
|
||||
public bool Equals(Ray other)
|
||||
{
|
||||
return Equals(ref value);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -499,21 +499,19 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Rectangle other)
|
||||
{
|
||||
return Location.Equals(ref other.Location) && Size.Equals(ref other.Size);
|
||||
return Location == other.Location && Size == other.Size;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(Rectangle other)
|
||||
{
|
||||
return Location.Equals(ref other.Location) && Size.Equals(ref other.Size);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj))
|
||||
return false;
|
||||
return obj is Rectangle && Equals((Rectangle)obj);
|
||||
return obj is Rectangle other && Equals(ref other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -1654,7 +1654,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Vector2 left, Vector2 right)
|
||||
{
|
||||
return Mathr.NearEqual(left.X, right.X) && Mathr.NearEqual(left.Y, right.Y);
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1666,7 +1666,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(Vector2 left, Vector2 right)
|
||||
{
|
||||
return !Mathr.NearEqual(left.X, right.X) || !Mathr.NearEqual(left.Y, right.Y);
|
||||
return !left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1782,7 +1782,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Vector2 other)
|
||||
{
|
||||
return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y);
|
||||
return X == other.X && Y == other.Y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1790,7 +1790,7 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
public static bool Equals(ref Vector2 a, ref Vector2 b)
|
||||
{
|
||||
return Mathr.NearEqual(a.X, b.X) && Mathr.NearEqual(a.Y, b.Y);
|
||||
return a.Equals(ref b);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1801,7 +1801,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Vector2 other)
|
||||
{
|
||||
return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1811,7 +1811,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return value is Vector2 other && Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y);
|
||||
return value is Vector2 other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2010,7 +2010,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Vector3 left, Vector3 right)
|
||||
{
|
||||
return Mathr.NearEqual(left.X, right.X) && Mathr.NearEqual(left.Y, right.Y) && Mathr.NearEqual(left.Z, right.Z);
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2022,7 +2022,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(Vector3 left, Vector3 right)
|
||||
{
|
||||
return !Mathr.NearEqual(left.X, right.X) || !Mathr.NearEqual(left.Y, right.Y) || !Mathr.NearEqual(left.Z, right.Z);
|
||||
return !left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2141,7 +2141,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Vector3 other)
|
||||
{
|
||||
return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z);
|
||||
return X == other.X && Y == other.Y && Z == other.Z;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2152,7 +2152,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Vector3 other)
|
||||
{
|
||||
return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2162,7 +2162,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return value is Vector3 other && Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z);
|
||||
return value is Vector3 other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1362,7 +1362,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Vector4 left, Vector4 right)
|
||||
{
|
||||
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);
|
||||
return left.Equals(ref right);
|
||||
}
|
||||
|
||||
/// <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(ref Vector4 other)
|
||||
{
|
||||
return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z) && Mathr.NearEqual(other.W, W);
|
||||
return X == other.X && Y == other.Y && Z == other.Z && W == other.W;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1504,7 +1504,7 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Vector4 other)
|
||||
{
|
||||
return Mathr.NearEqual(other.X, X) && Mathr.NearEqual(other.Y, Y) && Mathr.NearEqual(other.Z, Z) && Mathr.NearEqual(other.W, W);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1514,7 +1514,7 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
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);
|
||||
return value is Vector4 other && Equals(ref other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,12 +173,12 @@ namespace FlaxEngine
|
||||
/// <returns><c>true</c> if the specified <see cref="Viewport"/> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public bool Equals(ref Viewport other)
|
||||
{
|
||||
return Mathf.NearEqual(X, other.X) &&
|
||||
Mathf.NearEqual(Y, other.Y) &&
|
||||
Mathf.NearEqual(Width, other.Width) &&
|
||||
Mathf.NearEqual(Height, other.Height) &&
|
||||
Mathf.NearEqual(MinDepth, other.MinDepth) &&
|
||||
Mathf.NearEqual(MaxDepth, other.MaxDepth);
|
||||
return X == other.X &&
|
||||
Y == other.Y &&
|
||||
Width == other.Width &&
|
||||
Height == other.Height &&
|
||||
MinDepth == other.MinDepth &&
|
||||
MaxDepth == other.MaxDepth;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1162,9 +1162,9 @@ bool Variant::operator==(const Variant& other) const
|
||||
case VariantType::Enum:
|
||||
return AsEnum == other.AsEnum;
|
||||
case VariantType::Float:
|
||||
return Math::NearEqual(AsFloat, other.AsFloat);
|
||||
return AsFloat == other.AsFloat;
|
||||
case VariantType::Double:
|
||||
return Math::Abs(AsDouble - other.AsDouble) < ZeroTolerance;
|
||||
return AsDouble == other.AsDouble;
|
||||
case VariantType::Pointer:
|
||||
return AsPointer == other.AsPointer;
|
||||
case VariantType::String:
|
||||
|
||||
@@ -52,7 +52,7 @@ API_STRUCT(NoPod) struct FLAXENGINE_API FoliageInstance
|
||||
public:
|
||||
bool operator==(const FoliageInstance& v) const
|
||||
{
|
||||
return Type == v.Type && Math::NearEqual(Random, v.Random) && Transform == v.Transform;
|
||||
return Type == v.Type && Random == v.Random && Transform == v.Transform;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -64,8 +64,8 @@ namespace FlaxEngine
|
||||
&& DecalBlendingMode == other.DecalBlendingMode
|
||||
&& TransparentLightingMode == other.TransparentLightingMode
|
||||
&& PostFxLocation == other.PostFxLocation
|
||||
&& Mathf.NearEqual(MaskThreshold, other.MaskThreshold)
|
||||
&& Mathf.NearEqual(OpacityThreshold, other.OpacityThreshold)
|
||||
&& MaskThreshold == other.MaskThreshold
|
||||
&& OpacityThreshold == other.OpacityThreshold
|
||||
&& TessellationMode == other.TessellationMode
|
||||
&& MaxTessellationFactor == other.MaxTessellationFactor;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ bool MaterialInfo8::operator==(const MaterialInfo8& other) const
|
||||
&& TransparentLighting == other.TransparentLighting
|
||||
&& DecalBlendingMode == other.DecalBlendingMode
|
||||
&& PostFxLocation == other.PostFxLocation
|
||||
&& Math::NearEqual(MaskThreshold, other.MaskThreshold)
|
||||
&& Math::NearEqual(OpacityThreshold, other.OpacityThreshold)
|
||||
&& MaskThreshold == other.MaskThreshold
|
||||
&& OpacityThreshold == other.OpacityThreshold
|
||||
&& Flags == other.Flags
|
||||
&& TessellationMode == other.TessellationMode
|
||||
&& MaxTessellationFactor == other.MaxTessellationFactor;
|
||||
@@ -89,8 +89,8 @@ bool MaterialInfo9::operator==(const MaterialInfo9& other) const
|
||||
&& DecalBlendingMode == other.DecalBlendingMode
|
||||
&& PostFxLocation == other.PostFxLocation
|
||||
&& CullMode == other.CullMode
|
||||
&& Math::NearEqual(MaskThreshold, other.MaskThreshold)
|
||||
&& Math::NearEqual(OpacityThreshold, other.OpacityThreshold)
|
||||
&& MaskThreshold == other.MaskThreshold
|
||||
&& OpacityThreshold == other.OpacityThreshold
|
||||
&& TessellationMode == other.TessellationMode
|
||||
&& MaxTessellationFactor == other.MaxTessellationFactor;
|
||||
}
|
||||
@@ -123,8 +123,8 @@ bool MaterialInfo::operator==(const MaterialInfo& other) const
|
||||
&& TransparentLightingMode == other.TransparentLightingMode
|
||||
&& PostFxLocation == other.PostFxLocation
|
||||
&& CullMode == other.CullMode
|
||||
&& Math::NearEqual(MaskThreshold, other.MaskThreshold)
|
||||
&& Math::NearEqual(OpacityThreshold, other.OpacityThreshold)
|
||||
&& MaskThreshold == other.MaskThreshold
|
||||
&& OpacityThreshold == other.OpacityThreshold
|
||||
&& TessellationMode == other.TessellationMode
|
||||
&& MaxTessellationFactor == other.MaxTessellationFactor;
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ namespace FlaxEngine
|
||||
AddressU == other.AddressU &&
|
||||
AddressV == other.AddressV &&
|
||||
AddressW == other.AddressW &&
|
||||
Mathf.NearEqual(MipBias, other.MipBias) &&
|
||||
Mathf.NearEqual(MinMipLevel, other.MinMipLevel) &&
|
||||
Mathf.NearEqual(MaxMipLevel, other.MaxMipLevel) &&
|
||||
MipBias == other.MipBias &&
|
||||
MinMipLevel == other.MinMipLevel &&
|
||||
MaxMipLevel == other.MaxMipLevel &&
|
||||
MaxAnisotropy == other.MaxAnisotropy &&
|
||||
BorderColor == other.BorderColor &&
|
||||
ComparisonFunction == other.ComparisonFunction;
|
||||
|
||||
@@ -107,7 +107,7 @@ Color NavMeshRuntime::NavAreasColors[64];
|
||||
|
||||
bool NavAgentProperties::operator==(const NavAgentProperties& other) const
|
||||
{
|
||||
return Math::NearEqual(Radius, other.Radius) && Math::NearEqual(Height, other.Height) && Math::NearEqual(StepHeight, other.StepHeight) && Math::NearEqual(MaxSlopeAngle, other.MaxSlopeAngle) && Math::NearEqual(MaxSpeed, other.MaxSpeed) && Math::NearEqual(CrowdSeparationWeight, other.CrowdSeparationWeight);
|
||||
return Radius == other.Radius && Height == other.Height && StepHeight == other.StepHeight && MaxSlopeAngle == other.MaxSlopeAngle && MaxSpeed == other.MaxSpeed && CrowdSeparationWeight == other.CrowdSeparationWeight;
|
||||
}
|
||||
|
||||
bool NavAgentMask::IsAgentSupported(int32 agentIndex) const
|
||||
@@ -148,12 +148,12 @@ bool NavAgentMask::operator==(const NavAgentMask& other) const
|
||||
|
||||
bool NavAreaProperties::operator==(const NavAreaProperties& other) const
|
||||
{
|
||||
return Name == other.Name && Id == other.Id && Math::NearEqual(Cost, other.Cost);
|
||||
return Name == other.Name && Id == other.Id && Cost == other.Cost;
|
||||
}
|
||||
|
||||
bool NavMeshProperties::operator==(const NavMeshProperties& other) const
|
||||
{
|
||||
return Name == other.Name && Quaternion::NearEqual(Rotation, other.Rotation, 0.001f) && Agent == other.Agent && Vector3::NearEqual(DefaultQueryExtent, other.DefaultQueryExtent);
|
||||
return Name == other.Name && Rotation == other.Rotation && Agent == other.Agent && DefaultQueryExtent == other.DefaultQueryExtent;
|
||||
}
|
||||
|
||||
class NavigationService : public EngineService
|
||||
|
||||
@@ -59,7 +59,7 @@ API_STRUCT() struct HingeJointDrive
|
||||
public:
|
||||
bool operator==(const HingeJointDrive& other) const
|
||||
{
|
||||
return Math::NearEqual(Velocity, other.Velocity) && Math::NearEqual(ForceLimit, other.ForceLimit) && Math::NearEqual(GearRatio, other.GearRatio) && FreeSpin == other.FreeSpin;
|
||||
return Velocity == other.Velocity && ForceLimit == other.ForceLimit && GearRatio == other.GearRatio && FreeSpin == other.FreeSpin;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(TextLayoutOptions);
|
||||
&& HorizontalAlignment == other.HorizontalAlignment
|
||||
&& VerticalAlignment == other.VerticalAlignment
|
||||
&& TextWrapping == other.TextWrapping
|
||||
&& Math::NearEqual(Scale, other.Scale)
|
||||
&& Math::NearEqual(BaseLinesGapScale, other.BaseLinesGapScale);
|
||||
&& Scale == other.Scale
|
||||
&& BaseLinesGapScale == other.BaseLinesGapScale;
|
||||
}
|
||||
|
||||
FORCE_INLINE bool operator!=(const TextLayoutOptions& other) const
|
||||
|
||||
@@ -251,10 +251,10 @@ namespace FlaxEngine.GUI
|
||||
/// <returns><c>true</c> if the specified <see cref="Margin" /> is equal to this instance; otherwise, <c>false</c>.</returns>
|
||||
public bool Equals(ref Margin other)
|
||||
{
|
||||
return Mathf.NearEqual(other.Left, Left) &&
|
||||
Mathf.NearEqual(other.Right, Right) &&
|
||||
Mathf.NearEqual(other.Top, Top) &&
|
||||
Mathf.NearEqual(other.Bottom, Bottom);
|
||||
return other.Left == Left &&
|
||||
other.Right == Right &&
|
||||
other.Top == Top &&
|
||||
other.Bottom == Bottom;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user