Pārlūkot izejas kodu

Update Geometry.js

fixed a bug in mergeVertices, which removes wrong faces.
zexee 12 gadi atpakaļ
vecāks
revīzija
41b1a45a63
1 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 4 3
      src/core/Geometry.js

+ 4 - 3
src/core/Geometry.js

@@ -573,12 +573,13 @@ THREE.Geometry.prototype = {
 		}
 
 		for ( i = faceIndicesToRemove.length - 1; i >= 0; i -- ) {
-
-			this.faces.splice( i, 1 );
+			var idx = faceIndicesToRemove[ i ];
+			
+			this.faces.splice( idx, 1 );
 
 			for ( j = 0, jl = this.faceVertexUvs.length; j < jl; j ++ ) {
 
-				this.faceVertexUvs[ j ].splice( i, 1 );
+				this.faceVertexUvs[ j ].splice( idx, 1 );
 
 			}