[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:
parent
eee39f004b
commit
e825085978
27 changed files with 99 additions and 87 deletions
|
|
@ -62,6 +62,10 @@ bool Vector4::is_equal_approx(const Vector4 &p_vec4) const {
|
|||
return Math::is_equal_approx(x, p_vec4.x) && Math::is_equal_approx(y, p_vec4.y) && Math::is_equal_approx(z, p_vec4.z) && Math::is_equal_approx(w, p_vec4.w);
|
||||
}
|
||||
|
||||
bool Vector4::is_same(const Vector4 &p_vec4) const {
|
||||
return Math::is_same(x, p_vec4.x) && Math::is_same(y, p_vec4.y) && Math::is_same(z, p_vec4.z) && Math::is_same(w, p_vec4.w);
|
||||
}
|
||||
|
||||
bool Vector4::is_zero_approx() const {
|
||||
return Math::is_zero_approx(x) && Math::is_zero_approx(y) && Math::is_zero_approx(z) && Math::is_zero_approx(w);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue