Skip to content

Commit

Permalink
WebXRManager: Inherit active layers from camera (#29742)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrxz authored Oct 28, 2024
1 parent f3ee371 commit 6c231d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/renderers/webxr/WebXRManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,14 @@ class WebXRManager extends EventDispatcher {
//

const cameraL = new PerspectiveCamera();
cameraL.layers.enable( 1 );
cameraL.viewport = new Vector4();

const cameraR = new PerspectiveCamera();
cameraR.layers.enable( 2 );
cameraR.viewport = new Vector4();

const cameras = [ cameraL, cameraR ];

const cameraXR = new ArrayCamera();
cameraXR.layers.enable( 1 );
cameraXR.layers.enable( 2 );

let _currentDepthNear = null;
let _currentDepthFar = null;
Expand Down Expand Up @@ -572,6 +568,10 @@ class WebXRManager extends EventDispatcher {

}

cameraL.layers.mask = camera.layers.mask | 0b010;
cameraR.layers.mask = camera.layers.mask | 0b100;
cameraXR.layers.mask = cameraL.layers.mask | cameraR.layers.mask;

const parent = camera.parent;
const cameras = cameraXR.cameras;

Expand Down

0 comments on commit 6c231d8

Please sign in to comment.