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

This commit is contained in:
Malcolm Nixon 2024-03-02 22:17:29 -05:00
parent f2045ba822
commit 8fcf385ac5

View File

@ -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);
}