diff options
| author | Juan Linietsky | 2017-07-15 01:23:10 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-07-15 08:32:34 -0300 |
| commit | 2e73be99d8d86d9dad7bcb99518a4d3cbb5c373c (patch) | |
| tree | d863db50852afe5d4b0bc15b8452054498004cb1 /core/math/vector3.h | |
| parent | e64b82ebfcc3475c7a7d2a9196bfe20d6c9e3614 (diff) | |
| download | godot-2e73be99d8d86d9dad7bcb99518a4d3cbb5c373c.tar.gz godot-2e73be99d8d86d9dad7bcb99518a4d3cbb5c373c.tar.zst godot-2e73be99d8d86d9dad7bcb99518a4d3cbb5c373c.zip | |
Diffstat (limited to 'core/math/vector3.h')
| -rw-r--r-- | core/math/vector3.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/math/vector3.h b/core/math/vector3.h index 7dfcedd0d..6a7974681 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -100,6 +100,7 @@ struct Vector3 { _FORCE_INLINE_ Vector3 abs() const; _FORCE_INLINE_ Vector3 floor() const; + _FORCE_INLINE_ Vector3 sign() const; _FORCE_INLINE_ Vector3 ceil() const; _FORCE_INLINE_ real_t distance_to(const Vector3 &p_b) const; @@ -187,6 +188,11 @@ Vector3 Vector3::abs() const { return Vector3(Math::abs(x), Math::abs(y), Math::abs(z)); } +Vector3 Vector3::sign() const { + + return Vector3(SGN(x), SGN(y), SGN(z)); +} + Vector3 Vector3::floor() const { return Vector3(Math::floor(x), Math::floor(y), Math::floor(z)); |
