summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-26 09:39:20 +0100
committerGitHub <noreply@github.com>2021-01-26 09:39:20 +0100
commitacd96e5201f1afe0ec7ebfab32272334041429c4 (patch)
treecd59f35b58ff2b4357214e31a13cc21c383c9077 /modules
parent24a112a66138260613a73b7a647d97e57b6da237 (diff)
parent8b983bddfbf20d782cfee41d8f160ec1394f9b0f (diff)
Merge pull request #45407 from madmiraal/remove-set-methods
Remove Quat set methods in favour of constructors
Diffstat (limited to 'modules')
-rw-r--r--modules/gltf/gltf_document.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index d07d4d603c..1c97bbfb86 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -5287,8 +5287,7 @@ void GLTFDocument::_convert_mult_mesh_instance_to_gltf(Node *p_scene_parent, con
transform.origin =
Vector3(xform_2d.get_origin().x, 0, xform_2d.get_origin().y);
real_t rotation = xform_2d.get_rotation();
- Quat quat;
- quat.set_axis_angle(Vector3(0, 1, 0), rotation);
+ Quat quat(Vector3(0, 1, 0), rotation);
Size2 scale = xform_2d.get_scale();
transform.basis.set_quat_scale(quat,
Vector3(scale.x, 0, scale.y));
@@ -6040,14 +6039,12 @@ GLTFAnimation::Track GLTFDocument::_convert_animation_track(Ref<GLTFState> state
p_track.rotation_track.interpolation = gltf_interpolation;
for (int32_t key_i = 0; key_i < key_count; key_i++) {
- Quat rotation;
Vector3 rotation_degrees = p_animation->track_get_key_value(p_track_i, key_i);
Vector3 rotation_radian;
rotation_radian.x = Math::deg2rad(rotation_degrees.x);
rotation_radian.y = Math::deg2rad(rotation_degrees.y);
rotation_radian.z = Math::deg2rad(rotation_degrees.z);
- rotation.set_euler(rotation_radian);
- p_track.rotation_track.values.write[key_i] = rotation;
+ p_track.rotation_track.values.write[key_i] = Quat(rotation_radian);
}
} else if (path.find(":scale") != -1) {
p_track.scale_track.times = times;