ソースを参照

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.
Johnathon Selstad 3 年 前
コミット
777f97a042
1 ファイル変更1 行追加4 行削除
  1. 1 4
      src/renderers/webxr/WebXRManager.js

+ 1 - 4
src/renderers/webxr/WebXRManager.js

@@ -530,11 +530,8 @@ class WebXRManager extends EventDispatcher {
 
 			// update user camera and its children
 
-			camera.position.copy( cameraVR.position );
-			camera.quaternion.copy( cameraVR.quaternion );
-			camera.scale.copy( cameraVR.scale );
 			camera.matrix.copy( cameraVR.matrix );
-			camera.matrixWorld.copy( cameraVR.matrixWorld );
+			camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
 
 			const children = camera.children;