-
Notifications
You must be signed in to change notification settings - Fork 24
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
Implement XR_FB_hand_tracking_aim extension #81
Conversation
ca7b8c6
to
fe3162e
Compare
Note: This will fail CI until the Godot PR is merged, and we're using godot-cpp with an updated |
I'm not against support for hand tracking aim, but it should come with a big warning that it's an older solution that is not portable, and that soon better alternatives are possible through the hand interaction API. For getting this PR over the line I'd like to see two changes:
|
Note that for point 2, we probably need to make an amendment to core so OpenXRInterface::get_suggested_tracker_names calls into extension wrappers to ask for additional entries to return. We can then just have the 3 OpenXR paths returned, move the HTC entries into the HTC extension, and have this extension return the two new trackers. This will ensure they are selectable from the dropdown. Similarly, but this should be for later as its a much bigger job and a more structural change, |
d637884
to
c94823d
Compare
XRPose::TrackingConfidence confidence = XRPose::TrackingConfidence::XR_TRACKING_CONFIDENCE_LOW; | ||
|
||
if (!(aim_state[i].status & XR_HAND_TRACKING_AIM_VALID_BIT_FB)) { | ||
confidence = XRPose::TrackingConfidence::XR_TRACKING_CONFIDENCE_NONE; | ||
} else if (aim_state[i].status & XR_HAND_TRACKING_AIM_COMPUTED_BIT_FB) { | ||
confidence = XRPose::TrackingConfidence::XR_TRACKING_CONFIDENCE_HIGH; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still more work to be done on updating this PR but I rebased and swapped over to positional trackers as suggested. Not sure if in this context there is a point to checking anything for tracking confidence, but for the moment I threw this in. I don't understand what XR_HAND_TRACKING_AIM_COMPUTED_BIT_FB
really means yet, from the spec on what the flag means:
Aiming data is computed from additional sources beyond the hand data in the base structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that means that if full optical tracking isn't available (hand is not visible) that the current position is based on indirect measurements. I believe Quest for instance just added a way to determine hand position based on the cameras still seeing the arm.
So my gut feeling says that if XR_HAND_TRACKING_AIM_COMPUTED_BIT_FB
is set, our confidence would be low, not high.
Could be wrong though and I don't think many users check beyond confidence not being NONE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd discussed with @dsnopek and he thought the same. At the moment I have it setting the confidence always to LOW
, unless the flag XR_HAND_TRACKING_AIM_VALID_BIT_FB
is not set, in which case I set confidence to NONE
. So I'm not actually using the XR_HAND_TRACKING_AIM_COMPUTED_BIT_FB
bit anywhere now.
common/src/main/cpp/extensions/include/openxr_fb_hand_tracking_aim_extension_wrapper.h
Outdated
Show resolved
Hide resolved
common/src/main/cpp/extensions/openxr_fb_hand_tracking_aim_extension_wrapper.cpp
Outdated
Show resolved
Hide resolved
We follow the approach in Godot core where |
880d109
to
4045a76
Compare
Updated and rebased! Also see godotengine/godot#88311 for changes to |
common/src/main/cpp/extensions/openxr_fb_hand_tracking_aim_extension_wrapper.cpp
Outdated
Show resolved
Hide resolved
4045a76
to
8fd1c50
Compare
@devloglogan Can you bump the |
d681806
to
69be122
Compare
Rebased and bumped the |
69be122
to
5b096f6
Compare
5b096f6
to
88bdb06
Compare
Rebased! I believe all requested changes have been addressed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just retested this, and it's working wonderfully!
The latest code is looking good to me as well.
Great work!
common/src/main/cpp/extensions/openxr_fb_hand_tracking_aim_extension_wrapper.cpp
Outdated
Show resolved
Hide resolved
88bdb06
to
8d01ec5
Compare
8d01ec5
to
dd3f77a
Compare
This PR depends on Godot PR 87546
Adds extension wrapper for the XR_FB_hand_tracking_aim extension. The added singleton has methods to determine gesture states / pinch strength while hand tracking, and also provides a number of signals indicating when certain gestures begin/end.
Since this extension wrapper will only be supported by 4.3 onward, as well as the others listed in the above Godot PR, maybe it would make since to merge this into a 4.3 branch instead of master?
Also, one thing that might be worth discussing is how we should implement demos of these extension wrappers moving forward. Right now they're being dropped in
main.tscn
, but these are only meta extensions, so it doesn't really make sense to have them always present. Maybe we want to start thinking of implementing a menu to navigate implemented extensions and load corresponding demos?