Skip to content

Commit 7a2a11d

Browse files
committed
Update gltf-pipeline code in advance
1 parent f7e143e commit 7a2a11d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Source/ThirdParty/GltfPipeline/parseGlb.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import addPipelineExtras from './addPipelineExtras.js'
22
import removeExtensionsUsed from './removeExtensionsUsed.js'
33
import defaultValue from '../../Core/defaultValue.js'
44
import defined from '../../Core/defined.js'
5+
import getJsonFromTypedArray from '../../Core/getJsonFromTypedArray.js'
56
import getMagic from '../../Core/getMagic.js'
6-
import getStringFromTypedArray from '../../Core/getStringFromTypedArray.js'
77
import RuntimeError from '../../Core/RuntimeError.js'
88

99
var sizeOfUint32 = 4;
@@ -60,8 +60,7 @@ import RuntimeError from '../../Core/RuntimeError.js'
6060
var jsonStart = 20;
6161
var binaryStart = jsonStart + contentLength;
6262

63-
var contentString = getStringFromTypedArray(glb, jsonStart, contentLength);
64-
var gltf = JSON.parse(contentString);
63+
var gltf = getJsonFromTypedArray(glb, jsonStart, contentLength);
6564
addPipelineExtras(gltf);
6665

6766
var binaryBuffer = glb.subarray(binaryStart, length);
@@ -93,8 +92,7 @@ import RuntimeError from '../../Core/RuntimeError.js'
9392
byteOffset += chunkLength;
9493
// Load JSON chunk
9594
if (chunkType === 0x4E4F534A) {
96-
var jsonString = getStringFromTypedArray(chunkBuffer);
97-
gltf = JSON.parse(jsonString);
95+
gltf = getJsonFromTypedArray(chunkBuffer);
9896
addPipelineExtras(gltf);
9997
}
10098
// Load Binary chunk

0 commit comments

Comments
 (0)