Parcourir la source

Updated builds.

Mr.doob il y a 4 ans
Parent
commit
127daecd40
3 fichiers modifiés avec 112 ajouts et 80 suppressions
  1. 90 22
      build/three.js
  2. 0 0
      build/three.min.js
  3. 22 58
      build/three.module.js

+ 90 - 22
build/three.js

@@ -5607,7 +5607,10 @@
 			return new this.constructor().copy(this, recursive);
 		},
 		copy: function copy(source, recursive) {
-			if (recursive === undefined) recursive = true;
+			if (recursive === void 0) {
+				recursive = true;
+			}
+
 			this.name = source.name;
 			this.up.copy(source.up);
 			this.position.copy(source.position);
@@ -6429,7 +6432,10 @@
 		};
 
 		_proto.copyGammaToLinear = function copyGammaToLinear(color, gammaFactor) {
-			if (gammaFactor === undefined) gammaFactor = 2.0;
+			if (gammaFactor === void 0) {
+				gammaFactor = 2.0;
+			}
+
 			this.r = Math.pow(color.r, gammaFactor);
 			this.g = Math.pow(color.g, gammaFactor);
 			this.b = Math.pow(color.b, gammaFactor);
@@ -6437,7 +6443,10 @@
 		};
 
 		_proto.copyLinearToGamma = function copyLinearToGamma(color, gammaFactor) {
-			if (gammaFactor === undefined) gammaFactor = 2.0;
+			if (gammaFactor === void 0) {
+				gammaFactor = 2.0;
+			}
+
 			var safeInverse = gammaFactor > 0 ? 1.0 / gammaFactor : 1.0;
 			this.r = Math.pow(color.r, safeInverse);
 			this.g = Math.pow(color.g, safeInverse);
@@ -7301,7 +7310,10 @@
 			return this;
 		},
 		set: function set(value, offset) {
-			if (offset === undefined) offset = 0;
+			if (offset === void 0) {
+				offset = 0;
+			}
+
 			this.array.set(value, offset);
 			return this;
 		},
@@ -18557,7 +18569,10 @@
 		};
 
 		this.copyFramebufferToTexture = function (position, texture, level) {
-			if (level === undefined) level = 0;
+			if (level === void 0) {
+				level = 0;
+			}
+
 			var levelScale = Math.pow(2, -level);
 			var width = Math.floor(texture.image.width * levelScale);
 			var height = Math.floor(texture.image.height * levelScale);
@@ -18570,7 +18585,10 @@
 		};
 
 		this.copyTextureToTexture = function (position, srcTexture, dstTexture, level) {
-			if (level === undefined) level = 0;
+			if (level === void 0) {
+				level = 0;
+			}
+
 			var width = srcTexture.image.width;
 			var height = srcTexture.image.height;
 			var glFormat = utils.convert(dstTexture.format);
@@ -18777,7 +18795,10 @@
 			return this;
 		},
 		set: function set(value, offset) {
-			if (offset === undefined) offset = 0;
+			if (offset === void 0) {
+				offset = 0;
+			}
+
 			this.array.set(value, offset);
 			return this;
 		},
@@ -19193,7 +19214,10 @@
 			return this;
 		},
 		addLevel: function addLevel(object, distance) {
-			if (distance === undefined) distance = 0;
+			if (distance === void 0) {
+				distance = 0;
+			}
+
 			distance = Math.abs(distance);
 			var levels = this.levels;
 			var l;
@@ -20412,7 +20436,10 @@
 			}
 		},
 		computeVertexNormals: function computeVertexNormals(areaWeighted) {
-			if (areaWeighted === undefined) areaWeighted = true;
+			if (areaWeighted === void 0) {
+				areaWeighted = true;
+			}
+
 			var vertices = new Array(this.vertices.length);
 
 			for (var v = 0, vl = this.vertices.length; v < vl; v++) {
@@ -20589,6 +20616,10 @@
 			this.boundingSphere.setFromPoints(this.vertices);
 		},
 		merge: function merge(geometry, matrix, materialIndexOffset) {
+			if (materialIndexOffset === void 0) {
+				materialIndexOffset = 0;
+			}
+
 			if (!(geometry && geometry.isGeometry)) {
 				console.error('THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry);
 				return;
@@ -20602,7 +20633,6 @@
 					faces2 = geometry.faces,
 					colors1 = this.colors,
 					colors2 = geometry.colors;
-			if (materialIndexOffset === undefined) materialIndexOffset = 0;
 
 			if (matrix !== undefined) {
 				normalMatrix = new Matrix3().getNormalMatrix(matrix);
@@ -25462,9 +25492,19 @@
 			return clip;
 		},
 		makeClipAdditive: function makeClipAdditive(targetClip, referenceFrame, referenceClip, fps) {
-			if (referenceFrame === undefined) referenceFrame = 0;
-			if (referenceClip === undefined) referenceClip = targetClip;
-			if (fps === undefined || fps <= 0) fps = 30;
+			if (referenceFrame === void 0) {
+				referenceFrame = 0;
+			}
+
+			if (referenceClip === void 0) {
+				referenceClip = targetClip;
+			}
+
+			if (fps === void 0) {
+				fps = 30;
+			}
+
+			if (fps <= 0) fps = 30;
 			var numTracks = referenceClip.tracks.length;
 			var referenceTime = referenceFrame / fps; // Make each track's values relative to the values at the reference frame
 
@@ -27312,7 +27352,10 @@
 		},
 		// Get sequence of points using getPoint( t )
 		getPoints: function getPoints(divisions) {
-			if (divisions === undefined) divisions = 5;
+			if (divisions === void 0) {
+				divisions = 5;
+			}
+
 			var points = [];
 
 			for (var d = 0; d <= divisions; d++) {
@@ -27323,7 +27366,10 @@
 		},
 		// Get sequence of points using getPointAt( u )
 		getSpacedPoints: function getSpacedPoints(divisions) {
-			if (divisions === undefined) divisions = 5;
+			if (divisions === void 0) {
+				divisions = 5;
+			}
+
 			var points = [];
 
 			for (var d = 0; d <= divisions; d++) {
@@ -28348,7 +28394,10 @@
 			return lengths;
 		},
 		getSpacedPoints: function getSpacedPoints(divisions) {
-			if (divisions === undefined) divisions = 40;
+			if (divisions === void 0) {
+				divisions = 40;
+			}
+
 			var points = [];
 
 			for (var i = 0; i <= divisions; i++) {
@@ -28808,7 +28857,10 @@
 		constructor: PointLightShadow,
 		isPointLightShadow: true,
 		updateMatrices: function updateMatrices(light, viewportIndex) {
-			if (viewportIndex === undefined) viewportIndex = 0;
+			if (viewportIndex === void 0) {
+				viewportIndex = 0;
+			}
+
 			var camera = this.camera,
 					shadowMatrix = this.matrix,
 					lightPositionWorld = this._lightPositionWorld,
@@ -30618,7 +30670,10 @@
 	Object.assign(Font.prototype, {
 		isFont: true,
 		generateShapes: function generateShapes(text, size) {
-			if (size === undefined) size = 100;
+			if (size === void 0) {
+				size = 100;
+			}
+
 			var shapes = [];
 			var paths = createPaths(text, size, this.data);
 
@@ -31140,7 +31195,9 @@
 		};
 
 		_proto.play = function play(delay) {
-			if (delay === undefined) delay = 0;
+			if (delay === void 0) {
+				delay = 0;
+			}
 
 			if (this.isPlaying === true) {
 				console.warn('THREE.Audio: Audio is already playing.');
@@ -34786,7 +34843,15 @@
 		function PlaneHelper(plane, size, hex) {
 			var _this;
 
-			var color = hex !== undefined ? hex : 0xffff00;
+			if (size === void 0) {
+				size = 1;
+			}
+
+			if (hex === void 0) {
+				hex = 0xffff00;
+			}
+
+			var color = hex;
 			var positions = [1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0];
 			var geometry = new BufferGeometry();
 			geometry.setAttribute('position', new Float32BufferAttribute(positions, 3));
@@ -34797,7 +34862,7 @@
 			})) || this;
 			_this.type = 'PlaneHelper';
 			_this.plane = plane;
-			_this.size = size === undefined ? 1 : size;
+			_this.size = size;
 			var positions2 = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1];
 			var geometry2 = new BufferGeometry();
 			geometry2.setAttribute('position', new Float32BufferAttribute(positions2, 3));
@@ -35610,7 +35675,10 @@
 		return materials;
 	}
 	function MultiMaterial(materials) {
-		if (materials === undefined) materials = [];
+		if (materials === void 0) {
+			materials = [];
+		}
+
 		console.warn('THREE.MultiMaterial has been removed. Use an Array instead.');
 		materials.isMultiMaterial = true;
 		materials.materials = materials;

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
build/three.min.js


+ 22 - 58
build/three.module.js

@@ -7106,9 +7106,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 
 	},
 
-	copy: function ( source, recursive ) {
-
-		if ( recursive === undefined ) recursive = true;
+	copy: function ( source, recursive = true ) {
 
 		this.name = source.name;
 
@@ -7996,9 +7994,7 @@ class Color {
 
 	}
 
-	copyGammaToLinear( color, gammaFactor ) {
-
-		if ( gammaFactor === undefined ) gammaFactor = 2.0;
+	copyGammaToLinear( color, gammaFactor = 2.0 ) {
 
 		this.r = Math.pow( color.r, gammaFactor );
 		this.g = Math.pow( color.g, gammaFactor );
@@ -8008,9 +8004,7 @@ class Color {
 
 	}
 
-	copyLinearToGamma( color, gammaFactor ) {
-
-		if ( gammaFactor === undefined ) gammaFactor = 2.0;
+	copyLinearToGamma( color, gammaFactor = 2.0 ) {
 
 		const safeInverse = ( gammaFactor > 0 ) ? ( 1.0 / gammaFactor ) : 1.0;
 
@@ -9178,9 +9172,7 @@ Object.assign( BufferAttribute.prototype, {
 
 	},
 
-	set: function ( value, offset ) {
-
-		if ( offset === undefined ) offset = 0;
+	set: function ( value, offset = 0 ) {
 
 		this.array.set( value, offset );
 
@@ -25020,9 +25012,7 @@ function WebGLRenderer( parameters ) {
 
 	};
 
-	this.copyFramebufferToTexture = function ( position, texture, level ) {
-
-		if ( level === undefined ) level = 0;
+	this.copyFramebufferToTexture = function ( position, texture, level = 0 ) {
 
 		const levelScale = Math.pow( 2, - level );
 		const width = Math.floor( texture.image.width * levelScale );
@@ -25037,9 +25027,7 @@ function WebGLRenderer( parameters ) {
 
 	};
 
-	this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level ) {
-
-		if ( level === undefined ) level = 0;
+	this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level = 0 ) {
 
 		const width = srcTexture.image.width;
 		const height = srcTexture.image.height;
@@ -25296,9 +25284,7 @@ Object.assign( InterleavedBuffer.prototype, {
 
 	},
 
-	set: function ( value, offset ) {
-
-		if ( offset === undefined ) offset = 0;
+	set: function ( value, offset = 0 ) {
 
 		this.array.set( value, offset );
 
@@ -25915,9 +25901,7 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 	},
 
-	addLevel: function ( object, distance ) {
-
-		if ( distance === undefined ) distance = 0;
+	addLevel: function ( object, distance = 0 ) {
 
 		distance = Math.abs( distance );
 
@@ -27728,9 +27712,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 
 	},
 
-	computeVertexNormals: function ( areaWeighted ) {
-
-		if ( areaWeighted === undefined ) areaWeighted = true;
+	computeVertexNormals: function ( areaWeighted = true ) {
 
 		const vertices = new Array( this.vertices.length );
 
@@ -27986,7 +27968,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 
 	},
 
-	merge: function ( geometry, matrix, materialIndexOffset ) {
+	merge: function ( geometry, matrix, materialIndexOffset = 0 ) {
 
 		if ( ! ( geometry && geometry.isGeometry ) ) {
 
@@ -28004,8 +27986,6 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 			colors1 = this.colors,
 			colors2 = geometry.colors;
 
-		if ( materialIndexOffset === undefined ) materialIndexOffset = 0;
-
 		if ( matrix !== undefined ) {
 
 			normalMatrix = new Matrix3().getNormalMatrix( matrix );
@@ -34488,11 +34468,9 @@ const AnimationUtils = {
 
 	},
 
-	makeClipAdditive: function ( targetClip, referenceFrame, referenceClip, fps ) {
+	makeClipAdditive: function ( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) {
 
-		if ( referenceFrame === undefined ) referenceFrame = 0;
-		if ( referenceClip === undefined ) referenceClip = targetClip;
-		if ( fps === undefined || fps <= 0 ) fps = 30;
+		if ( fps <= 0 ) fps = 30;
 
 		const numTracks = referenceClip.tracks.length;
 		const referenceTime = referenceFrame / fps;
@@ -37239,9 +37217,7 @@ Object.assign( Curve.prototype, {
 
 	// Get sequence of points using getPoint( t )
 
-	getPoints: function ( divisions ) {
-
-		if ( divisions === undefined ) divisions = 5;
+	getPoints: function ( divisions = 5 ) {
 
 		const points = [];
 
@@ -37257,9 +37233,7 @@ Object.assign( Curve.prototype, {
 
 	// Get sequence of points using getPointAt( u )
 
-	getSpacedPoints: function ( divisions ) {
-
-		if ( divisions === undefined ) divisions = 5;
+	getSpacedPoints: function ( divisions = 5 ) {
 
 		const points = [];
 
@@ -38766,9 +38740,7 @@ CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), {
 
 	},
 
-	getSpacedPoints: function ( divisions ) {
-
-		if ( divisions === undefined ) divisions = 40;
+	getSpacedPoints: function ( divisions = 40 ) {
 
 		const points = [];
 
@@ -39536,9 +39508,7 @@ PointLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype
 
 	isPointLightShadow: true,
 
-	updateMatrices: function ( light, viewportIndex ) {
-
-		if ( viewportIndex === undefined ) viewportIndex = 0;
+	updateMatrices: function ( light, viewportIndex = 0 ) {
 
 		const camera = this.camera,
 			shadowMatrix = this.matrix,
@@ -42218,9 +42188,7 @@ Object.assign( Font.prototype, {
 
 	isFont: true,
 
-	generateShapes: function ( text, size ) {
-
-		if ( size === undefined ) size = 100;
+	generateShapes: function ( text, size = 100 ) {
 
 		const shapes = [];
 		const paths = createPaths( text, size, this.data );
@@ -42937,9 +42905,7 @@ class Audio extends Object3D {
 
 	}
 
-	play( delay ) {
-
-		if ( delay === undefined ) delay = 0;
+	play( delay = 0 ) {
 
 		if ( this.isPlaying === true ) {
 
@@ -47924,9 +47890,9 @@ class Box3Helper extends LineSegments {
 
 class PlaneHelper extends Line {
 
-	constructor( plane, size, hex ) {
+	constructor( plane, size = 1, hex = 0xffff00 ) {
 
-		const color = ( hex !== undefined ) ? hex : 0xffff00;
+		const color = hex;
 
 		const positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ];
 
@@ -47940,7 +47906,7 @@ class PlaneHelper extends Line {
 
 		this.plane = plane;
 
-		this.size = ( size === undefined ) ? 1 : size;
+		this.size = size;
 
 		const positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ];
 
@@ -49110,9 +49076,7 @@ function MeshFaceMaterial( materials ) {
 
 }
 
-function MultiMaterial( materials ) {
-
-	if ( materials === undefined ) materials = [];
+function MultiMaterial( materials = [] ) {
 
 	console.warn( 'THREE.MultiMaterial has been removed. Use an Array instead.' );
 	materials.isMultiMaterial = true;

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff