Skip to content
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

Merged
merged 9 commits into from
Apr 20, 2022
Merged

WebXRManager: Added setReferenceSpace() #20949

merged 9 commits into from
Apr 20, 2022

Conversation

arodic
Copy link
Contributor

@arodic arodic commented Dec 27, 2020

Implemented suggestion #19615 by @dbuck to allow setting customReferenceSpace. This can be used for user teleportation among other things. (added example).

@arodic
Copy link
Contributor Author

arodic commented Dec 27, 2020

Closing in favor of #20790 and #20696

@marcjordan
Copy link

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.

@arodic arodic reopened this Feb 19, 2021
@dbuck
Copy link
Contributor

dbuck commented Feb 19, 2021

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?

@mrdoob mrdoob added this to the r126 milestone Feb 19, 2021
@arodic
Copy link
Contributor Author

arodic commented Feb 21, 2021

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?

From what I can see @dbuck, getPose happens in WebXRController.update. So here we pass offsetReferenceSpace || referenceSpace as an argument.

@arodic
Copy link
Contributor Author

arodic commented Feb 21, 2021

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.

@dbuck
Copy link
Contributor

dbuck commented Feb 22, 2021

@arodic That's how it works in the webxr-samples/teleportation also, albeit a bit trickier to follow.

@mrdoob mrdoob modified the milestones: r126, r127 Feb 23, 2021
@mrdoob mrdoob modified the milestones: r127, r128 Mar 30, 2021
@carstenschwede
Copy link
Contributor

Having this merged (just the setOffsetReferenceSpace - without the controllermove events) would be tremendously helpful when aligning AR scenes without altering world transforms.

@arodic
Copy link
Contributor Author

arodic commented Apr 9, 2021

@carstenschwede I removed controllermove event from this PR. Hopefully it gets merged. Fingers crossed.

@dbuck
Copy link
Contributor

dbuck commented Apr 13, 2021

Would love to see this in! It would help remove a boatload of strange scene.onBeforeRender hackery in my build ;)

@arodic
Copy link
Contributor Author

arodic commented Apr 22, 2021

Fixed merge conflicts. @mrdoob let me know how this looks.

@mrdoob mrdoob modified the milestones: r128, r129 Apr 23, 2021
@mrdoob mrdoob modified the milestones: r129, r130 May 27, 2021
@felixtrz
Copy link
Contributor

Would love to see this feature merged! Is there any update on this?

@mrdoob mrdoob modified the milestones: r138, r139 Feb 23, 2022
@mrdoob mrdoob modified the milestones: r139, r140 Mar 24, 2022
@LeviPesin
Copy link
Contributor

@arodic Can you please resolve the merge conflicts?

@arodic
Copy link
Contributor Author

arodic commented Apr 1, 2022

@LeviPesin sure. Is there any interest to actually merge this PR?

@carstenschwede
Copy link
Contributor

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

@LeviPesin
Copy link
Contributor

@mrdoob @Mugen87 Can you please look on this PR? It would be very nice to have it!

@arodic
Copy link
Contributor Author

arodic commented Apr 2, 2022

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.

@cabanier
Copy link
Contributor

cabanier commented Apr 4, 2022

Does this work if you use hand input?

@arodic
Copy link
Contributor Author

arodic commented Apr 6, 2022

@cabanier fixed the hand input. I would be nice to add space rotation to the demo after this gets merged.

@cabanier
Copy link
Contributor

cabanier commented Apr 7, 2022

@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?

@arodic
Copy link
Contributor Author

arodic commented Apr 7, 2022

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.

@mrdoob mrdoob changed the title WebXRController and WebXRManager improvements WebXRManager: Added setOffsetReferenceSpace() Apr 8, 2022
@mrdoob mrdoob changed the title WebXRManager: Added setOffsetReferenceSpace() WebXRManager: Added setReferenceSpace() Apr 20, 2022
@mrdoob mrdoob merged commit 591d359 into mrdoob:dev Apr 20, 2022
@mrdoob
Copy link
Owner

mrdoob commented Apr 20, 2022

Thanks!

joshuaellis pushed a commit to three-types/three-ts-types that referenced this pull request May 25, 2022
…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
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants