-
-
Notifications
You must be signed in to change notification settings - Fork 35.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
WebXRManager: Added setReferenceSpace() #20949
Conversation
I'm wondering if this PR could be re-opened? We were making a PR to implement the suggestion in #19615 when we found that this PR already addressed it (and also had an example, etc.) Since it is not clear if WebXR Layers will help with this, it would be good to get this functionality. |
It's been a while since I was in the area, but I think you also want to pass the offsetReferenceSpace to the getPose calls for the controller grip / ray? |
One thing that confused me while making this PR is how offsetReferenceSpace does inverse of what I expected it to do. Perhaps that is how it it should be? I'm not sure. |
@arodic That's how it works in the webxr-samples/teleportation also, albeit a bit trickier to follow. |
Having this merged (just the |
@carstenschwede I removed controllermove event from this PR. Hopefully it gets merged. Fingers crossed. |
Would love to see this in! It would help remove a boatload of strange scene.onBeforeRender hackery in my build ;) |
Fixed merge conflicts. @mrdoob let me know how this looks. |
Would love to see this feature merged! Is there any update on this? |
@arodic Can you please resolve the merge conflicts? |
@LeviPesin sure. Is there any interest to actually merge this PR? |
This PR would be tremendously helpful when aligning AR scenes to the real world without altering world transforms. Would be great if this could get merged. @mrdoob |
It should be OK now. I haven't had a chance to test it in VR after the merge since I'm working on a brand new machine and my VR workflow is not setup yet. |
Does this work if you use hand input? |
@cabanier fixed the hand input. I would be nice to add space rotation to the demo after this gets merged. |
What do you mean by space rotation? |
@cabanier In addition to teleport (position), the user should be able to move controller sticks left and right to rotate reference space. It is a pretty standard locomotion technique in VR. Very often it is paired with teleport. |
Thanks! |
…169) * chore(WebXRManager): add missing methods, update getCamera signature * chore(WebXRManager): move three types out of webxr spec types * chore: run prettier * fix(WebXRManager): leave XRProjectionLayer out of getBaseLayer for now * fix(WebXRManager): add setReferenceSpace From mrdoob/three.js#20949 * chore: update webxr types, complete webxr controller types * chore(XRHandSpace): make joints readonly * chore: lint * fix: unwrap mangled * chore: lint * chore: lint * chore: prefer record * chore: lint
* Added "controllermove" event to WebXRController * Added offsetReferenceSpace to WebXRController and teleport example. * Removed controllermove events. * Renamed offsetReferenceSpace to customReferenceSpace in webXRManager Co-authored-by: Aki Rodic <[email protected]>
Implemented suggestion #19615 by @dbuck to allow setting
customReferenceSpace
. This can be used for user teleportation among other things. (added example).