-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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 hand capsule data to XRHandTracker
#89289
Conversation
XRHandTracker
Thanks! The implementation looks great to me :-) I think the main things we'll need to discuss among the @godotengine/xr team is:
|
This is slightly off topic, but Meta's XR_FB_hand_tracking_capsules extension certainly seems a little rough around the edges. I "assumed" they would have named the capsules - so someone could tell what finger was colliding with a button... but no! The openxr header file has It's just mildly annoying they decided to separate bones/joints from colliders, considering that game engines (including Godot) have mechanisms for creating physics bones (https://docs.godotengine.org/en/stable/classes/class_physicalbone3d.html) associated with skeleton bones - which allow for bones to interact with physics and to allow for advanced effects such as ragdoll. We already get the finger joints and tip locations - so we could actually get the lengths of every bone in the hand (including knowing which bone it is). The only thing "missing" is the radius of the bone capsule. We could get that from either:
In an ideal world what would have been nice would have been:
Alas with Meta coming out of the gate decoupling bones and colliders I'm not sure we should design an API with them combined back. |
They do associate each capsule with a joint, but it's only defined as the joint "that drives this capsule’s transform". And there can be (and are!) multiple capsules to a single joint. So, unfortunately, they don't relate directly to bones. If I had designed the data, like you, I would also have been inclined to associate each capsule with a bone.
I agree. Any attempt to "normalize" their data to correlate each capsule to a bone wouldn't be guaranteed to continue working per the spec. |
Hmmm, the thing is, when we look at the current core solution, no additions are needed. All information is already in The hand capsule approach Meta has seems a solution that attempts to do the same thing OpenXR already solves, and its still unclear to me as to why? What does this offer what we don't already have the ability to do with what core OpenXR offers us, and wouldn't we be better off to support the core functionality so all platforms benefit from the work? I'm not aware of any other vendor going down this path, so I don't think we should be changing anything in I'm not against having the logic in the vendor plugin if we must have a Meta specific implementation, that is where it belongs. It just seems, uhm, double. |
I have no qualms with closing this PR, updating the vendor repo PR to expose the data like this, and removing the physics aspects if we find that preferable! I agree that it does feel slightly "double", and because of that if feels off in adding anything related to it to Godot itself. But I don't think there's anything wrong with exposing the data via the vendor repo. I will plan on updating the vendor repo PR, and if there's consensus on this being the agreed solution we can close this PR. |
Closing, a PR in the vendor repo has been merged that exposes the data for |
This PR makes it possible to provide
XRHandTracker
with capsule data that could then be used to construct meshes or collision shapes.Discussion has taken place that a vendor-neutral way of populating/consuming hand capsule data may be desirable in GodotVR/godot_openxr_vendors#88. The conversation boils down to: OpenXR extension XR_FB_hand_tracking_capsules provides capsule data, however similar capsule data could also be constructed via joint data from the vendor-neutral XR_EXT_hand_tracking. This is the main motivation for this PR.