Pārlūkot izejas kodu

Merge branch 'dev' of github.com:mrdoob/three.js into stlloader-fix-credentials

Amos 4 gadi atpakaļ
vecāks
revīzija
b4f51a6f10

+ 92 - 69
build/three.js

@@ -1,3 +1,4 @@
+// threejs.org/license
 (function (global, factory) {
 	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
 	typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -32476,7 +32477,12 @@
 
 	}
 
-	function EdgesGeometry( geometry, thresholdAngle ) {
+	var _v0$2 = new Vector3();
+	var _v1$5 = new Vector3();
+	var _normal$1 = new Vector3();
+	var _triangle = new Triangle();
+
+		function EdgesGeometry( geometry, thresholdAngle ) {
 
 			BufferGeometry.call(this);
 
@@ -32488,89 +32494,123 @@
 
 			thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1;
 
-			// buffer
+			if ( geometry.isGeometry ) {
 
-			var vertices = [];
+				geometry = new BufferGeometry().fromGeometry( geometry );
 
-			// helper variables
+			}
 
+			var precisionPoints = 4;
+			var precision = Math.pow( 10, precisionPoints );
 			var thresholdDot = Math.cos( MathUtils.DEG2RAD * thresholdAngle );
-			var edge = [ 0, 0 ], edges = {};
-			var edge1, edge2, key;
-			var keys = [ 'a', 'b', 'c' ];
 
-			// prepare source geometry
+			var indexAttr = geometry.getIndex();
+			var positionAttr = geometry.getAttribute( 'position' );
+			var indexCount = indexAttr ? indexAttr.count : positionAttr.count;
 
-			var geometry2;
+			var indexArr = [ 0, 0, 0 ];
+			var vertKeys = [ 'a', 'b', 'c' ];
+			var hashes = new Array( 3 );
 
-			if ( geometry.isBufferGeometry ) {
+			var edgeData = {};
+			var vertices = [];
+			for ( var i = 0; i < indexCount; i += 3 ) {
 
-				geometry2 = new Geometry();
-				geometry2.fromBufferGeometry( geometry );
+				if ( indexAttr ) {
 
-			} else {
+					indexArr[ 0 ] = indexAttr.getX( i );
+					indexArr[ 1 ] = indexAttr.getX( i + 1 );
+					indexArr[ 2 ] = indexAttr.getX( i + 2 );
 
-				geometry2 = geometry.clone();
+				} else {
 
-			}
+					indexArr[ 0 ] = i;
+					indexArr[ 1 ] = i + 1;
+					indexArr[ 2 ] = i + 2;
 
-			geometry2.mergeVertices();
-			geometry2.computeFaceNormals();
+				}
 
-			var sourceVertices = geometry2.vertices;
-			var faces = geometry2.faces;
+				var a = _triangle.a;
+				var b = _triangle.b;
+				var c = _triangle.c;
+				a.fromBufferAttribute( positionAttr, indexArr[ 0 ] );
+				b.fromBufferAttribute( positionAttr, indexArr[ 1 ] );
+				c.fromBufferAttribute( positionAttr, indexArr[ 2 ] );
+				_triangle.getNormal( _normal$1 );
 
-			// now create a data structure where each entry represents an edge with its adjoining faces
+				// create hashes for the edge from the vertices
+				hashes[ 0 ] = (Math.round( a.x * precision )) + "," + (Math.round( a.y * precision )) + "," + (Math.round( a.z * precision ));
+				hashes[ 1 ] = (Math.round( b.x * precision )) + "," + (Math.round( b.y * precision )) + "," + (Math.round( b.z * precision ));
+				hashes[ 2 ] = (Math.round( c.x * precision )) + "," + (Math.round( c.y * precision )) + "," + (Math.round( c.z * precision ));
 
-			for ( var i = 0, l = faces.length; i < l; i ++ ) {
+				// skip degenerate triangles
+				if ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) {
+
+					continue;
 
-				var face = faces[ i ];
+				}
 
+				// iterate over every edge
 				for ( var j = 0; j < 3; j ++ ) {
 
-					edge1 = face[ keys[ j ] ];
-					edge2 = face[ keys[ ( j + 1 ) % 3 ] ];
-					edge[ 0 ] = Math.min( edge1, edge2 );
-					edge[ 1 ] = Math.max( edge1, edge2 );
+					// get the first and next vertex making up the edge
+					var jNext = ( j + 1 ) % 3;
+					var vecHash0 = hashes[ j ];
+					var vecHash1 = hashes[ jNext ];
+					var v0 = _triangle[ vertKeys[ j ] ];
+					var v1 = _triangle[ vertKeys[ jNext ] ];
 
-					key = edge[ 0 ] + ',' + edge[ 1 ];
+					var hash = vecHash0 + "_" + vecHash1;
+					var reverseHash = vecHash1 + "_" + vecHash0;
 
-					if ( edges[ key ] === undefined ) {
+					if ( reverseHash in edgeData && edgeData[ reverseHash ] ) {
 
-						edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ], face1: i, face2: undefined };
+						// if we found a sibling edge add it into the vertex array if
+						// it meets the angle threshold and delete the edge from the map.
+						if ( _normal$1.dot( edgeData[ reverseHash ].normal ) <= thresholdDot ) {
 
-					} else {
+							vertices.push( v0.x, v0.y, v0.z );
+							vertices.push( v1.x, v1.y, v1.z );
 
-						edges[ key ].face2 = i;
+						}
 
-					}
+						edgeData[ reverseHash ] = null;
 
-				}
+					} else if ( ! ( hash in edgeData ) ) {
 
-			}
+						// if we've already got an edge here then skip adding a new one
+						edgeData[ hash ] = {
+
+							index0: indexArr[ j ],
+							index1: indexArr[ jNext ],
+							normal: _normal$1.clone(),
 
-			// generate vertices
+						};
+
+					}
 
-			for ( key in edges ) {
+				}
 
-				var e = edges[ key ];
+			}
 
-				// an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree.
+			// iterate over all remaining, unmatched edges and add them to the vertex array
+			for ( var key in edgeData ) {
 
-				if ( e.face2 === undefined || faces[ e.face1 ].normal.dot( faces[ e.face2 ].normal ) <= thresholdDot ) {
+				if ( edgeData[ key ] ) {
 
-					var vertex = sourceVertices[ e.index1 ];
-					vertices.push( vertex.x, vertex.y, vertex.z );
+					var ref = edgeData[ key ];
+					var index0 = ref.index0;
+					var index1 = ref.index1;
+					_v0$2.fromBufferAttribute( positionAttr, index0 );
+					_v1$5.fromBufferAttribute( positionAttr, index1 );
 
-					vertex = sourceVertices[ e.index2 ];
-					vertices.push( vertex.x, vertex.y, vertex.z );
+					vertices.push( _v0$2.x, _v0$2.y, _v0$2.z );
+					vertices.push( _v1$5.x, _v1$5.y, _v1$5.z );
 
 				}
 
 			}
 
-			// build geometry
-
 			this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
 
 		}
@@ -38977,8 +39017,6 @@
 		this.color = new Color( color );
 		this.intensity = intensity !== undefined ? intensity : 1;
 
-		this.receiveShadow = undefined;
-
 	}
 
 	Light.prototype = Object.assign( Object.create( Object3D.prototype ), {
@@ -39026,8 +39064,6 @@
 
 		this.type = 'HemisphereLight';
 
-		this.castShadow = undefined;
-
 		this.position.copy( Object3D.DefaultUp );
 		this.updateMatrix();
 
@@ -39610,8 +39646,6 @@
 
 		this.type = 'AmbientLight';
 
-		this.castShadow = undefined;
-
 	}
 
 	AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), {
@@ -41607,7 +41641,10 @@
 
 			}
 
-			fetch( url ).then( function ( res ) {
+			var fetchOptions = {};
+			fetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';
+
+			fetch( url, fetchOptions ).then( function ( res ) {
 
 				return res.blob();
 
@@ -46002,20 +46039,6 @@
 
 	} );
 
-	/**
-	 * @author raub / https://github.com/raub
-	 */
-
-	/**
-	 * Element size is one of:
-	 * 5126: 4
-	 * 5123: 2
-	 * 5122: 2
-	 * 5125: 4
-	 * 5124: 4
-	 * 5120: 1
-	 * 5121: 1
-	 */
 	function GLBufferAttribute( buffer, type, itemSize, elementSize, count ) {
 
 		this.buffer = buffer;
@@ -47198,7 +47221,7 @@
 		PolarGridHelper.prototype = Object.create( LineSegments.prototype );
 		PolarGridHelper.prototype.constructor = PolarGridHelper;
 
-	var _v1$5 = /*@__PURE__*/ new Vector3();
+	var _v1$6 = /*@__PURE__*/ new Vector3();
 	var _v2$3 = /*@__PURE__*/ new Vector3();
 	var _v3$1 = /*@__PURE__*/ new Vector3();
 
@@ -47253,9 +47276,9 @@
 
 		DirectionalLightHelper.prototype.update = function update () {
 
-			_v1$5.setFromMatrixPosition( this.light.matrixWorld );
+			_v1$6.setFromMatrixPosition( this.light.matrixWorld );
 			_v2$3.setFromMatrixPosition( this.light.target.matrixWorld );
-			_v3$1.subVectors( _v2$3, _v1$5 );
+			_v3$1.subVectors( _v2$3, _v1$6 );
 
 			this.lightPlane.lookAt( _v2$3 );
 

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 613
build/three.min.js


+ 87 - 68
build/three.module.js

@@ -1,3 +1,4 @@
+// threejs.org/license
 // Polyfills
 
 if ( Number.EPSILON === undefined ) {
@@ -32573,6 +32574,11 @@ function toJSON$1( shapes, data ) {
 
 }
 
+const _v0$2 = new Vector3();
+const _v1$5 = new Vector3();
+const _normal$1 = new Vector3();
+const _triangle = new Triangle();
+
 class EdgesGeometry extends BufferGeometry {
 
 	constructor( geometry, thresholdAngle ) {
@@ -32587,89 +32593,119 @@ class EdgesGeometry extends BufferGeometry {
 
 		thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1;
 
-		// buffer
+		if ( geometry.isGeometry ) {
 
-		const vertices = [];
+			geometry = new BufferGeometry().fromGeometry( geometry );
 
-		// helper variables
+		}
 
+		const precisionPoints = 4;
+		const precision = Math.pow( 10, precisionPoints );
 		const thresholdDot = Math.cos( MathUtils.DEG2RAD * thresholdAngle );
-		const edge = [ 0, 0 ], edges = {};
-		let edge1, edge2, key;
-		const keys = [ 'a', 'b', 'c' ];
 
-		// prepare source geometry
+		const indexAttr = geometry.getIndex();
+		const positionAttr = geometry.getAttribute( 'position' );
+		const indexCount = indexAttr ? indexAttr.count : positionAttr.count;
 
-		let geometry2;
+		const indexArr = [ 0, 0, 0 ];
+		const vertKeys = [ 'a', 'b', 'c' ];
+		const hashes = new Array( 3 );
 
-		if ( geometry.isBufferGeometry ) {
+		const edgeData = {};
+		const vertices = [];
+		for ( let i = 0; i < indexCount; i += 3 ) {
 
-			geometry2 = new Geometry();
-			geometry2.fromBufferGeometry( geometry );
+			if ( indexAttr ) {
 
-		} else {
+				indexArr[ 0 ] = indexAttr.getX( i );
+				indexArr[ 1 ] = indexAttr.getX( i + 1 );
+				indexArr[ 2 ] = indexAttr.getX( i + 2 );
 
-			geometry2 = geometry.clone();
+			} else {
 
-		}
+				indexArr[ 0 ] = i;
+				indexArr[ 1 ] = i + 1;
+				indexArr[ 2 ] = i + 2;
 
-		geometry2.mergeVertices();
-		geometry2.computeFaceNormals();
+			}
 
-		const sourceVertices = geometry2.vertices;
-		const faces = geometry2.faces;
+			const { a, b, c } = _triangle;
+			a.fromBufferAttribute( positionAttr, indexArr[ 0 ] );
+			b.fromBufferAttribute( positionAttr, indexArr[ 1 ] );
+			c.fromBufferAttribute( positionAttr, indexArr[ 2 ] );
+			_triangle.getNormal( _normal$1 );
 
-		// now create a data structure where each entry represents an edge with its adjoining faces
+			// create hashes for the edge from the vertices
+			hashes[ 0 ] = `${ Math.round( a.x * precision ) },${ Math.round( a.y * precision ) },${ Math.round( a.z * precision ) }`;
+			hashes[ 1 ] = `${ Math.round( b.x * precision ) },${ Math.round( b.y * precision ) },${ Math.round( b.z * precision ) }`;
+			hashes[ 2 ] = `${ Math.round( c.x * precision ) },${ Math.round( c.y * precision ) },${ Math.round( c.z * precision ) }`;
 
-		for ( let i = 0, l = faces.length; i < l; i ++ ) {
+			// skip degenerate triangles
+			if ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) {
 
-			const face = faces[ i ];
+				continue;
 
+			}
+
+			// iterate over every edge
 			for ( let j = 0; j < 3; j ++ ) {
 
-				edge1 = face[ keys[ j ] ];
-				edge2 = face[ keys[ ( j + 1 ) % 3 ] ];
-				edge[ 0 ] = Math.min( edge1, edge2 );
-				edge[ 1 ] = Math.max( edge1, edge2 );
+				// get the first and next vertex making up the edge
+				const jNext = ( j + 1 ) % 3;
+				const vecHash0 = hashes[ j ];
+				const vecHash1 = hashes[ jNext ];
+				const v0 = _triangle[ vertKeys[ j ] ];
+				const v1 = _triangle[ vertKeys[ jNext ] ];
 
-				key = edge[ 0 ] + ',' + edge[ 1 ];
+				const hash = `${ vecHash0 }_${ vecHash1 }`;
+				const reverseHash = `${ vecHash1 }_${ vecHash0 }`;
 
-				if ( edges[ key ] === undefined ) {
+				if ( reverseHash in edgeData && edgeData[ reverseHash ] ) {
 
-					edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ], face1: i, face2: undefined };
+					// if we found a sibling edge add it into the vertex array if
+					// it meets the angle threshold and delete the edge from the map.
+					if ( _normal$1.dot( edgeData[ reverseHash ].normal ) <= thresholdDot ) {
 
-				} else {
+						vertices.push( v0.x, v0.y, v0.z );
+						vertices.push( v1.x, v1.y, v1.z );
 
-					edges[ key ].face2 = i;
+					}
 
-				}
+					edgeData[ reverseHash ] = null;
 
-			}
+				} else if ( ! ( hash in edgeData ) ) {
 
-		}
+					// if we've already got an edge here then skip adding a new one
+					edgeData[ hash ] = {
 
-		// generate vertices
+						index0: indexArr[ j ],
+						index1: indexArr[ jNext ],
+						normal: _normal$1.clone(),
 
-		for ( key in edges ) {
+					};
 
-			const e = edges[ key ];
+				}
 
-			// an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree.
+			}
 
-			if ( e.face2 === undefined || faces[ e.face1 ].normal.dot( faces[ e.face2 ].normal ) <= thresholdDot ) {
+		}
 
-				let vertex = sourceVertices[ e.index1 ];
-				vertices.push( vertex.x, vertex.y, vertex.z );
+		// iterate over all remaining, unmatched edges and add them to the vertex array
+		for ( const key in edgeData ) {
 
-				vertex = sourceVertices[ e.index2 ];
-				vertices.push( vertex.x, vertex.y, vertex.z );
+			if ( edgeData[ key ] ) {
+
+				const { index0, index1 } = edgeData[ key ];
+				_v0$2.fromBufferAttribute( positionAttr, index0 );
+				_v1$5.fromBufferAttribute( positionAttr, index1 );
+
+				vertices.push( _v0$2.x, _v0$2.y, _v0$2.z );
+				vertices.push( _v1$5.x, _v1$5.y, _v1$5.z );
 
 			}
 
 		}
 
-		// build geometry
-
 		this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
 
 	}
@@ -39079,8 +39115,6 @@ function Light( color, intensity ) {
 	this.color = new Color( color );
 	this.intensity = intensity !== undefined ? intensity : 1;
 
-	this.receiveShadow = undefined;
-
 }
 
 Light.prototype = Object.assign( Object.create( Object3D.prototype ), {
@@ -39128,8 +39162,6 @@ function HemisphereLight( skyColor, groundColor, intensity ) {
 
 	this.type = 'HemisphereLight';
 
-	this.castShadow = undefined;
-
 	this.position.copy( Object3D.DefaultUp );
 	this.updateMatrix();
 
@@ -39712,8 +39744,6 @@ function AmbientLight( color, intensity ) {
 
 	this.type = 'AmbientLight';
 
-	this.castShadow = undefined;
-
 }
 
 AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), {
@@ -41714,7 +41744,10 @@ ImageBitmapLoader.prototype = Object.assign( Object.create( Loader.prototype ),
 
 		}
 
-		fetch( url ).then( function ( res ) {
+		const fetchOptions = {};
+		fetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';
+
+		fetch( url, fetchOptions ).then( function ( res ) {
 
 			return res.blob();
 
@@ -46128,20 +46161,6 @@ InstancedInterleavedBuffer.prototype = Object.assign( Object.create( Interleaved
 
 } );
 
-/**
- * @author raub / https://github.com/raub
- */
-
-/**
- * Element size is one of:
- * 5126: 4
- * 5123: 2
- * 5122: 2
- * 5125: 4
- * 5124: 4
- * 5120: 1
- * 5121: 1
- */
 function GLBufferAttribute( buffer, type, itemSize, elementSize, count ) {
 
 	this.buffer = buffer;
@@ -47342,7 +47361,7 @@ class PolarGridHelper extends LineSegments {
 
 }
 
-const _v1$5 = /*@__PURE__*/ new Vector3();
+const _v1$6 = /*@__PURE__*/ new Vector3();
 const _v2$3 = /*@__PURE__*/ new Vector3();
 const _v3$1 = /*@__PURE__*/ new Vector3();
 
@@ -47396,9 +47415,9 @@ class DirectionalLightHelper extends Object3D {
 
 	update() {
 
-		_v1$5.setFromMatrixPosition( this.light.matrixWorld );
+		_v1$6.setFromMatrixPosition( this.light.matrixWorld );
 		_v2$3.setFromMatrixPosition( this.light.target.matrixWorld );
-		_v3$1.subVectors( _v2$3, _v1$5 );
+		_v3$1.subVectors( _v2$3, _v1$6 );
 
 		this.lightPlane.lookAt( _v2$3 );
 

+ 0 - 5
docs/api/en/lights/AmbientLight.html

@@ -46,11 +46,6 @@
 				See the base [page:Light Light] class for common properties.
 		</p>
 
-		<h3>[property:Boolean castShadow]</h3>
-		<p>
-			This is set to *undefined* in the constructor as ambient lights cannot cast shadows.
-		</p>
-
 
 		<h2>Methods</h2>
 		<p>

+ 0 - 6
docs/api/en/lights/HemisphereLight.html

@@ -52,12 +52,6 @@
 			See the base [page:Light Light] class for common properties.
 		</p>
 
-		<h3>[property:Boolean castShadow]</h3>
-		<p>
-			This is set to *undefined* in the constructor as hemisphere lights cannot cast shadows.
-		</p>
-
-
 		<h3>[property:Float color]</h3>
 		<p>
 			The light's sky color, as passed in the constructor.

+ 15 - 1
editor/js/Sidebar.Object.js

@@ -539,7 +539,7 @@ function SidebarObject( editor ) {
 
 			}
 
-			if ( object.receiveShadow !== undefined && object.receiveShadow !== objectReceiveShadow.getValue() ) {
+			if ( object.receiveShadow !== objectReceiveShadow.getValue() ) {
 
 				if ( object.material !== undefined ) object.material.needsUpdate = true;
 				editor.execute( new SetValueCommand( editor, object, 'receiveShadow', objectReceiveShadow.getValue() ) );
@@ -629,6 +629,20 @@ function SidebarObject( editor ) {
 
 		}
 
+		//
+
+		if ( object.isLight ) {
+
+			objectReceiveShadow.setDisplay( 'none' );
+
+		}
+
+		if ( object.isAmbientLight || object.isHemisphereLight ) {
+
+			objectShadowRow.setDisplay( 'none' );
+
+		}
+
 	}
 
 	function updateTransformRows( object ) {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 300 - 322
package-lock.json


+ 1 - 2
package.json

@@ -55,7 +55,6 @@
     "start": "npm run dev",
     "test": "npm run test-lint && npm run test-unit",
     "build": "rollup -c utils/build/rollup.config.js",
-    "build-closure": "npm run build && google-closure-compiler --warning_level=VERBOSE --jscomp_off=globalThis --jscomp_off=checkTypes --externs utils/build/externs.js --language_in=ECMASCRIPT5_STRICT --js build/three.js --js_output_file build/three.min.js",
     "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"http-server -c-1 -p 8080\"",
     "dev-test": "concurrently --names \"ROLLUP,ROLLUPTEST,HTTP\" -c \"bgBlue.bold,bgRed.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"npm run dev --prefix test\" \"http-server -p 8080\"",
     "lint-fix": "eslint src --ext js --ext ts --fix && eslint examples/js/ --ext js --ext ts --ignore-pattern libs --fix",
@@ -95,10 +94,10 @@
     "eslint": "^7.6.0",
     "eslint-config-mdcs": "^5.0.0",
     "eslint-plugin-html": "^6.0.3",
-    "google-closure-compiler": "20200719.0.0",
     "http-server": "^0.12.3",
     "rollup": "^2.23.1",
     "rollup-plugin-buble": "^0.19.8",
+    "rollup-plugin-terser": "^7.0.2",
     "typescript": "^4.0.2"
   },
   "jspm": {

+ 0 - 4
src/lights/AmbientLight.d.ts

@@ -20,10 +20,6 @@ export class AmbientLight extends Light {
 	 */
 	type: string;
 
-	/**
-	 * @default undefined
-	 */
-	castShadow: boolean;
 	readonly isAmbientLight: true;
 
 }

+ 0 - 2
src/lights/AmbientLight.js

@@ -6,8 +6,6 @@ function AmbientLight( color, intensity ) {
 
 	this.type = 'AmbientLight';
 
-	this.castShadow = undefined;
-
 }
 
 AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), {

+ 0 - 5
src/lights/HemisphereLight.d.ts

@@ -25,11 +25,6 @@ export class HemisphereLight extends Light {
 	 */
 	position: Vector3;
 
-	/**
-	 * @default undefined
-	 */
-	castShadow: boolean;
-
 	groundColor: Color;
 
 	readonly isHemisphereLight: true;

+ 0 - 2
src/lights/HemisphereLight.js

@@ -8,8 +8,6 @@ function HemisphereLight( skyColor, groundColor, intensity ) {
 
 	this.type = 'HemisphereLight';
 
-	this.castShadow = undefined;
-
 	this.position.copy( Object3D.DefaultUp );
 	this.updateMatrix();
 

+ 0 - 4
src/lights/Light.d.ts

@@ -24,10 +24,6 @@ export class Light extends Object3D {
 	intensity: number;
 	readonly isLight: true;
 
-	/**
-	 * @default undefined
-	 */
-	receiveShadow: boolean;
 	shadow: LightShadow;
 	/**
 	 * @deprecated Use shadow.camera.fov instead.

+ 0 - 2
src/lights/Light.js

@@ -10,8 +10,6 @@ function Light( color, intensity ) {
 	this.color = new Color( color );
 	this.intensity = intensity !== undefined ? intensity : 1;
 
-	this.receiveShadow = undefined;
-
 }
 
 Light.prototype = Object.assign( Object.create( Object3D.prototype ), {

+ 0 - 10
utils/build/externs.js

@@ -1,10 +0,0 @@
-var THREE;
-var define;
-var module;
-var exports;
-var performance;
-var createImageBitmap;
-var WebGL2RenderingContext;
-var WebGL2ComputeRenderingContext;
-var XRHand;
-var XRWebGLLayer;

+ 43 - 2
utils/build/rollup.config.js

@@ -1,4 +1,5 @@
 import buble from 'rollup-plugin-buble';
+import { terser } from "rollup-plugin-terser";
 
 function glconstants() {
 
@@ -240,6 +241,20 @@ function bubleCleanup() {
 
 }
 
+function header() {
+
+	return {
+
+		renderChunk( code ) {
+
+			return "// threejs.org/license\n" + code;
+
+		}
+
+	};
+
+}
+
 export default [
 	{
 		input: 'src/Three.js',
@@ -252,7 +267,8 @@ export default [
 					classes: true
 				}
 			} ),
-			bubleCleanup()
+			bubleCleanup(),
+			header()
 		],
 		output: [
 			{
@@ -267,7 +283,32 @@ export default [
 		input: 'src/Three.js',
 		plugins: [
 			glconstants(),
-			glsl()
+			glsl(),
+			buble( {
+				transforms: {
+					arrow: false,
+					classes: true
+				}
+			} ),
+			bubleCleanup(),
+			terser(),
+			header()
+		],
+		output: [
+			{
+				format: 'umd',
+				name: 'THREE',
+				file: 'build/three.min.js',
+				indent: '\t'
+			}
+		]
+	},
+	{
+		input: 'src/Three.js',
+		plugins: [
+			glconstants(),
+			glsl(),
+			header()
 		],
 		output: [
 			{

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels