-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Provide generic interface for XR hand tracking #88639
Conversation
e781eec
to
059f519
Compare
@@ -0,0 +1,223 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<class name="XRHandTracker" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
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.
How about classifying it as experimental just in case?
<class name="XRHandTracker" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | |
<class name="XRHandTracker" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd" experimental=""> |
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.
Perhaps. But I don't know if it makes sense to mark this as experimental if we're also deprecated the older APIs. I feel like we should do one or the other: Mark the old APIs as deprecated OR mark the new APIs as experimental, but not both.
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.
Hmm, I think it's overkill, probably the original OpenXR implementation should have been called experimental, but since this is all based on the experience we gathered with this, I think we have a pretty solid grasp on it.
5950618
to
6d9d109
Compare
6d9d109
to
101d0e0
Compare
101d0e0
to
5f945e9
Compare
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.
This works well for me, and drops directly in to my Humanoid hand tests.
5f945e9
to
d4fef4c
Compare
@Malcolmnixon @AThousandShips Thanks for the review! It should be addressed in my latest push |
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.
Perfect! Only two nitpicking things. This looks real good, thanks @dsnopek !
</members> | ||
<constants> | ||
<constant name="HAND_LEFT" value="0" enum="Hand"> | ||
A left hand. |
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've wondered about this for awhile seeing this comes back in a number of APIs. Should we add this constant to [XRServer] itself?
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.
Hm. Well, before this PR we have two left/right hand enums:
XRPositionalTracker.TrackerHand
OpenXRInterface.Hand
The 2nd of those is going to be deprecated after this PR, so I think we can mostly ignore it.
The 1st of those has different values: unknown (0), left (1) and right (2). That's a little inconvenient for hand tracking because their is no unknown and we can use left (0) and right (1) as array indexes, and the max value (2) for loops.
Given that, I feel like it's OK for XRHandTracker
to have a hand enum that fits its purposes. And, even if we decided to consolidate to a single enum on XRServer
, we can't change XRPositionalTracker
to use it for backwards compatibility reasons. Maybe when we can break compatibility (like, Godot 5) we could consolidate on a single enum in XRServer
? Although, given the different needs of the two enums, I personally still think I'd prefer to have the two of them for their different purposes.
d4fef4c
to
0cf3278
Compare
@BastiaanOlij Thanks for the review! |
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.
Looks good!
Added some minor feedback to address.
0cf3278
to
2184fa9
Compare
Thanks! |
This adds a generic interface for hand tracking similar to what PR #88312 added for face tracking, based on notes from @BastiaanOlij and @Malcolmnixon on RocketChat and Discord.
It deprecates
OpenXRHand
and the methods for accessing raw hand tracking data onOpenXRInterface
.While this does seem to work, it could use some testing - I plan to experiment with it some more myself, but testing from others would also be much appreciated as well!