소스 검색

FBXLoader: Clean up.

Mr.doob 9 년 전
부모
커밋
e8b91d4db4
1개의 변경된 파일9개의 추가작업 그리고 11개의 파일을 삭제
  1. 9 11
      examples/js/loaders/FBXLoader.js

+ 9 - 11
examples/js/loaders/FBXLoader.js

@@ -48,9 +48,7 @@
 			} else {
 
 				scope.textureBasePath = scope.extractUrlBase( url );
-				parser = new FBXParser();
-				var nodes = parser.parse( text );
-				onLoad( scope.parse( nodes ) );
+				onLoad( scope.parse( text ) );
 
 			}
 
@@ -108,10 +106,16 @@
 
 	};
 
-	THREE.FBXLoader.prototype.parse = function ( allNodes ) {
+	THREE.FBXLoader.prototype.parse = function ( text ) {
 
 		var scope = this;
 
+		console.time( 'FBXLoader' );
+
+		console.time( 'FBXLoader: TextParser' );
+		var allNodes = new FBXParser().parse( text );
+		console.timeEnd( 'FBXLoader: TextParser' );
+
 		console.time( 'FBXLoader: ObjectParser' );
 		scope.hierarchy = ( new Bones() ).parseHierarchy( allNodes );
 		scope.weights	= ( new Weights() ).parse( allNodes, scope.hierarchy );
@@ -147,7 +151,7 @@
 
 		}
 
-		console.timeEnd( 'FBXLoader: total' );
+		console.timeEnd( 'FBXLoader' );
 		return container;
 
 	};
@@ -742,16 +746,12 @@
 		// ----------parse ---------------------------------------------------
 		parse: function ( text ) {
 
-			console.time( 'FBXLoader: total' );
-
 			this.currentIndent = 0;
 			this.allNodes = new FBXNodes();
 			this.nodeStack = [];
 			this.currentProp = [];
 			this.currentPropName = '';
 
-			console.time( 'FBXLoader: TextParser' );
-
 			var split = text.split( "\n" );
 			for ( var line in split ) {
 
@@ -825,10 +825,8 @@
 
 			}
 
-			console.timeEnd( 'FBXLoader: TextParser' );
 			return this.allNodes;
 
-
 		},
 
 		parseNodeBegin: function ( line, nodeName, nodeAttrs ) {