Skip to content

Commit

Permalink
Fix invalid Skeleton3D bone pose updates
Browse files Browse the repository at this point in the history
The issue would cause log spams when trying to update the bone pose position or rotation with an invalid bone index.
  • Loading branch information
m4gr3d committed Aug 26, 2024
1 parent 28a72fa commit 039722a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scene/3d/xr_hand_modifier_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ void XRHandModifier3D::_process_modification() {

// Apply previous relative transforms if they are stored.
for (int joint = 0; joint < XRHandTracker::HAND_JOINT_MAX; joint++) {
const int bone = joints[joint].bone;
if (bone == -1) {
continue;
}

if (bone_update == BONE_UPDATE_FULL) {
skeleton->set_bone_pose_position(joints[joint].bone, previous_relative_transforms[joint].origin);
}
Expand Down

0 comments on commit 039722a

Please sign in to comment.