Browse Source

Updated builds.

Mugen87 3 năm trước cách đây
mục cha
commit
68f8ba5f0b
4 tập tin đã thay đổi với 58 bổ sung233 xóa
  1. 19 69
      build/three.cjs
  2. 19 69
      build/three.js
  3. 0 0
      build/three.min.js
  4. 20 95
      build/three.module.js

+ 19 - 69
build/three.cjs

@@ -2928,10 +2928,6 @@ class Quaternion {
 	}
 
 	setFromEuler(euler, update) {
-		if (!(euler && euler.isEuler)) {
-			throw new Error('THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.');
-		}
-
 		const x = euler._x,
 					y = euler._y,
 					z = euler._z,
@@ -8737,10 +8733,6 @@ class ShaderMaterial extends Material {
 		this.glslVersion = null;
 
 		if (parameters !== undefined) {
-			if (parameters.attributes !== undefined) {
-				console.error('THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.');
-			}
-
 			this.setValues(parameters);
 		}
 	}
@@ -9055,12 +9047,6 @@ class CubeCamera extends Object3D {
 	constructor(near, far, renderTarget) {
 		super();
 		this.type = 'CubeCamera';
-
-		if (renderTarget.isWebGLCubeRenderTarget !== true) {
-			console.error('THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.');
-			return;
-		}
-
 		this.renderTarget = renderTarget;
 		const cameraPX = new PerspectiveCamera(fov, aspect, near, far);
 		cameraPX.layers = this.layers;
@@ -13967,16 +13953,10 @@ function includeReplacer(match, include) {
 } // Unroll Loops
 
 
-const deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
 const unrollLoopPattern = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
 
 function unrollLoops(string) {
-	return string.replace(unrollLoopPattern, loopReplacer).replace(deprecatedUnrollLoopPattern, deprecatedLoopReplacer);
-}
-
-function deprecatedLoopReplacer(match, start, end, snippet) {
-	console.warn('WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.');
-	return loopReplacer(match, start, end, snippet);
+	return string.replace(unrollLoopPattern, loopReplacer);
 }
 
 function loopReplacer(match, start, end, snippet) {
@@ -14295,23 +14275,26 @@ class WebGLShaderCache {
 
 	_getShaderCacheForMaterial(material) {
 		const cache = this.materialCache;
+		let set = cache.get(material);
 
-		if (cache.has(material) === false) {
-			cache.set(material, new Set());
+		if (set === undefined) {
+			set = new Set();
+			cache.set(material, set);
 		}
 
-		return cache.get(material);
+		return set;
 	}
 
 	_getShaderStage(code) {
 		const cache = this.shaderCache;
+		let stage = cache.get(code);
 
-		if (cache.has(code) === false) {
-			const stage = new WebGLShaderStage(code);
+		if (stage === undefined) {
+			stage = new WebGLShaderStage(code);
 			cache.set(code, stage);
 		}
 
-		return cache.get(code);
+		return stage;
 	}
 
 }
@@ -21983,12 +21966,6 @@ class Skeleton {
 
 class InstancedBufferAttribute extends BufferAttribute {
 	constructor(array, itemSize, normalized, meshPerAttribute = 1) {
-		if (typeof normalized === 'number') {
-			meshPerAttribute = normalized;
-			normalized = false;
-			console.error('THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.');
-		}
-
 		super(array, itemSize, normalized);
 		this.isInstancedBufferAttribute = true;
 		this.meshPerAttribute = meshPerAttribute;
@@ -30263,10 +30240,6 @@ class ObjectLoader extends Loader {
 						geometry = bufferGeometryLoader.parse(data);
 						break;
 
-					case 'Geometry':
-						console.error('THREE.ObjectLoader: The legacy Geometry type is no longer supported.');
-						break;
-
 					default:
 						if (data.type in Geometries) {
 							geometry = Geometries[data.type].fromJSON(data, shapes);
@@ -30298,28 +30271,11 @@ class ObjectLoader extends Loader {
 			for (let i = 0, l = json.length; i < l; i++) {
 				const data = json[i];
 
-				if (data.type === 'MultiMaterial') {
-					// Deprecated
-					const array = [];
-
-					for (let j = 0; j < data.materials.length; j++) {
-						const material = data.materials[j];
-
-						if (cache[material.uuid] === undefined) {
-							cache[material.uuid] = loader.parse(material);
-						}
-
-						array.push(cache[material.uuid]);
-					}
-
-					materials[data.uuid] = array;
-				} else {
-					if (cache[data.uuid] === undefined) {
-						cache[data.uuid] = loader.parse(data);
-					}
-
-					materials[data.uuid] = cache[data.uuid];
+				if (cache[data.uuid] === undefined) {
+					cache[data.uuid] = loader.parse(data);
 				}
+
+				materials[data.uuid] = cache[data.uuid];
 			}
 		}
 
@@ -32790,13 +32746,12 @@ class AnimationAction {
 			const timeRunning = (time - startTime) * timeDirection;
 
 			if (timeRunning < 0 || timeDirection === 0) {
-				return; // yet to come / don't decide when delta = 0
-			} // start
-
-
-			this._startTime = null; // unschedule
+				deltaTime = 0;
+			} else {
+				this._startTime = null; // unschedule
 
-			deltaTime = timeDirection * timeRunning;
+				deltaTime = timeDirection * timeRunning;
+			}
 		} // apply time scale and advance time
 
 
@@ -33580,11 +33535,6 @@ class AnimationMixer extends EventDispatcher {
 
 class Uniform {
 	constructor(value) {
-		if (typeof value === 'string') {
-			console.warn('THREE.Uniform: Type parameter is no longer needed.');
-			value = arguments[1];
-		}
-
 		this.value = value;
 	}
 

+ 19 - 69
build/three.js

@@ -2930,10 +2930,6 @@
 		}
 
 		setFromEuler(euler, update) {
-			if (!(euler && euler.isEuler)) {
-				throw new Error('THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.');
-			}
-
 			const x = euler._x,
 						y = euler._y,
 						z = euler._z,
@@ -8739,10 +8735,6 @@
 			this.glslVersion = null;
 
 			if (parameters !== undefined) {
-				if (parameters.attributes !== undefined) {
-					console.error('THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.');
-				}
-
 				this.setValues(parameters);
 			}
 		}
@@ -9057,12 +9049,6 @@
 		constructor(near, far, renderTarget) {
 			super();
 			this.type = 'CubeCamera';
-
-			if (renderTarget.isWebGLCubeRenderTarget !== true) {
-				console.error('THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.');
-				return;
-			}
-
 			this.renderTarget = renderTarget;
 			const cameraPX = new PerspectiveCamera(fov, aspect, near, far);
 			cameraPX.layers = this.layers;
@@ -13969,16 +13955,10 @@
 	} // Unroll Loops
 
 
-	const deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
 	const unrollLoopPattern = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
 
 	function unrollLoops(string) {
-		return string.replace(unrollLoopPattern, loopReplacer).replace(deprecatedUnrollLoopPattern, deprecatedLoopReplacer);
-	}
-
-	function deprecatedLoopReplacer(match, start, end, snippet) {
-		console.warn('WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.');
-		return loopReplacer(match, start, end, snippet);
+		return string.replace(unrollLoopPattern, loopReplacer);
 	}
 
 	function loopReplacer(match, start, end, snippet) {
@@ -14297,23 +14277,26 @@
 
 		_getShaderCacheForMaterial(material) {
 			const cache = this.materialCache;
+			let set = cache.get(material);
 
-			if (cache.has(material) === false) {
-				cache.set(material, new Set());
+			if (set === undefined) {
+				set = new Set();
+				cache.set(material, set);
 			}
 
-			return cache.get(material);
+			return set;
 		}
 
 		_getShaderStage(code) {
 			const cache = this.shaderCache;
+			let stage = cache.get(code);
 
-			if (cache.has(code) === false) {
-				const stage = new WebGLShaderStage(code);
+			if (stage === undefined) {
+				stage = new WebGLShaderStage(code);
 				cache.set(code, stage);
 			}
 
-			return cache.get(code);
+			return stage;
 		}
 
 	}
@@ -21985,12 +21968,6 @@
 
 	class InstancedBufferAttribute extends BufferAttribute {
 		constructor(array, itemSize, normalized, meshPerAttribute = 1) {
-			if (typeof normalized === 'number') {
-				meshPerAttribute = normalized;
-				normalized = false;
-				console.error('THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.');
-			}
-
 			super(array, itemSize, normalized);
 			this.isInstancedBufferAttribute = true;
 			this.meshPerAttribute = meshPerAttribute;
@@ -30265,10 +30242,6 @@
 							geometry = bufferGeometryLoader.parse(data);
 							break;
 
-						case 'Geometry':
-							console.error('THREE.ObjectLoader: The legacy Geometry type is no longer supported.');
-							break;
-
 						default:
 							if (data.type in Geometries) {
 								geometry = Geometries[data.type].fromJSON(data, shapes);
@@ -30300,28 +30273,11 @@
 				for (let i = 0, l = json.length; i < l; i++) {
 					const data = json[i];
 
-					if (data.type === 'MultiMaterial') {
-						// Deprecated
-						const array = [];
-
-						for (let j = 0; j < data.materials.length; j++) {
-							const material = data.materials[j];
-
-							if (cache[material.uuid] === undefined) {
-								cache[material.uuid] = loader.parse(material);
-							}
-
-							array.push(cache[material.uuid]);
-						}
-
-						materials[data.uuid] = array;
-					} else {
-						if (cache[data.uuid] === undefined) {
-							cache[data.uuid] = loader.parse(data);
-						}
-
-						materials[data.uuid] = cache[data.uuid];
+					if (cache[data.uuid] === undefined) {
+						cache[data.uuid] = loader.parse(data);
 					}
+
+					materials[data.uuid] = cache[data.uuid];
 				}
 			}
 
@@ -32792,13 +32748,12 @@
 				const timeRunning = (time - startTime) * timeDirection;
 
 				if (timeRunning < 0 || timeDirection === 0) {
-					return; // yet to come / don't decide when delta = 0
-				} // start
-
-
-				this._startTime = null; // unschedule
+					deltaTime = 0;
+				} else {
+					this._startTime = null; // unschedule
 
-				deltaTime = timeDirection * timeRunning;
+					deltaTime = timeDirection * timeRunning;
+				}
 			} // apply time scale and advance time
 
 
@@ -33582,11 +33537,6 @@
 
 	class Uniform {
 		constructor(value) {
-			if (typeof value === 'string') {
-				console.warn('THREE.Uniform: Type parameter is no longer needed.');
-				value = arguments[1];
-			}
-
 			this.value = value;
 		}
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
build/three.min.js


+ 20 - 95
build/three.module.js

@@ -3756,12 +3756,6 @@ class Quaternion {
 
 	setFromEuler( euler, update ) {
 
-		if ( ! ( euler && euler.isEuler ) ) {
-
-			throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' );
-
-		}
-
 		const x = euler._x, y = euler._y, z = euler._z, order = euler._order;
 
 		// http://www.mathworks.com/matlabcentral/fileexchange/
@@ -11505,12 +11499,6 @@ class ShaderMaterial extends Material {
 
 		if ( parameters !== undefined ) {
 
-			if ( parameters.attributes !== undefined ) {
-
-				console.error( 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.' );
-
-			}
-
 			this.setValues( parameters );
 
 		}
@@ -11941,13 +11929,6 @@ class CubeCamera extends Object3D {
 
 		this.type = 'CubeCamera';
 
-		if ( renderTarget.isWebGLCubeRenderTarget !== true ) {
-
-			console.error( 'THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.' );
-			return;
-
-		}
-
 		this.renderTarget = renderTarget;
 
 		const cameraPX = new PerspectiveCamera( fov, aspect, near, far );
@@ -18289,21 +18270,11 @@ function includeReplacer( match, include ) {
 
 // Unroll Loops
 
-const deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
 const unrollLoopPattern = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
 
 function unrollLoops( string ) {
 
-	return string
-		.replace( unrollLoopPattern, loopReplacer )
-		.replace( deprecatedUnrollLoopPattern, deprecatedLoopReplacer );
-
-}
-
-function deprecatedLoopReplacer( match, start, end, snippet ) {
-
-	console.warn( 'WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.' );
-	return loopReplacer( match, start, end, snippet );
+	return string.replace( unrollLoopPattern, loopReplacer );
 
 }
 
@@ -19049,29 +19020,32 @@ class WebGLShaderCache {
 	_getShaderCacheForMaterial( material ) {
 
 		const cache = this.materialCache;
+		let set = cache.get( material );
 
-		if ( cache.has( material ) === false ) {
+		if ( set === undefined ) {
 
-			cache.set( material, new Set() );
+			set = new Set();
+			cache.set( material, set );
 
 		}
 
-		return cache.get( material );
+		return set;
 
 	}
 
 	_getShaderStage( code ) {
 
 		const cache = this.shaderCache;
+		let stage = cache.get( code );
 
-		if ( cache.has( code ) === false ) {
+		if ( stage === undefined ) {
 
-			const stage = new WebGLShaderStage( code );
+			stage = new WebGLShaderStage( code );
 			cache.set( code, stage );
 
 		}
 
-		return cache.get( code );
+		return stage;
 
 	}
 
@@ -30176,16 +30150,6 @@ class InstancedBufferAttribute extends BufferAttribute {
 
 	constructor( array, itemSize, normalized, meshPerAttribute = 1 ) {
 
-		if ( typeof normalized === 'number' ) {
-
-			meshPerAttribute = normalized;
-
-			normalized = false;
-
-			console.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.' );
-
-		}
-
 		super( array, itemSize, normalized );
 
 		this.isInstancedBufferAttribute = true;
@@ -42189,13 +42153,6 @@ class ObjectLoader extends Loader {
 					case 'InstancedBufferGeometry':
 
 						geometry = bufferGeometryLoader.parse( data );
-
-						break;
-
-					case 'Geometry':
-
-						console.error( 'THREE.ObjectLoader: The legacy Geometry type is no longer supported.' );
-
 						break;
 
 					default:
@@ -42241,40 +42198,14 @@ class ObjectLoader extends Loader {
 
 				const data = json[ i ];
 
-				if ( data.type === 'MultiMaterial' ) {
-
-					// Deprecated
-
-					const array = [];
-
-					for ( let j = 0; j < data.materials.length; j ++ ) {
-
-						const material = data.materials[ j ];
-
-						if ( cache[ material.uuid ] === undefined ) {
-
-							cache[ material.uuid ] = loader.parse( material );
-
-						}
-
-						array.push( cache[ material.uuid ] );
-
-					}
-
-					materials[ data.uuid ] = array;
-
-				} else {
-
-					if ( cache[ data.uuid ] === undefined ) {
+				if ( cache[ data.uuid ] === undefined ) {
 
-						cache[ data.uuid ] = loader.parse( data );
-
-					}
-
-					materials[ data.uuid ] = cache[ data.uuid ];
+					cache[ data.uuid ] = loader.parse( data );
 
 				}
 
+				materials[ data.uuid ] = cache[ data.uuid ];
+
 			}
 
 		}
@@ -45825,14 +45756,15 @@ class AnimationAction {
 			const timeRunning = ( time - startTime ) * timeDirection;
 			if ( timeRunning < 0 || timeDirection === 0 ) {
 
-				return; // yet to come / don't decide when delta = 0
+				deltaTime = 0;
+
+			} else {
 
-			}
 
-			// start
+				this._startTime = null; // unschedule
+				deltaTime = timeDirection * timeRunning;
 
-			this._startTime = null; // unschedule
-			deltaTime = timeDirection * timeRunning;
+			}
 
 		}
 
@@ -46944,13 +46876,6 @@ class Uniform {
 
 	constructor( value ) {
 
-		if ( typeof value === 'string' ) {
-
-			console.warn( 'THREE.Uniform: Type parameter is no longer needed.' );
-			value = arguments[ 1 ];
-
-		}
-
 		this.value = value;
 
 	}

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác