Explorar el Código

JSONLoader: Added callbackProgress check as suggested in #3284.

Mr.doob hace 12 años
padre
commit
9f5c454ddd
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      src/loaders/JSONLoader.js

+ 6 - 2
src/loaders/JSONLoader.js

@@ -78,7 +78,11 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
 
 		} else if ( xhr.readyState === xhr.HEADERS_RECEIVED ) {
 
-			length = xhr.getResponseHeader( "Content-Length" );
+			if ( callbackProgress !== undefined ) {
+
+				length = xhr.getResponseHeader( "Content-Length" );
+
+			}
 
 		}
 
@@ -174,7 +178,7 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
 			type = faces[ offset ++ ];
 
 
-			isQuad          	= isBitSet( type, 0 );
+			isQuad              = isBitSet( type, 0 );
 			hasMaterial         = isBitSet( type, 1 );
 			hasFaceUv           = isBitSet( type, 2 );
 			hasFaceVertexUv     = isBitSet( type, 3 );