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

World position workaround for VR not working #5027

Closed
xaqbr opened this issue Mar 18, 2022 · 3 comments
Closed

World position workaround for VR not working #5027

xaqbr opened this issue Mar 18, 2022 · 3 comments

Comments

@xaqbr
Copy link

xaqbr commented Mar 18, 2022

Description: I understand that getWorld* functions don't work in VR, and that a workaround was mentioned, but I still cannot seem to get it to work.

  • A-Frame Version: 1.2.0
  • Platform / Device: Oculus Quest 2
  • Reproducible Code Snippet or URL:
let worldPosition = new THREE.Vector3();
const camera = document.querySelector("#camera");
camera.object3D.updateMatrixWorld();
camera.sceneEl?.object3D.updateMatrixWorld();
worldPosition.setFromMatrixPosition(camera.object3D.matrixWorld);
console.log(worldPosition); // Always returns (0, 0, 0) in Oculus Quest 2 VR
@dmarcos
Copy link
Member

dmarcos commented Mar 21, 2022

Can you provide runnable example to reproduce? I recommend https://glitch.com/edit/#!/aframe

@dmarcos
Copy link
Member

dmarcos commented Mar 21, 2022

An example printing the world position https://glitch.com/edit/#!/momentous-foremost-game?path=world-position.js%3A7%3A0

As far as I can tell A-Frame works as expected. For usage questions I recommend using https://stackoverflow.com/questions/tagged/aframe

I'm closing this and can reopen if necessary. Best of luck

@dmarcos dmarcos closed this as completed Mar 21, 2022
@dmarcos
Copy link
Member

dmarcos commented Mar 21, 2022

I also recommend using A-Frame 1.3.0

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

No branches or pull requests

2 participants