Browse Source

Decal: Remove Face4 code.

Mr.doob 11 years ago
parent
commit
74b100abc8
1 changed files with 3 additions and 18 deletions
  1. 3 18
      examples/js/THREE.DecalGeometry.js

+ 3 - 18
examples/js/THREE.DecalGeometry.js

@@ -182,26 +182,11 @@ THREE.DecalGeometry = function( mesh, position, rotation, dimensions, check ) {
 	    for( var i = 0; i < mesh.geometry.faces.length; i++ ) {
 	    for( var i = 0; i < mesh.geometry.faces.length; i++ ) {
 
 
 	        var f = mesh.geometry.faces[ i ];
 	        var f = mesh.geometry.faces[ i ];
-	        var n = ( f instanceof THREE.Face3 ) ? 3 : 4;
 	        var vertices = [];
 	        var vertices = [];
 
 
-	        if( n === 3 ) {
-
-	            this.pushVertex( vertices, f[ this.faceIndices[ 0 ] ], f.vertexNormals[ 0 ] );
-	            this.pushVertex( vertices, f[ this.faceIndices[ 1 ] ], f.vertexNormals[ 1 ] );
-	            this.pushVertex( vertices, f[ this.faceIndices[ 2 ] ], f.vertexNormals[ 2 ] );
-
-	        } else {
-
-	            this.pushVertex( vertices, f[ this.faceIndices[ 0 ] ], f.vertexNormals[ 0 ] );
-	            this.pushVertex( vertices, f[ this.faceIndices[ 1 ] ], f.vertexNormals[ 1 ] );
-	            this.pushVertex( vertices, f[ this.faceIndices[ 2 ] ], f.vertexNormals[ 2 ] );
-
-	            this.pushVertex( vertices, f[ this.faceIndices[ 3 ] ], f.vertexNormals[ 3 ] );
-	            this.pushVertex( vertices, f[ this.faceIndices[ 0 ] ], f.vertexNormals[ 0 ] );
-	            this.pushVertex( vertices, f[ this.faceIndices[ 2 ] ], f.vertexNormals[ 2 ] );
-
-	        }
+            this.pushVertex( vertices, f[ this.faceIndices[ 0 ] ], f.vertexNormals[ 0 ] );
+            this.pushVertex( vertices, f[ this.faceIndices[ 1 ] ], f.vertexNormals[ 1 ] );
+            this.pushVertex( vertices, f[ this.faceIndices[ 2 ] ], f.vertexNormals[ 2 ] );
 
 
 	        if( check.x ) {
 	        if( check.x ) {
 	        	vertices = this.clipFace( vertices, new THREE.Vector3( 1, 0, 0 ) );
 	        	vertices = this.clipFace( vertices, new THREE.Vector3( 1, 0, 0 ) );