-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
feat: add teleportation support #263
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2d75191:
|
I take into account head pose relative to |
9a364b4
to
4fc3e27
Compare
This is awesome! |
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 was unable to get the white circle indicator to render in my scene. I fixed this by manually declaring the Y axis as 0 in its mesh position
thanks! @adamistheanswer |
Fixed warning messages as per build and added video of demo. |
@richardanaya awesome work! would you be so kind and add example of this to the |
@saitonakamura done! :) |
@CodyJasonBennett fixed! |
src/Teleportation.tsx
Outdated
const offsetX = pose?.transform.position.x || 0 | ||
const offsetZ = pose?.transform.position.z || 0 | ||
|
||
const offsetFromBase = { | ||
x: -worldPosition.x + offsetX, | ||
y: -worldPosition.y, | ||
z: -worldPosition.z + offsetZ | ||
} | ||
const transform = new XRRigidTransform(offsetFromBase, new Quaternion()) | ||
const teleportSpaceOffset = baseReferenceSpace.getOffsetReferenceSpace(transform) | ||
xrManager.setReferenceSpace(teleportSpaceOffset) |
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.
Can this be done by moving useXR().player
or are there any ramifications in leaving pose unmodified?
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 may not be the best person to answer this question about WebXR, but I think the reason for modifying XR reference space instead of player objects in WebXR is to handle weird device specific issues around player camera positioning. I think it may also come into play when we do anchors since they get poses relative to the base reference frame. I think there might be some complexity if we start asking for anchors relative to base reference and also modifying player. :)
Any thoughts on this? @saitonakamura @CodyJasonBennett |
I meant to triage this. I'll get back to it today and include in a minor. |
Thanks!
…On Sat, Jul 1, 2023 at 6:02 AM Cody Bennett ***@***.***> wrote:
I meant to triage this. I'll get back to it today and include in a minor.
—
Reply to this email directly, view it on GitHub
<#263 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHZGWHVAT6JERBSWV2COTXOANW5ANCNFSM6AAAAAAVYNCMGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This PR adds two helpers for building teleportation experiences
useTeleportation
- provides functionality for teleporting to global positions<TeleportationPlane>
- A simple plane based teleportation plane that can specify which hand to use as teleportation hand trigger, max distance from camera to teleport, and simple interaction visuals.Demo: https://avatarposer.com/
com.oculus.browser-20230313-115217.mp4
Future ideas:
Allow for thumbstick to determine final direction so that you land with a specific rotation. That said, I think even just positional teleportation will be a boon to
react-xr
users.