Browse Source

Updated builds.

Mr.doob 3 years ago
parent
commit
7af10a6b6b
4 changed files with 225 additions and 190 deletions
  1. 73 62
      build/three.cjs
  2. 73 62
      build/three.js
  3. 0 0
      build/three.min.js
  4. 79 66
      build/three.module.js

+ 73 - 62
build/three.cjs

@@ -1367,6 +1367,10 @@ function toComponents(source, target) {
 
 class Color {
 	constructor(r, g, b) {
+		this.r = 1;
+		this.g = 1;
+		this.b = 1;
+
 		if (g === undefined && b === undefined) {
 			// r is THREE.Color, hex or string
 			return this.set(r);
@@ -1756,9 +1760,6 @@ class Color {
 
 Color.NAMES = _colorKeywords;
 Color.prototype.isColor = true;
-Color.prototype.r = 1;
-Color.prototype.g = 1;
-Color.prototype.b = 1;
 
 let _canvas;
 
@@ -13783,35 +13784,44 @@ function getPureArraySetter(type) {
 } // --- Uniform Classes ---
 
 
-function SingleUniform(id, activeInfo, addr) {
-	this.id = id;
-	this.addr = addr;
-	this.cache = [];
-	this.setValue = getSingularSetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG
-}
+class SingleUniform {
+	constructor(id, activeInfo, addr) {
+		this.id = id;
+		this.addr = addr;
+		this.cache = [];
+		this.setValue = getSingularSetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG
+	}
 
-function PureArrayUniform(id, activeInfo, addr) {
-	this.id = id;
-	this.addr = addr;
-	this.cache = [];
-	this.size = activeInfo.size;
-	this.setValue = getPureArraySetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG
 }
 
-function StructuredUniform(id) {
-	this.id = id;
-	this.seq = [];
-	this.map = {};
+class PureArrayUniform {
+	constructor(id, activeInfo, addr) {
+		this.id = id;
+		this.addr = addr;
+		this.cache = [];
+		this.size = activeInfo.size;
+		this.setValue = getPureArraySetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG
+	}
+
 }
 
-StructuredUniform.prototype.setValue = function (gl, value, textures) {
-	const seq = this.seq;
+class StructuredUniform {
+	constructor(id) {
+		this.id = id;
+		this.seq = [];
+		this.map = {};
+	}
+
+	setValue(gl, value, textures) {
+		const seq = this.seq;
 
-	for (let i = 0, n = seq.length; i !== n; ++i) {
-		const u = seq[i];
-		u.setValue(gl, value[u.id], textures);
+		for (let i = 0, n = seq.length; i !== n; ++i) {
+			const u = seq[i];
+			u.setValue(gl, value[u.id], textures);
+		}
 	}
-}; // --- Top-level ---
+
+} // --- Top-level ---
 // Parser - builds up the property tree from the path strings
 
 
@@ -13863,51 +13873,53 @@ function parseUniform(activeInfo, addr, container) {
 } // Root Container
 
 
-function WebGLUniforms(gl, program) {
-	this.seq = [];
-	this.map = {};
-	const n = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+class WebGLUniforms {
+	constructor(gl, program) {
+		this.seq = [];
+		this.map = {};
+		const n = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
 
-	for (let i = 0; i < n; ++i) {
-		const info = gl.getActiveUniform(program, i),
-					addr = gl.getUniformLocation(program, info.name);
-		parseUniform(info, addr, this);
+		for (let i = 0; i < n; ++i) {
+			const info = gl.getActiveUniform(program, i),
+						addr = gl.getUniformLocation(program, info.name);
+			parseUniform(info, addr, this);
+		}
 	}
-}
 
-WebGLUniforms.prototype.setValue = function (gl, name, value, textures) {
-	const u = this.map[name];
-	if (u !== undefined) u.setValue(gl, value, textures);
-};
-
-WebGLUniforms.prototype.setOptional = function (gl, object, name) {
-	const v = object[name];
-	if (v !== undefined) this.setValue(gl, name, v);
-}; // Static interface
+	setValue(gl, name, value, textures) {
+		const u = this.map[name];
+		if (u !== undefined) u.setValue(gl, value, textures);
+	}
 
+	setOptional(gl, object, name) {
+		const v = object[name];
+		if (v !== undefined) this.setValue(gl, name, v);
+	}
 
-WebGLUniforms.upload = function (gl, seq, values, textures) {
-	for (let i = 0, n = seq.length; i !== n; ++i) {
-		const u = seq[i],
-					v = values[u.id];
+	static upload(gl, seq, values, textures) {
+		for (let i = 0, n = seq.length; i !== n; ++i) {
+			const u = seq[i],
+						v = values[u.id];
 
-		if (v.needsUpdate !== false) {
-			// note: always updating when .needsUpdate is undefined
-			u.setValue(gl, v.value, textures);
+			if (v.needsUpdate !== false) {
+				// note: always updating when .needsUpdate is undefined
+				u.setValue(gl, v.value, textures);
+			}
 		}
 	}
-};
 
-WebGLUniforms.seqWithValue = function (seq, values) {
-	const r = [];
+	static seqWithValue(seq, values) {
+		const r = [];
 
-	for (let i = 0, n = seq.length; i !== n; ++i) {
-		const u = seq[i];
-		if (u.id in values) r.push(u);
+		for (let i = 0, n = seq.length; i !== n; ++i) {
+			const u = seq[i];
+			if (u.id in values) r.push(u);
+		}
+
+		return r;
 	}
 
-	return r;
-};
+}
 
 function WebGLShader(gl, type, string) {
 	const shader = gl.createShader(type);
@@ -19228,10 +19240,9 @@ function WebGLRenderer(parameters = {}) {
 	this.toneMapping = NoToneMapping;
 	this.toneMappingExposure = 1.0; //
 
-	Object.defineProperties(WebGLRenderer.prototype, {
+	Object.defineProperties(this, {
 		// @deprecated since r136, 0e21088102b4de7e0a0a33140620b7a3424b9e6d
 		gammaFactor: {
-			configurable: true,
 			get: function () {
 				console.warn('THREE.WebGLRenderer: .gammaFactor has been removed.');
 				return 2;
@@ -28828,7 +28839,7 @@ class HemisphereLight extends Light {
 	}
 
 	copy(source) {
-		Light.prototype.copy.call(this, source);
+		super.copy(source);
 		this.groundColor.copy(source.groundColor);
 		return this;
 	}
@@ -29919,7 +29930,7 @@ class ObjectLoader extends Loader {
 			let hasImages = false;
 
 			for (const uuid in images) {
-				if (images[uuid] instanceof HTMLImageElement) {
+				if (images[uuid].data instanceof HTMLImageElement) {
 					hasImages = true;
 					break;
 				}

+ 73 - 62
build/three.js

@@ -1369,6 +1369,10 @@
 
 	class Color {
 		constructor(r, g, b) {
+			this.r = 1;
+			this.g = 1;
+			this.b = 1;
+
 			if (g === undefined && b === undefined) {
 				// r is THREE.Color, hex or string
 				return this.set(r);
@@ -1758,9 +1762,6 @@
 
 	Color.NAMES = _colorKeywords;
 	Color.prototype.isColor = true;
-	Color.prototype.r = 1;
-	Color.prototype.g = 1;
-	Color.prototype.b = 1;
 
 	let _canvas;
 
@@ -13785,35 +13786,44 @@
 	} // --- Uniform Classes ---
 
 
-	function SingleUniform(id, activeInfo, addr) {
-		this.id = id;
-		this.addr = addr;
-		this.cache = [];
-		this.setValue = getSingularSetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG
-	}
+	class SingleUniform {
+		constructor(id, activeInfo, addr) {
+			this.id = id;
+			this.addr = addr;
+			this.cache = [];
+			this.setValue = getSingularSetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG
+		}
 
-	function PureArrayUniform(id, activeInfo, addr) {
-		this.id = id;
-		this.addr = addr;
-		this.cache = [];
-		this.size = activeInfo.size;
-		this.setValue = getPureArraySetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG
 	}
 
-	function StructuredUniform(id) {
-		this.id = id;
-		this.seq = [];
-		this.map = {};
+	class PureArrayUniform {
+		constructor(id, activeInfo, addr) {
+			this.id = id;
+			this.addr = addr;
+			this.cache = [];
+			this.size = activeInfo.size;
+			this.setValue = getPureArraySetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG
+		}
+
 	}
 
-	StructuredUniform.prototype.setValue = function (gl, value, textures) {
-		const seq = this.seq;
+	class StructuredUniform {
+		constructor(id) {
+			this.id = id;
+			this.seq = [];
+			this.map = {};
+		}
+
+		setValue(gl, value, textures) {
+			const seq = this.seq;
 
-		for (let i = 0, n = seq.length; i !== n; ++i) {
-			const u = seq[i];
-			u.setValue(gl, value[u.id], textures);
+			for (let i = 0, n = seq.length; i !== n; ++i) {
+				const u = seq[i];
+				u.setValue(gl, value[u.id], textures);
+			}
 		}
-	}; // --- Top-level ---
+
+	} // --- Top-level ---
 	// Parser - builds up the property tree from the path strings
 
 
@@ -13865,51 +13875,53 @@
 	} // Root Container
 
 
-	function WebGLUniforms(gl, program) {
-		this.seq = [];
-		this.map = {};
-		const n = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+	class WebGLUniforms {
+		constructor(gl, program) {
+			this.seq = [];
+			this.map = {};
+			const n = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
 
-		for (let i = 0; i < n; ++i) {
-			const info = gl.getActiveUniform(program, i),
-						addr = gl.getUniformLocation(program, info.name);
-			parseUniform(info, addr, this);
+			for (let i = 0; i < n; ++i) {
+				const info = gl.getActiveUniform(program, i),
+							addr = gl.getUniformLocation(program, info.name);
+				parseUniform(info, addr, this);
+			}
 		}
-	}
 
-	WebGLUniforms.prototype.setValue = function (gl, name, value, textures) {
-		const u = this.map[name];
-		if (u !== undefined) u.setValue(gl, value, textures);
-	};
-
-	WebGLUniforms.prototype.setOptional = function (gl, object, name) {
-		const v = object[name];
-		if (v !== undefined) this.setValue(gl, name, v);
-	}; // Static interface
+		setValue(gl, name, value, textures) {
+			const u = this.map[name];
+			if (u !== undefined) u.setValue(gl, value, textures);
+		}
 
+		setOptional(gl, object, name) {
+			const v = object[name];
+			if (v !== undefined) this.setValue(gl, name, v);
+		}
 
-	WebGLUniforms.upload = function (gl, seq, values, textures) {
-		for (let i = 0, n = seq.length; i !== n; ++i) {
-			const u = seq[i],
-						v = values[u.id];
+		static upload(gl, seq, values, textures) {
+			for (let i = 0, n = seq.length; i !== n; ++i) {
+				const u = seq[i],
+							v = values[u.id];
 
-			if (v.needsUpdate !== false) {
-				// note: always updating when .needsUpdate is undefined
-				u.setValue(gl, v.value, textures);
+				if (v.needsUpdate !== false) {
+					// note: always updating when .needsUpdate is undefined
+					u.setValue(gl, v.value, textures);
+				}
 			}
 		}
-	};
 
-	WebGLUniforms.seqWithValue = function (seq, values) {
-		const r = [];
+		static seqWithValue(seq, values) {
+			const r = [];
 
-		for (let i = 0, n = seq.length; i !== n; ++i) {
-			const u = seq[i];
-			if (u.id in values) r.push(u);
+			for (let i = 0, n = seq.length; i !== n; ++i) {
+				const u = seq[i];
+				if (u.id in values) r.push(u);
+			}
+
+			return r;
 		}
 
-		return r;
-	};
+	}
 
 	function WebGLShader(gl, type, string) {
 		const shader = gl.createShader(type);
@@ -19230,10 +19242,9 @@
 		this.toneMapping = NoToneMapping;
 		this.toneMappingExposure = 1.0; //
 
-		Object.defineProperties(WebGLRenderer.prototype, {
+		Object.defineProperties(this, {
 			// @deprecated since r136, 0e21088102b4de7e0a0a33140620b7a3424b9e6d
 			gammaFactor: {
-				configurable: true,
 				get: function () {
 					console.warn('THREE.WebGLRenderer: .gammaFactor has been removed.');
 					return 2;
@@ -28830,7 +28841,7 @@
 		}
 
 		copy(source) {
-			Light.prototype.copy.call(this, source);
+			super.copy(source);
 			this.groundColor.copy(source.groundColor);
 			return this;
 		}
@@ -29921,7 +29932,7 @@
 				let hasImages = false;
 
 				for (const uuid in images) {
-					if (images[uuid] instanceof HTMLImageElement) {
+					if (images[uuid].data instanceof HTMLImageElement) {
 						hasImages = true;
 						break;
 					}

File diff suppressed because it is too large
+ 0 - 0
build/three.min.js


+ 79 - 66
build/three.module.js

@@ -1585,6 +1585,10 @@ class Color {
 
 	constructor( r, g, b ) {
 
+		this.r = 1;
+		this.g = 1;
+		this.b = 1;
+
 		if ( g === undefined && b === undefined ) {
 
 			// r is THREE.Color, hex or string
@@ -2136,9 +2140,6 @@ class Color {
 Color.NAMES = _colorKeywords;
 
 Color.prototype.isColor = true;
-Color.prototype.r = 1;
-Color.prototype.g = 1;
-Color.prototype.b = 1;
 
 let _canvas;
 
@@ -17997,50 +17998,62 @@ function getPureArraySetter( type ) {
 
 // --- Uniform Classes ---
 
-function SingleUniform( id, activeInfo, addr ) {
+class SingleUniform {
+
+	constructor( id, activeInfo, addr ) {
 
-	this.id = id;
-	this.addr = addr;
-	this.cache = [];
-	this.setValue = getSingularSetter( activeInfo.type );
+		this.id = id;
+		this.addr = addr;
+		this.cache = [];
+		this.setValue = getSingularSetter( activeInfo.type );
 
-	// this.path = activeInfo.name; // DEBUG
+		// this.path = activeInfo.name; // DEBUG
+
+	}
 
 }
 
-function PureArrayUniform( id, activeInfo, addr ) {
+class PureArrayUniform {
 
-	this.id = id;
-	this.addr = addr;
-	this.cache = [];
-	this.size = activeInfo.size;
-	this.setValue = getPureArraySetter( activeInfo.type );
+	constructor( id, activeInfo, addr ) {
 
-	// this.path = activeInfo.name; // DEBUG
+		this.id = id;
+		this.addr = addr;
+		this.cache = [];
+		this.size = activeInfo.size;
+		this.setValue = getPureArraySetter( activeInfo.type );
+
+		// this.path = activeInfo.name; // DEBUG
+
+	}
 
 }
 
-function StructuredUniform( id ) {
+class StructuredUniform {
 
-	this.id = id;
+	constructor( id ) {
 
-	this.seq = [];
-	this.map = {};
+		this.id = id;
 
-}
+		this.seq = [];
+		this.map = {};
 
-StructuredUniform.prototype.setValue = function ( gl, value, textures ) {
+	}
+
+	setValue( gl, value, textures ) {
 
-	const seq = this.seq;
+		const seq = this.seq;
 
-	for ( let i = 0, n = seq.length; i !== n; ++ i ) {
+		for ( let i = 0, n = seq.length; i !== n; ++ i ) {
 
-		const u = seq[ i ];
-		u.setValue( gl, value[ u.id ], textures );
+			const u = seq[ i ];
+			u.setValue( gl, value[ u.id ], textures );
+
+		}
 
 	}
 
-};
+}
 
 // --- Top-level ---
 
@@ -18117,75 +18130,76 @@ function parseUniform( activeInfo, addr, container ) {
 
 // Root Container
 
-function WebGLUniforms( gl, program ) {
+class WebGLUniforms {
 
-	this.seq = [];
-	this.map = {};
+	constructor( gl, program ) {
 
-	const n = gl.getProgramParameter( program, 35718 );
+		this.seq = [];
+		this.map = {};
 
-	for ( let i = 0; i < n; ++ i ) {
+		const n = gl.getProgramParameter( program, 35718 );
 
-		const info = gl.getActiveUniform( program, i ),
-			addr = gl.getUniformLocation( program, info.name );
+		for ( let i = 0; i < n; ++ i ) {
 
-		parseUniform( info, addr, this );
+			const info = gl.getActiveUniform( program, i ),
+				addr = gl.getUniformLocation( program, info.name );
 
-	}
+			parseUniform( info, addr, this );
 
-}
+		}
 
-WebGLUniforms.prototype.setValue = function ( gl, name, value, textures ) {
+	}
 
-	const u = this.map[ name ];
+	setValue( gl, name, value, textures ) {
 
-	if ( u !== undefined ) u.setValue( gl, value, textures );
+		const u = this.map[ name ];
 
-};
+		if ( u !== undefined ) u.setValue( gl, value, textures );
 
-WebGLUniforms.prototype.setOptional = function ( gl, object, name ) {
+	}
 
-	const v = object[ name ];
+	setOptional( gl, object, name ) {
 
-	if ( v !== undefined ) this.setValue( gl, name, v );
+		const v = object[ name ];
 
-};
+		if ( v !== undefined ) this.setValue( gl, name, v );
 
+	}
 
-// Static interface
+	static upload( gl, seq, values, textures ) {
 
-WebGLUniforms.upload = function ( gl, seq, values, textures ) {
+		for ( let i = 0, n = seq.length; i !== n; ++ i ) {
 
-	for ( let i = 0, n = seq.length; i !== n; ++ i ) {
+			const u = seq[ i ],
+				v = values[ u.id ];
 
-		const u = seq[ i ],
-			v = values[ u.id ];
+			if ( v.needsUpdate !== false ) {
 
-		if ( v.needsUpdate !== false ) {
+				// note: always updating when .needsUpdate is undefined
+				u.setValue( gl, v.value, textures );
 
-			// note: always updating when .needsUpdate is undefined
-			u.setValue( gl, v.value, textures );
+			}
 
 		}
 
 	}
 
-};
+	static seqWithValue( seq, values ) {
 
-WebGLUniforms.seqWithValue = function ( seq, values ) {
+		const r = [];
 
-	const r = [];
+		for ( let i = 0, n = seq.length; i !== n; ++ i ) {
 
-	for ( let i = 0, n = seq.length; i !== n; ++ i ) {
+			const u = seq[ i ];
+			if ( u.id in values ) r.push( u );
 
-		const u = seq[ i ];
-		if ( u.id in values ) r.push( u );
+		}
 
-	}
+		return r;
 
-	return r;
+	}
 
-};
+}
 
 function WebGLShader( gl, type, string ) {
 
@@ -26188,12 +26202,11 @@ function WebGLRenderer( parameters = {} ) {
 
 	//
 
-	Object.defineProperties( WebGLRenderer.prototype, {
+	Object.defineProperties( this, {
 
 		// @deprecated since r136, 0e21088102b4de7e0a0a33140620b7a3424b9e6d
 
 		gammaFactor: {
-			configurable: true,
 			get: function () {
 
 				console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );
@@ -40035,7 +40048,7 @@ class HemisphereLight extends Light {
 
 	copy( source ) {
 
-		Light.prototype.copy.call( this, source );
+		super.copy( source );
 
 		this.groundColor.copy( source.groundColor );
 
@@ -41569,7 +41582,7 @@ class ObjectLoader extends Loader {
 
 			for ( const uuid in images ) {
 
-				if ( images[ uuid ] instanceof HTMLImageElement ) {
+				if ( images[ uuid ].data instanceof HTMLImageElement ) {
 
 					hasImages = true;
 					break;

Some files were not shown because too many files changed in this diff