-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Updated WebXR Hand implementation to the new API #20938
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
Conversation
|
@fernandojsg can you take a look? |
|
@cabanier it looks good to me. The only thing I don't really like is using numbers to refer to the joints, it makes the code harder to read. Can't we just create constants with these names and expose them directly in three even if the WebXR doens't include these constants anymore? // Previously we had
const indexTip = controller.joints[ XRHand.INDEX_PHALANX_TIP ];
// This PR proposal
const indexTip = controller.joints[ 9 ];
// Something more readable ?
const indexTip = controller.joints[ THREE.XRHand.INDEX_PHALANX_TIP ]; |
@fernandojsg Where would I define |
|
@fernandojsg I decided to get rid of the indexes and move to using joint names. |
|
Looking good!
When do you think this would be? |
Thanks!
I believe sometime in January. |
|
Okay! Let us know when it's out and I'll merge this 👍 |
|
@mrdoob The new Oculus browser with the updated API is now rolling out to users. |
|
Thanks! |
| handPose = true; | ||
|
|
||
| for ( let i = 0; i <= window.XRHand.LITTLE_PHALANX_TIP; i ++ ) { | ||
| for ( const inputjoint of inputSource.hand.values() ) { |
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.
Is it possible to turn this into a simple for loop instead of a for of loop?
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.
What would be the advantage of doing it that way?
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.
Avoiding having to add a polyfill for it:
657b36d#diff-af408426d6a7b072569230b0ee45fa87b6e69f3e97ebdc527d6995924aa1a1ceR1061-R1102
Description
The WebXR API has been updated per feedback from the W3C: https://immersive-web.github.io/webxr-hand-input
This breaks the current implementation.
This patch will update three.js so it will work with the new API. However, it will no longer work with the old API.
Since most headsets are updated quickly, this shouldn't cause too many problems.
This patch should only be merged once the API goes live.
This contribution is funded by Oculus.