diff options
Diffstat (limited to 'core/math/vector2.h')
-rw-r--r-- | core/math/vector2.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/math/vector2.h b/core/math/vector2.h index 1a73831891..7fcaadab00 100644 --- a/core/math/vector2.h +++ b/core/math/vector2.h @@ -92,6 +92,8 @@ struct Vector2 { Vector2 bounce(const Vector2 &p_normal) const; Vector2 reflect(const Vector2 &p_normal) const; + bool is_equal_approx(const Vector2 &p_v) const; + Vector2 operator+(const Vector2 &p_v) const; void operator+=(const Vector2 &p_v); Vector2 operator-(const Vector2 &p_v) const; @@ -221,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 { |