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

Please update camera's position and quaternion in XR mode #19084

Closed
marcofugaro opened this issue Apr 8, 2020 · 3 comments
Closed

Please update camera's position and quaternion in XR mode #19084

marcofugaro opened this issue Apr 8, 2020 · 3 comments

Comments

@marcofugaro
Copy link
Contributor

Hey, I've been trying the XR mode (specifically immersive-ar) and I have some feedback.

Currently, each time you have to get the camera's position and quaternion, you have to do it like this:

const cameraPosition = new THREE.Vector3().setFromMatrixPosition(camera.matrixWorld)
const cameraQuaternion =  new THREE.Quaternion().setFromRotationMatrix(camera.matrixWorld)

Because just the camera.matrixWorld is updated directly from the XRViewerPose, the position and quaternion are never updated.

camera.matrixWorld.copy( cameraVR.matrixWorld );

Can this be solved just by setting the position and quaternion from the matrixWorld each frame and setting camera.matrixAutoUpdate = false?

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 8, 2020

I believe this issue is related to #18448 (comment).

If so, is it okay for you to mark this issue as a duplicate and continue the discussion in #18448?

@marcofugaro
Copy link
Contributor Author

Yeah sure. So are camera.position and camera.quaternion be updated automatically when that issue will be fixed?

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 8, 2020

Let's see how this PR goes: #19085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants