Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checking of hand-tracking state. #16

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions addons/hand_pose_detector/hand_pose_detector.gd
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ func _process(delta: float) -> void:
if not tracker or not hand_pose_set:
return

# If the palm is not tracked then skip pose detection. Any current pose will
# remain active until we see the hand again.
var flags := tracker.get_hand_joint_flags(XRHandTracker.HAND_JOINT_PALM)
if (flags & XRHandTracker.HAND_JOINT_FLAG_POSITION_TRACKED) == 0:
return;
if (flags & XRHandTracker.HAND_JOINT_FLAG_ORIENTATION_TRACKED) == 0:
return;

# Save the active pose before updates (to report changes)
var active_pos := _current_pose

Expand Down