From 86922ff70ba533b376a6680f965f542894e8c614 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Mon, 14 Oct 2019 16:33:45 -0400 Subject: Make is_equal_approx separate for structures This commit adds exposed behavior for C# --- core/math/vector2.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/math/vector2.cpp') diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index 972bccc0ac..fbedeb8eb2 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -203,6 +203,10 @@ Vector2 Vector2::reflect(const Vector2 &p_normal) const { return 2.0 * p_normal * this->dot(p_normal) - *this; } +bool Vector2::is_equal_approx(const Vector2 &p_v) const { + return Math::is_equal_approx(x, p_v.x) && Math::is_equal_approx(y, p_v.y); +} + /* Vector2i */ Vector2i Vector2i::operator+(const Vector2i &p_v) const { -- cgit v1.2.3