瀏覽代碼

JSONLoader: Added callbackProgress check as suggested in #3284.

Mr.doob 12 年之前
父節點
當前提交
9f5c454ddd
共有 1 個文件被更改,包括 6 次插入2 次删除
  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 );