浏览代码

Updated builds.

Mr.doob 8 年之前
父节点
当前提交
3254dde978
共有 3 个文件被更改,包括 506 次插入372 次删除
  1. 97 30
      build/three.js
  2. 313 312
      build/three.min.js
  3. 96 30
      build/three.module.js

+ 97 - 30
build/three.js

@@ -15514,43 +15514,46 @@
 
 	}
 
-	Camera.prototype = Object.create( Object3D.prototype );
-	Camera.prototype.constructor = Camera;
+	Camera.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
-	Camera.prototype.isCamera = true;
+		constructor: Camera,
 
-	Camera.prototype.getWorldDirection = function () {
+		isCamera: true,
 
-		var quaternion = new Quaternion();
+		copy: function ( source ) {
 
-		return function getWorldDirection( optionalTarget ) {
+			Object3D.prototype.copy.call( this, source );
 
-			var result = optionalTarget || new Vector3();
+			this.matrixWorldInverse.copy( source.matrixWorldInverse );
+			this.projectionMatrix.copy( source.projectionMatrix );
 
-			this.getWorldQuaternion( quaternion );
+			return this;
 
-			return result.set( 0, 0, - 1 ).applyQuaternion( quaternion );
+		},
 
-		};
+		getWorldDirection: function () {
 
-	}();
+			var quaternion = new Quaternion();
+
+			return function getWorldDirection( optionalTarget ) {
 
-	Camera.prototype.clone = function () {
+				var result = optionalTarget || new Vector3();
+
+				this.getWorldQuaternion( quaternion );
 
-		return new this.constructor().copy( this );
+				return result.set( 0, 0, - 1 ).applyQuaternion( quaternion );
 
-	};
+			};
 
-	Camera.prototype.copy = function ( source ) {
+		}(),
 
-		Object3D.prototype.copy.call( this, source );
+		clone: function () {
 
-		this.matrixWorldInverse.copy( source.matrixWorldInverse );
-		this.projectionMatrix.copy( source.projectionMatrix );
+			return new this.constructor().copy( this );
 
-		return this;
+		}
 
-	};
+	} );
 
 	/**
 	 * @author mrdoob / http://mrdoob.com/
@@ -15711,7 +15714,7 @@
 
 		},
 
-		clearViewOffset: function() {
+		clearViewOffset: function () {
 
 			this.view = null;
 			this.updateProjectionMatrix();
@@ -20815,6 +20818,8 @@
 
 			// update camera matrices and frustum
 
+			camera.onBeforeRender( _this );
+
 			if ( camera.parent === null ) camera.updateMatrixWorld();
 
 			camera.matrixWorldInverse.getInverse( camera.matrixWorld );
@@ -20963,6 +20968,7 @@
 				// opaque pass (front-to-back order)
 
 				state.setBlending( NoBlending );
+
 				if ( opaqueObjects.length ) renderObjects( opaqueObjects, scene, camera );
 
 				// transparent pass (back-to-front order)
@@ -20990,6 +20996,14 @@
 			state.buffers.depth.setMask( true );
 			state.buffers.color.setMask( true );
 
+			if ( camera.isArrayCamera && camera.enabled ) {
+
+				_this.setScissorTest( false );
+
+			}
+
+			camera.onAfterRender( _this );
+
 			// _gl.finish();
 
 		};
@@ -21156,22 +21170,30 @@
 
 				object.onBeforeRender( _this, scene, camera, geometry, material, group );
 
-				object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
-				object.normalMatrix.getNormalMatrix( object.modelViewMatrix );
+				if ( camera.isArrayCamera && camera.enabled ) {
 
-				if ( object.isImmediateRenderObject ) {
+					var cameras = camera.cameras;
 
-					state.setMaterial( material );
+					for ( var j = 0, jl = cameras.length; j < jl; j ++ ) {
 
-					var program = setProgram( camera, scene.fog, material, object );
+						var camera2 = cameras[ j ];
+						var bounds = camera2.bounds;
+						_this.setViewport(
+							bounds.x * _width * _pixelRatio, bounds.y * _height * _pixelRatio,
+							bounds.z * _width * _pixelRatio, bounds.w * _height * _pixelRatio
+						);
+						_this.setScissor(
+							bounds.x * _width * _pixelRatio, bounds.y * _height * _pixelRatio,
+							bounds.z * _width * _pixelRatio, bounds.w * _height * _pixelRatio
+						);
+						_this.setScissorTest( true );
+						renderObject( object, scene, camera2, geometry, material, group );
 
-					_currentGeometryProgram = '';
-
-					renderObjectImmediate( object, program, material );
+					}
 
 				} else {
 
-					_this.renderBufferDirect( camera, scene.fog, geometry, material, object, group );
+					renderObject( object, scene, camera, geometry, material, group );
 
 				}
 
@@ -21181,6 +21203,29 @@
 
 		}
 
+		function renderObject( object, scene, camera, geometry, material, group ) {
+
+			object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
+			object.normalMatrix.getNormalMatrix( object.modelViewMatrix );
+
+			if ( object.isImmediateRenderObject ) {
+
+				state.setMaterial( material );
+
+				var program = setProgram( camera, scene.fog, material, object );
+
+				_currentGeometryProgram = '';
+
+				renderObjectImmediate( object, program, material );
+
+			} else {
+
+				_this.renderBufferDirect( camera, scene.fog, geometry, material, object, group );
+
+			}
+
+		}
+
 		function initMaterial( material, fog, object ) {
 
 			var materialProperties = properties.get( material );
@@ -35715,6 +35760,27 @@
 	CubeCamera.prototype = Object.create( Object3D.prototype );
 	CubeCamera.prototype.constructor = CubeCamera;
 
+	/**
+	 * @author mrdoob / http://mrdoob.com/
+	 */
+
+	function ArrayCamera( array ) {
+
+		PerspectiveCamera.call( this );
+
+		this.enabled = false;
+		this.cameras = array || [];
+
+	}
+
+	ArrayCamera.prototype = Object.assign( Object.create( PerspectiveCamera.prototype ), {
+
+		constructor: ArrayCamera,
+
+		isArrayCamera: true
+
+	} );
+
 	/**
 	 * @author mrdoob / http://mrdoob.com/
 	 */
@@ -43111,6 +43177,7 @@
 	exports.PerspectiveCamera = PerspectiveCamera;
 	exports.OrthographicCamera = OrthographicCamera;
 	exports.CubeCamera = CubeCamera;
+	exports.ArrayCamera = ArrayCamera;
 	exports.Camera = Camera;
 	exports.AudioListener = AudioListener;
 	exports.PositionalAudio = PositionalAudio;

文件差异内容过多而无法显示
+ 313 - 312
build/three.min.js


文件差异内容过多而无法显示
+ 96 - 30
build/three.module.js


部分文件因为文件数量过多而无法显示