Browse Source

Merge pull request #15037 from OndrejSpanel/dev

Fix code style to match ESLint requirements.
Michael Herzog 6 năm trước cách đây
mục cha
commit
7406e3c581
1 tập tin đã thay đổi với 10 bổ sung6 xóa
  1. 10 6
      src/cameras/ArrayCamera.js

+ 10 - 6
src/cameras/ArrayCamera.js

@@ -25,10 +25,12 @@ ArrayCamera.prototype = Object.assign( Object.create( PerspectiveCamera.prototyp
 	 * And that near and far planes are identical for both cameras.
 	 */
 	setProjectionFromUnion: function () {
+
 		var cameraLPos = new Vector3();
 		var cameraRPos = new Vector3();
 
 		return function () {
+
 			cameraLPos.setFromMatrixPosition( this.cameras[ 0 ].matrixWorld );
 			cameraRPos.setFromMatrixPosition( this.cameras[ 1 ].matrixWorld );
 
@@ -54,15 +56,15 @@ ArrayCamera.prototype = Object.assign( Object.create( PerspectiveCamera.prototyp
 
 			// Calculate the new camera's position offset from the
 			// left camera.
-			var zOffset = ipd / (leftFovL + rightFovR);
+			var zOffset = ipd / ( leftFovL + rightFovR );
 			var xOffset = zOffset * leftFovL;
 
 			// TODO: Better way to apply this offset?
 			this.cameras[ 0 ].matrixWorld.decompose( this.position, this.quaternion, this.scale );
-			this.translateX(xOffset);
-			this.translateZ(-zOffset);
+			this.translateX( xOffset );
+			this.translateZ( - zOffset );
 			this.matrixWorld.compose( this.position, this.quaternion, this.scale );
-			this.matrixWorldInverse.getInverse(this.matrixWorld);
+			this.matrixWorldInverse.getInverse( this.matrixWorld );
 
 			// Find the union of the frustum values of the cameras and scale
 			// the values so that the near plane's position does not change in world space,
@@ -70,12 +72,14 @@ ArrayCamera.prototype = Object.assign( Object.create( PerspectiveCamera.prototyp
 			var near2 = near + zOffset;
 			var far2 = far + zOffset;
 			var left = leftL - xOffset;
-			var right = rightR + (ipd - xOffset)
+			var right = rightR + ( ipd - xOffset );
 			var top = Math.max( topL, topR );
 			var bottom = Math.min( bottomL, bottomR );
 
 			this.projectionMatrix.makePerspective( left, right, top, bottom, near2, far2 );
-		}
+
+		};
+
 	}(),
 
 } );