diff options
| author | Hein-Pieter van Braam | 2017-02-14 04:10:02 +0100 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2017-02-14 13:32:23 +0100 |
| commit | adcc211feb7827127b2548c791f2de0b6efda3d3 (patch) | |
| tree | 8bb33b592e3d3982ca5faf5e041c37644d5b525d /core/math/math_2d.cpp | |
| parent | 81edda18f39efc4f783bc6fa2b381c01cfc0ef2d (diff) | |
| download | godot-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.cpp | 7 |
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) ); |
