summaryrefslogtreecommitdiffstats
path: root/modules/gltf/structures/gltf_node.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2023-10-12 17:37:03 -0500
committerAaron Franke <arnfranke@yahoo.com>2024-01-29 21:24:02 -0600
commitc60ed2587ddfa1aa8835658d3f75a954c2cac4ec (patch)
tree0456a92985b8045d2ee3496190878af7ed30ab08 /modules/gltf/structures/gltf_node.cpp
parent51991e20143a39e9ef0107163eaf283ca0a761ea (diff)
downloadredot-engine-c60ed2587ddfa1aa8835658d3f75a954c2cac4ec.tar.gz
Fix desynced duplicate GLTFNode transform properties
Diffstat (limited to 'modules/gltf/structures/gltf_node.cpp')
-rw-r--r--modules/gltf/structures/gltf_node.cpp16
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() {