浏览代码

Updated builds.

Mr.doob 7 年之前
父节点
当前提交
e6e02e84bd
共有 3 个文件被更改,包括 517 次插入451 次删除
  1. 190 38
      build/three.js
  2. 137 375
      build/three.min.js
  3. 190 38
      build/three.module.js

+ 190 - 38
build/three.js

@@ -22167,7 +22167,10 @@
 		function start() {
 
 			if ( isAnimating ) return;
-			( vr.getDevice() || window ).requestAnimationFrame( loop );
+
+			var device = vr.getDevice();
+			( ( device && device.isConnected ) || window ).requestAnimationFrame( loop );
+
 			isAnimating = true;
 
 		}
@@ -22175,7 +22178,9 @@
 		function loop( time ) {
 
 			if ( onAnimationFrame !== null ) onAnimationFrame( time );
-			( vr.getDevice() || window ).requestAnimationFrame( loop );
+
+			var device = vr.getDevice();
+			( ( device && device.isConnected ) || window ).requestAnimationFrame( loop );
 
 		}
 
@@ -28942,7 +28947,7 @@
 
 		openEnded = openEnded !== undefined ? openEnded : false;
 		thetaStart = thetaStart !== undefined ? thetaStart : 0.0;
-		thetaLength = thetaLength !== undefined ? thetaLength : 2.0 * Math.PI;
+		thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;
 
 		// buffers
 
@@ -30508,6 +30513,8 @@
 
 					var callbacks = loading[ url ];
 
+					delete loading[ url ];
+
 					for ( var i = 0, il = callbacks.length; i < il; i ++ ) {
 
 						var callback = callbacks[ i ];
@@ -35603,6 +35610,20 @@
 				binormals: binormals
 			};
 
+		},
+
+		clone: function () {
+
+			return new this.constructor().copy( this );
+
+		},
+
+		copy: function ( source ) {
+
+			this.arcLengthDivisions = source.arcLengthDivisions;
+
+			return this;
+
 		}
 
 	} );
@@ -35613,8 +35634,8 @@
 
 		this.type = 'LineCurve';
 
-		this.v1 = v1;
-		this.v2 = v2;
+		this.v1 = v1 || new Vector2();
+		this.v2 = v2 || new Vector2();
 
 	}
 
@@ -35658,6 +35679,17 @@
 
 	};
 
+	LineCurve.prototype.copy = function ( source ) {
+
+		Curve.prototype.copy.call( this, source );
+
+		this.v1.copy( source.v1 );
+		this.v2.copy( source.v2 );
+
+		return this;
+
+	};
+
 	/**
 	 * @author zz85 / http://www.lab4games.net/zz85/blog
 	 *
@@ -35864,16 +35896,16 @@
 
 		this.type = 'EllipseCurve';
 
-		this.aX = aX;
-		this.aY = aY;
+		this.aX = aX || 0;
+		this.aY = aY || 0;
 
-		this.xRadius = xRadius;
-		this.yRadius = yRadius;
+		this.xRadius = xRadius || 1;
+		this.yRadius = yRadius || 1;
 
-		this.aStartAngle = aStartAngle;
-		this.aEndAngle = aEndAngle;
+		this.aStartAngle = aStartAngle || 0;
+		this.aEndAngle = aEndAngle || 2 * Math.PI;
 
-		this.aClockwise = aClockwise;
+		this.aClockwise = aClockwise || false;
 
 		this.aRotation = aRotation || 0;
 
@@ -35946,13 +35978,34 @@
 
 	};
 
+	EllipseCurve.prototype.copy = function ( source ) {
+
+		Curve.prototype.copy.call( this, source );
+
+		this.aX = source.aX;
+		this.aY = source.aY;
+
+		this.xRadius = source.xRadius;
+		this.yRadius = source.yRadius;
+
+		this.aStartAngle = source.aStartAngle;
+		this.aEndAngle = source.aEndAngle;
+
+		this.aClockwise = source.aClockwise;
+
+		this.aRotation = source.aRotation;
+
+		return this;
+
+	};
+
 	function SplineCurve( points /* array of Vector2 */ ) {
 
 		Curve.call( this );
 
 		this.type = 'SplineCurve';
 
-		this.points = ( points === undefined ) ? [] : points;
+		this.points = points || [];
 
 	}
 
@@ -35985,16 +36038,34 @@
 
 	};
 
+	SplineCurve.prototype.copy = function ( source ) {
+
+		Curve.prototype.copy.call( this, source );
+
+		this.points = [];
+
+		for ( var i = 0, l = source.points.length; i < l; i ++ ) {
+
+			var point = source.points[ i ];
+
+			this.points.push( point.clone() );
+
+		}
+
+		return this;
+
+	};
+
 	function CubicBezierCurve( v0, v1, v2, v3 ) {
 
 		Curve.call( this );
 
 		this.type = 'CubicBezierCurve';
 
-		this.v0 = v0;
-		this.v1 = v1;
-		this.v2 = v2;
-		this.v3 = v3;
+		this.v0 = v0 || new Vector2();
+		this.v1 = v1 || new Vector2();
+		this.v2 = v2 || new Vector2();
+		this.v3 = v3 || new Vector2();
 
 	}
 
@@ -36018,15 +36089,28 @@
 
 	};
 
+	CubicBezierCurve.prototype.copy = function ( source ) {
+
+		Curve.prototype.copy.call( this, source );
+
+		this.v0.copy( source.v0 );
+		this.v1.copy( source.v1 );
+		this.v2.copy( source.v2 );
+		this.v3.copy( source.v3 );
+
+		return this;
+
+	};
+
 	function QuadraticBezierCurve( v0, v1, v2 ) {
 
 		Curve.call( this );
 
 		this.type = 'QuadraticBezierCurve';
 
-		this.v0 = v0;
-		this.v1 = v1;
-		this.v2 = v2;
+		this.v0 = v0 || new Vector2();
+		this.v1 = v1 || new Vector2();
+		this.v2 = v2 || new Vector2();
 
 	}
 
@@ -36050,6 +36134,18 @@
 
 	};
 
+	QuadraticBezierCurve.prototype.copy = function ( source ) {
+
+		Curve.prototype.copy.call( this, source );
+
+		this.v0.copy( source.v0 );
+		this.v1.copy( source.v1 );
+		this.v2.copy( source.v2 );
+
+		return this;
+
+	};
+
 	var PathPrototype = Object.assign( Object.create( CurvePath.prototype ), {
 
 		fromPoints: function ( vectors ) {
@@ -42574,17 +42670,16 @@
 	var py = new CubicPoly();
 	var pz = new CubicPoly();
 
-	function CatmullRomCurve3( points ) {
+	function CatmullRomCurve3( points, closed, curveType, tension ) {
 
 		Curve.call( this );
 
 		this.type = 'CatmullRomCurve3';
 
-		if ( points.length < 2 ) console.warn( 'THREE.CatmullRomCurve3: Points array needs at least two entries.' );
-
 		this.points = points || [];
-		this.closed = false;
-		this.curveType = 'centripetal';
+		this.closed = closed || false;
+		this.curveType = curveType || 'centripetal';
+		this.tension = tension || 0.5;
 
 	}
 
@@ -42663,10 +42758,9 @@
 
 		} else if ( this.curveType === 'catmullrom' ) {
 
-			var tension = this.tension !== undefined ? this.tension : 0.5;
-			px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, tension );
-			py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, tension );
-			pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, tension );
+			px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension );
+			py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension );
+			pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension );
 
 		}
 
@@ -42680,16 +42774,38 @@
 
 	};
 
+	CatmullRomCurve3.prototype.copy = function ( source ) {
+
+		Curve.prototype.copy.call( this, source );
+
+		this.points = [];
+
+		for ( var i = 0, l = source.points.length; i < l; i ++ ) {
+
+			var point = source.points[ i ];
+
+			this.points.push( point.clone() );
+
+		}
+
+		this.closed = source.closed;
+		this.curveType = source.curveType;
+		this.tension = source.tension;
+
+		return this;
+
+	};
+
 	function CubicBezierCurve3( v0, v1, v2, v3 ) {
 
 		Curve.call( this );
 
 		this.type = 'CubicBezierCurve3';
 
-		this.v0 = v0;
-		this.v1 = v1;
-		this.v2 = v2;
-		this.v3 = v3;
+		this.v0 = v0 || new Vector3();
+		this.v1 = v1 || new Vector3();
+		this.v2 = v2 || new Vector3();
+		this.v3 = v3 || new Vector3();
 
 	}
 
@@ -42714,15 +42830,28 @@
 
 	};
 
+	CubicBezierCurve3.prototype.copy = function ( source ) {
+
+		Curve.prototype.copy.call( this, source );
+
+		this.v0.copy( source.v0 );
+		this.v1.copy( source.v1 );
+		this.v2.copy( source.v2 );
+		this.v3.copy( source.v3 );
+
+		return this;
+
+	};
+
 	function QuadraticBezierCurve3( v0, v1, v2 ) {
 
 		Curve.call( this );
 
 		this.type = 'QuadraticBezierCurve3';
 
-		this.v0 = v0;
-		this.v1 = v1;
-		this.v2 = v2;
+		this.v0 = v0 || new Vector3();
+		this.v1 = v1 || new Vector3();
+		this.v2 = v2 || new Vector3();
 
 	}
 
@@ -42747,14 +42876,26 @@
 
 	};
 
+	QuadraticBezierCurve3.prototype.copy = function ( source ) {
+
+		Curve.prototype.copy.call( this, source );
+
+		this.v0.copy( source.v0 );
+		this.v1.copy( source.v1 );
+		this.v2.copy( source.v2 );
+
+		return this;
+
+	};
+
 	function LineCurve3( v1, v2 ) {
 
 		Curve.call( this );
 
 		this.type = 'LineCurve3';
 
-		this.v1 = v1;
-		this.v2 = v2;
+		this.v1 = v1 || new Vector3();
+		this.v2 = v2 || new Vector3();
 
 	}
 
@@ -42790,6 +42931,17 @@
 
 	};
 
+	LineCurve3.prototype.copy = function ( source ) {
+
+		Curve.prototype.copy.call( this, source );
+
+		this.v1.copy( source.v1 );
+		this.v2.copy( source.v2 );
+
+		return this;
+
+	};
+
 	function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {
 
 		EllipseCurve.call( this, aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );

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


+ 190 - 38
build/three.module.js

@@ -22161,7 +22161,10 @@ function WebGLRenderer( parameters ) {
 	function start() {
 
 		if ( isAnimating ) return;
-		( vr.getDevice() || window ).requestAnimationFrame( loop );
+
+		var device = vr.getDevice();
+		( ( device && device.isConnected ) || window ).requestAnimationFrame( loop );
+
 		isAnimating = true;
 
 	}
@@ -22169,7 +22172,9 @@ function WebGLRenderer( parameters ) {
 	function loop( time ) {
 
 		if ( onAnimationFrame !== null ) onAnimationFrame( time );
-		( vr.getDevice() || window ).requestAnimationFrame( loop );
+
+		var device = vr.getDevice();
+		( ( device && device.isConnected ) || window ).requestAnimationFrame( loop );
 
 	}
 
@@ -28936,7 +28941,7 @@ function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments
 
 	openEnded = openEnded !== undefined ? openEnded : false;
 	thetaStart = thetaStart !== undefined ? thetaStart : 0.0;
-	thetaLength = thetaLength !== undefined ? thetaLength : 2.0 * Math.PI;
+	thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;
 
 	// buffers
 
@@ -30502,6 +30507,8 @@ Object.assign( FileLoader.prototype, {
 
 				var callbacks = loading[ url ];
 
+				delete loading[ url ];
+
 				for ( var i = 0, il = callbacks.length; i < il; i ++ ) {
 
 					var callback = callbacks[ i ];
@@ -35597,6 +35604,20 @@ Object.assign( Curve.prototype, {
 			binormals: binormals
 		};
 
+	},
+
+	clone: function () {
+
+		return new this.constructor().copy( this );
+
+	},
+
+	copy: function ( source ) {
+
+		this.arcLengthDivisions = source.arcLengthDivisions;
+
+		return this;
+
 	}
 
 } );
@@ -35607,8 +35628,8 @@ function LineCurve( v1, v2 ) {
 
 	this.type = 'LineCurve';
 
-	this.v1 = v1;
-	this.v2 = v2;
+	this.v1 = v1 || new Vector2();
+	this.v2 = v2 || new Vector2();
 
 }
 
@@ -35652,6 +35673,17 @@ LineCurve.prototype.getTangent = function ( /* t */ ) {
 
 };
 
+LineCurve.prototype.copy = function ( source ) {
+
+	Curve.prototype.copy.call( this, source );
+
+	this.v1.copy( source.v1 );
+	this.v2.copy( source.v2 );
+
+	return this;
+
+};
+
 /**
  * @author zz85 / http://www.lab4games.net/zz85/blog
  *
@@ -35858,16 +35890,16 @@ function EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockw
 
 	this.type = 'EllipseCurve';
 
-	this.aX = aX;
-	this.aY = aY;
+	this.aX = aX || 0;
+	this.aY = aY || 0;
 
-	this.xRadius = xRadius;
-	this.yRadius = yRadius;
+	this.xRadius = xRadius || 1;
+	this.yRadius = yRadius || 1;
 
-	this.aStartAngle = aStartAngle;
-	this.aEndAngle = aEndAngle;
+	this.aStartAngle = aStartAngle || 0;
+	this.aEndAngle = aEndAngle || 2 * Math.PI;
 
-	this.aClockwise = aClockwise;
+	this.aClockwise = aClockwise || false;
 
 	this.aRotation = aRotation || 0;
 
@@ -35940,13 +35972,34 @@ EllipseCurve.prototype.getPoint = function ( t, optionalTarget ) {
 
 };
 
+EllipseCurve.prototype.copy = function ( source ) {
+
+	Curve.prototype.copy.call( this, source );
+
+	this.aX = source.aX;
+	this.aY = source.aY;
+
+	this.xRadius = source.xRadius;
+	this.yRadius = source.yRadius;
+
+	this.aStartAngle = source.aStartAngle;
+	this.aEndAngle = source.aEndAngle;
+
+	this.aClockwise = source.aClockwise;
+
+	this.aRotation = source.aRotation;
+
+	return this;
+
+};
+
 function SplineCurve( points /* array of Vector2 */ ) {
 
 	Curve.call( this );
 
 	this.type = 'SplineCurve';
 
-	this.points = ( points === undefined ) ? [] : points;
+	this.points = points || [];
 
 }
 
@@ -35979,16 +36032,34 @@ SplineCurve.prototype.getPoint = function ( t, optionalTarget ) {
 
 };
 
+SplineCurve.prototype.copy = function ( source ) {
+
+	Curve.prototype.copy.call( this, source );
+
+	this.points = [];
+
+	for ( var i = 0, l = source.points.length; i < l; i ++ ) {
+
+		var point = source.points[ i ];
+
+		this.points.push( point.clone() );
+
+	}
+
+	return this;
+
+};
+
 function CubicBezierCurve( v0, v1, v2, v3 ) {
 
 	Curve.call( this );
 
 	this.type = 'CubicBezierCurve';
 
-	this.v0 = v0;
-	this.v1 = v1;
-	this.v2 = v2;
-	this.v3 = v3;
+	this.v0 = v0 || new Vector2();
+	this.v1 = v1 || new Vector2();
+	this.v2 = v2 || new Vector2();
+	this.v3 = v3 || new Vector2();
 
 }
 
@@ -36012,15 +36083,28 @@ CubicBezierCurve.prototype.getPoint = function ( t, optionalTarget ) {
 
 };
 
+CubicBezierCurve.prototype.copy = function ( source ) {
+
+	Curve.prototype.copy.call( this, source );
+
+	this.v0.copy( source.v0 );
+	this.v1.copy( source.v1 );
+	this.v2.copy( source.v2 );
+	this.v3.copy( source.v3 );
+
+	return this;
+
+};
+
 function QuadraticBezierCurve( v0, v1, v2 ) {
 
 	Curve.call( this );
 
 	this.type = 'QuadraticBezierCurve';
 
-	this.v0 = v0;
-	this.v1 = v1;
-	this.v2 = v2;
+	this.v0 = v0 || new Vector2();
+	this.v1 = v1 || new Vector2();
+	this.v2 = v2 || new Vector2();
 
 }
 
@@ -36044,6 +36128,18 @@ QuadraticBezierCurve.prototype.getPoint = function ( t, optionalTarget ) {
 
 };
 
+QuadraticBezierCurve.prototype.copy = function ( source ) {
+
+	Curve.prototype.copy.call( this, source );
+
+	this.v0.copy( source.v0 );
+	this.v1.copy( source.v1 );
+	this.v2.copy( source.v2 );
+
+	return this;
+
+};
+
 var PathPrototype = Object.assign( Object.create( CurvePath.prototype ), {
 
 	fromPoints: function ( vectors ) {
@@ -42568,17 +42664,16 @@ var px = new CubicPoly();
 var py = new CubicPoly();
 var pz = new CubicPoly();
 
-function CatmullRomCurve3( points ) {
+function CatmullRomCurve3( points, closed, curveType, tension ) {
 
 	Curve.call( this );
 
 	this.type = 'CatmullRomCurve3';
 
-	if ( points.length < 2 ) console.warn( 'THREE.CatmullRomCurve3: Points array needs at least two entries.' );
-
 	this.points = points || [];
-	this.closed = false;
-	this.curveType = 'centripetal';
+	this.closed = closed || false;
+	this.curveType = curveType || 'centripetal';
+	this.tension = tension || 0.5;
 
 }
 
@@ -42657,10 +42752,9 @@ CatmullRomCurve3.prototype.getPoint = function ( t, optionalTarget ) {
 
 	} else if ( this.curveType === 'catmullrom' ) {
 
-		var tension = this.tension !== undefined ? this.tension : 0.5;
-		px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, tension );
-		py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, tension );
-		pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, tension );
+		px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension );
+		py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension );
+		pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension );
 
 	}
 
@@ -42674,16 +42768,38 @@ CatmullRomCurve3.prototype.getPoint = function ( t, optionalTarget ) {
 
 };
 
+CatmullRomCurve3.prototype.copy = function ( source ) {
+
+	Curve.prototype.copy.call( this, source );
+
+	this.points = [];
+
+	for ( var i = 0, l = source.points.length; i < l; i ++ ) {
+
+		var point = source.points[ i ];
+
+		this.points.push( point.clone() );
+
+	}
+
+	this.closed = source.closed;
+	this.curveType = source.curveType;
+	this.tension = source.tension;
+
+	return this;
+
+};
+
 function CubicBezierCurve3( v0, v1, v2, v3 ) {
 
 	Curve.call( this );
 
 	this.type = 'CubicBezierCurve3';
 
-	this.v0 = v0;
-	this.v1 = v1;
-	this.v2 = v2;
-	this.v3 = v3;
+	this.v0 = v0 || new Vector3();
+	this.v1 = v1 || new Vector3();
+	this.v2 = v2 || new Vector3();
+	this.v3 = v3 || new Vector3();
 
 }
 
@@ -42708,15 +42824,28 @@ CubicBezierCurve3.prototype.getPoint = function ( t, optionalTarget ) {
 
 };
 
+CubicBezierCurve3.prototype.copy = function ( source ) {
+
+	Curve.prototype.copy.call( this, source );
+
+	this.v0.copy( source.v0 );
+	this.v1.copy( source.v1 );
+	this.v2.copy( source.v2 );
+	this.v3.copy( source.v3 );
+
+	return this;
+
+};
+
 function QuadraticBezierCurve3( v0, v1, v2 ) {
 
 	Curve.call( this );
 
 	this.type = 'QuadraticBezierCurve3';
 
-	this.v0 = v0;
-	this.v1 = v1;
-	this.v2 = v2;
+	this.v0 = v0 || new Vector3();
+	this.v1 = v1 || new Vector3();
+	this.v2 = v2 || new Vector3();
 
 }
 
@@ -42741,14 +42870,26 @@ QuadraticBezierCurve3.prototype.getPoint = function ( t, optionalTarget ) {
 
 };
 
+QuadraticBezierCurve3.prototype.copy = function ( source ) {
+
+	Curve.prototype.copy.call( this, source );
+
+	this.v0.copy( source.v0 );
+	this.v1.copy( source.v1 );
+	this.v2.copy( source.v2 );
+
+	return this;
+
+};
+
 function LineCurve3( v1, v2 ) {
 
 	Curve.call( this );
 
 	this.type = 'LineCurve3';
 
-	this.v1 = v1;
-	this.v2 = v2;
+	this.v1 = v1 || new Vector3();
+	this.v2 = v2 || new Vector3();
 
 }
 
@@ -42784,6 +42925,17 @@ LineCurve3.prototype.getPointAt = function ( u, optionalTarget ) {
 
 };
 
+LineCurve3.prototype.copy = function ( source ) {
+
+	Curve.prototype.copy.call( this, source );
+
+	this.v1.copy( source.v1 );
+	this.v2.copy( source.v2 );
+
+	return this;
+
+};
+
 function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {
 
 	EllipseCurve.call( this, aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );

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