diff options
Diffstat (limited to 'core/math/matrix3.h')
-rw-r--r-- | core/math/matrix3.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/core/math/matrix3.h b/core/math/matrix3.h index be85c244bd..9a33b8203d 100644 --- a/core/math/matrix3.h +++ b/core/math/matrix3.h @@ -81,16 +81,18 @@ public: Vector3 get_rotation() const; void get_rotation_axis_angle(Vector3 &p_axis, real_t &p_angle) const; - void set_rotation_euler(const Vector3 &p_euler); - void set_rotation_axis_angle(const Vector3 &p_axis, real_t p_angle); + Vector3 rotref_posscale_decomposition(Basis &rotref) const; Vector3 get_euler_xyz() const; void set_euler_xyz(const Vector3 &p_euler); Vector3 get_euler_yxz() const; void set_euler_yxz(const Vector3 &p_euler); - Vector3 get_euler() const { return get_euler_yxz(); }; - void set_euler(const Vector3 &p_euler) { set_euler_yxz(p_euler); }; + Quat get_quat() const; + void set_quat(const Quat &p_quat); + + Vector3 get_euler() const { return get_euler_yxz(); } + void set_euler(const Vector3 &p_euler) { set_euler_yxz(p_euler); } void get_axis_angle(Vector3 &r_axis, real_t &r_angle) const; void set_axis_angle(const Vector3 &p_axis, real_t p_phi); @@ -98,8 +100,9 @@ public: void scale(const Vector3 &p_scale); Basis scaled(const Vector3 &p_scale) const; - Vector3 get_scale() const; void set_scale(const Vector3 &p_scale); + Vector3 get_scale() const; + Vector3 get_signed_scale() const; // transposed dot products _FORCE_INLINE_ real_t tdotx(const Vector3 &v) const { @@ -132,6 +135,7 @@ public: void set_orthogonal_index(int p_index); bool is_orthogonal() const; + bool is_diagonal() const; bool is_rotation() const; operator String() const; @@ -204,11 +208,11 @@ public: bool is_symmetric() const; Basis diagonalize(); - operator Quat() const; + operator Quat() const { return get_quat(); } - Basis(const Quat &p_quat); // euler - Basis(const Vector3 &p_euler); // euler - Basis(const Vector3 &p_axis, real_t p_phi); + Basis(const Quat &p_quat) { set_quat(p_quat); }; + Basis(const Vector3 &p_euler) { set_euler(p_euler); } + Basis(const Vector3 &p_axis, real_t p_phi) { set_axis_angle(p_axis, p_phi); } _FORCE_INLINE_ Basis(const Vector3 &row0, const Vector3 &row1, const Vector3 &row2) { elements[0] = row0; |