diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-11 09:25:46 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-11 09:25:46 +0200 |
commit | 58eff50bf12dc330df284d7ff78bcfa59f5a2037 (patch) | |
tree | 42b500cefeff0b4226c9596f209adc086589bdb0 /core/math/vector3.cpp | |
parent | 3306ffefd1d00ac5cec0783b9a34633d2d1a6ab3 (diff) | |
parent | 5da515773d8edec988b7523ea97cdfd54c3fd16c (diff) | |
download | redot-engine-58eff50bf12dc330df284d7ff78bcfa59f5a2037.tar.gz |
Merge pull request #64268 from timothyqiu/is-finite
Add `is_finite` method for checking built-in types
Diffstat (limited to 'core/math/vector3.cpp')
-rw-r--r-- | core/math/vector3.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index 55ba509144..b106200c4a 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -139,6 +139,10 @@ bool Vector3::is_zero_approx() const { return Math::is_zero_approx(x) && Math::is_zero_approx(y) && Math::is_zero_approx(z); } +bool Vector3::is_finite() const { + return Math::is_finite(x) && Math::is_finite(y) && Math::is_finite(z); +} + Vector3::operator String() const { return "(" + String::num_real(x, false) + ", " + String::num_real(y, false) + ", " + String::num_real(z, false) + ")"; } |