aboutsummaryrefslogtreecommitdiff
path: root/core/math/math_2d.cpp
diff options
context:
space:
mode:
authorHein-Pieter van Braam2017-02-14 04:10:02 +0100
committerHein-Pieter van Braam2017-02-14 13:32:23 +0100
commitadcc211feb7827127b2548c791f2de0b6efda3d3 (patch)
tree8bb33b592e3d3982ca5faf5e041c37644d5b525d /core/math/math_2d.cpp
parent81edda18f39efc4f783bc6fa2b381c01cfc0ef2d (diff)
downloadgodot-adcc211feb7827127b2548c791f2de0b6efda3d3.tar.gz
godot-adcc211feb7827127b2548c791f2de0b6efda3d3.tar.zst
godot-adcc211feb7827127b2548c791f2de0b6efda3d3.zip
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 76eeece68..995cb0834 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) );