Browse Source

Updated VREffect.

Mr.doob 9 years ago
parent
commit
d6abbd78d8
1 changed files with 4 additions and 2 deletions
  1. 4 2
      examples/js/effects/VREffect.js

+ 4 - 2
examples/js/effects/VREffect.js

@@ -111,8 +111,10 @@ THREE.VREffect = function ( renderer, onError ) {
 			var layers = vrDisplay.getLayers();
 			var layers = vrDisplay.getLayers();
 			if ( layers.length ) {
 			if ( layers.length ) {
 
 
-				leftBounds = layers[0].leftBounds || [ 0.0, 0.0, 0.5, 1.0 ];
-				rightBounds = layers[0].rightBounds || [ 0.5, 0.0, 0.5, 1.0 ];
+				var layer = layers[0];
+
+				leftBounds = layer.leftBounds !== null && layer.leftBounds.length === 4 ? leftBounds : [ 0.0, 0.0, 0.5, 1.0 ];
+				rightBounds = layer.rightBounds !== null && layer.rightBounds.length === 4 ? rightBounds : [ 0.5, 0.0, 0.5, 1.0 ];
 
 
 			}
 			}