提交 beb9bf0e 编写于 作者: T Takahiro

Use TextDecoder for PCDLoader

上级 d681e0f0
...@@ -35,9 +35,16 @@ THREE.PCDLoader.prototype = { ...@@ -35,9 +35,16 @@ THREE.PCDLoader.prototype = {
binarryToStr: function ( data ) { binarryToStr: function ( data ) {
var text = "";
var charArray = new Uint8Array( data ); var charArray = new Uint8Array( data );
for ( var i = 0; i < data.byteLength; i ++ ) {
if ( window.TextDecoder !== undefined ) {
return new TextDecoder().decode( charArray );
}
var text = "";
for ( var i = 0, il = data.byteLength; i < il; i ++ ) {
text += String.fromCharCode( charArray[ i ] ); text += String.fromCharCode( charArray[ i ] );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册