Is there a way to teleport in a three.js VR scene using the controllers at the moment? If so, how do we do it?
The official WebXR examples mention that this can be achieved by the means of using getOffsetReferenceSpace() function but I don’t see this function being used at the moment in the WebXR Manager/Controller classes.
Also, checking further on GitHub issues, I get to this suggestion thread mentioning something similar on these lines. Not sure, if he is talking about the same thing here. Quoting him " The controllers already support alternate reference frames now by way of the WebXRController.update(inputSource, frame, referenceSpace)". Is he talking about teleportation itself over here?
If not, should we implement the feature from scratch?
If I am able to get this WebXR code to handle teleport down to a single function Ill create a PR for the same so that future users can use this functionality.
Also, found this another slightly updated example.(WebXR teleport on native Webgl).
Before you do this, please get the approval by @mrdoob first. We’ve lately get a bit more restrictive with adding new logic to the repository since it’s already very big and thus hard to manage^^.
Besides, @seanwasere (who is a very active user in this forum) also worked at this topic in context of WebVR. Check out the following project:
There was a discussion in a Github issue here that included a couple examples of teleportation from myself and the original poster. There hasn’t been any follow up from maintainers I suspect because of focus being on other issues within the project right now but hopefully at some point we can get more robust WebXR control examples.
Hello, according to WebXR API it is possible to reposition the entire scene relative to the last known XRRefSpace by using XRRigidTransfor objects to create offset and getOffsetReferenceSpace() method to create the update XRRefSpace, however that does nothing to the immersive session.
How does one apply the newly calculated XRRefSpace to the Session, or Scene or whatever it is that needs to be made aware of the new XRRefSpace?
let xrRigidTransform:XRRigidTransform = new XRRigidTransform(DOMPoint.fromPoint({x: 500, y: 500, z: 500, w: 1}), DOMPoint.fromPoint({x: 0, y: 0, z: 0, w: 1})); //move i.e. new offset
this.xrReferenceSpace = (this.xrReferenceSpace as XRReferenceSpace).getOffsetReferenceSpace(xrRigidTransform);