Skip to content

Commit

Permalink
WebVRManager: Parent may not have matrixWorldInverse.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 16, 2017
1 parent b6a8dd1 commit b44f037
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/renderers/webvr/WebVRManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ function WebVRManager( renderer ) {

}

var matrixWorldInverse = new THREE.Matrix4();

var cameraL = new THREE.PerspectiveCamera();
cameraL.bounds = new THREE.Vector4( 0.0, 0.0, 0.5, 1.0 );
cameraL.layers.enable( 1 );
Expand Down Expand Up @@ -115,8 +117,10 @@ function WebVRManager( renderer ) {

if ( parent !== null ) {

cameraL.matrixWorldInverse.multiply( parent.matrixWorldInverse );
cameraR.matrixWorldInverse.multiply( parent.matrixWorldInverse );
matrixWorldInverse.getInverse( parent.matrixWorld );

cameraL.matrixWorldInverse.multiply( matrixWorldInverse );
cameraR.matrixWorldInverse.multiply( matrixWorldInverse );

}

Expand Down

0 comments on commit b44f037

Please sign in to comment.