diff options
author | Jonathan Nicholl <jonathantnicholl@gmail.com> | 2022-09-01 20:32:33 -0400 |
---|---|---|
committer | Jonathan Nicholl <jonathantnicholl@gmail.com> | 2022-09-02 00:29:50 -0400 |
commit | 15d057c5211270605d4344165930bba9c5d7e2aa (patch) | |
tree | 04856ee92b23c5ea34cc39d708881796ca4cad8c /core/math/vector2.cpp | |
parent | c6fd311da0d0052bb11237662ec528f9fab1b7dd (diff) | |
download | redot-engine-15d057c5211270605d4344165930bba9c5d7e2aa.tar.gz |
Add `is_zero_approx` methods to `Vector2`, `3`, and `4`
Diffstat (limited to 'core/math/vector2.cpp')
-rw-r--r-- | core/math/vector2.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index d9b5d55454..56dbba393a 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -182,6 +182,10 @@ 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); } +bool Vector2::is_zero_approx() const { + return Math::is_zero_approx(x) && Math::is_zero_approx(y); +} + Vector2::operator String() const { return "(" + String::num_real(x, false) + ", " + String::num_real(y, false) + ")"; } |