summaryrefslogtreecommitdiffstats
path: root/core/math/vector2.h
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2019-10-02 16:35:49 -0400
committerAaron Franke <arnfranke@yahoo.com>2019-10-14 16:48:59 -0400
commit218f38c7ecdea970a5e82a48e7782077be4fc248 (patch)
tree98c0dc91a6253b678a3cd3dc781b5b4c10044e65 /core/math/vector2.h
parentaeb70756287ad209f0b9d799bcd157dcaed41c17 (diff)
downloadredot-engine-218f38c7ecdea970a5e82a48e7782077be4fc248.tar.gz
Expose is_equal_approx and restore == to be exact again
This commit changes behavior for GDScript and C#. Also did some organizing of the order to logically group related methods, mostly for Rect2 and AABB.
Diffstat (limited to 'core/math/vector2.h')
-rw-r--r--core/math/vector2.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/vector2.h b/core/math/vector2.h
index 39fec15ce6..7fcaadab00 100644
--- a/core/math/vector2.h
+++ b/core/math/vector2.h
@@ -223,11 +223,11 @@ _FORCE_INLINE_ Vector2 Vector2::operator-() const {
_FORCE_INLINE_ bool Vector2::operator==(const Vector2 &p_vec2) const {
- return Math::is_equal_approx(x, p_vec2.x) && Math::is_equal_approx(y, p_vec2.y);
+ return x == p_vec2.x && y == p_vec2.y;
}
_FORCE_INLINE_ bool Vector2::operator!=(const Vector2 &p_vec2) const {
- return !Math::is_equal_approx(x, p_vec2.x) || !Math::is_equal_approx(y, p_vec2.y);
+ return x != p_vec2.x || y != p_vec2.y;
}
Vector2 Vector2::linear_interpolate(const Vector2 &p_b, real_t p_t) const {