[Core] Add is_same to types that have float components
Compares `NaN` as equal. Added to: * `AABB` * `Basis` * `Color` * `Plane` * `Projection` * `Quaternion` * `Rect2` * `Transform2D` * `Transform3D` * `Vector2` * `Vector3` * `Vector4` And added as a method in `Math`
This commit is contained in:
committed by
AThousandShips
parent
eee39f004b
commit
e825085978
@ -66,6 +66,10 @@ bool Quaternion::is_equal_approx(const Quaternion &p_quaternion) const {
|
||||
return Math::is_equal_approx(x, p_quaternion.x) && Math::is_equal_approx(y, p_quaternion.y) && Math::is_equal_approx(z, p_quaternion.z) && Math::is_equal_approx(w, p_quaternion.w);
|
||||
}
|
||||
|
||||
bool Quaternion::is_same(const Quaternion &p_quaternion) const {
|
||||
return Math::is_same(x, p_quaternion.x) && Math::is_same(y, p_quaternion.y) && Math::is_same(z, p_quaternion.z) && Math::is_same(w, p_quaternion.w);
|
||||
}
|
||||
|
||||
bool Quaternion::is_finite() const {
|
||||
return Math::is_finite(x) && Math::is_finite(y) && Math::is_finite(z) && Math::is_finite(w);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user