Skip to content

Commit 777f97a

Browse files
authored
WebXRManager: Fix Camera Local Space by Reverting #21964 (#22362)
This PR attempts to move XR Camera calculations back into local space by undoing #21964 (which appears to conflate `matrixWorld` and `matrix`). This enables the XR camera to be parented to another object again without odd behavior. If this isn't the correct fix; I'd be happy to test alternatives in the context of my application.
1 parent 8943888 commit 777f97a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/renderers/webxr/WebXRManager.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,8 @@ class WebXRManager extends EventDispatcher {
530530

531531
// update user camera and its children
532532

533-
camera.position.copy( cameraVR.position );
534-
camera.quaternion.copy( cameraVR.quaternion );
535-
camera.scale.copy( cameraVR.scale );
536533
camera.matrix.copy( cameraVR.matrix );
537-
camera.matrixWorld.copy( cameraVR.matrixWorld );
534+
camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
538535

539536
const children = camera.children;
540537

0 commit comments

Comments
 (0)