diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-04-24 11:16:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-24 11:16:20 +0200 |
commit | 5ae1e172da08a63b14635f5d06e32385901525e2 (patch) | |
tree | 9a9bd7f4dd90eada323f504b551e7630802fa494 /core/math/matrix3.h | |
parent | 90ef1fd03d43d51f09b730dee107c0e407cf0703 (diff) | |
parent | 9a37ff1e34fe445a9168a7d91ae1df7d9928eb25 (diff) | |
download | redot-engine-5ae1e172da08a63b14635f5d06e32385901525e2.tar.gz |
Merge pull request #8277 from tagcup/math_checks
Added various functions basic math classes. Also enabled math checks …
Diffstat (limited to 'core/math/matrix3.h')
-rw-r--r-- | core/math/matrix3.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/core/math/matrix3.h b/core/math/matrix3.h index 08e963f56e..c3eeb1f705 100644 --- a/core/math/matrix3.h +++ b/core/math/matrix3.h @@ -77,15 +77,25 @@ public: void rotate(const Vector3 &p_euler); Basis rotated(const Vector3 &p_euler) const; + Vector3 get_rotation() const; + void get_rotation_axis_angle(Vector3 &p_axis, real_t &p_angle) const; - void scale(const Vector3 &p_scale); - Basis scaled(const Vector3 &p_scale) const; - Vector3 get_scale() const; + void set_rotation_euler(const Vector3 &p_euler); + void set_rotation_axis_angle(const Vector3 &p_axis, real_t p_angle); Vector3 get_euler() const; void set_euler(const Vector3 &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); + + void scale(const Vector3 &p_scale); + Basis scaled(const Vector3 &p_scale) const; + + Vector3 get_scale() const; + void set_scale(const Vector3 &p_scale); + // transposed dot products _FORCE_INLINE_ real_t tdotx(const Vector3 &v) const { return elements[0][0] * v[0] + elements[1][0] * v[1] + elements[2][0] * v[2]; @@ -97,7 +107,7 @@ public: return elements[0][2] * v[0] + elements[1][2] * v[1] + elements[2][2] * v[2]; } - bool isequal_approx(const Basis &a, const Basis &b) const; + bool is_equal_approx(const Basis &a, const Basis &b) const; bool operator==(const Basis &p_matrix) const; bool operator!=(const Basis &p_matrix) const; @@ -121,8 +131,6 @@ public: operator String() const; - void get_axis_and_angle(Vector3 &r_axis, real_t &r_angle) const; - /* create / set */ _FORCE_INLINE_ void set(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz) { |