From 8fcf385ac59e42c1d8163c534a78eb34dc100344 Mon Sep 17 00:00:00 2001 From: Malcolm Nixon Date: Sat, 2 Mar 2024 22:17:29 -0500 Subject: [PATCH] Allow the hips joint to be positioned even if the bone update mode is set to "Rotation Only". --- scene/3d/xr_body_modifier_3d.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scene/3d/xr_body_modifier_3d.cpp b/scene/3d/xr_body_modifier_3d.cpp index 3414ce13ae..82fcc941ed 100644 --- a/scene/3d/xr_body_modifier_3d.cpp +++ b/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); }