Browse Source

Code clean up.

Mr.doob 11 years ago
parent
commit
0b2c09169e
2 changed files with 18 additions and 6 deletions
  1. 18 5
      src/core/Face3.js
  2. 0 1
      src/core/Face4.js

+ 18 - 5
src/core/Face3.js

@@ -10,7 +10,7 @@ THREE.Face3 = function ( a, b, c, normal, color, materialIndex ) {
 	this.c = c;
 
 	this.normal = normal instanceof THREE.Vector3 ? normal : new THREE.Vector3();
-	this.vertexNormals = normal instanceof Array ? normal : [ ];
+	this.vertexNormals = normal instanceof Array ? normal : [];
 
 	this.color = color instanceof THREE.Color ? color : new THREE.Color();
 	this.vertexColors = color instanceof Array ? color : [];
@@ -34,10 +34,23 @@ THREE.Face3.prototype = {
 
 		face.materialIndex = this.materialIndex;
 
-		var i, il;
-		for ( i = 0, il = this.vertexNormals.length; i < il; i ++ ) face.vertexNormals[ i ] = this.vertexNormals[ i ].clone();
-		for ( i = 0, il = this.vertexColors.length; i < il; i ++ ) face.vertexColors[ i ] = this.vertexColors[ i ].clone();
-		for ( i = 0, il = this.vertexTangents.length; i < il; i ++ ) face.vertexTangents[ i ] = this.vertexTangents[ i ].clone();
+		for ( var i = 0, il = this.vertexNormals.length; i < il; i ++ ) {
+		
+			face.vertexNormals[ i ] = this.vertexNormals[ i ].clone();
+		
+		}
+
+		for ( var i = 0, il = this.vertexColors.length; i < il; i ++ ) {
+		
+			face.vertexColors[ i ] = this.vertexColors[ i ].clone();
+		
+		}
+
+		for ( var i = 0, il = this.vertexTangents.length; i < il; i ++ ) {
+		
+			face.vertexTangents[ i ] = this.vertexTangents[ i ].clone();
+		
+		}
 
 		return face;
 

+ 0 - 1
src/core/Face4.js

@@ -5,7 +5,6 @@
 THREE.Face4 = function ( a, b, c, d, normal, color, materialIndex ) {
 
 	console.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.')
-
 	return new THREE.Face3( a, b, c, normal, color, materialIndex );
 
 };