diff options
-rw-r--r-- | core/math/matrix3.cpp | 33 | ||||
-rw-r--r-- | core/math/matrix3.h | 4 | ||||
-rw-r--r-- | core/variant_call.cpp | 6 | ||||
-rw-r--r-- | doc/base/classes.xml | 23 | ||||
-rw-r--r-- | scene/3d/arvr_nodes.cpp | 2 |
5 files changed, 1 insertions, 67 deletions
diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp index c7e2a8f307..57555bbb2a 100644 --- a/core/math/matrix3.cpp +++ b/core/math/matrix3.cpp @@ -254,17 +254,6 @@ Vector3 Basis::get_scale() const { Vector3(elements[0][2], elements[1][2], elements[2][2]).length()); } -// Sets scaling while preserving rotation. -// This requires some care when working with matrices with negative determinant, -// since we're using a particular convention for "polar" decomposition in get_scale and get_rotation. -// For details, see the explanation in get_scale. -void Basis::set_scale(const Vector3 &p_scale) { - Vector3 e = get_euler(); - Basis(); // reset to identity - scale(p_scale); - rotate(e); -} - // Multiplies the matrix from left by the rotation matrix: M -> R.M // Note that this does *not* rotate the matrix itself. // @@ -316,28 +305,6 @@ void Basis::get_rotation_axis_angle(Vector3 &p_axis, real_t &p_angle) const { m.get_axis_angle(p_axis, p_angle); } -// Sets rotation while preserving scaling. -// This requires some care when working with matrices with negative determinant, -// since we're using a particular convention for "polar" decomposition in get_scale and get_rotation. -// For details, see the explanation in get_scale. -void Basis::set_rotation_euler(const Vector3 &p_euler) { - Vector3 s = get_scale(); - Basis(); // reset to identity - scale(s); - rotate(p_euler); -} - -// Sets rotation while preserving scaling. -// This requires some care when working with matrices with negative determinant, -// since we're using a particular convention for "polar" decomposition in get_scale and get_rotation. -// For details, see the explanation in get_scale. -void Basis::set_rotation_axis_angle(const Vector3 &p_axis, real_t p_angle) { - Vector3 s = get_scale(); - Basis(); // reset to identity - scale(s); - rotate(p_axis, p_angle); -} - // get_euler_xyz returns a vector containing the Euler angles in the format // (a1,a2,a3), where a3 is the angle of the first rotation, and a1 is the last // (following the convention they are commonly defined in the literature). diff --git a/core/math/matrix3.h b/core/math/matrix3.h index be85c244bd..be8de2e1c4 100644 --- a/core/math/matrix3.h +++ b/core/math/matrix3.h @@ -81,9 +81,6 @@ 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 get_euler_xyz() const; void set_euler_xyz(const Vector3 &p_euler); Vector3 get_euler_yxz() const; @@ -99,7 +96,6 @@ public: 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 { diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 77372d1e60..ad15f8f5cb 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -729,9 +729,6 @@ struct _VariantCall { VCALL_PTR1R(Basis, scaled); VCALL_PTR0R(Basis, get_scale); VCALL_PTR0R(Basis, get_euler); - VCALL_PTR1(Basis, set_scale); - VCALL_PTR1(Basis, set_rotation_euler); - VCALL_PTR2(Basis, set_rotation_axis_angle); VCALL_PTR1R(Basis, tdotx); VCALL_PTR1R(Basis, tdoty); VCALL_PTR1R(Basis, tdotz); @@ -1700,9 +1697,6 @@ void register_variant_methods() { ADDFUNC0(BASIS, REAL, Basis, determinant, varray()); ADDFUNC2(BASIS, BASIS, Basis, rotated, VECTOR3, "axis", REAL, "phi", varray()); ADDFUNC1(BASIS, BASIS, Basis, scaled, VECTOR3, "scale", varray()); - ADDFUNC1(BASIS, NIL, Basis, set_scale, VECTOR3, "scale", varray()); - ADDFUNC1(BASIS, NIL, Basis, set_rotation_euler, VECTOR3, "euler", varray()); - ADDFUNC2(BASIS, NIL, Basis, set_rotation_axis_angle, VECTOR3, "axis", REAL, "angle", varray()); ADDFUNC0(BASIS, VECTOR3, Basis, get_scale, varray()); ADDFUNC0(BASIS, VECTOR3, Basis, get_euler, varray()); ADDFUNC1(BASIS, REAL, Basis, tdotx, VECTOR3, "with", varray()); diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 26c0b81428..8af7385934 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -7741,29 +7741,6 @@ Introduce an additional scaling specified by the given 3D scaling factor. Only relevant when the matrix is being used as a part of [Transform]. </description> </method> - <method name="set_rotation_axis_angle"> - <argument index="0" name="axis" type="Vector3"> - </argument> - <argument index="1" name="angle" type="float"> - </argument> - <description> - Changes only the rotation part of the [Basis] to a rotation around given axis by phi, while preserving the scaling part (as determined by get_scale). - </description> - </method> - <method name="set_rotation_euler"> - <argument index="0" name="euler" type="Vector3"> - </argument> - <description> - Changes only the rotation part of the [Basis] to a rotation corresponding to given Euler angles, while preserving the scaling part (as determined by get_scale). - </description> - </method> - <method name="set_scale"> - <argument index="0" name="scale" type="Vector3"> - </argument> - <description> - Changes only the scaling part of the Basis to the specified scaling, while preserving the rotation part (as determined by get_rotation). - </description> - </method> <method name="tdotx"> <return type="float"> </return> diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index 545be8bc5f..caf313190b 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -264,7 +264,7 @@ void ARVRAnchor::_notification(int p_what) { // our basis is scaled to the size of the plane the anchor is tracking // extract the size from our basis and reset the scale size = transform.basis.get_scale() * world_scale; - transform.basis.set_scale(Vector3(1.0, 1.0, 1.0)); + transform.basis.orthonormalize(); // apply our reference frame and set our transform set_transform(arvr_server->get_reference_frame() * transform); |