Skip to content

Commit 22209db

Browse files
committed
Add checking of hand-tracking state.
1 parent f7d7fa1 commit 22209db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

addons/hand_pose_detector/hand_pose_detector.gd

+8
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ func _process(delta: float) -> void:
6565
if not tracker or not hand_pose_set:
6666
return
6767

68+
# If the palm is not tracked then skip pose detection. Any current pose will
69+
# remain active until we see the hand again.
70+
var flags := tracker.get_hand_joint_flags(XRHandTracker.HAND_JOINT_PALM)
71+
if (flags & XRHandTracker.HAND_JOINT_FLAG_POSITION_TRACKED) == 0:
72+
return;
73+
if (flags & XRHandTracker.HAND_JOINT_FLAG_ORIENTATION_TRACKED) == 0:
74+
return;
75+
6876
# Save the active pose before updates (to report changes)
6977
var active_pos := _current_pose
7078

0 commit comments

Comments
 (0)