summaryrefslogtreecommitdiffstats
path: root/core/math/matrix3.h
diff options
context:
space:
mode:
authorFerenc Arn <tagcup@yahoo.com>2017-04-05 17:47:13 -0500
committerFerenc Arn <tagcup@yahoo.com>2017-04-06 13:03:56 -0500
commit9a37ff1e34fe445a9168a7d91ae1df7d9928eb25 (patch)
treef524cd3d1fd4c31e7e1fe868eea45d3d3086c2f6 /core/math/matrix3.h
parent454f53c77659721a529c48fd4be6bf80d33c0082 (diff)
downloadredot-engine-9a37ff1e34fe445a9168a7d91ae1df7d9928eb25.tar.gz
Added various functions basic math classes. Also enabled math checks only for debug builds.
Added set_scale, set_rotation_euler, set_rotation_axis_angle. Addresses #2565 directly. Added an euler angle constructor for Basis in GDScript and also exposed is_normalized for vectors and quaternions. Various other changes mostly cosmetic in nature.
Diffstat (limited to 'core/math/matrix3.h')
-rw-r--r--core/math/matrix3.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/core/math/matrix3.h b/core/math/matrix3.h
index 0240bc8610..ddf473f167 100644
--- a/core/math/matrix3.h
+++ b/core/math/matrix3.h
@@ -76,15 +76,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];
@@ -96,7 +106,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;
@@ -120,8 +130,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) {