提交 dc09c02c 编写于 作者: T Takahiro

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

上级 b1f7a8af
......@@ -25,16 +25,15 @@ THREE.BVHLoader.prototype = {
var scope = this;
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 );
},
parse: function ( buffer ) {
parse: function ( text ) {
/*
reads a string array (lines) from a BVH file
......@@ -376,15 +375,6 @@ THREE.BVHLoader.prototype = {
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 bones = readBvh( lines );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册