2
0
Эх сурвалжийг харах

WebVRManager: Parent may not have matrixWorldInverse.

Mr.doob 8 жил өмнө
parent
commit
b44f03733d

+ 6 - 2
src/renderers/webvr/WebVRManager.js

@@ -15,6 +15,8 @@ function WebVRManager( renderer ) {
 
 
 	}
 	}
 
 
+	var matrixWorldInverse = new THREE.Matrix4();
+
 	var cameraL = new THREE.PerspectiveCamera();
 	var cameraL = new THREE.PerspectiveCamera();
 	cameraL.bounds = new THREE.Vector4( 0.0, 0.0, 0.5, 1.0 );
 	cameraL.bounds = new THREE.Vector4( 0.0, 0.0, 0.5, 1.0 );
 	cameraL.layers.enable( 1 );
 	cameraL.layers.enable( 1 );
@@ -115,8 +117,10 @@ function WebVRManager( renderer ) {
 
 
 		if ( parent !== null ) {
 		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 );
 
 
 		}
 		}