Просмотр исходного кода

Allow the hips joint to be positioned even if the bone update mode is set to "Rotation Only".

Malcolm Nixon 1 год назад
Родитель
Сommit
8fcf385ac5
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      scene/3d/xr_body_modifier_3d.cpp

+ 3 - 2
scene/3d/xr_body_modifier_3d.cpp

@@ -353,8 +353,9 @@ void XRBodyModifier3D::_update_skeleton() {
 		const int parent_joint = joints[joint].parent_joint;
 		const Transform3D relative_transform = inv_transforms[parent_joint] * transforms[joint];
 
-		// Update the bone position if enabled by update mode.
-		if (bone_update == BONE_UPDATE_FULL) {
+		// Update the bone position if enabled by update mode, or if the joint is the hips to allow
+		// for climbing or crouching.
+		if (bone_update == BONE_UPDATE_FULL || joint == XRBodyTracker::JOINT_HIPS) {
 			skeleton->set_bone_pose_position(joints[joint].bone, relative_transform.origin);
 		}