summaryrefslogtreecommitdiff
path: root/core/math/basis.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-02 22:37:12 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-02 22:37:12 +0100
commit08d56ac2f10f4c9484e253bcfd3a0ad065514080 (patch)
tree0cca6a53f8689e65c6f60e60fc9b1a4720be2f3e /core/math/basis.h
parent18380817f2da27bfd79079c5730ae68a1d06ed33 (diff)
parent8556fdd4bc1560f03f70df08282b12464a4cdf04 (diff)
Merge pull request #66747 from aaronfranke/move-euler-order
Move EulerOrder enum to math_defs.h and global scope
Diffstat (limited to 'core/math/basis.h')
-rw-r--r--core/math/basis.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/core/math/basis.h b/core/math/basis.h
index 69bef5a7be..a1d9fccef1 100644
--- a/core/math/basis.h
+++ b/core/math/basis.h
@@ -56,15 +56,6 @@ struct _NO_DISCARD_ Basis {
_FORCE_INLINE_ real_t determinant() const;
- enum EulerOrder {
- EULER_ORDER_XYZ,
- EULER_ORDER_XZY,
- EULER_ORDER_YXZ,
- EULER_ORDER_YZX,
- EULER_ORDER_ZXY,
- EULER_ORDER_ZYX
- };
-
void from_z(const Vector3 &p_z);
void rotate(const Vector3 &p_axis, real_t p_angle);
@@ -73,13 +64,13 @@ struct _NO_DISCARD_ Basis {
void rotate_local(const Vector3 &p_axis, real_t p_angle);
Basis rotated_local(const Vector3 &p_axis, real_t p_angle) const;
- void rotate(const Vector3 &p_euler, EulerOrder p_order = EULER_ORDER_YXZ);
- Basis rotated(const Vector3 &p_euler, EulerOrder p_order = EULER_ORDER_YXZ) const;
+ void rotate(const Vector3 &p_euler, EulerOrder p_order = EulerOrder::YXZ);
+ Basis rotated(const Vector3 &p_euler, EulerOrder p_order = EulerOrder::YXZ) const;
void rotate(const Quaternion &p_quaternion);
Basis rotated(const Quaternion &p_quaternion) const;
- Vector3 get_euler_normalized(EulerOrder p_order = EULER_ORDER_YXZ) const;
+ Vector3 get_euler_normalized(EulerOrder p_order = EulerOrder::YXZ) const;
void get_rotation_axis_angle(Vector3 &p_axis, real_t &p_angle) const;
void get_rotation_axis_angle_local(Vector3 &p_axis, real_t &p_angle) const;
Quaternion get_rotation_quaternion() const;
@@ -88,9 +79,9 @@ struct _NO_DISCARD_ Basis {
Vector3 rotref_posscale_decomposition(Basis &rotref) const;
- Vector3 get_euler(EulerOrder p_order = EULER_ORDER_YXZ) const;
- void set_euler(const Vector3 &p_euler, EulerOrder p_order = EULER_ORDER_YXZ);
- static Basis from_euler(const Vector3 &p_euler, EulerOrder p_order = EULER_ORDER_YXZ) {
+ Vector3 get_euler(EulerOrder p_order = EulerOrder::YXZ) const;
+ void set_euler(const Vector3 &p_euler, EulerOrder p_order = EulerOrder::YXZ);
+ static Basis from_euler(const Vector3 &p_euler, EulerOrder p_order = EulerOrder::YXZ) {
Basis b;
b.set_euler(p_euler, p_order);
return b;
@@ -119,7 +110,7 @@ struct _NO_DISCARD_ Basis {
Vector3 get_scale_local() const;
void set_axis_angle_scale(const Vector3 &p_axis, real_t p_angle, const Vector3 &p_scale);
- void set_euler_scale(const Vector3 &p_euler, const Vector3 &p_scale, EulerOrder p_order = EULER_ORDER_YXZ);
+ void set_euler_scale(const Vector3 &p_euler, const Vector3 &p_scale, EulerOrder p_order = EulerOrder::YXZ);
void set_quaternion_scale(const Quaternion &p_quaternion, const Vector3 &p_scale);
// transposed dot products