|
@@ -286,6 +286,7 @@ class GLTFLoader extends Loader {
|
|
|
let json;
|
|
|
const extensions = {};
|
|
|
const plugins = {};
|
|
|
+ const textDecoder = new TextDecoder();
|
|
|
|
|
|
if ( typeof data === 'string' ) {
|
|
|
|
|
@@ -293,7 +294,7 @@ class GLTFLoader extends Loader {
|
|
|
|
|
|
} else if ( data instanceof ArrayBuffer ) {
|
|
|
|
|
|
- const magic = LoaderUtils.decodeText( new Uint8Array( data, 0, 4 ) );
|
|
|
+ const magic = textDecoder.decode( new Uint8Array( data, 0, 4 ) );
|
|
|
|
|
|
if ( magic === BINARY_EXTENSION_HEADER_MAGIC ) {
|
|
|
|
|
@@ -312,7 +313,7 @@ class GLTFLoader extends Loader {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- json = JSON.parse( LoaderUtils.decodeText( new Uint8Array( data ) ) );
|
|
|
+ json = JSON.parse( textDecoder.decode( data ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1566,9 +1567,10 @@ class GLTFBinaryExtension {
|
|
|
this.body = null;
|
|
|
|
|
|
const headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH );
|
|
|
+ const textDecoder = new TextDecoder();
|
|
|
|
|
|
this.header = {
|
|
|
- magic: LoaderUtils.decodeText( new Uint8Array( data.slice( 0, 4 ) ) ),
|
|
|
+ magic: textDecoder.decode( new Uint8Array( data.slice( 0, 4 ) ) ),
|
|
|
version: headerView.getUint32( 4, true ),
|
|
|
length: headerView.getUint32( 8, true )
|
|
|
};
|
|
@@ -1598,7 +1600,7 @@ class GLTFBinaryExtension {
|
|
|
if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON ) {
|
|
|
|
|
|
const contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength );
|
|
|
- this.content = LoaderUtils.decodeText( contentArray );
|
|
|
+ this.content = textDecoder.decode( contentArray );
|
|
|
|
|
|
} else if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN ) {
|
|
|
|