summaryrefslogtreecommitdiff
path: root/core/math/math_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/math_2d.cpp')
-rw-r--r--core/math/math_2d.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp
index 76eeece688..995cb0834a 100644
--- a/core/math/math_2d.cpp
+++ b/core/math/math_2d.cpp
@@ -157,6 +157,13 @@ bool Vector2::operator!=(const Vector2& p_vec2) const {
return x!=p_vec2.x || y!=p_vec2.y;
}
+bool Vector2::nan_equals(const Vector2& p_vec2) const {
+
+ return (x==p_vec2.x && y==p_vec2.y) ||
+ (x==p_vec2.x && isnan(y) && isnan(p_vec2.y)) ||
+ (isnan(x) && isnan(p_vec2.x) && y == p_vec2.y);
+}
+
Vector2 Vector2::floor() const {
return Vector2( Math::floor(x), Math::floor(y) );