Mr.doob 4 роки тому
батько
коміт
9ee6ec8fcf
3 змінених файлів з 514 додано та 433 видалено
  1. 333 253
      build/three.js
  2. 0 0
      build/three.min.js
  3. 181 180
      build/three.module.js

+ 333 - 253
build/three.js

@@ -1997,95 +1997,101 @@
 
 	var textureId = 0;
 
-	function Texture(image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding) {
-		if (image === void 0) {
-			image = Texture.DEFAULT_IMAGE;
-		}
+	var Texture = /*#__PURE__*/function (_EventDispatcher) {
+		_inheritsLoose(Texture, _EventDispatcher);
 
-		if (mapping === void 0) {
-			mapping = Texture.DEFAULT_MAPPING;
-		}
+		function Texture(image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding) {
+			var _this;
 
-		if (wrapS === void 0) {
-			wrapS = ClampToEdgeWrapping;
-		}
+			if (image === void 0) {
+				image = Texture.DEFAULT_IMAGE;
+			}
 
-		if (wrapT === void 0) {
-			wrapT = ClampToEdgeWrapping;
-		}
+			if (mapping === void 0) {
+				mapping = Texture.DEFAULT_MAPPING;
+			}
 
-		if (magFilter === void 0) {
-			magFilter = LinearFilter;
-		}
+			if (wrapS === void 0) {
+				wrapS = ClampToEdgeWrapping;
+			}
 
-		if (minFilter === void 0) {
-			minFilter = LinearMipmapLinearFilter;
-		}
+			if (wrapT === void 0) {
+				wrapT = ClampToEdgeWrapping;
+			}
 
-		if (format === void 0) {
-			format = RGBAFormat;
-		}
+			if (magFilter === void 0) {
+				magFilter = LinearFilter;
+			}
 
-		if (type === void 0) {
-			type = UnsignedByteType;
-		}
+			if (minFilter === void 0) {
+				minFilter = LinearMipmapLinearFilter;
+			}
 
-		if (anisotropy === void 0) {
-			anisotropy = 1;
-		}
+			if (format === void 0) {
+				format = RGBAFormat;
+			}
+
+			if (type === void 0) {
+				type = UnsignedByteType;
+			}
+
+			if (anisotropy === void 0) {
+				anisotropy = 1;
+			}
+
+			if (encoding === void 0) {
+				encoding = LinearEncoding;
+			}
+
+			_this = _EventDispatcher.call(this) || this;
+			Object.defineProperty(_assertThisInitialized(_this), 'id', {
+				value: textureId++
+			});
+			_this.uuid = MathUtils.generateUUID();
+			_this.name = '';
+			_this.image = image;
+			_this.mipmaps = [];
+			_this.mapping = mapping;
+			_this.wrapS = wrapS;
+			_this.wrapT = wrapT;
+			_this.magFilter = magFilter;
+			_this.minFilter = minFilter;
+			_this.anisotropy = anisotropy;
+			_this.format = format;
+			_this.internalFormat = null;
+			_this.type = type;
+			_this.offset = new Vector2(0, 0);
+			_this.repeat = new Vector2(1, 1);
+			_this.center = new Vector2(0, 0);
+			_this.rotation = 0;
+			_this.matrixAutoUpdate = true;
+			_this.matrix = new Matrix3();
+			_this.generateMipmaps = true;
+			_this.premultiplyAlpha = false;
+			_this.flipY = true;
+			_this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
+			// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
+			//
+			// Also changing the encoding after already used by a Material will not automatically make the Material
+			// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
 
-		if (encoding === void 0) {
-			encoding = LinearEncoding;
+			_this.encoding = encoding;
+			_this.version = 0;
+			_this.onUpdate = null;
+			return _this;
 		}
 
-		Object.defineProperty(this, 'id', {
-			value: textureId++
-		});
-		this.uuid = MathUtils.generateUUID();
-		this.name = '';
-		this.image = image;
-		this.mipmaps = [];
-		this.mapping = mapping;
-		this.wrapS = wrapS;
-		this.wrapT = wrapT;
-		this.magFilter = magFilter;
-		this.minFilter = minFilter;
-		this.anisotropy = anisotropy;
-		this.format = format;
-		this.internalFormat = null;
-		this.type = type;
-		this.offset = new Vector2(0, 0);
-		this.repeat = new Vector2(1, 1);
-		this.center = new Vector2(0, 0);
-		this.rotation = 0;
-		this.matrixAutoUpdate = true;
-		this.matrix = new Matrix3();
-		this.generateMipmaps = true;
-		this.premultiplyAlpha = false;
-		this.flipY = true;
-		this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
-		// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
-		//
-		// Also changing the encoding after already used by a Material will not automatically make the Material
-		// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
-
-		this.encoding = encoding;
-		this.version = 0;
-		this.onUpdate = null;
-	}
+		var _proto = Texture.prototype;
 
-	Texture.DEFAULT_IMAGE = undefined;
-	Texture.DEFAULT_MAPPING = UVMapping;
-	Texture.prototype = Object.assign(Object.create(EventDispatcher.prototype), {
-		constructor: Texture,
-		isTexture: true,
-		updateMatrix: function updateMatrix() {
+		_proto.updateMatrix = function updateMatrix() {
 			this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y);
-		},
-		clone: function clone() {
+		};
+
+		_proto.clone = function clone() {
 			return new this.constructor().copy(this);
-		},
-		copy: function copy(source) {
+		};
+
+		_proto.copy = function copy(source) {
 			this.name = source.name;
 			this.image = source.image;
 			this.mipmaps = source.mipmaps.slice(0);
@@ -2110,8 +2116,9 @@
 			this.unpackAlignment = source.unpackAlignment;
 			this.encoding = source.encoding;
 			return this;
-		},
-		toJSON: function toJSON(meta) {
+		};
+
+		_proto.toJSON = function toJSON(meta) {
 			var isRootObject = meta === undefined || typeof meta === 'string';
 
 			if (!isRootObject && meta.textures[this.uuid] !== undefined) {
@@ -2185,13 +2192,15 @@
 			}
 
 			return output;
-		},
-		dispose: function dispose() {
+		};
+
+		_proto.dispose = function dispose() {
 			this.dispatchEvent({
 				type: 'dispose'
 			});
-		},
-		transformUv: function transformUv(uv) {
+		};
+
+		_proto.transformUv = function transformUv(uv) {
 			if (this.mapping !== UVMapping) return uv;
 			uv.applyMatrix3(this.matrix);
 
@@ -2242,13 +2251,21 @@
 			}
 
 			return uv;
-		}
-	});
-	Object.defineProperty(Texture.prototype, 'needsUpdate', {
-		set: function set(value) {
-			if (value === true) this.version++;
-		}
-	});
+		};
+
+		_createClass(Texture, [{
+			key: "needsUpdate",
+			set: function set(value) {
+				if (value === true) this.version++;
+			}
+		}]);
+
+		return Texture;
+	}(EventDispatcher);
+
+	Texture.DEFAULT_IMAGE = undefined;
+	Texture.DEFAULT_MAPPING = UVMapping;
+	Texture.prototype.isTexture = true;
 
 	function serializeImage(image) {
 		if (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement || typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap) {
@@ -10265,34 +10282,43 @@
 		return CubeCamera;
 	}(Object3D);
 
-	function CubeTexture(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding) {
-		images = images !== undefined ? images : [];
-		mapping = mapping !== undefined ? mapping : CubeReflectionMapping;
-		format = format !== undefined ? format : RGBFormat;
-		Texture.call(this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);
-		this.flipY = false; // Why CubeTexture._needsFlipEnvMap is necessary:
-		//
-		// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
-		// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,
-		// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.
-		// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped
-		// and the flag _needsFlipEnvMap controls this conversion. The flip is not required (and thus _needsFlipEnvMap is set to false)
-		// when using WebGLCubeRenderTarget.texture as a cube texture.
-
-		this._needsFlipEnvMap = true;
-	}
+	var CubeTexture = /*#__PURE__*/function (_Texture) {
+		_inheritsLoose(CubeTexture, _Texture);
 
-	CubeTexture.prototype = Object.create(Texture.prototype);
-	CubeTexture.prototype.constructor = CubeTexture;
-	CubeTexture.prototype.isCubeTexture = true;
-	Object.defineProperty(CubeTexture.prototype, 'images', {
-		get: function get() {
-			return this.image;
-		},
-		set: function set(value) {
-			this.image = value;
+		function CubeTexture(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding) {
+			var _this;
+
+			images = images !== undefined ? images : [];
+			mapping = mapping !== undefined ? mapping : CubeReflectionMapping;
+			format = format !== undefined ? format : RGBFormat;
+			_this = _Texture.call(this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding) || this; // Why CubeTexture._needsFlipEnvMap is necessary:
+			//
+			// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
+			// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,
+			// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.
+			// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped
+			// and the flag _needsFlipEnvMap controls this conversion. The flip is not required (and thus _needsFlipEnvMap is set to false)
+			// when using WebGLCubeRenderTarget.texture as a cube texture.
+
+			_this._needsFlipEnvMap = true;
+			_this.flipY = false;
+			return _this;
 		}
-	});
+
+		_createClass(CubeTexture, [{
+			key: "images",
+			get: function get() {
+				return this.image;
+			},
+			set: function set(value) {
+				this.image = value;
+			}
+		}]);
+
+		return CubeTexture;
+	}(Texture);
+
+	CubeTexture.prototype.isCubeTexture = true;
 
 	var WebGLCubeRenderTarget = /*#__PURE__*/function (_WebGLRenderTarget) {
 		_inheritsLoose(WebGLCubeRenderTarget, _WebGLRenderTarget);
@@ -10375,23 +10401,30 @@
 
 	WebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true;
 
-	function DataTexture(data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {
-		Texture.call(this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);
-		this.image = {
-			data: data || null,
-			width: width || 1,
-			height: height || 1
-		};
-		this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
-		this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
-		this.generateMipmaps = false;
-		this.flipY = false;
-		this.unpackAlignment = 1;
-		this.needsUpdate = true;
-	}
+	var DataTexture = /*#__PURE__*/function (_Texture) {
+		_inheritsLoose(DataTexture, _Texture);
+
+		function DataTexture(data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {
+			var _this;
+
+			_this = _Texture.call(this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding) || this;
+			_this.image = {
+				data: data || null,
+				width: width || 1,
+				height: height || 1
+			};
+			_this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
+			_this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
+			_this.generateMipmaps = false;
+			_this.flipY = false;
+			_this.unpackAlignment = 1;
+			_this.needsUpdate = true;
+			return _this;
+		}
+
+		return DataTexture;
+	}(Texture);
 
-	DataTexture.prototype = Object.create(Texture.prototype);
-	DataTexture.prototype.constructor = DataTexture;
 	DataTexture.prototype.isDataTexture = true;
 
 	var _sphere$1 = /*@__PURE__*/new Sphere();
@@ -12948,83 +12981,97 @@
 		};
 	}
 
-	function DataTexture2DArray(data, width, height, depth) {
-		if (data === void 0) {
-			data = null;
-		}
+	var DataTexture2DArray = /*#__PURE__*/function (_Texture) {
+		_inheritsLoose(DataTexture2DArray, _Texture);
 
-		if (width === void 0) {
-			width = 1;
-		}
+		function DataTexture2DArray(data, width, height, depth) {
+			var _this;
 
-		if (height === void 0) {
-			height = 1;
-		}
+			if (data === void 0) {
+				data = null;
+			}
+
+			if (width === void 0) {
+				width = 1;
+			}
 
-		if (depth === void 0) {
-			depth = 1;
+			if (height === void 0) {
+				height = 1;
+			}
+
+			if (depth === void 0) {
+				depth = 1;
+			}
+
+			_this = _Texture.call(this, null) || this;
+			_this.image = {
+				data: data,
+				width: width,
+				height: height,
+				depth: depth
+			};
+			_this.magFilter = NearestFilter;
+			_this.minFilter = NearestFilter;
+			_this.wrapR = ClampToEdgeWrapping;
+			_this.generateMipmaps = false;
+			_this.flipY = false;
+			_this.needsUpdate = true;
+			return _this;
 		}
 
-		Texture.call(this, null);
-		this.image = {
-			data: data,
-			width: width,
-			height: height,
-			depth: depth
-		};
-		this.magFilter = NearestFilter;
-		this.minFilter = NearestFilter;
-		this.wrapR = ClampToEdgeWrapping;
-		this.generateMipmaps = false;
-		this.flipY = false;
-		this.needsUpdate = true;
-	}
+		return DataTexture2DArray;
+	}(Texture);
 
-	DataTexture2DArray.prototype = Object.create(Texture.prototype);
-	DataTexture2DArray.prototype.constructor = DataTexture2DArray;
 	DataTexture2DArray.prototype.isDataTexture2DArray = true;
 
-	function DataTexture3D(data, width, height, depth) {
-		if (data === void 0) {
-			data = null;
-		}
+	var DataTexture3D = /*#__PURE__*/function (_Texture) {
+		_inheritsLoose(DataTexture3D, _Texture);
 
-		if (width === void 0) {
-			width = 1;
-		}
+		function DataTexture3D(data, width, height, depth) {
+			var _this;
 
-		if (height === void 0) {
-			height = 1;
-		}
+			if (data === void 0) {
+				data = null;
+			}
+
+			if (width === void 0) {
+				width = 1;
+			}
+
+			if (height === void 0) {
+				height = 1;
+			}
 
-		if (depth === void 0) {
-			depth = 1;
+			if (depth === void 0) {
+				depth = 1;
+			}
+
+			// We're going to add .setXXX() methods for setting properties later.
+			// Users can still set in DataTexture3D directly.
+			//
+			//	const texture = new THREE.DataTexture3D( data, width, height, depth );
+			// 	texture.anisotropy = 16;
+			//
+			// See #14839
+			_this = _Texture.call(this, null) || this;
+			_this.image = {
+				data: data,
+				width: width,
+				height: height,
+				depth: depth
+			};
+			_this.magFilter = NearestFilter;
+			_this.minFilter = NearestFilter;
+			_this.wrapR = ClampToEdgeWrapping;
+			_this.generateMipmaps = false;
+			_this.flipY = false;
+			_this.needsUpdate = true;
+			return _this;
 		}
 
-		// We're going to add .setXXX() methods for setting properties later.
-		// Users can still set in DataTexture3D directly.
-		//
-		//	const texture = new THREE.DataTexture3D( data, width, height, depth );
-		// 	texture.anisotropy = 16;
-		//
-		// See #14839
-		Texture.call(this, null);
-		this.image = {
-			data: data,
-			width: width,
-			height: height,
-			depth: depth
-		};
-		this.magFilter = NearestFilter;
-		this.minFilter = NearestFilter;
-		this.wrapR = ClampToEdgeWrapping;
-		this.generateMipmaps = false;
-		this.flipY = false;
-		this.needsUpdate = true;
-	}
+		return DataTexture3D;
+	}(Texture);
 
-	DataTexture3D.prototype = Object.create(Texture.prototype);
-	DataTexture3D.prototype.constructor = DataTexture3D;
 	DataTexture3D.prototype.isDataTexture3D = true;
 
 	/**
@@ -21310,90 +21357,123 @@
 		}
 	}
 
-	function VideoTexture(video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {
-		Texture.call(this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);
-		this.format = format !== undefined ? format : RGBFormat;
-		this.minFilter = minFilter !== undefined ? minFilter : LinearFilter;
-		this.magFilter = magFilter !== undefined ? magFilter : LinearFilter;
-		this.generateMipmaps = false;
-		var scope = this;
+	var VideoTexture = /*#__PURE__*/function (_Texture) {
+		_inheritsLoose(VideoTexture, _Texture);
 
-		function updateVideo() {
-			scope.needsUpdate = true;
-			video.requestVideoFrameCallback(updateVideo);
-		}
+		function VideoTexture(video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {
+			var _this;
+
+			_this = _Texture.call(this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) || this;
+			_this.format = format !== undefined ? format : RGBFormat;
+			_this.minFilter = minFilter !== undefined ? minFilter : LinearFilter;
+			_this.magFilter = magFilter !== undefined ? magFilter : LinearFilter;
+			_this.generateMipmaps = false;
 
-		if ('requestVideoFrameCallback' in video) {
-			video.requestVideoFrameCallback(updateVideo);
+			var scope = _assertThisInitialized(_this);
+
+			function updateVideo() {
+				scope.needsUpdate = true;
+				video.requestVideoFrameCallback(updateVideo);
+			}
+
+			if ('requestVideoFrameCallback' in video) {
+				video.requestVideoFrameCallback(updateVideo);
+			}
+
+			return _this;
 		}
-	}
 
-	VideoTexture.prototype = Object.assign(Object.create(Texture.prototype), {
-		constructor: VideoTexture,
-		clone: function clone() {
+		var _proto = VideoTexture.prototype;
+
+		_proto.clone = function clone() {
 			return new this.constructor(this.image).copy(this);
-		},
-		isVideoTexture: true,
-		update: function update() {
+		};
+
+		_proto.update = function update() {
 			var video = this.image;
 			var hasVideoFrameCallback = ('requestVideoFrameCallback' in video);
 
 			if (hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA) {
 				this.needsUpdate = true;
 			}
-		}
-	});
-
-	function CompressedTexture(mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {
-		Texture.call(this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);
-		this.image = {
-			width: width,
-			height: height
 		};
-		this.mipmaps = mipmaps; // no flipping for cube textures
-		// (also flipping doesn't work for compressed textures )
 
-		this.flipY = false; // can't generate mipmaps for compressed textures
-		// mips must be embedded in DDS files
+		return VideoTexture;
+	}(Texture);
 
-		this.generateMipmaps = false;
-	}
+	VideoTexture.prototype.isVideoTexture = true;
+
+	var CompressedTexture = /*#__PURE__*/function (_Texture) {
+		_inheritsLoose(CompressedTexture, _Texture);
+
+		function CompressedTexture(mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {
+			var _this;
+
+			_this = _Texture.call(this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding) || this;
+			_this.image = {
+				width: width,
+				height: height
+			};
+			_this.mipmaps = mipmaps; // no flipping for cube textures
+			// (also flipping doesn't work for compressed textures )
+
+			_this.flipY = false; // can't generate mipmaps for compressed textures
+			// mips must be embedded in DDS files
+
+			_this.generateMipmaps = false;
+			return _this;
+		}
+
+		return CompressedTexture;
+	}(Texture);
 
-	CompressedTexture.prototype = Object.create(Texture.prototype);
-	CompressedTexture.prototype.constructor = CompressedTexture;
 	CompressedTexture.prototype.isCompressedTexture = true;
 
-	function CanvasTexture(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {
-		Texture.call(this, canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);
-		this.needsUpdate = true;
-	}
+	var CanvasTexture = /*#__PURE__*/function (_Texture) {
+		_inheritsLoose(CanvasTexture, _Texture);
+
+		function CanvasTexture(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {
+			var _this;
+
+			_this = _Texture.call(this, canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) || this;
+			_this.needsUpdate = true;
+			return _this;
+		}
+
+		return CanvasTexture;
+	}(Texture);
 
-	CanvasTexture.prototype = Object.create(Texture.prototype);
-	CanvasTexture.prototype.constructor = CanvasTexture;
 	CanvasTexture.prototype.isCanvasTexture = true;
 
-	function DepthTexture(width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format) {
-		format = format !== undefined ? format : DepthFormat;
+	var DepthTexture = /*#__PURE__*/function (_Texture) {
+		_inheritsLoose(DepthTexture, _Texture);
+
+		function DepthTexture(width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format) {
+			var _this;
+
+			format = format !== undefined ? format : DepthFormat;
+
+			if (format !== DepthFormat && format !== DepthStencilFormat) {
+				throw new Error('DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat');
+			}
 
-		if (format !== DepthFormat && format !== DepthStencilFormat) {
-			throw new Error('DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat');
+			if (type === undefined && format === DepthFormat) type = UnsignedShortType;
+			if (type === undefined && format === DepthStencilFormat) type = UnsignedInt248Type;
+			_this = _Texture.call(this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) || this;
+			_this.image = {
+				width: width,
+				height: height
+			};
+			_this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
+			_this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
+			_this.flipY = false;
+			_this.generateMipmaps = false;
+			return _this;
 		}
 
-		if (type === undefined && format === DepthFormat) type = UnsignedShortType;
-		if (type === undefined && format === DepthStencilFormat) type = UnsignedInt248Type;
-		Texture.call(this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);
-		this.image = {
-			width: width,
-			height: height
-		};
-		this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
-		this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
-		this.flipY = false;
-		this.generateMipmaps = false;
-	}
+		return DepthTexture;
+	}(Texture);
 
-	DepthTexture.prototype = Object.create(Texture.prototype);
-	DepthTexture.prototype.constructor = DepthTexture;
 	DepthTexture.prototype.isDepthTexture = true;
 
 	var CircleGeometry = /*#__PURE__*/function (_BufferGeometry) {

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
build/three.min.js


+ 181 - 180
build/three.module.js

@@ -1392,77 +1392,75 @@ const ImageUtils = {
 
 let textureId = 0;
 
-function Texture( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {
+class Texture extends EventDispatcher {
 
-	Object.defineProperty( this, 'id', { value: textureId ++ } );
+	static DEFAULT_IMAGE = undefined;
+	static DEFAULT_MAPPING = UVMapping;
 
-	this.uuid = MathUtils.generateUUID();
-
-	this.name = '';
+	constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {
 
-	this.image = image;
-	this.mipmaps = [];
+		super();
 
-	this.mapping = mapping;
+		Object.defineProperty( this, 'id', { value: textureId ++ } );
 
-	this.wrapS = wrapS;
-	this.wrapT = wrapT;
+		this.uuid = MathUtils.generateUUID();
 
-	this.magFilter = magFilter;
-	this.minFilter = minFilter;
+		this.name = '';
 
-	this.anisotropy = anisotropy;
+		this.image = image;
+		this.mipmaps = [];
 
-	this.format = format;
-	this.internalFormat = null;
-	this.type = type;
+		this.mapping = mapping;
 
-	this.offset = new Vector2( 0, 0 );
-	this.repeat = new Vector2( 1, 1 );
-	this.center = new Vector2( 0, 0 );
-	this.rotation = 0;
+		this.wrapS = wrapS;
+		this.wrapT = wrapT;
 
-	this.matrixAutoUpdate = true;
-	this.matrix = new Matrix3();
+		this.magFilter = magFilter;
+		this.minFilter = minFilter;
 
-	this.generateMipmaps = true;
-	this.premultiplyAlpha = false;
-	this.flipY = true;
-	this.unpackAlignment = 4;	// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
+		this.anisotropy = anisotropy;
 
-	// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
-	//
-	// Also changing the encoding after already used by a Material will not automatically make the Material
-	// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
-	this.encoding = encoding;
+		this.format = format;
+		this.internalFormat = null;
+		this.type = type;
 
-	this.version = 0;
-	this.onUpdate = null;
+		this.offset = new Vector2( 0, 0 );
+		this.repeat = new Vector2( 1, 1 );
+		this.center = new Vector2( 0, 0 );
+		this.rotation = 0;
 
-}
+		this.matrixAutoUpdate = true;
+		this.matrix = new Matrix3();
 
-Texture.DEFAULT_IMAGE = undefined;
-Texture.DEFAULT_MAPPING = UVMapping;
+		this.generateMipmaps = true;
+		this.premultiplyAlpha = false;
+		this.flipY = true;
+		this.unpackAlignment = 4;	// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
 
-Texture.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
+		// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
+		//
+		// Also changing the encoding after already used by a Material will not automatically make the Material
+		// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
+		this.encoding = encoding;
 
-	constructor: Texture,
+		this.version = 0;
+		this.onUpdate = null;
 
-	isTexture: true,
+	}
 
-	updateMatrix: function () {
+	updateMatrix() {
 
 		this.matrix.setUvTransform( this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y );
 
-	},
+	}
 
-	clone: function () {
+	clone() {
 
 		return new this.constructor().copy( this );
 
-	},
+	}
 
-	copy: function ( source ) {
+	copy( source ) {
 
 		this.name = source.name;
 
@@ -1499,9 +1497,9 @@ Texture.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
 
 		return this;
 
-	},
+	}
 
-	toJSON: function ( meta ) {
+	toJSON( meta ) {
 
 		const isRootObject = ( meta === undefined || typeof meta === 'string' );
 
@@ -1611,15 +1609,15 @@ Texture.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
 
 		return output;
 
-	},
+	}
 
-	dispose: function () {
+	dispose() {
 
 		this.dispatchEvent( { type: 'dispose' } );
 
-	},
+	}
 
-	transformUv: function ( uv ) {
+	transformUv( uv ) {
 
 		if ( this.mapping !== UVMapping ) return uv;
 
@@ -1699,17 +1697,15 @@ Texture.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
 
 	}
 
-} );
-
-Object.defineProperty( Texture.prototype, 'needsUpdate', {
-
-	set: function ( value ) {
+	set needsUpdate( value ) {
 
 		if ( value === true ) this.version ++;
 
 	}
 
-} );
+}
+
+Texture.prototype.isTexture = true;
 
 function serializeImage( image ) {
 
@@ -11927,50 +11923,47 @@ class CubeCamera extends Object3D {
 
 }
 
-function CubeTexture( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {
-
-	images = images !== undefined ? images : [];
-	mapping = mapping !== undefined ? mapping : CubeReflectionMapping;
-	format = format !== undefined ? format : RGBFormat;
+class CubeTexture extends Texture {
 
-	Texture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+	constructor( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {
 
-	this.flipY = false;
-
-	// Why CubeTexture._needsFlipEnvMap is necessary:
-	//
-	// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
-	// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,
-	// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.
+		images = images !== undefined ? images : [];
+		mapping = mapping !== undefined ? mapping : CubeReflectionMapping;
+		format = format !== undefined ? format : RGBFormat;
 
-	// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped
-	// and the flag _needsFlipEnvMap controls this conversion. The flip is not required (and thus _needsFlipEnvMap is set to false)
-	// when using WebGLCubeRenderTarget.texture as a cube texture.
+		super( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 
-	this._needsFlipEnvMap = true;
+		// Why CubeTexture._needsFlipEnvMap is necessary:
+		//
+		// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
+		// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,
+		// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.
 
-}
+		// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped
+		// and the flag _needsFlipEnvMap controls this conversion. The flip is not required (and thus _needsFlipEnvMap is set to false)
+		// when using WebGLCubeRenderTarget.texture as a cube texture.
 
-CubeTexture.prototype = Object.create( Texture.prototype );
-CubeTexture.prototype.constructor = CubeTexture;
+		this._needsFlipEnvMap = true;
 
-CubeTexture.prototype.isCubeTexture = true;
+		this.flipY = false;
 
-Object.defineProperty( CubeTexture.prototype, 'images', {
+	}
 
-	get: function () {
+	get images() {
 
 		return this.image;
 
-	},
+	}
 
-	set: function ( value ) {
+	set images( value ) {
 
 		this.image = value;
 
 	}
 
-} );
+}
+
+CubeTexture.prototype.isCubeTexture = true;
 
 class WebGLCubeRenderTarget extends WebGLRenderTarget {
 
@@ -12108,25 +12101,26 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
 
 WebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true;
 
-function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
+class DataTexture extends Texture {
 
-	Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+	constructor( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
 
-	this.image = { data: data || null, width: width || 1, height: height || 1 };
+		super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 
-	this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
-	this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
+		this.image = { data: data || null, width: width || 1, height: height || 1 };
 
-	this.generateMipmaps = false;
-	this.flipY = false;
-	this.unpackAlignment = 1;
+		this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
+		this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
 
-	this.needsUpdate = true;
+		this.generateMipmaps = false;
+		this.flipY = false;
+		this.unpackAlignment = 1;
 
-}
+		this.needsUpdate = true;
 
-DataTexture.prototype = Object.create( Texture.prototype );
-DataTexture.prototype.constructor = DataTexture;
+	}
+
+}
 
 DataTexture.prototype.isDataTexture = true;
 
@@ -15388,57 +15382,60 @@ function WebGLObjects( gl, geometries, attributes, info ) {
 
 }
 
-function DataTexture2DArray( data = null, width = 1, height = 1, depth = 1 ) {
+class DataTexture2DArray extends Texture {
+
+	constructor( data = null, width = 1, height = 1, depth = 1 ) {
+
+		super( null );
 
-	Texture.call( this, null );
+		this.image = { data, width, height, depth };
 
-	this.image = { data, width, height, depth };
+		this.magFilter = NearestFilter;
+		this.minFilter = NearestFilter;
 
-	this.magFilter = NearestFilter;
-	this.minFilter = NearestFilter;
+		this.wrapR = ClampToEdgeWrapping;
 
-	this.wrapR = ClampToEdgeWrapping;
+		this.generateMipmaps = false;
+		this.flipY = false;
 
-	this.generateMipmaps = false;
-	this.flipY = false;
+		this.needsUpdate = true;
 
-	this.needsUpdate = true;
+	}
 
 }
 
-DataTexture2DArray.prototype = Object.create( Texture.prototype );
-DataTexture2DArray.prototype.constructor = DataTexture2DArray;
 DataTexture2DArray.prototype.isDataTexture2DArray = true;
 
-function DataTexture3D( data = null, width = 1, height = 1, depth = 1 ) {
+class DataTexture3D extends Texture {
 
-	// We're going to add .setXXX() methods for setting properties later.
-	// Users can still set in DataTexture3D directly.
-	//
-	//	const texture = new THREE.DataTexture3D( data, width, height, depth );
-	// 	texture.anisotropy = 16;
-	//
-	// See #14839
+	constructor( data = null, width = 1, height = 1, depth = 1 ) {
 
-	Texture.call( this, null );
+		// We're going to add .setXXX() methods for setting properties later.
+		// Users can still set in DataTexture3D directly.
+		//
+		//	const texture = new THREE.DataTexture3D( data, width, height, depth );
+		// 	texture.anisotropy = 16;
+		//
+		// See #14839
 
-	this.image = { data, width, height, depth };
+		super( null );
 
-	this.magFilter = NearestFilter;
-	this.minFilter = NearestFilter;
+		this.image = { data, width, height, depth };
 
-	this.wrapR = ClampToEdgeWrapping;
+		this.magFilter = NearestFilter;
+		this.minFilter = NearestFilter;
 
-	this.generateMipmaps = false;
-	this.flipY = false;
+		this.wrapR = ClampToEdgeWrapping;
 
-	this.needsUpdate = true;
+		this.generateMipmaps = false;
+		this.flipY = false;
 
+		this.needsUpdate = true;
+
+	}
 
 }
 
-DataTexture3D.prototype = Object.create( Texture.prototype );
-DataTexture3D.prototype.constructor = DataTexture3D;
 DataTexture3D.prototype.isDataTexture3D = true;
 
 /**
@@ -27137,47 +27134,43 @@ function testPoint( point, index, localThresholdSq, matrixWorld, raycaster, inte
 
 }
 
-function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
+class VideoTexture extends Texture {
 
-	Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
+	constructor( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
 
-	this.format = format !== undefined ? format : RGBFormat;
+		super( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 
-	this.minFilter = minFilter !== undefined ? minFilter : LinearFilter;
-	this.magFilter = magFilter !== undefined ? magFilter : LinearFilter;
+		this.format = format !== undefined ? format : RGBFormat;
 
-	this.generateMipmaps = false;
+		this.minFilter = minFilter !== undefined ? minFilter : LinearFilter;
+		this.magFilter = magFilter !== undefined ? magFilter : LinearFilter;
 
-	const scope = this;
+		this.generateMipmaps = false;
 
-	function updateVideo() {
-
-		scope.needsUpdate = true;
-		video.requestVideoFrameCallback( updateVideo );
+		const scope = this;
 
-	}
+		function updateVideo() {
 
-	if ( 'requestVideoFrameCallback' in video ) {
+			scope.needsUpdate = true;
+			video.requestVideoFrameCallback( updateVideo );
 
-		video.requestVideoFrameCallback( updateVideo );
+		}
 
-	}
+		if ( 'requestVideoFrameCallback' in video ) {
 
-}
+			video.requestVideoFrameCallback( updateVideo );
 
-VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {
+		}
 
-	constructor: VideoTexture,
+	}
 
-	clone: function () {
+	clone() {
 
 		return new this.constructor( this.image ).copy( this );
 
-	},
-
-	isVideoTexture: true,
+	}
 
-	update: function () {
+	update() {
 
 		const video = this.image;
 		const hasVideoFrameCallback = 'requestVideoFrameCallback' in video;
@@ -27190,71 +27183,79 @@ VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {
 
 	}
 
-} );
+}
 
-function CompressedTexture( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
+VideoTexture.prototype.isVideoTexture = true;
 
-	Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+class CompressedTexture extends Texture {
 
-	this.image = { width: width, height: height };
-	this.mipmaps = mipmaps;
+	constructor( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
 
-	// no flipping for cube textures
-	// (also flipping doesn't work for compressed textures )
+		super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 
-	this.flipY = false;
+		this.image = { width: width, height: height };
+		this.mipmaps = mipmaps;
 
-	// can't generate mipmaps for compressed textures
-	// mips must be embedded in DDS files
+		// no flipping for cube textures
+		// (also flipping doesn't work for compressed textures )
 
-	this.generateMipmaps = false;
+		this.flipY = false;
 
-}
+		// can't generate mipmaps for compressed textures
+		// mips must be embedded in DDS files
+
+		this.generateMipmaps = false;
 
-CompressedTexture.prototype = Object.create( Texture.prototype );
-CompressedTexture.prototype.constructor = CompressedTexture;
+	}
+
+}
 
 CompressedTexture.prototype.isCompressedTexture = true;
 
-function CanvasTexture( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
+class CanvasTexture extends Texture {
+
+	constructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
 
-	Texture.call( this, canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
+		super( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 
-	this.needsUpdate = true;
+		this.needsUpdate = true;
+
+	}
 
 }
 
-CanvasTexture.prototype = Object.create( Texture.prototype );
-CanvasTexture.prototype.constructor = CanvasTexture;
 CanvasTexture.prototype.isCanvasTexture = true;
 
-function DepthTexture( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) {
+class DepthTexture extends Texture {
 
-	format = format !== undefined ? format : DepthFormat;
+	constructor( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) {
 
-	if ( format !== DepthFormat && format !== DepthStencilFormat ) {
+		format = format !== undefined ? format : DepthFormat;
 
-		throw new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' );
+		if ( format !== DepthFormat && format !== DepthStencilFormat ) {
 
-	}
+			throw new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' );
+
+		}
 
-	if ( type === undefined && format === DepthFormat ) type = UnsignedShortType;
-	if ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type;
+		if ( type === undefined && format === DepthFormat ) type = UnsignedShortType;
+		if ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type;
 
-	Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
+		super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 
-	this.image = { width: width, height: height };
+		this.image = { width: width, height: height };
 
-	this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
-	this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
+		this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
+		this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
+
+		this.flipY = false;
+		this.generateMipmaps	= false;
+
+	}
 
-	this.flipY = false;
-	this.generateMipmaps = false;
 
 }
 
-DepthTexture.prototype = Object.create( Texture.prototype );
-DepthTexture.prototype.constructor = DepthTexture;
 DepthTexture.prototype.isDepthTexture = true;
 
 class CircleGeometry extends BufferGeometry {

Деякі файли не було показано, через те що забагато файлів було змінено