Browse Source

It's not really a temp var, it's a new face.

Mr.doob 13 years ago
parent
commit
aa47bfcdf1
2 changed files with 18 additions and 18 deletions
  1. 9 9
      src/core/Face3.js
  2. 9 9
      src/core/Face4.js

+ 9 - 9
src/core/Face3.js

@@ -29,20 +29,20 @@ THREE.Face3.prototype = {
 
 	clone: function () {
 
-		var tmp = new THREE.Face3( this.a, this.b, this.c );
+		var face = new THREE.Face3( this.a, this.b, this.c );
 
-		tmp.normal.copy( this.normal );
-		tmp.color.copy( this.color );
-		tmp.centroid.copy( this.centroid );
+		face.normal.copy( this.normal );
+		face.color.copy( this.color );
+		face.centroid.copy( this.centroid );
 
-		tmp.materialIndex = this.materialIndex;
+		face.materialIndex = this.materialIndex;
 
 		var i, il;
-		for ( i = 0, il = this.vertexNormals.length; i < il; i ++ ) tmp.vertexNormals[ i ] = this.vertexNormals[ i ].clone();
-		for ( i = 0, il = this.vertexColors.length; i < il; i ++ ) tmp.vertexColors[ i ] = this.vertexColors[ i ].clone();
-		for ( i = 0, il = this.vertexTangents.length; i < il; i ++ ) tmp.vertexTangents[ i ] = this.vertexTangents[ i ].clone();
+		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();
 
-		return tmp;
+		return face;
 
 	}
 

+ 9 - 9
src/core/Face4.js

@@ -30,20 +30,20 @@ THREE.Face4.prototype = {
 
 	clone: function () {
 
-		var tmp = new THREE.Face4( this.a, this.b, this.c, this.d );
+		var face = new THREE.Face4( this.a, this.b, this.c, this.d );
 
-		tmp.normal.copy( this.normal );
-		tmp.color.copy( this.color );
-		tmp.centroid.copy( this.centroid );
+		face.normal.copy( this.normal );
+		face.color.copy( this.color );
+		face.centroid.copy( this.centroid );
 
-		tmp.materialIndex = this.materialIndex;
+		face.materialIndex = this.materialIndex;
 
 		var i, il;
-		for ( i = 0, il = this.vertexNormals.length; i < il; i ++ ) tmp.vertexNormals[ i ] = this.vertexNormals[ i ].clone();
-		for ( i = 0, il = this.vertexColors.length; i < il; i ++ ) tmp.vertexColors[ i ] = this.vertexColors[ i ].clone();
-		for ( i = 0, il = this.vertexTangents.length; i < il; i ++ ) tmp.vertexTangents[ i ] = this.vertexTangents[ i ].clone();
+		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();
 
-		return tmp;
+		return face;
 
 	}