Procházet zdrojové kódy

GLTFExporter: Clean up forceIndices

Takahiro před 8 roky
rodič
revize
b14f706e23
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  1. 2 3
      examples/js/exporters/GLTFExporter.js

+ 2 - 3
examples/js/exporters/GLTFExporter.js

@@ -1008,10 +1008,9 @@ THREE.GLTFExporter.prototype = {
 
 			if ( geometry.index === null && options.forceIndices ) {
 
-				var numFaces = geometry.attributes.position.count;
-				var indices = new Uint32Array( numFaces );
+				var indices = new Uint32Array( geometry.attributes.position.count );
 
-				for ( var i = 0; i < numFaces; i ++ ) {
+				for ( var i = 0, il = indices.length; i < il; i ++ ) {
 
 					indices[ i ] = i;
 

粤ICP备19079148号