浏览代码

Updated builds.

Mr.doob 5 年之前
父节点
当前提交
6c8380431c
共有 3 个文件被更改,包括 251 次插入296 次删除
  1. 33 52
      build/three.js
  2. 185 192
      build/three.min.js
  3. 33 52
      build/three.module.js

+ 33 - 52
build/three.js

@@ -6097,8 +6097,11 @@
 		new Vector3(),
 		new Vector3()
 	];
+
 	var _vector$2 = new Vector3();
 
+	var _box = new Box3();
+
 	// triangle centered vertices
 
 	var _v0 = new Vector3();
@@ -6128,6 +6131,7 @@
 
 	}
 
+
 	Object.assign( Box3.prototype, {
 
 		isBox3: true,
@@ -6327,8 +6331,6 @@
 
 		expandByObject: function ( object ) {
 
-			var i, l;
-
 			// Computes the world-axis-aligned bounding box of an object (including its children),
 			// accounting for both the object's, and children's, world transforms
 
@@ -6338,44 +6340,23 @@
 
 			if ( geometry !== undefined ) {
 
-				if ( geometry.isGeometry ) {
-
-					var vertices = geometry.vertices;
-
-					for ( i = 0, l = vertices.length; i < l; i ++ ) {
-
-						_vector$2.copy( vertices[ i ] );
-						_vector$2.applyMatrix4( object.matrixWorld );
-
-						this.expandByPoint( _vector$2 );
-
-					}
-
-				} else if ( geometry.isBufferGeometry ) {
-
-					var attribute = geometry.attributes.position;
-
-					if ( attribute !== undefined ) {
+				if ( geometry.boundingBox === null ) {
 
-						for ( i = 0, l = attribute.count; i < l; i ++ ) {
+					geometry.computeBoundingBox();
 
-							_vector$2.fromBufferAttribute( attribute, i ).applyMatrix4( object.matrixWorld );
-
-							this.expandByPoint( _vector$2 );
+				}
 
-						}
+				_box.copy( geometry.boundingBox );
+				_box.applyMatrix4( object.matrixWorld );
 
-					}
-
-				}
+				this.expandByPoint( _box.min );
+				this.expandByPoint( _box.max );
 
 			}
 
-			//
-
 			var children = object.children;
 
-			for ( i = 0, l = children.length; i < l; i ++ ) {
+			for ( var i = 0, l = children.length; i < l; i ++ ) {
 
 				this.expandByObject( children[ i ] );
 
@@ -6665,7 +6646,7 @@
 
 	}
 
-	var _box = new Box3();
+	var _box$1 = new Box3();
 
 	/**
 	 * @author bhouston / http://clara.io
@@ -6700,7 +6681,7 @@
 
 			} else {
 
-				_box.setFromPoints( points ).getCenter( center );
+				_box$1.setFromPoints( points ).getCenter( center );
 
 			}
 
@@ -9802,7 +9783,7 @@
 	var _m1$2 = new Matrix4();
 	var _obj = new Object3D();
 	var _offset = new Vector3();
-	var _box$1 = new Box3();
+	var _box$2 = new Box3();
 	var _boxMorphTargets = new Box3();
 	var _vector$4 = new Vector3();
 
@@ -10354,20 +10335,20 @@
 					for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {
 
 						var morphAttribute = morphAttributesPosition[ i ];
-						_box$1.setFromBufferAttribute( morphAttribute );
+						_box$2.setFromBufferAttribute( morphAttribute );
 
 						if ( this.morphTargetsRelative ) {
 
-							_vector$4.addVectors( this.boundingBox.min, _box$1.min );
+							_vector$4.addVectors( this.boundingBox.min, _box$2.min );
 							this.boundingBox.expandByPoint( _vector$4 );
 
-							_vector$4.addVectors( this.boundingBox.max, _box$1.max );
+							_vector$4.addVectors( this.boundingBox.max, _box$2.max );
 							this.boundingBox.expandByPoint( _vector$4 );
 
 						} else {
 
-							this.boundingBox.expandByPoint( _box$1.min );
-							this.boundingBox.expandByPoint( _box$1.max );
+							this.boundingBox.expandByPoint( _box$2.min );
+							this.boundingBox.expandByPoint( _box$2.max );
 
 						}
 
@@ -10406,7 +10387,7 @@
 
 				var center = this.boundingSphere.center;
 
-				_box$1.setFromBufferAttribute( position );
+				_box$2.setFromBufferAttribute( position );
 
 				// process morph attributes if present
 
@@ -10419,16 +10400,16 @@
 
 						if ( this.morphTargetsRelative ) {
 
-							_vector$4.addVectors( _box$1.min, _boxMorphTargets.min );
-							_box$1.expandByPoint( _vector$4 );
+							_vector$4.addVectors( _box$2.min, _boxMorphTargets.min );
+							_box$2.expandByPoint( _vector$4 );
 
-							_vector$4.addVectors( _box$1.max, _boxMorphTargets.max );
-							_box$1.expandByPoint( _vector$4 );
+							_vector$4.addVectors( _box$2.max, _boxMorphTargets.max );
+							_box$2.expandByPoint( _vector$4 );
 
 						} else {
 
-							_box$1.expandByPoint( _boxMorphTargets.min );
-							_box$1.expandByPoint( _boxMorphTargets.max );
+							_box$2.expandByPoint( _boxMorphTargets.min );
+							_box$2.expandByPoint( _boxMorphTargets.max );
 
 						}
 
@@ -10436,7 +10417,7 @@
 
 				}
 
-				_box$1.getCenter( center );
+				_box$2.getCenter( center );
 
 				// second, try to find a boundingSphere with a radius smaller than the
 				// boundingSphere of the boundingBox: sqrt(3) smaller in the best case
@@ -47312,7 +47293,7 @@
 	 * @author Mugen87 / http://github.com/Mugen87
 	 */
 
-	var _box$2 = new Box3();
+	var _box$3 = new Box3();
 
 	function BoxHelper( object, color ) {
 
@@ -47348,14 +47329,14 @@
 
 		if ( this.object !== undefined ) {
 
-			_box$2.setFromObject( this.object );
+			_box$3.setFromObject( this.object );
 
 		}
 
-		if ( _box$2.isEmpty() ) { return; }
+		if ( _box$3.isEmpty() ) { return; }
 
-		var min = _box$2.min;
-		var max = _box$2.max;
+		var min = _box$3.min;
+		var max = _box$3.max;
 
 		/*
 		  5____4

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


+ 33 - 52
build/three.module.js

@@ -6091,8 +6091,11 @@ var _points = [
 	new Vector3(),
 	new Vector3()
 ];
+
 var _vector$2 = new Vector3();
 
+var _box = new Box3();
+
 // triangle centered vertices
 
 var _v0 = new Vector3();
@@ -6122,6 +6125,7 @@ function Box3( min, max ) {
 
 }
 
+
 Object.assign( Box3.prototype, {
 
 	isBox3: true,
@@ -6321,8 +6325,6 @@ Object.assign( Box3.prototype, {
 
 	expandByObject: function ( object ) {
 
-		var i, l;
-
 		// Computes the world-axis-aligned bounding box of an object (including its children),
 		// accounting for both the object's, and children's, world transforms
 
@@ -6332,44 +6334,23 @@ Object.assign( Box3.prototype, {
 
 		if ( geometry !== undefined ) {
 
-			if ( geometry.isGeometry ) {
-
-				var vertices = geometry.vertices;
-
-				for ( i = 0, l = vertices.length; i < l; i ++ ) {
-
-					_vector$2.copy( vertices[ i ] );
-					_vector$2.applyMatrix4( object.matrixWorld );
-
-					this.expandByPoint( _vector$2 );
-
-				}
-
-			} else if ( geometry.isBufferGeometry ) {
-
-				var attribute = geometry.attributes.position;
-
-				if ( attribute !== undefined ) {
+			if ( geometry.boundingBox === null ) {
 
-					for ( i = 0, l = attribute.count; i < l; i ++ ) {
+				geometry.computeBoundingBox();
 
-						_vector$2.fromBufferAttribute( attribute, i ).applyMatrix4( object.matrixWorld );
-
-						this.expandByPoint( _vector$2 );
+			}
 
-					}
+			_box.copy( geometry.boundingBox );
+			_box.applyMatrix4( object.matrixWorld );
 
-				}
-
-			}
+			this.expandByPoint( _box.min );
+			this.expandByPoint( _box.max );
 
 		}
 
-		//
-
 		var children = object.children;
 
-		for ( i = 0, l = children.length; i < l; i ++ ) {
+		for ( var i = 0, l = children.length; i < l; i ++ ) {
 
 			this.expandByObject( children[ i ] );
 
@@ -6659,7 +6640,7 @@ function satForAxes( axes, v0, v1, v2, extents ) {
 
 }
 
-var _box = new Box3();
+var _box$1 = new Box3();
 
 /**
  * @author bhouston / http://clara.io
@@ -6694,7 +6675,7 @@ Object.assign( Sphere.prototype, {
 
 		} else {
 
-			_box.setFromPoints( points ).getCenter( center );
+			_box$1.setFromPoints( points ).getCenter( center );
 
 		}
 
@@ -9796,7 +9777,7 @@ var _bufferGeometryId = 1; // BufferGeometry uses odd numbers as Id
 var _m1$2 = new Matrix4();
 var _obj = new Object3D();
 var _offset = new Vector3();
-var _box$1 = new Box3();
+var _box$2 = new Box3();
 var _boxMorphTargets = new Box3();
 var _vector$4 = new Vector3();
 
@@ -10348,20 +10329,20 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 				for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {
 
 					var morphAttribute = morphAttributesPosition[ i ];
-					_box$1.setFromBufferAttribute( morphAttribute );
+					_box$2.setFromBufferAttribute( morphAttribute );
 
 					if ( this.morphTargetsRelative ) {
 
-						_vector$4.addVectors( this.boundingBox.min, _box$1.min );
+						_vector$4.addVectors( this.boundingBox.min, _box$2.min );
 						this.boundingBox.expandByPoint( _vector$4 );
 
-						_vector$4.addVectors( this.boundingBox.max, _box$1.max );
+						_vector$4.addVectors( this.boundingBox.max, _box$2.max );
 						this.boundingBox.expandByPoint( _vector$4 );
 
 					} else {
 
-						this.boundingBox.expandByPoint( _box$1.min );
-						this.boundingBox.expandByPoint( _box$1.max );
+						this.boundingBox.expandByPoint( _box$2.min );
+						this.boundingBox.expandByPoint( _box$2.max );
 
 					}
 
@@ -10400,7 +10381,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 			var center = this.boundingSphere.center;
 
-			_box$1.setFromBufferAttribute( position );
+			_box$2.setFromBufferAttribute( position );
 
 			// process morph attributes if present
 
@@ -10413,16 +10394,16 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 					if ( this.morphTargetsRelative ) {
 
-						_vector$4.addVectors( _box$1.min, _boxMorphTargets.min );
-						_box$1.expandByPoint( _vector$4 );
+						_vector$4.addVectors( _box$2.min, _boxMorphTargets.min );
+						_box$2.expandByPoint( _vector$4 );
 
-						_vector$4.addVectors( _box$1.max, _boxMorphTargets.max );
-						_box$1.expandByPoint( _vector$4 );
+						_vector$4.addVectors( _box$2.max, _boxMorphTargets.max );
+						_box$2.expandByPoint( _vector$4 );
 
 					} else {
 
-						_box$1.expandByPoint( _boxMorphTargets.min );
-						_box$1.expandByPoint( _boxMorphTargets.max );
+						_box$2.expandByPoint( _boxMorphTargets.min );
+						_box$2.expandByPoint( _boxMorphTargets.max );
 
 					}
 
@@ -10430,7 +10411,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 			}
 
-			_box$1.getCenter( center );
+			_box$2.getCenter( center );
 
 			// second, try to find a boundingSphere with a radius smaller than the
 			// boundingSphere of the boundingBox: sqrt(3) smaller in the best case
@@ -47306,7 +47287,7 @@ function setPoint( point, pointMap, geometry, camera, x, y, z ) {
  * @author Mugen87 / http://github.com/Mugen87
  */
 
-var _box$2 = new Box3();
+var _box$3 = new Box3();
 
 function BoxHelper( object, color ) {
 
@@ -47342,14 +47323,14 @@ BoxHelper.prototype.update = function ( object ) {
 
 	if ( this.object !== undefined ) {
 
-		_box$2.setFromObject( this.object );
+		_box$3.setFromObject( this.object );
 
 	}
 
-	if ( _box$2.isEmpty() ) return;
+	if ( _box$3.isEmpty() ) return;
 
-	var min = _box$2.min;
-	var max = _box$2.max;
+	var min = _box$3.min;
+	var max = _box$3.max;
 
 	/*
 	  5____4

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