Browse Source

Updated examples builds.

Mr.doob 3 years ago
parent
commit
f6e6fa192a

+ 0 - 2
examples/js/exporters/ColladaExporter.js

@@ -131,8 +131,6 @@
 
 			function attrBufferToArray( attr, isColor = false ) {
 
-				console.log( attr, attr.count, isColor );
-
 				if ( isColor ) {
 
 					// convert the colors to srgb before export

+ 1 - 1
examples/js/exporters/PLYExporter.js

@@ -235,7 +235,7 @@
 								output.setFloat32( vOffset, uvs.getY( i ), options.littleEndian );
 								vOffset += 4;
 
-							} else if ( includeUVs !== false ) {
+							} else {
 
 								output.setFloat32( vOffset, 0, options.littleEndian );
 								vOffset += 4;

+ 3 - 10
examples/js/loaders/3MFLoader.js

@@ -75,12 +75,10 @@
 				const modelPartNames = [];
 				const printTicketPartNames = [];
 				const texturesPartNames = [];
-				const otherPartNames = [];
 				let modelRels;
 				const modelParts = {};
 				const printTicketParts = {};
 				const texturesParts = {};
-				const otherParts = {};
 
 				try {
 
@@ -119,10 +117,6 @@
 
 						texturesPartNames.push( file );
 
-					} else if ( file.match( /^3D\/Other\/.*/ ) ) {
-
-						otherPartNames.push( file );
-
 					}
 
 				} //
@@ -195,8 +189,7 @@
 					modelRels: modelRels,
 					model: modelParts,
 					printTicket: printTicketParts,
-					texture: texturesParts,
-					other: otherParts
+					texture: texturesParts
 				};
 
 			}
@@ -909,7 +902,7 @@
 
 			}
 
-			function buildVertexColorMesh( colorgroup, triangleProperties, meshData, objects, modelData, objectData ) {
+			function buildVertexColorMesh( colorgroup, triangleProperties, meshData, objects, objectData ) {
 
 				// geometry
 				const geometry = new THREE.BufferGeometry();
@@ -1008,7 +1001,7 @@
 
 						case 'vertexColors':
 							const colorgroup = modelData.resources.colorgroup[ resourceId ];
-							meshes.push( buildVertexColorMesh( colorgroup, triangleProperties, meshData, objects, modelData, objectData ) );
+							meshes.push( buildVertexColorMesh( colorgroup, triangleProperties, meshData, objects, objectData ) );
 							break;
 
 						case 'default':

+ 3 - 3
examples/js/loaders/ColladaLoader.js

@@ -1333,11 +1333,11 @@
 
 			function parseEffectExtraTechniqueBump( xml ) {
 
-				var data = {};
+				const data = {};
 
-				for ( var i = 0, l = xml.childNodes.length; i < l; i ++ ) {
+				for ( let i = 0, l = xml.childNodes.length; i < l; i ++ ) {
 
-					var child = xml.childNodes[ i ];
+					const child = xml.childNodes[ i ];
 					if ( child.nodeType !== 1 ) continue;
 
 					switch ( child.nodeName ) {

File diff suppressed because it is too large
+ 219 - 217
examples/js/loaders/EXRLoader.js


+ 0 - 1
examples/js/loaders/GCodeLoader.js

@@ -185,7 +185,6 @@
 					line.y = args.y !== undefined ? args.y : line.y;
 					line.z = args.z !== undefined ? args.z : line.z;
 					line.e = args.e !== undefined ? args.e : line.e;
-					state = line;
 
 				} else { //console.warn( 'THREE.GCodeLoader: Command not supported:' + cmd );
 				}

+ 2 - 2
examples/js/loaders/RGBELoader.js

@@ -171,13 +171,13 @@
 
 						if ( match = line.match( gamma_re ) ) {
 
-							header.gamma = parseFloat( match[ 1 ], 10 );
+							header.gamma = parseFloat( match[ 1 ] );
 
 						}
 
 						if ( match = line.match( exposure_re ) ) {
 
-							header.exposure = parseFloat( match[ 1 ], 10 );
+							header.exposure = parseFloat( match[ 1 ] );
 
 						}
 

+ 4 - 4
examples/js/loaders/lwo/LWO2Parser.js

@@ -12,8 +12,8 @@
 
 			this.IFF.debugger.offset = this.IFF.reader.offset;
 			this.IFF.debugger.closeForms();
-			var blockID = this.IFF.reader.getIDTag();
-			var length = this.IFF.reader.getUint32(); // size of data in bytes
+			const blockID = this.IFF.reader.getIDTag();
+			let length = this.IFF.reader.getUint32(); // size of data in bytes
 
 			if ( length > this.IFF.reader.dv.byteLength - this.IFF.reader.offset ) {
 
@@ -247,7 +247,7 @@
 					break;
 
 				case 'IMAG':
-					var index = this.IFF.reader.getVariableLengthIndex();
+					const index = this.IFF.reader.getVariableLengthIndex();
 					this.IFF.currentForm.imageIndex = index;
 					break;
 					// Texture Mapping Form
@@ -315,7 +315,7 @@
 					// LWO2 Spec chunks: these are needed since the SURF FORMs are often in LWO2 format
 
 				case 'SMAN':
-					var maxSmoothingAngle = this.IFF.reader.getFloat32();
+					const maxSmoothingAngle = this.IFF.reader.getFloat32();
 					this.IFF.currentSurface.attributes.smooth = maxSmoothingAngle < 0 ? false : true;
 					break;
 					// LWO2: Basic Surface Parameters

+ 4 - 4
examples/js/loaders/lwo/LWO3Parser.js

@@ -12,8 +12,8 @@
 
 			this.IFF.debugger.offset = this.IFF.reader.offset;
 			this.IFF.debugger.closeForms();
-			var blockID = this.IFF.reader.getIDTag();
-			var length = this.IFF.reader.getUint32(); // size of data in bytes
+			const blockID = this.IFF.reader.getIDTag();
+			const length = this.IFF.reader.getUint32(); // size of data in bytes
 
 			this.IFF.debugger.dataOffset = this.IFF.reader.offset;
 			this.IFF.debugger.length = length; // Data types may be found in either LWO2 OR LWO3 spec
@@ -212,7 +212,7 @@
 					break;
 
 				case 'IMAG':
-					var index = this.IFF.reader.getVariableLengthIndex();
+					const index = this.IFF.reader.getVariableLengthIndex();
 					this.IFF.currentForm.imageIndex = index;
 					break;
 					// Texture Mapping Form
@@ -280,7 +280,7 @@
 					// LWO2 Spec chunks: these are needed since the SURF FORMs are often in LWO2 format
 
 				case 'SMAN':
-					var maxSmoothingAngle = this.IFF.reader.getFloat32();
+					const maxSmoothingAngle = this.IFF.reader.getFloat32();
 					this.IFF.currentSurface.attributes.smooth = maxSmoothingAngle < 0 ? false : true;
 					break;
 					// LWO2: Basic Surface Parameters

+ 1 - 1
examples/js/math/Lut.js

@@ -94,7 +94,7 @@
 
 			alpha = ( alpha - this.minV ) / ( this.maxV - this.minV );
 			let colorPosition = Math.round( alpha * this.n );
-			colorPosition == this.n ? colorPosition -= 1 : colorPosition;
+			if ( colorPosition === this.n ) colorPosition -= 1;
 			return this.lut[ colorPosition ];
 
 		}

+ 4 - 4
examples/js/postprocessing/TAARenderPass.js

@@ -24,7 +24,7 @@
 
 		render( renderer, writeBuffer, readBuffer, deltaTime ) {
 
-			if ( ! this.accumulate ) {
+			if ( this.accumulate === false ) {
 
 				super.render( renderer, writeBuffer, readBuffer, deltaTime );
 				this.accumulateIndex = - 1;
@@ -34,21 +34,21 @@
 
 			const jitterOffsets = _JitterVectors[ 5 ];
 
-			if ( ! this.sampleRenderTarget ) {
+			if ( this.sampleRenderTarget === undefined ) {
 
 				this.sampleRenderTarget = new THREE.WebGLRenderTarget( readBuffer.width, readBuffer.height, this.params );
 				this.sampleRenderTarget.texture.name = 'TAARenderPass.sample';
 
 			}
 
-			if ( ! this.holdRenderTarget ) {
+			if ( this.holdRenderTarget === undefined ) {
 
 				this.holdRenderTarget = new THREE.WebGLRenderTarget( readBuffer.width, readBuffer.height, this.params );
 				this.holdRenderTarget.texture.name = 'TAARenderPass.hold';
 
 			}
 
-			if ( this.accumulate && this.accumulateIndex === - 1 ) {
+			if ( this.accumulateIndex === - 1 ) {
 
 				super.render( renderer, this.holdRenderTarget, readBuffer, deltaTime );
 				this.accumulateIndex = 0;

+ 6 - 6
examples/js/utils/LDrawUtils.js

@@ -138,9 +138,9 @@
 			const mergedObject = new THREE.Group();
 			const meshMaterialsIds = Object.keys( meshGeometries );
 
-			for ( const i in meshMaterialsIds ) {
+			for ( const meshMaterialsId of meshMaterialsIds ) {
 
-				const meshGeometry = meshGeometries[ meshMaterialsIds[ i ] ];
+				const meshGeometry = meshGeometries[ meshMaterialsId ];
 				const mergedGeometry = THREE.mergeBufferGeometries( meshGeometry.arr );
 				mergedObject.add( new THREE.Mesh( mergedGeometry, meshGeometry.mat ) );
 
@@ -148,9 +148,9 @@
 
 			const linesMaterialsIds = Object.keys( linesGeometries );
 
-			for ( const i in linesMaterialsIds ) {
+			for ( const linesMaterialsId of linesMaterialsIds ) {
 
-				const lineGeometry = linesGeometries[ linesMaterialsIds[ i ] ];
+				const lineGeometry = linesGeometries[ linesMaterialsId ];
 				const mergedGeometry = THREE.mergeBufferGeometries( lineGeometry.arr );
 				mergedObject.add( new THREE.LineSegments( mergedGeometry, lineGeometry.mat ) );
 
@@ -158,9 +158,9 @@
 
 			const condLinesMaterialsIds = Object.keys( condLinesGeometries );
 
-			for ( const i in condLinesMaterialsIds ) {
+			for ( const condLinesMaterialsId of condLinesMaterialsIds ) {
 
-				const condLineGeometry = condLinesGeometries[ condLinesMaterialsIds[ i ] ];
+				const condLineGeometry = condLinesGeometries[ condLinesMaterialsId ];
 				const mergedGeometry = THREE.mergeBufferGeometries( condLineGeometry.arr );
 				const condLines = new THREE.LineSegments( mergedGeometry, condLineGeometry.mat );
 				condLines.isConditionalLine = true;

+ 1 - 1
examples/js/utils/SkeletonUtils.js

@@ -64,7 +64,7 @@
 				bone = bones[ i ];
 				name = options.names[ bone.name ] || bone.name;
 
-				if ( options.offsets && options.offsets[ name ] ) {
+				if ( options.offsets[ name ] ) {
 
 					bone.matrix.multiply( options.offsets[ name ] );
 					bone.matrix.decompose( bone.position, bone.quaternion, bone.scale );

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