Ver código fonte

Code clean up.

Mr.doob 11 anos atrás
pai
commit
db548187e7
2 arquivos alterados com 14 adições e 14 exclusões
  1. 8 8
      examples/js/loaders/ctm/CTMLoader.js
  2. 6 6
      src/core/BufferGeometry.js

+ 8 - 8
examples/js/loaders/ctm/CTMLoader.js

@@ -116,8 +116,8 @@ THREE.CTMLoader.prototype.load = function( url, callback, parameters ) {
 
 
 							var ctmFile = files[ i ];
 							var ctmFile = files[ i ];
 
 
-																		var e1 = Date.now();
-																		// console.log( "CTM data parse time [worker]: " + (e1-s) + " ms" );
+							var e1 = Date.now();
+							// console.log( "CTM data parse time [worker]: " + (e1-s) + " ms" );
 
 
 							if ( useBuffers ) {
 							if ( useBuffers ) {
 
 
@@ -129,8 +129,8 @@ THREE.CTMLoader.prototype.load = function( url, callback, parameters ) {
 
 
 							}
 							}
 
 
-																		var e = Date.now();
-																		console.log( "model load time [worker]: " + (e-e1) + " ms, total: " + (e-s));
+							var e = Date.now();
+							console.log( "model load time [worker]: " + (e-e1) + " ms, total: " + (e-s));
 
 
 						}
 						}
 
 
@@ -229,7 +229,7 @@ THREE.CTMLoader.prototype.createModelBuffers = function ( file, callback ) {
 		// attributes
 		// attributes
 		var attributes = scope.attributes;
 		var attributes = scope.attributes;
 
 
-		attributes[ "index" ]		 = { itemSize: 1, array: vertexIndexArray };
+		attributes[ "index" ]    = { itemSize: 1, array: vertexIndexArray };
 		attributes[ "position" ] = { itemSize: 3, array: vertexPositionArray };
 		attributes[ "position" ] = { itemSize: 3, array: vertexPositionArray };
 
 
 		if ( vertexNormalArray !== undefined ) 
 		if ( vertexNormalArray !== undefined ) 
@@ -432,15 +432,15 @@ THREE.CTMLoader.prototype.createModelClassic = function ( file, callback ) {
 
 
 	function f3n ( scope, normals, a, b, c, mi, nai, nbi, nci ) {
 	function f3n ( scope, normals, a, b, c, mi, nai, nbi, nci ) {
 
 
-		var nax = normals[ nai * 3		 ],
+		var nax = normals[ nai * 3     ],
 			nay = normals[ nai * 3 + 1 ],
 			nay = normals[ nai * 3 + 1 ],
 			naz = normals[ nai * 3 + 2 ],
 			naz = normals[ nai * 3 + 2 ],
 
 
-			nbx = normals[ nbi * 3		 ],
+			nbx = normals[ nbi * 3     ],
 			nby = normals[ nbi * 3 + 1 ],
 			nby = normals[ nbi * 3 + 1 ],
 			nbz = normals[ nbi * 3 + 2 ],
 			nbz = normals[ nbi * 3 + 2 ],
 
 
-			ncx = normals[ nci * 3		 ],
+			ncx = normals[ nci * 3     ],
 			ncy = normals[ nci * 3 + 1 ],
 			ncy = normals[ nci * 3 + 1 ],
 			ncz = normals[ nci * 3 + 2 ];
 			ncz = normals[ nci * 3 + 2 ];
 
 

+ 6 - 6
src/core/BufferGeometry.js

@@ -273,15 +273,15 @@ THREE.BufferGeometry.prototype = {
 						ab.subVectors( pA, pB );
 						ab.subVectors( pA, pB );
 						cb.cross( ab );
 						cb.cross( ab );
 
 
-						normals[ vA * 3 ]			+= cb.x;
+						normals[ vA * 3     ] += cb.x;
 						normals[ vA * 3 + 1 ] += cb.y;
 						normals[ vA * 3 + 1 ] += cb.y;
 						normals[ vA * 3 + 2 ] += cb.z;
 						normals[ vA * 3 + 2 ] += cb.z;
 
 
-						normals[ vB * 3 ]			+= cb.x;
+						normals[ vB * 3     ] += cb.x;
 						normals[ vB * 3 + 1 ] += cb.y;
 						normals[ vB * 3 + 1 ] += cb.y;
 						normals[ vB * 3 + 2 ] += cb.z;
 						normals[ vB * 3 + 2 ] += cb.z;
 
 
-						normals[ vC * 3 ]			+= cb.x;
+						normals[ vC * 3     ] += cb.x;
 						normals[ vC * 3 + 1 ] += cb.y;
 						normals[ vC * 3 + 1 ] += cb.y;
 						normals[ vC * 3 + 2 ] += cb.z;
 						normals[ vC * 3 + 2 ] += cb.z;
 
 
@@ -314,7 +314,7 @@ THREE.BufferGeometry.prototype = {
 					ab.subVectors( pA, pB );
 					ab.subVectors( pA, pB );
 					cb.cross( ab );
 					cb.cross( ab );
 
 
-					normals[ i ]	 = cb.x;
+					normals[ i     ] = cb.x;
 					normals[ i + 1 ] = cb.y;
 					normals[ i + 1 ] = cb.y;
 					normals[ i + 2 ] = cb.z;
 					normals[ i + 2 ] = cb.z;
 
 
@@ -352,7 +352,7 @@ THREE.BufferGeometry.prototype = {
 
 
 			n = 1.0 / Math.sqrt( x * x + y * y + z * z );
 			n = 1.0 / Math.sqrt( x * x + y * y + z * z );
 
 
-			normals[ i ]	 *= n;
+			normals[ i     ] *= n;
 			normals[ i + 1 ] *= n;
 			normals[ i + 1 ] *= n;
 			normals[ i + 2 ] *= n;
 			normals[ i + 2 ] *= n;
 
 
@@ -530,7 +530,7 @@ THREE.BufferGeometry.prototype = {
 			test = tmp2.dot( tan2[ v ] );
 			test = tmp2.dot( tan2[ v ] );
 			w = ( test < 0.0 ) ? -1.0 : 1.0;
 			w = ( test < 0.0 ) ? -1.0 : 1.0;
 
 
-			tangents[ v * 4 ]			= tmp.x;
+			tangents[ v * 4     ] = tmp.x;
 			tangents[ v * 4 + 1 ] = tmp.y;
 			tangents[ v * 4 + 1 ] = tmp.y;
 			tangents[ v * 4 + 2 ] = tmp.z;
 			tangents[ v * 4 + 2 ] = tmp.z;
 			tangents[ v * 4 + 3 ] = w;
 			tangents[ v * 4 + 3 ] = w;