diff options
| author | Ferenc Arn | 2017-03-23 12:27:00 -0500 |
|---|---|---|
| committer | Ferenc Arn | 2017-03-23 12:27:00 -0500 |
| commit | 6bb9b58b09aee7fc543c03844ce51b62c838dadd (patch) | |
| tree | dcb9a80383698af2b9d741f151a03f5a2b739987 /core/math/vector3.h | |
| parent | c37fad650f92845a6f59740fea2fea1b46f56db1 (diff) | |
| download | godot-6bb9b58b09aee7fc543c03844ce51b62c838dadd.tar.gz godot-6bb9b58b09aee7fc543c03844ce51b62c838dadd.tar.zst godot-6bb9b58b09aee7fc543c03844ce51b62c838dadd.zip | |
Diffstat (limited to 'core/math/vector3.h')
| -rw-r--r-- | core/math/vector3.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/math/vector3.h b/core/math/vector3.h index fc02e66c3..097d6b948 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -75,6 +75,7 @@ struct Vector3 { _FORCE_INLINE_ void normalize(); _FORCE_INLINE_ Vector3 normalized() const; + _FORCE_INLINE_ bool is_normalized() const; _FORCE_INLINE_ Vector3 inverse() const; _FORCE_INLINE_ void zero(); @@ -385,6 +386,10 @@ Vector3 Vector3::normalized() const { return v; } +bool Vector3::is_normalized() const { + return Math::isequal_approx(length(), (real_t)1.0); +} + Vector3 Vector3::inverse() const { return Vector3(1.0 / x, 1.0 / y, 1.0 / z); |
