diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/math/matrix3.cpp | 9 | ||||
-rw-r--r-- | core/math/matrix3.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp index ab3bca79ae..5346141470 100644 --- a/core/math/matrix3.cpp +++ b/core/math/matrix3.cpp @@ -311,6 +311,15 @@ void Basis::rotate(const Vector3 &p_axis, real_t p_phi) { *this = rotated(p_axis, p_phi); } +void Basis::rotate_local(const Vector3 &p_axis, real_t p_phi) { + + *this = rotated_local(p_axis, p_phi); +} +Basis Basis::rotated_local(const Vector3 &p_axis, real_t p_phi) const { + + return (*this) * Basis(p_axis, p_phi); +} + Basis Basis::rotated(const Vector3 &p_euler) const { return Basis(p_euler) * (*this); } diff --git a/core/math/matrix3.h b/core/math/matrix3.h index 9a33b8203d..9a75308f08 100644 --- a/core/math/matrix3.h +++ b/core/math/matrix3.h @@ -75,6 +75,9 @@ public: void rotate(const Vector3 &p_axis, real_t p_phi); Basis rotated(const Vector3 &p_axis, real_t p_phi) const; + void rotate_local(const Vector3 &p_axis, real_t p_phi); + Basis rotated_local(const Vector3 &p_axis, real_t p_phi) const; + void rotate(const Vector3 &p_euler); Basis rotated(const Vector3 &p_euler) const; |