summaryrefslogtreecommitdiff
path: root/core/math/vector2.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-10-11 09:25:46 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-10-11 09:25:46 +0200
commit58eff50bf12dc330df284d7ff78bcfa59f5a2037 (patch)
tree42b500cefeff0b4226c9596f209adc086589bdb0 /core/math/vector2.cpp
parent3306ffefd1d00ac5cec0783b9a34633d2d1a6ab3 (diff)
parent5da515773d8edec988b7523ea97cdfd54c3fd16c (diff)
Merge pull request #64268 from timothyqiu/is-finite
Add `is_finite` method for checking built-in types
Diffstat (limited to 'core/math/vector2.cpp')
-rw-r--r--core/math/vector2.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp
index 56dbba393a..5366587126 100644
--- a/core/math/vector2.cpp
+++ b/core/math/vector2.cpp
@@ -186,6 +186,10 @@ bool Vector2::is_zero_approx() const {
return Math::is_zero_approx(x) && Math::is_zero_approx(y);
}
+bool Vector2::is_finite() const {
+ return Math::is_finite(x) && Math::is_finite(y);
+}
+
Vector2::operator String() const {
return "(" + String::num_real(x, false) + ", " + String::num_real(y, false) + ")";
}