|
@@ -425,116 +425,98 @@ struct HashMapComparatorDefault {
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<float> {
|
|
struct HashMapComparatorDefault<float> {
|
|
static bool compare(const float &p_lhs, const float &p_rhs) {
|
|
static bool compare(const float &p_lhs, const float &p_rhs) {
|
|
- return (p_lhs == p_rhs) || (Math::is_nan(p_lhs) && Math::is_nan(p_rhs));
|
|
|
|
|
|
+ return Math::is_same(p_lhs, p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<double> {
|
|
struct HashMapComparatorDefault<double> {
|
|
static bool compare(const double &p_lhs, const double &p_rhs) {
|
|
static bool compare(const double &p_lhs, const double &p_rhs) {
|
|
- return (p_lhs == p_rhs) || (Math::is_nan(p_lhs) && Math::is_nan(p_rhs));
|
|
|
|
|
|
+ return Math::is_same(p_lhs, p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Color> {
|
|
struct HashMapComparatorDefault<Color> {
|
|
static bool compare(const Color &p_lhs, const Color &p_rhs) {
|
|
static bool compare(const Color &p_lhs, const Color &p_rhs) {
|
|
- return ((p_lhs.r == p_rhs.r) || (Math::is_nan(p_lhs.r) && Math::is_nan(p_rhs.r))) && ((p_lhs.g == p_rhs.g) || (Math::is_nan(p_lhs.g) && Math::is_nan(p_rhs.g))) && ((p_lhs.b == p_rhs.b) || (Math::is_nan(p_lhs.b) && Math::is_nan(p_rhs.b))) && ((p_lhs.a == p_rhs.a) || (Math::is_nan(p_lhs.a) && Math::is_nan(p_rhs.a)));
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Vector2> {
|
|
struct HashMapComparatorDefault<Vector2> {
|
|
static bool compare(const Vector2 &p_lhs, const Vector2 &p_rhs) {
|
|
static bool compare(const Vector2 &p_lhs, const Vector2 &p_rhs) {
|
|
- return ((p_lhs.x == p_rhs.x) || (Math::is_nan(p_lhs.x) && Math::is_nan(p_rhs.x))) && ((p_lhs.y == p_rhs.y) || (Math::is_nan(p_lhs.y) && Math::is_nan(p_rhs.y)));
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Vector3> {
|
|
struct HashMapComparatorDefault<Vector3> {
|
|
static bool compare(const Vector3 &p_lhs, const Vector3 &p_rhs) {
|
|
static bool compare(const Vector3 &p_lhs, const Vector3 &p_rhs) {
|
|
- return ((p_lhs.x == p_rhs.x) || (Math::is_nan(p_lhs.x) && Math::is_nan(p_rhs.x))) && ((p_lhs.y == p_rhs.y) || (Math::is_nan(p_lhs.y) && Math::is_nan(p_rhs.y))) && ((p_lhs.z == p_rhs.z) || (Math::is_nan(p_lhs.z) && Math::is_nan(p_rhs.z)));
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Vector4> {
|
|
struct HashMapComparatorDefault<Vector4> {
|
|
static bool compare(const Vector4 &p_lhs, const Vector4 &p_rhs) {
|
|
static bool compare(const Vector4 &p_lhs, const Vector4 &p_rhs) {
|
|
- return ((p_lhs.x == p_rhs.x) || (Math::is_nan(p_lhs.x) && Math::is_nan(p_rhs.x))) && ((p_lhs.y == p_rhs.y) || (Math::is_nan(p_lhs.y) && Math::is_nan(p_rhs.y))) && ((p_lhs.z == p_rhs.z) || (Math::is_nan(p_lhs.z) && Math::is_nan(p_rhs.z))) && ((p_lhs.w == p_rhs.w) || (Math::is_nan(p_lhs.w) && Math::is_nan(p_rhs.w)));
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Rect2> {
|
|
struct HashMapComparatorDefault<Rect2> {
|
|
static bool compare(const Rect2 &p_lhs, const Rect2 &p_rhs) {
|
|
static bool compare(const Rect2 &p_lhs, const Rect2 &p_rhs) {
|
|
- return HashMapComparatorDefault<Vector2>().compare(p_lhs.position, p_rhs.position) && HashMapComparatorDefault<Vector2>().compare(p_lhs.size, p_rhs.size);
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<AABB> {
|
|
struct HashMapComparatorDefault<AABB> {
|
|
static bool compare(const AABB &p_lhs, const AABB &p_rhs) {
|
|
static bool compare(const AABB &p_lhs, const AABB &p_rhs) {
|
|
- return HashMapComparatorDefault<Vector3>().compare(p_lhs.position, p_rhs.position) && HashMapComparatorDefault<Vector3>().compare(p_lhs.size, p_rhs.size);
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Plane> {
|
|
struct HashMapComparatorDefault<Plane> {
|
|
static bool compare(const Plane &p_lhs, const Plane &p_rhs) {
|
|
static bool compare(const Plane &p_lhs, const Plane &p_rhs) {
|
|
- return HashMapComparatorDefault<Vector3>().compare(p_lhs.normal, p_rhs.normal) && ((p_lhs.d == p_rhs.d) || (Math::is_nan(p_lhs.d) && Math::is_nan(p_rhs.d)));
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Transform2D> {
|
|
struct HashMapComparatorDefault<Transform2D> {
|
|
static bool compare(const Transform2D &p_lhs, const Transform2D &p_rhs) {
|
|
static bool compare(const Transform2D &p_lhs, const Transform2D &p_rhs) {
|
|
- for (int i = 0; i < 3; ++i) {
|
|
|
|
- if (!HashMapComparatorDefault<Vector2>().compare(p_lhs.columns[i], p_rhs.columns[i])) {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return true;
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Basis> {
|
|
struct HashMapComparatorDefault<Basis> {
|
|
static bool compare(const Basis &p_lhs, const Basis &p_rhs) {
|
|
static bool compare(const Basis &p_lhs, const Basis &p_rhs) {
|
|
- for (int i = 0; i < 3; ++i) {
|
|
|
|
- if (!HashMapComparatorDefault<Vector3>().compare(p_lhs.rows[i], p_rhs.rows[i])) {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return true;
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Transform3D> {
|
|
struct HashMapComparatorDefault<Transform3D> {
|
|
static bool compare(const Transform3D &p_lhs, const Transform3D &p_rhs) {
|
|
static bool compare(const Transform3D &p_lhs, const Transform3D &p_rhs) {
|
|
- return HashMapComparatorDefault<Basis>().compare(p_lhs.basis, p_rhs.basis) && HashMapComparatorDefault<Vector3>().compare(p_lhs.origin, p_rhs.origin);
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Projection> {
|
|
struct HashMapComparatorDefault<Projection> {
|
|
static bool compare(const Projection &p_lhs, const Projection &p_rhs) {
|
|
static bool compare(const Projection &p_lhs, const Projection &p_rhs) {
|
|
- for (int i = 0; i < 4; ++i) {
|
|
|
|
- if (!HashMapComparatorDefault<Vector4>().compare(p_lhs.columns[i], p_rhs.columns[i])) {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return true;
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
template <>
|
|
template <>
|
|
struct HashMapComparatorDefault<Quaternion> {
|
|
struct HashMapComparatorDefault<Quaternion> {
|
|
static bool compare(const Quaternion &p_lhs, const Quaternion &p_rhs) {
|
|
static bool compare(const Quaternion &p_lhs, const Quaternion &p_rhs) {
|
|
- return ((p_lhs.x == p_rhs.x) || (Math::is_nan(p_lhs.x) && Math::is_nan(p_rhs.x))) && ((p_lhs.y == p_rhs.y) || (Math::is_nan(p_lhs.y) && Math::is_nan(p_rhs.y))) && ((p_lhs.z == p_rhs.z) || (Math::is_nan(p_lhs.z) && Math::is_nan(p_rhs.z))) && ((p_lhs.w == p_rhs.w) || (Math::is_nan(p_lhs.w) && Math::is_nan(p_rhs.w)));
|
|
|
|
|
|
+ return p_lhs.is_same(p_rhs);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|