浏览代码

Fixed some more lgtm.com alerts.

Mr.doob 8 年之前
父节点
当前提交
61520f0d8a

+ 1 - 1
editor/js/History.js

@@ -273,7 +273,7 @@ History.prototype = {
 
 
 				if ( cmd === undefined || id === cmd.id ) break;
 				if ( cmd === undefined || id === cmd.id ) break;
 
 
-				cmd = this.undo();
+				this.undo();
 
 
 			}
 			}
 
 

+ 1 - 2
examples/js/WaterShader.js

@@ -307,8 +307,7 @@ THREE.Water.prototype.updateTextureMatrix = function () {
 	q.w = ( 1.0 + projectionMatrix.elements[ 10 ] ) / projectionMatrix.elements[ 14 ];
 	q.w = ( 1.0 + projectionMatrix.elements[ 10 ] ) / projectionMatrix.elements[ 14 ];
 
 
 	// Calculate the scaled plane vector
 	// Calculate the scaled plane vector
-	var c = new THREE.Vector4();
-	c = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot( q ) );
+	var c = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot( q ) );
 
 
 	// Replacing the third row of the projection matrix
 	// Replacing the third row of the projection matrix
 	projectionMatrix.elements[ 2 ] = c.x;
 	projectionMatrix.elements[ 2 ] = c.x;

+ 1 - 3
examples/js/geometries/TeapotBufferGeometry.js

@@ -479,7 +479,7 @@ THREE.TeapotBufferGeometry = function ( size, segments, bottom, lid, body, fitLi
 	var tcoord;
 	var tcoord;
 
 
 	var sstep, tstep;
 	var sstep, tstep;
-	var vertPerRow, eps;
+	var vertPerRow;
 
 
 	var s, t, sval, tval, p;
 	var s, t, sval, tval, p;
 	var dsval = 0;
 	var dsval = 0;
@@ -532,8 +532,6 @@ THREE.TeapotBufferGeometry = function ( size, segments, bottom, lid, body, fitLi
 
 
 	vertPerRow = segments + 1;
 	vertPerRow = segments + 1;
 
 
-	eps = 0.0000001;
-
 	var surfCount = 0;
 	var surfCount = 0;
 
 
 	var vertCount = 0;
 	var vertCount = 0;

+ 0 - 2
examples/js/loaders/AWDLoader.js

@@ -288,7 +288,6 @@
 					mtx,
 					mtx,
 					materials, mat, mat_id,
 					materials, mat, mat_id,
 					num_materials,
 					num_materials,
-					materials_parsed,
 					parent,
 					parent,
 					i;
 					i;
 
 
@@ -301,7 +300,6 @@
 			geometries = this.getBlock( data_id );
 			geometries = this.getBlock( data_id );
 
 
 			materials = [];
 			materials = [];
-			materials_parsed = 0;
 
 
 			for ( i = 0; i < num_materials; i ++ ) {
 			for ( i = 0; i < num_materials; i ++ ) {
 
 

+ 0 - 10
examples/js/loaders/AssimpLoader.js

@@ -493,16 +493,6 @@
 
 
 	}
 	}
 
 
-	function aiAnimation() {
-
-		this.mName = "";
-		this.mDuration = 0;
-		this.mTicksPerSecond = 0;
-		this.mNumChannels = 0;
-		this.mChannels = [];
-
-	}
-
 	function sortWeights( indexes, weights ) {
 	function sortWeights( indexes, weights ) {
 
 
 		var pairs = [];
 		var pairs = [];

+ 1 - 2
examples/js/loaders/BinaryLoader.js

@@ -92,7 +92,7 @@ THREE.BinaryLoader.prototype = {
 				start_quad_flat, start_quad_smooth, start_quad_flat_uv, start_quad_smooth_uv,
 				start_quad_flat, start_quad_smooth, start_quad_flat_uv, start_quad_smooth_uv,
 				tri_size, quad_size,
 				tri_size, quad_size,
 				len_tri_flat, len_tri_smooth, len_tri_flat_uv, len_tri_smooth_uv,
 				len_tri_flat, len_tri_smooth, len_tri_flat_uv, len_tri_smooth_uv,
-				len_quad_flat, len_quad_smooth, len_quad_flat_uv, len_quad_smooth_uv;
+				len_quad_flat, len_quad_smooth, len_quad_flat_uv;
 
 
 
 
 			THREE.Geometry.call( this );
 			THREE.Geometry.call( this );
@@ -119,7 +119,6 @@ THREE.BinaryLoader.prototype = {
 			len_quad_flat      = md.nquad_flat      * ( quad_size );
 			len_quad_flat      = md.nquad_flat      * ( quad_size );
 			len_quad_smooth    = md.nquad_smooth    * ( quad_size + md.normal_index_bytes * 4 );
 			len_quad_smooth    = md.nquad_smooth    * ( quad_size + md.normal_index_bytes * 4 );
 			len_quad_flat_uv   = md.nquad_flat_uv   * ( quad_size + md.uv_index_bytes * 4 );
 			len_quad_flat_uv   = md.nquad_flat_uv   * ( quad_size + md.uv_index_bytes * 4 );
-			len_quad_smooth_uv = md.nquad_smooth_uv * ( quad_size + md.normal_index_bytes * 4 + md.uv_index_bytes * 4 );
 
 
 			// read buffers
 			// read buffers
 
 

+ 4 - 6
examples/js/loaders/ColladaLoader.js

@@ -682,11 +682,11 @@ THREE.ColladaLoader = function () {
 
 
 	}
 	}
 
 
-	function applySkin ( geometry, instanceCtrl, frame ) {
+	function applySkin( geometry, instanceCtrl, frame ) {
 
 
-		var skinController = controllers[ instanceCtrl.url ];
+		if ( frame === undefined ) frame = 40;
 
 
-		frame = frame !== undefined ? frame : 40;
+		var skinController = controllers[ instanceCtrl.url ];
 
 
 		if ( !skinController || !skinController.skin ) {
 		if ( !skinController || !skinController.skin ) {
 
 
@@ -2171,13 +2171,11 @@ THREE.ColladaLoader = function () {
 			var dotSyntax = (sid.indexOf(".") >= 0);
 			var dotSyntax = (sid.indexOf(".") >= 0);
 			var arrSyntax = (sid.indexOf("(") >= 0);
 			var arrSyntax = (sid.indexOf("(") >= 0);
 			var arrIndices;
 			var arrIndices;
-			var member;
 
 
 			if ( dotSyntax ) {
 			if ( dotSyntax ) {
 
 
 				parts = sid.split(".");
 				parts = sid.split(".");
 				sid = parts.shift();
 				sid = parts.shift();
-				member = parts.shift();
 
 
 			} else if ( arrSyntax ) {
 			} else if ( arrSyntax ) {
 
 
@@ -2871,7 +2869,7 @@ THREE.ColladaLoader = function () {
 		var j, k, pList = primitive.p, inputs = primitive.inputs;
 		var j, k, pList = primitive.p, inputs = primitive.inputs;
 		var input, index, idx32;
 		var input, index, idx32;
 		var source, numParams;
 		var source, numParams;
-		var vcIndex = 0, vcount = 3, maxOffset = 0;
+		var vcount, vcIndex = 0, maxOffset = 0;
 		var texture_sets = [];
 		var texture_sets = [];
 
 
 		for ( j = 0; j < inputs.length; j ++ ) {
 		for ( j = 0; j < inputs.length; j ++ ) {

+ 0 - 7
examples/js/loaders/NRRDLoader.js

@@ -367,13 +367,6 @@ THREE.NRRDLoader.prototype = {
 		} else {
 		} else {
 
 
 			var v = headerObject.vectors;
 			var v = headerObject.vectors;
-			var origin = headerObject.space_origin;
-
-			if ( ! origin ) {
-
-				origin = [ 0, 0, 0 ];
-
-			}
 
 
 			volume.matrix.set( _spaceX * v[ 0 ][ 0 ], _spaceX * v[ 1 ][ 0 ], _spaceX * v[ 2 ][ 0 ], 0,
 			volume.matrix.set( _spaceX * v[ 0 ][ 0 ], _spaceX * v[ 1 ][ 0 ], _spaceX * v[ 2 ][ 0 ], 0,
 			_spaceY * v[ 0 ][ 1 ], _spaceY * v[ 1 ][ 1 ], _spaceY * v[ 2 ][ 1 ], 0,
 			_spaceY * v[ 0 ][ 1 ], _spaceY * v[ 1 ][ 1 ], _spaceY * v[ 2 ][ 1 ], 0,

+ 17 - 17
examples/js/loaders/PVRLoader.js

@@ -1,4 +1,4 @@
-/*    
+/*
  *	 PVRLoader
  *	 PVRLoader
  *   Author: pierre lepers
  *   Author: pierre lepers
  *   Date: 17/09/2014 11:09
  *   Date: 17/09/2014 11:09
@@ -36,7 +36,7 @@ THREE.PVRLoader.parse = function ( buffer, loadMipmaps ) {
 
 
 		return THREE.PVRLoader._parseV3( pvrDatas );
 		return THREE.PVRLoader._parseV3( pvrDatas );
 
 
-	} 
+	}
 	// PVR v2
 	// PVR v2
 	else if ( header[ 11 ] === 0x21525650 ) {
 	else if ( header[ 11 ] === 0x21525650 ) {
 
 
@@ -51,10 +51,10 @@ THREE.PVRLoader.parse = function ( buffer, loadMipmaps ) {
 };
 };
 
 
 THREE.PVRLoader._parseV3 = function ( pvrDatas ) {
 THREE.PVRLoader._parseV3 = function ( pvrDatas ) {
-	
+
 	var header = pvrDatas.header;
 	var header = pvrDatas.header;
 	var bpp, format;
 	var bpp, format;
-	
+
 
 
 	var metaLen 	  = header[ 12 ],
 	var metaLen 	  = header[ 12 ],
 		pixelFormat   =  header[ 2 ],
 		pixelFormat   =  header[ 2 ],
@@ -109,7 +109,7 @@ THREE.PVRLoader._parseV2 = function ( pvrDatas ) {
 		numMipmaps    =  header[ 3 ],
 		numMipmaps    =  header[ 3 ],
 		flags         =  header[ 4 ],
 		flags         =  header[ 4 ],
 		dataLength    =  header[ 5 ],
 		dataLength    =  header[ 5 ],
-		bpp           =  header[ 6 ],
+		// bpp           =  header[ 6 ],
 		bitmaskRed    =  header[ 7 ],
 		bitmaskRed    =  header[ 7 ],
 		bitmaskGreen  =  header[ 8 ],
 		bitmaskGreen  =  header[ 8 ],
 		bitmaskBlue   =  header[ 9 ],
 		bitmaskBlue   =  header[ 9 ],
@@ -141,7 +141,7 @@ THREE.PVRLoader._parseV2 = function ( pvrDatas ) {
 
 
 	} else
 	} else
 		throw new Error( "pvrtc - unknown format " + formatFlags );
 		throw new Error( "pvrtc - unknown format " + formatFlags );
-	
+
 
 
 
 
 	pvrDatas.dataPtr 	 = headerLength;
 	pvrDatas.dataPtr 	 = headerLength;
@@ -162,14 +162,14 @@ THREE.PVRLoader._parseV2 = function ( pvrDatas ) {
 
 
 
 
 THREE.PVRLoader._extract = function ( pvrDatas ) {
 THREE.PVRLoader._extract = function ( pvrDatas ) {
-	
+
 	var pvr = {
 	var pvr = {
-		mipmaps: [], 
-		width: pvrDatas.width, 
-		height: pvrDatas.height, 
-		format: pvrDatas.format, 
-		mipmapCount: pvrDatas.numMipmaps, 
-		isCubemap : pvrDatas.isCubemap 
+		mipmaps: [],
+		width: pvrDatas.width,
+		height: pvrDatas.height,
+		format: pvrDatas.format,
+		mipmapCount: pvrDatas.numMipmaps,
+		isCubemap : pvrDatas.isCubemap
 	};
 	};
 
 
 	var buffer = pvrDatas.buffer;
 	var buffer = pvrDatas.buffer;
@@ -246,10 +246,10 @@ THREE.PVRLoader._extract = function ( pvrDatas ) {
 
 
 			var byteArray = new Uint8Array( buffer, dataOffset, dataSize );
 			var byteArray = new Uint8Array( buffer, dataOffset, dataSize );
 
 
-			var mipmap = { 
-				data: byteArray, 
-				width: sWidth, 
-				height: sHeight 
+			var mipmap = {
+				data: byteArray,
+				width: sWidth,
+				height: sHeight
 			};
 			};
 
 
 			pvr.mipmaps[ surfIndex * pvrDatas.numMipmaps + mipLevel ] = mipmap;
 			pvr.mipmaps[ surfIndex * pvrDatas.numMipmaps + mipLevel ] = mipmap;

+ 14 - 19
examples/js/loaders/VRMLLoader.js

@@ -114,22 +114,20 @@ THREE.VRMLLoader.prototype = {
 			 */
 			 */
 			var paintFaces = function ( geometry, radius, angles, colors, directionIsDown ) {
 			var paintFaces = function ( geometry, radius, angles, colors, directionIsDown ) {
 
 
-				var f, n, p, vertexIndex, color;
-
 				var direction = directionIsDown ? 1 : - 1;
 				var direction = directionIsDown ? 1 : - 1;
 
 
 				var faceIndices = [ 'a', 'b', 'c', 'd' ];
 				var faceIndices = [ 'a', 'b', 'c', 'd' ];
 
 
-				var coord = [ ], aColor, bColor, t = 1, A = {}, B = {}, applyColor = false, colorIndex;
+				var coord = [], A = {}, B = {}, applyColor = false;
 
 
 				for ( var k = 0; k < angles.length; k ++ ) {
 				for ( var k = 0; k < angles.length; k ++ ) {
 
 
-					var vec = { };
-
 					// push the vector at which the color changes
 					// push the vector at which the color changes
-					vec.y = direction * ( Math.cos( angles[ k ] ) * radius );
 
 
-					vec.x = direction * ( Math.sin( angles[ k ] ) * radius );
+					var vec = {
+						x: direction * ( Math.cos( angles[ k ] ) * radius ),
+						y: direction * ( Math.sin( angles[ k ] ) * radius )
+					};
 
 
 					coord.push( vec );
 					coord.push( vec );
 
 
@@ -138,15 +136,15 @@ THREE.VRMLLoader.prototype = {
 				// painting the colors on the faces
 				// painting the colors on the faces
 				for ( var i = 0; i < geometry.faces.length ; i ++ ) {
 				for ( var i = 0; i < geometry.faces.length ; i ++ ) {
 
 
-					f  = geometry.faces[ i ];
+					var f = geometry.faces[ i ];
 
 
-					n = ( f instanceof THREE.Face3 ) ? 3 : 4;
+					var n = ( f instanceof THREE.Face3 ) ? 3 : 4;
 
 
 					for ( var j = 0; j < n; j ++ ) {
 					for ( var j = 0; j < n; j ++ ) {
 
 
-						vertexIndex = f[ faceIndices[ j ] ];
+						var vertexIndex = f[ faceIndices[ j ] ];
 
 
-						p = geometry.vertices[ vertexIndex ];
+						var p = geometry.vertices[ vertexIndex ];
 
 
 						for ( var index = 0; index < colors.length; index ++ ) {
 						for ( var index = 0; index < colors.length; index ++ ) {
 
 
@@ -174,15 +172,14 @@ THREE.VRMLLoader.prototype = {
 
 
 								if ( applyColor ) {
 								if ( applyColor ) {
 
 
-									bColor = colors[ index + 1 ];
-
-									aColor = colors[ index ];
+									var aColor = colors[ index ];
+									var bColor = colors[ index + 1 ];
 
 
 									// below is simple linear interpolation
 									// below is simple linear interpolation
-									t = Math.abs( p.y - A.y ) / ( A.y - B.y );
+									var t = Math.abs( p.y - A.y ) / ( A.y - B.y );
 
 
 									// to make it faster, you can only calculate this if the y coord changes, the color is the same for points with the same y
 									// to make it faster, you can only calculate this if the y coord changes, the color is the same for points with the same y
-									color = interpolateColors( aColor, bColor, t );
+									var color = interpolateColors( aColor, bColor, t );
 
 
 									f.vertexColors[ j ] = color;
 									f.vertexColors[ j ] = color;
 
 
@@ -190,7 +187,7 @@ THREE.VRMLLoader.prototype = {
 
 
 							} else if ( undefined === f.vertexColors[ j ] ) {
 							} else if ( undefined === f.vertexColors[ j ] ) {
 
 
-								colorIndex = directionIsDown ? colors.length - 1 : 0;
+								var colorIndex = directionIsDown ? colors.length - 1 : 0;
 								f.vertexColors[ j ] = colors[ colorIndex ];
 								f.vertexColors[ j ] = colors[ colorIndex ];
 
 
 							}
 							}
@@ -1025,8 +1022,6 @@ THREE.VRMLLoader.prototype = {
 
 
 				for ( var i = 0, l = data.children.length; i < l; i ++ ) {
 				for ( var i = 0, l = data.children.length; i < l; i ++ ) {
 
 
-					var child = data.children[ i ];
-
 					parseNode( data.children[ i ], object );
 					parseNode( data.children[ i ], object );
 
 
 				}
 				}

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

@@ -20,11 +20,10 @@ THREE.Lut = function ( colormap, numberofcolors ) {
 				var min = this.map[ j ][ 0 ];
 				var min = this.map[ j ][ 0 ];
 				var max = this.map[ j + 1 ][ 0 ];
 				var max = this.map[ j + 1 ][ 0 ];
 
 
-				var color = new THREE.Color( 0xffffff );
 				var minColor = new THREE.Color( 0xffffff ).setHex( this.map[ j ][ 1 ] );
 				var minColor = new THREE.Color( 0xffffff ).setHex( this.map[ j ][ 1 ] );
 				var maxColor = new THREE.Color( 0xffffff ).setHex( this.map[ j + 1 ][ 1 ] );
 				var maxColor = new THREE.Color( 0xffffff ).setHex( this.map[ j + 1 ][ 1 ] );
 
 
-				color = minColor.lerp( maxColor, ( i - min ) / ( max - min ) );
+				var color = minColor.lerp( maxColor, ( i - min ) / ( max - min ) );
 
 
 				this.lut.push( color );
 				this.lut.push( color );
 
 
@@ -176,10 +175,11 @@ THREE.Lut.prototype = {
 
 
 					var min = this.map[ j - 1 ][ 0 ];
 					var min = this.map[ j - 1 ][ 0 ];
 					var max = this.map[ j ][ 0 ];
 					var max = this.map[ j ][ 0 ];
-					var color = new THREE.Color( 0xffffff );
+
 					var minColor = new THREE.Color( 0xffffff ).setHex( this.map[ j - 1 ][ 1 ] );
 					var minColor = new THREE.Color( 0xffffff ).setHex( this.map[ j - 1 ][ 1 ] );
 					var maxColor = new THREE.Color( 0xffffff ).setHex( this.map[ j ][ 1 ] );
 					var maxColor = new THREE.Color( 0xffffff ).setHex( this.map[ j ][ 1 ] );
-					color = minColor.lerp( maxColor, ( i - min ) / ( max - min ) );
+
+					var color = minColor.lerp( maxColor, ( i - min ) / ( max - min ) );
 
 
 					data[ k * 4 ] = Math.round( color.r * 255 );
 					data[ k * 4 ] = Math.round( color.r * 255 );
 					data[ k * 4 + 1 ] = Math.round( color.g * 255 );
 					data[ k * 4 + 1 ] = Math.round( color.g * 255 );

+ 0 - 5
examples/js/modifiers/BufferSubdivisionModifier.js

@@ -242,7 +242,6 @@ function compute_vertex_normals( geometry ) {
 
 
 	}
 	}
 
 
-	var tmpx, tmpy, tmpz;
 	var t_len;
 	var t_len;
 
 
 	for ( var i = 0, il = oldFaces.length; i < il; i++ ) {
 	for ( var i = 0, il = oldFaces.length; i < il; i++ ) {
@@ -268,10 +267,6 @@ function compute_vertex_normals( geometry ) {
 		full_weights[ 1 ] = ( my_weight / newNormalFaces.buffer[ oldFaces.register[ 0 ].b ] );
 		full_weights[ 1 ] = ( my_weight / newNormalFaces.buffer[ oldFaces.register[ 0 ].b ] );
 		full_weights[ 2 ] = ( my_weight / newNormalFaces.buffer[ oldFaces.register[ 0 ].c ] );
 		full_weights[ 2 ] = ( my_weight / newNormalFaces.buffer[ oldFaces.register[ 0 ].c ] );
 
 
-		tmpx = newNormals.register[ 3 ].x * full_weights[ 0 ];
-		tmpy = newNormals.register[ 3 ].y * full_weights[ 0 ];
-		tmpz = newNormals.register[ 3 ].z * full_weights[ 0 ];
-
 		newNormals.buffer[ ( oldFaces.register[ 0 ].a * 3 ) + 0 ] += newNormals.register[ 3 ].x * full_weights[ 0 ];
 		newNormals.buffer[ ( oldFaces.register[ 0 ].a * 3 ) + 0 ] += newNormals.register[ 3 ].x * full_weights[ 0 ];
 		newNormals.buffer[ ( oldFaces.register[ 0 ].a * 3 ) + 1 ] += newNormals.register[ 3 ].y * full_weights[ 0 ];
 		newNormals.buffer[ ( oldFaces.register[ 0 ].a * 3 ) + 1 ] += newNormals.register[ 3 ].y * full_weights[ 0 ];
 		newNormals.buffer[ ( oldFaces.register[ 0 ].a * 3 ) + 2 ] += newNormals.register[ 3 ].z * full_weights[ 0 ];
 		newNormals.buffer[ ( oldFaces.register[ 0 ].a * 3 ) + 2 ] += newNormals.register[ 3 ].z * full_weights[ 0 ];

+ 1 - 3
examples/js/renderers/RaytracingWorker.js

@@ -80,12 +80,10 @@ self.onmessage = function( e ) {
  * @author zz95 / http://github.com/zz85
  * @author zz95 / http://github.com/zz85
  */
  */
 
 
-THREE.RaytracingRendererWorker = function ( parameters ) {
+THREE.RaytracingRendererWorker = function () {
 
 
 	console.log( 'THREE.RaytracingRendererWorker', THREE.REVISION );
 	console.log( 'THREE.RaytracingRendererWorker', THREE.REVISION );
 
 
-	parameters = parameters || {};
-
 	var scope = this;
 	var scope = this;
 
 
 	var maxRecursionDepth = 3;
 	var maxRecursionDepth = 3;

+ 0 - 8
examples/webgl_gpgpu_protoplanet.html

@@ -312,8 +312,6 @@
 
 
 			}
 			}
 
 
-			var last = performance.now();
-
 			var gpuCompute;
 			var gpuCompute;
 			var velocityVariable;
 			var velocityVariable;
 			var positionVariable;
 			var positionVariable;
@@ -600,12 +598,6 @@
 
 
 			function render() {
 			function render() {
 
 
-				var now = performance.now();
-				var delta = (now - last) / 1000;
-
-				if (delta > 1) delta = 1; // safety cap on large deltas
-				last = now;
-
 				gpuCompute.compute();
 				gpuCompute.compute();
 
 
 				particleUniforms.texturePosition.value = gpuCompute.getCurrentRenderTarget( positionVariable ).texture;
 				particleUniforms.texturePosition.value = gpuCompute.getCurrentRenderTarget( positionVariable ).texture;

+ 1 - 3
examples/webgl_materials_nodes.html

@@ -577,8 +577,6 @@
 					var colorA = new THREE.ColorNode( 0xFFFFFF );
 					var colorA = new THREE.ColorNode( 0xFFFFFF );
 					var colorB = new THREE.ColorNode( 0x0054df );
 					var colorB = new THREE.ColorNode( 0x0054df );
 
 
-					var uv = new THREE.UVNode();
-
 					var timeScale = new THREE.OperatorNode(
 					var timeScale = new THREE.OperatorNode(
 						time,
 						time,
 						speed,
 						speed,
@@ -1901,7 +1899,7 @@
 
 
 					var setMyVar = new THREE.FunctionNode( [
 					var setMyVar = new THREE.FunctionNode( [
 					"float setMyVar( vec3 pos ) {",
 					"float setMyVar( vec3 pos ) {",
-					// set "myVar" in vertex shader in this example, 
+					// set "myVar" in vertex shader in this example,
 					// can be used in fragment shader too or in rest of the current shader
 					// can be used in fragment shader too or in rest of the current shader
 					"	myVar = pos;",
 					"	myVar = pos;",
 					// it is not accept "void" functions for now!
 					// it is not accept "void" functions for now!

+ 1 - 3
examples/webgl_materials_skin.html

@@ -109,9 +109,7 @@
 
 
 				// MATERIALS
 				// MATERIALS
 
 
-				var diffuse = 0xbbbbbb, specular = 0x070707, shininess = 50;
-
-				specular = 0x555555;
+				var diffuse = 0xbbbbbb, specular = 0x555555, shininess = 50;
 
 
 				var shader = THREE.ShaderSkin[ "skin" ];
 				var shader = THREE.ShaderSkin[ "skin" ];
 
 

+ 1 - 1
examples/webgl_postprocessing_dof2.html

@@ -496,7 +496,7 @@ Use WEBGL Depth buffer support?
 				}
 				}
 
 
 				for (var i=0;i<leaves;i++) {
 				for (var i=0;i<leaves;i++) {
-					plane = planes[i];
+					var plane = planes[i];
 					plane.rotation.x += plane.rotation.dx;
 					plane.rotation.x += plane.rotation.dx;
 					plane.rotation.y += plane.rotation.dy;
 					plane.rotation.y += plane.rotation.dy;
 					plane.rotation.z += plane.rotation.dz;
 					plane.rotation.z += plane.rotation.dz;

+ 2 - 2
examples/webgl_postprocessing_glitch.html

@@ -77,10 +77,10 @@
 				scene.add( object );
 				scene.add( object );
 
 
 				var geometry = new THREE.SphereGeometry( 1, 4, 4 );
 				var geometry = new THREE.SphereGeometry( 1, 4, 4 );
-				var material = new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading } );
 
 
 				for ( var i = 0; i < 100; i ++ ) {
 				for ( var i = 0; i < 100; i ++ ) {
-					material = new THREE.MeshPhongMaterial( { color: 0xffffff * Math.random(), shading: THREE.FlatShading } );
+
+					var material = new THREE.MeshPhongMaterial( { color: 0xffffff * Math.random(), shading: THREE.FlatShading } );
 
 
 					var mesh = new THREE.Mesh( geometry, material );
 					var mesh = new THREE.Mesh( geometry, material );
 					mesh.position.set( Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5 ).normalize();
 					mesh.position.set( Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5 ).normalize();

+ 1 - 4
src/geometries/ExtrudeGeometry.js

@@ -56,7 +56,6 @@ function ExtrudeBufferGeometry( shapes, options ) {
 
 
 	if ( typeof ( shapes ) === "undefined" ) {
 	if ( typeof ( shapes ) === "undefined" ) {
 
 
-		shapes = [];
 		return;
 		return;
 
 
 	}
 	}
@@ -211,8 +210,6 @@ ExtrudeBufferGeometry.prototype.addShape = function ( shape, options ) {
 
 
 		}
 		}
 
 
-		reverse = false; // If vertices are in order now, we shouldn't need to worry about them again (hopefully)!
-
 	}
 	}
 
 
 
 
@@ -256,7 +253,7 @@ ExtrudeBufferGeometry.prototype.addShape = function ( shape, options ) {
 		// inPt' is the intersection of the two lines parallel to the two
 		// inPt' is the intersection of the two lines parallel to the two
 		//  adjacent edges of inPt at a distance of 1 unit on the left side.
 		//  adjacent edges of inPt at a distance of 1 unit on the left side.
 
 
-		var v_trans_x, v_trans_y, shrink_by = 1; // resulting translation vector for inPt
+		var v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt
 
 
 		// good reading for geometry algorithms (here: line-line intersection)
 		// good reading for geometry algorithms (here: line-line intersection)
 		// http://geomalgorithms.com/a05-_intersect-1.html
 		// http://geomalgorithms.com/a05-_intersect-1.html