2
0
Эх сурвалжийг харах

Replace arraybuffer/text conversion to loading data as text in BVHLoader

Takahiro 8 жил өмнө
parent
commit
dc09c02ccd

+ 3 - 13
examples/js/loaders/BVHLoader.js

@@ -25,16 +25,15 @@ THREE.BVHLoader.prototype = {
 		var scope = this;
 		var scope = this;
 
 
 		var loader = new THREE.FileLoader( scope.manager );
 		var loader = new THREE.FileLoader( scope.manager );
-		loader.setResponseType( 'arraybuffer' );
-		loader.load( url, function( buffer ) {
+		loader.load( url, function( text ) {
 
 
-			onLoad( scope.parse( buffer ) );
+			onLoad( scope.parse( text ) );
 
 
 		}, onProgress, onError );
 		}, onProgress, onError );
 
 
 	},
 	},
 
 
-	parse: function ( buffer ) {
+	parse: function ( text ) {
 
 
 		/*
 		/*
 			reads a string array (lines) from a BVH file
 			reads a string array (lines) from a BVH file
@@ -376,15 +375,6 @@ THREE.BVHLoader.prototype = {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		// convert buffer to ASCII string
-		var text = "";
-		var raw = new Uint8Array( buffer );
-		for ( var i = 0; i < raw.length; ++ i ) {
-
-			text += String.fromCharCode( raw[ i ] );
-
-		}
-
 		var lines = text.split( /[\r\n]+/g );
 		var lines = text.split( /[\r\n]+/g );
 
 
 		var bones = readBvh( lines );
 		var bones = readBvh( lines );