diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-02-09 18:09:05 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-02-09 18:09:05 +0100 |
commit | 161894652a0b811eb86388d58d59c14850f3a324 (patch) | |
tree | 269ac7b34e0db77757851e7e2be7c265970f1649 /modules/gltf/structures/gltf_node.cpp | |
parent | b604a0516e401515a1100a5c6f84a5e5373b1f36 (diff) | |
parent | c60ed2587ddfa1aa8835658d3f75a954c2cac4ec (diff) | |
download | redot-engine-161894652a0b811eb86388d58d59c14850f3a324.tar.gz |
Merge pull request #83231 from aaronfranke/gltf-transform
Fix desynced duplicate GLTFNode transform properties
Diffstat (limited to 'modules/gltf/structures/gltf_node.cpp')
-rw-r--r-- | modules/gltf/structures/gltf_node.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/gltf/structures/gltf_node.cpp b/modules/gltf/structures/gltf_node.cpp index 30895034a9..03f71525fd 100644 --- a/modules/gltf/structures/gltf_node.cpp +++ b/modules/gltf/structures/gltf_node.cpp @@ -89,11 +89,11 @@ void GLTFNode::set_height(int p_height) { } Transform3D GLTFNode::get_xform() { - return xform; + return transform; } void GLTFNode::set_xform(Transform3D p_xform) { - xform = p_xform; + transform = p_xform; } GLTFMeshIndex GLTFNode::get_mesh() { @@ -129,27 +129,27 @@ void GLTFNode::set_skeleton(GLTFSkeletonIndex p_skeleton) { } Vector3 GLTFNode::get_position() { - return position; + return transform.origin; } void GLTFNode::set_position(Vector3 p_position) { - position = p_position; + transform.origin = p_position; } Quaternion GLTFNode::get_rotation() { - return rotation; + return transform.basis.get_rotation_quaternion(); } void GLTFNode::set_rotation(Quaternion p_rotation) { - rotation = p_rotation; + transform.basis.set_quaternion_scale(p_rotation, transform.basis.get_scale()); } Vector3 GLTFNode::get_scale() { - return scale; + return transform.basis.get_scale(); } void GLTFNode::set_scale(Vector3 p_scale) { - scale = p_scale; + transform.basis = transform.basis.orthonormalized() * Basis::from_scale(p_scale); } Vector<int> GLTFNode::get_children() { |