@galacean/engine-loader 1.4.14 → 1.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +1023 -855
- package/dist/main.js.map +1 -1
- package/dist/module.js +1024 -856
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/gltf/GLTFUtils.d.ts +3 -3
- package/types/gltf/extensions/GLTFExtensionParser.d.ts +3 -3
- package/types/gltf/parser/GLTFAnimationParser.d.ts +3 -3
- package/types/gltf/parser/GLTFAnimatorControllerParser.d.ts +2 -2
- package/types/gltf/parser/GLTFBufferParser.d.ts +2 -1
- package/types/gltf/parser/GLTFBufferViewParser.d.ts +3 -2
- package/types/gltf/parser/GLTFMaterialParser.d.ts +2 -2
- package/types/gltf/parser/GLTFMeshParser.d.ts +4 -4
- package/types/gltf/parser/GLTFParser.d.ts +2 -2
- package/types/gltf/parser/GLTFParserContext.d.ts +10 -9
- package/types/gltf/parser/GLTFSceneParser.d.ts +2 -2
- package/types/gltf/parser/GLTFSkinParser.d.ts +2 -2
- package/types/gltf/parser/GLTFTextureParser.d.ts +3 -3
- package/types/gltf/parser/GLTFValidator.d.ts +2 -1
- package/types/ktx2/KTX2Loader.d.ts +1 -1
- package/types/resource-deserialize/index.d.ts +8 -8
- package/types/resource-deserialize/resources/animationClip/AnimationClipDecoder.d.ts +2 -2
- package/types/resource-deserialize/resources/mesh/MeshDecoder.d.ts +2 -3
- package/types/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +2 -2
- package/types/resource-deserialize/utils/Decorator.d.ts +2 -2
package/dist/main.js
CHANGED
|
@@ -289,11 +289,216 @@ var FileHeader = /*#__PURE__*/ function() {
|
|
|
289
289
|
return FileHeader;
|
|
290
290
|
}();
|
|
291
291
|
|
|
292
|
+
var InterpolableValueType = /*#__PURE__*/ function(InterpolableValueType) {
|
|
293
|
+
InterpolableValueType[InterpolableValueType["Float"] = 0] = "Float";
|
|
294
|
+
InterpolableValueType[InterpolableValueType["FloatArray"] = 1] = "FloatArray";
|
|
295
|
+
InterpolableValueType[InterpolableValueType["Vector2"] = 2] = "Vector2";
|
|
296
|
+
InterpolableValueType[InterpolableValueType["Vector3"] = 3] = "Vector3";
|
|
297
|
+
InterpolableValueType[InterpolableValueType["Vector4"] = 4] = "Vector4";
|
|
298
|
+
InterpolableValueType[InterpolableValueType["Quaternion"] = 5] = "Quaternion";
|
|
299
|
+
InterpolableValueType[InterpolableValueType["Color"] = 6] = "Color";
|
|
300
|
+
InterpolableValueType[InterpolableValueType["Array"] = 7] = "Array";
|
|
301
|
+
InterpolableValueType[InterpolableValueType["Boolean"] = 8] = "Boolean";
|
|
302
|
+
InterpolableValueType[InterpolableValueType["Rect"] = 9] = "Rect";
|
|
303
|
+
InterpolableValueType[InterpolableValueType["ReferResource"] = 10] = "ReferResource";
|
|
304
|
+
return InterpolableValueType;
|
|
305
|
+
}({});
|
|
306
|
+
exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
307
|
+
function AnimationClipDecoder() {}
|
|
308
|
+
AnimationClipDecoder.decode = function decode(engine, bufferReader) {
|
|
309
|
+
return new engineCore.AssetPromise(function(resolve) {
|
|
310
|
+
var name = bufferReader.nextStr();
|
|
311
|
+
var clip = new engineCore.AnimationClip(name);
|
|
312
|
+
var eventsLen = bufferReader.nextUint16();
|
|
313
|
+
for(var i = 0; i < eventsLen; ++i){
|
|
314
|
+
var event = new engineCore.AnimationEvent();
|
|
315
|
+
event.time = bufferReader.nextFloat32();
|
|
316
|
+
event.functionName = bufferReader.nextStr();
|
|
317
|
+
event.parameter = JSON.parse(bufferReader.nextStr()).val;
|
|
318
|
+
clip.addEvent(event);
|
|
319
|
+
}
|
|
320
|
+
var curveBindingsLen = bufferReader.nextUint16();
|
|
321
|
+
for(var i1 = 0; i1 < curveBindingsLen; ++i1){
|
|
322
|
+
var relativePath = bufferReader.nextStr();
|
|
323
|
+
var componentStr = bufferReader.nextStr();
|
|
324
|
+
var componentType = engineCore.Loader.getClass(componentStr);
|
|
325
|
+
var property = bufferReader.nextStr();
|
|
326
|
+
var getProperty = bufferReader.nextStr();
|
|
327
|
+
var curve = void 0;
|
|
328
|
+
var interpolation = bufferReader.nextUint8();
|
|
329
|
+
var keysLen = bufferReader.nextUint16();
|
|
330
|
+
var curveType = bufferReader.nextStr();
|
|
331
|
+
switch(curveType){
|
|
332
|
+
case "AnimationFloatCurve":
|
|
333
|
+
{
|
|
334
|
+
curve = new engineCore.AnimationFloatCurve();
|
|
335
|
+
curve.interpolation = interpolation;
|
|
336
|
+
for(var j = 0; j < keysLen; ++j){
|
|
337
|
+
var keyframe = new engineCore.Keyframe();
|
|
338
|
+
keyframe.time = bufferReader.nextFloat32();
|
|
339
|
+
keyframe.value = bufferReader.nextFloat32();
|
|
340
|
+
keyframe.inTangent = bufferReader.nextFloat32();
|
|
341
|
+
keyframe.outTangent = bufferReader.nextFloat32();
|
|
342
|
+
curve.addKey(keyframe);
|
|
343
|
+
}
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
case "AnimationArrayCurve":
|
|
347
|
+
{
|
|
348
|
+
curve = new engineCore.AnimationArrayCurve();
|
|
349
|
+
curve.interpolation = interpolation;
|
|
350
|
+
for(var j1 = 0; j1 < keysLen; ++j1){
|
|
351
|
+
var keyframe1 = new engineCore.Keyframe();
|
|
352
|
+
keyframe1.time = bufferReader.nextFloat32();
|
|
353
|
+
var len = bufferReader.nextUint16();
|
|
354
|
+
keyframe1.value = Array.from(bufferReader.nextFloat32Array(len));
|
|
355
|
+
keyframe1.inTangent = Array.from(bufferReader.nextFloat32Array(len));
|
|
356
|
+
keyframe1.outTangent = Array.from(bufferReader.nextFloat32Array(len));
|
|
357
|
+
curve.addKey(keyframe1);
|
|
358
|
+
}
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
case "AnimationFloatArrayCurve":
|
|
362
|
+
{
|
|
363
|
+
curve = new engineCore.AnimationFloatArrayCurve();
|
|
364
|
+
curve.interpolation = interpolation;
|
|
365
|
+
for(var j2 = 0; j2 < keysLen; ++j2){
|
|
366
|
+
var keyframe2 = new engineCore.Keyframe();
|
|
367
|
+
keyframe2.time = bufferReader.nextFloat32();
|
|
368
|
+
var len1 = bufferReader.nextUint16();
|
|
369
|
+
keyframe2.value = bufferReader.nextFloat32Array(len1);
|
|
370
|
+
keyframe2.inTangent = Array.from(bufferReader.nextFloat32Array(len1));
|
|
371
|
+
keyframe2.outTangent = Array.from(bufferReader.nextFloat32Array(len1));
|
|
372
|
+
curve.addKey(keyframe2);
|
|
373
|
+
}
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
case "AnimationVector2Curve":
|
|
377
|
+
{
|
|
378
|
+
curve = new engineCore.AnimationVector2Curve();
|
|
379
|
+
curve.interpolation = interpolation;
|
|
380
|
+
for(var j3 = 0; j3 < keysLen; ++j3){
|
|
381
|
+
var keyframe3 = new engineCore.Keyframe();
|
|
382
|
+
keyframe3.time = bufferReader.nextFloat32();
|
|
383
|
+
keyframe3.value = new engineMath.Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
384
|
+
keyframe3.inTangent = new engineMath.Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
385
|
+
keyframe3.outTangent = new engineMath.Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
386
|
+
curve.addKey(keyframe3);
|
|
387
|
+
}
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
case "AnimationVector3Curve":
|
|
391
|
+
{
|
|
392
|
+
curve = new engineCore.AnimationVector3Curve();
|
|
393
|
+
curve.interpolation = interpolation;
|
|
394
|
+
for(var j4 = 0; j4 < keysLen; ++j4){
|
|
395
|
+
var keyframe4 = new engineCore.Keyframe();
|
|
396
|
+
keyframe4.time = bufferReader.nextFloat32();
|
|
397
|
+
keyframe4.value = new engineMath.Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
398
|
+
keyframe4.inTangent = new engineMath.Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
399
|
+
keyframe4.outTangent = new engineMath.Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
400
|
+
curve.addKey(keyframe4);
|
|
401
|
+
}
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
case "AnimationVector4Curve":
|
|
405
|
+
{
|
|
406
|
+
curve = new engineCore.AnimationVector4Curve();
|
|
407
|
+
curve.interpolation = interpolation;
|
|
408
|
+
var keyframe5 = new engineCore.Keyframe();
|
|
409
|
+
keyframe5.time = bufferReader.nextFloat32();
|
|
410
|
+
keyframe5.value = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
411
|
+
keyframe5.inTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
412
|
+
keyframe5.outTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
413
|
+
curve.addKey(keyframe5);
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
case "AnimationColorCurve":
|
|
417
|
+
{
|
|
418
|
+
curve = new engineCore.AnimationColorCurve();
|
|
419
|
+
curve.interpolation = interpolation;
|
|
420
|
+
for(var j5 = 0; j5 < keysLen; ++j5){
|
|
421
|
+
var keyframe6 = new engineCore.Keyframe();
|
|
422
|
+
keyframe6.time = bufferReader.nextFloat32();
|
|
423
|
+
keyframe6.value = new engineMath.Color(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
424
|
+
keyframe6.inTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
425
|
+
keyframe6.outTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
426
|
+
curve.addKey(keyframe6);
|
|
427
|
+
}
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
case "AnimationQuaternionCurve":
|
|
431
|
+
{
|
|
432
|
+
curve = new engineCore.AnimationQuaternionCurve();
|
|
433
|
+
curve.interpolation = interpolation;
|
|
434
|
+
for(var j6 = 0; j6 < keysLen; ++j6){
|
|
435
|
+
var keyframe7 = new engineCore.Keyframe();
|
|
436
|
+
keyframe7.time = bufferReader.nextFloat32();
|
|
437
|
+
keyframe7.value = new engineMath.Quaternion(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
438
|
+
keyframe7.inTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
439
|
+
keyframe7.outTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
440
|
+
curve.addKey(keyframe7);
|
|
441
|
+
}
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
case "AnimationRefCurve":
|
|
445
|
+
{
|
|
446
|
+
curve = new engineCore.AnimationRefCurve();
|
|
447
|
+
curve.interpolation = interpolation;
|
|
448
|
+
for(var j7 = 0; j7 < keysLen; ++j7){
|
|
449
|
+
var keyframe8 = new engineCore.Keyframe();
|
|
450
|
+
keyframe8.time = bufferReader.nextFloat32();
|
|
451
|
+
var str = bufferReader.nextStr();
|
|
452
|
+
if (str) {
|
|
453
|
+
keyframe8.value = JSON.parse(str);
|
|
454
|
+
} else {
|
|
455
|
+
keyframe8.value = null;
|
|
456
|
+
}
|
|
457
|
+
curve.addKey(keyframe8);
|
|
458
|
+
}
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
case "AnimationBoolCurve":
|
|
462
|
+
{
|
|
463
|
+
curve = new engineCore.AnimationBoolCurve();
|
|
464
|
+
curve.interpolation = interpolation;
|
|
465
|
+
for(var j8 = 0; j8 < keysLen; ++j8){
|
|
466
|
+
var keyframe9 = new engineCore.Keyframe();
|
|
467
|
+
keyframe9.time = bufferReader.nextFloat32();
|
|
468
|
+
keyframe9.value = bufferReader.nextUint8() === 1;
|
|
469
|
+
curve.addKey(keyframe9);
|
|
470
|
+
}
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
case "AnimationStringCurve":
|
|
474
|
+
{
|
|
475
|
+
curve = new engineCore.AnimationStringCurve();
|
|
476
|
+
curve.interpolation = interpolation;
|
|
477
|
+
for(var j9 = 0; j9 < keysLen; ++j9){
|
|
478
|
+
var keyframe10 = new engineCore.Keyframe();
|
|
479
|
+
keyframe10.time = bufferReader.nextFloat32();
|
|
480
|
+
keyframe10.value = bufferReader.nextStr();
|
|
481
|
+
curve.addKey(keyframe10);
|
|
482
|
+
}
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
clip.addCurveBinding(relativePath, componentType, property, getProperty, curve);
|
|
487
|
+
}
|
|
488
|
+
resolve(clip);
|
|
489
|
+
});
|
|
490
|
+
};
|
|
491
|
+
return AnimationClipDecoder;
|
|
492
|
+
}();
|
|
493
|
+
exports.AnimationClipDecoder = __decorate([
|
|
494
|
+
decoder("AnimationClip")
|
|
495
|
+
], exports.AnimationClipDecoder);
|
|
496
|
+
|
|
292
497
|
exports.MeshDecoder = /*#__PURE__*/ function() {
|
|
293
498
|
function MeshDecoder() {}
|
|
294
|
-
MeshDecoder.decode = function decode(engine, bufferReader) {
|
|
295
|
-
return new
|
|
296
|
-
var modelMesh = new engineCore.ModelMesh(engine);
|
|
499
|
+
MeshDecoder.decode = function decode(engine, bufferReader, restoredMesh) {
|
|
500
|
+
return new engineCore.AssetPromise(function(resolve) {
|
|
501
|
+
var modelMesh = restoredMesh || new engineCore.ModelMesh(engine);
|
|
297
502
|
var jsonDataString = bufferReader.nextStr();
|
|
298
503
|
var encodedMeshData = JSON.parse(jsonDataString);
|
|
299
504
|
// @ts-ignore Vector3 is not compatible with {x: number, y: number, z: number}.
|
|
@@ -423,81 +628,6 @@ function float32ArrayToVector2(float32Array, vertexCount) {
|
|
|
423
628
|
return array;
|
|
424
629
|
}
|
|
425
630
|
|
|
426
|
-
exports.Texture2DDecoder = /*#__PURE__*/ function() {
|
|
427
|
-
function Texture2DDecoder() {}
|
|
428
|
-
Texture2DDecoder.decode = function decode(engine, bufferReader) {
|
|
429
|
-
return new Promise(function(resolve, reject) {
|
|
430
|
-
var objectId = bufferReader.nextStr();
|
|
431
|
-
var mipmap = !!bufferReader.nextUint8();
|
|
432
|
-
var filterMode = bufferReader.nextUint8();
|
|
433
|
-
var anisoLevel = bufferReader.nextUint8();
|
|
434
|
-
var wrapModeU = bufferReader.nextUint8();
|
|
435
|
-
var wrapModeV = bufferReader.nextUint8();
|
|
436
|
-
var format = bufferReader.nextUint8();
|
|
437
|
-
var width = bufferReader.nextUint16();
|
|
438
|
-
var height = bufferReader.nextUint16();
|
|
439
|
-
var isPixelBuffer = bufferReader.nextUint8();
|
|
440
|
-
var mipCount = bufferReader.nextUint8();
|
|
441
|
-
var imagesData = bufferReader.nextImagesData(mipCount);
|
|
442
|
-
var texture2D = new engineCore.Texture2D(engine, width, height, format, mipmap);
|
|
443
|
-
texture2D.filterMode = filterMode;
|
|
444
|
-
texture2D.anisoLevel = anisoLevel;
|
|
445
|
-
texture2D.wrapModeU = wrapModeU;
|
|
446
|
-
texture2D.wrapModeV = wrapModeV;
|
|
447
|
-
if (isPixelBuffer) {
|
|
448
|
-
var pixelBuffer = imagesData[0];
|
|
449
|
-
texture2D.setPixelBuffer(pixelBuffer);
|
|
450
|
-
if (mipmap) {
|
|
451
|
-
texture2D.generateMipmaps();
|
|
452
|
-
for(var i = 1; i < mipCount; i++){
|
|
453
|
-
var pixelBuffer1 = imagesData[i];
|
|
454
|
-
texture2D.setPixelBuffer(pixelBuffer1, i);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
// @ts-ignore
|
|
458
|
-
engine.resourceManager._objectPool[objectId] = texture2D;
|
|
459
|
-
resolve(texture2D);
|
|
460
|
-
} else {
|
|
461
|
-
var blob = new window.Blob([
|
|
462
|
-
imagesData[0]
|
|
463
|
-
]);
|
|
464
|
-
var img = new Image();
|
|
465
|
-
img.onload = function() {
|
|
466
|
-
texture2D.setImageSource(img);
|
|
467
|
-
var completedCount = 0;
|
|
468
|
-
var onComplete = function() {
|
|
469
|
-
completedCount++;
|
|
470
|
-
if (completedCount >= mipCount) {
|
|
471
|
-
resolve(texture2D);
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
onComplete();
|
|
475
|
-
if (mipmap) {
|
|
476
|
-
var _loop = function(i) {
|
|
477
|
-
var blob = new window.Blob([
|
|
478
|
-
imagesData[i]
|
|
479
|
-
]);
|
|
480
|
-
var img = new Image();
|
|
481
|
-
img.onload = function() {
|
|
482
|
-
texture2D.setImageSource(img, i);
|
|
483
|
-
onComplete();
|
|
484
|
-
};
|
|
485
|
-
img.src = URL.createObjectURL(blob);
|
|
486
|
-
};
|
|
487
|
-
texture2D.generateMipmaps();
|
|
488
|
-
for(var i = 1; i < mipCount; i++)_loop(i);
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
img.src = URL.createObjectURL(blob);
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
};
|
|
495
|
-
return Texture2DDecoder;
|
|
496
|
-
}();
|
|
497
|
-
exports.Texture2DDecoder = __decorate([
|
|
498
|
-
decoder("Texture2D")
|
|
499
|
-
], exports.Texture2DDecoder);
|
|
500
|
-
|
|
501
631
|
function _is_native_reflect_construct() {
|
|
502
632
|
// Since Reflect.construct can't be properly polyfilled, some
|
|
503
633
|
// implementations (e.g. core-js@2) don't set the correct internal slots.
|
|
@@ -675,334 +805,233 @@ var ReflectionParser = /*#__PURE__*/ function() {
|
|
|
675
805
|
};
|
|
676
806
|
_proto.parseBasicType = function parseBasicType(value, originValue) {
|
|
677
807
|
var _this = this;
|
|
678
|
-
if (Array.isArray(value)) {
|
|
679
|
-
return Promise.all(value.map(function(item) {
|
|
680
|
-
return _this.parseBasicType(item);
|
|
681
|
-
}));
|
|
682
|
-
} else if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value != null) {
|
|
683
|
-
if (ReflectionParser._isClassType(value)) {
|
|
684
|
-
return Promise.resolve(engineCore.Loader.getClass(value["classType"]));
|
|
685
|
-
} else if (ReflectionParser._isClass(value)) {
|
|
686
|
-
// class object
|
|
687
|
-
return this.parseClassObject(value);
|
|
688
|
-
} else if (ReflectionParser._isAssetRef(value)) {
|
|
689
|
-
var _this1 = this, context = _this1._context;
|
|
690
|
-
// reference object
|
|
691
|
-
// @ts-ignore
|
|
692
|
-
return context.resourceManager.getResourceByRef(value).then(function(resource) {
|
|
693
|
-
if (context.type === ParserType.Prefab) {
|
|
694
|
-
// @ts-ignore
|
|
695
|
-
context.resource._addDependenceAsset(resource);
|
|
696
|
-
}
|
|
697
|
-
return resource;
|
|
698
|
-
});
|
|
699
|
-
} else if (ReflectionParser._isComponentRef(value)) {
|
|
700
|
-
return this._context.getComponentByRef(value);
|
|
701
|
-
} else if (ReflectionParser._isEntityRef(value)) {
|
|
702
|
-
// entity reference
|
|
703
|
-
return Promise.resolve(this._context.entityMap.get(value.entityId));
|
|
704
|
-
} else if (originValue) {
|
|
705
|
-
var _this2, _loop = function(key) {
|
|
706
|
-
if (key === "methods") {
|
|
707
|
-
var methods = value[key];
|
|
708
|
-
for(var methodName in methods){
|
|
709
|
-
var methodParams = methods[methodName];
|
|
710
|
-
for(var i = 0, count = methodParams.length; i < count; i++){
|
|
711
|
-
var params = methodParams[i];
|
|
712
|
-
var promise = _this2.parseMethod(originValue, methodName, params);
|
|
713
|
-
promises.push(promise);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
} else {
|
|
717
|
-
promises.push(_this2.parseBasicType(value[key], originValue[key]).then(function(v) {
|
|
718
|
-
return originValue[key] = v;
|
|
719
|
-
}));
|
|
720
|
-
}
|
|
721
|
-
};
|
|
722
|
-
var promises = [];
|
|
723
|
-
for(var key in value)_this2 = this, _loop(key);
|
|
724
|
-
return Promise.all(promises).then(function() {
|
|
725
|
-
return originValue;
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
// primitive type
|
|
730
|
-
return Promise.resolve(value);
|
|
731
|
-
};
|
|
732
|
-
_proto._getEntityByConfig = function _getEntityByConfig(entityConfig) {
|
|
733
|
-
var _this = this;
|
|
734
|
-
// @ts-ignore
|
|
735
|
-
var assetRefId = entityConfig.assetRefId;
|
|
736
|
-
var engine = this._context.engine;
|
|
737
|
-
if (assetRefId) {
|
|
738
|
-
return engine.resourceManager// @ts-ignore
|
|
739
|
-
.getResourceByRef({
|
|
740
|
-
refId: assetRefId,
|
|
741
|
-
key: entityConfig.key,
|
|
742
|
-
isClone: entityConfig.isClone
|
|
743
|
-
}).then(function(entity) {
|
|
744
|
-
// @ts-ignore
|
|
745
|
-
var resource = engine.resourceManager._objectPool[assetRefId];
|
|
746
|
-
if (_this._context.type === ParserType.Prefab) {
|
|
747
|
-
// @ts-ignore
|
|
748
|
-
_this._context.resource._addDependenceAsset(resource);
|
|
749
|
-
}
|
|
750
|
-
entity.name = entityConfig.name;
|
|
751
|
-
return entity;
|
|
752
|
-
});
|
|
753
|
-
} else {
|
|
754
|
-
var transform = entityConfig.transform;
|
|
755
|
-
var entity = new engineCore.Entity(engine, entityConfig.name, transform ? engineCore.Loader.getClass(transform.class) : engineCore.Transform);
|
|
756
|
-
return Promise.resolve(entity);
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
ReflectionParser.registerCustomParseComponent = function registerCustomParseComponent(componentType, handle) {
|
|
760
|
-
this.customParseComponentHandles[componentType] = handle;
|
|
761
|
-
};
|
|
762
|
-
ReflectionParser._isClass = function _isClass(value) {
|
|
763
|
-
return value["class"] !== undefined;
|
|
764
|
-
};
|
|
765
|
-
ReflectionParser._isClassType = function _isClassType(value) {
|
|
766
|
-
return value["classType"] !== undefined;
|
|
767
|
-
};
|
|
768
|
-
ReflectionParser._isAssetRef = function _isAssetRef(value) {
|
|
769
|
-
return value["refId"] !== undefined;
|
|
770
|
-
};
|
|
771
|
-
ReflectionParser._isEntityRef = function _isEntityRef(value) {
|
|
772
|
-
return value["entityId"] !== undefined;
|
|
773
|
-
};
|
|
774
|
-
ReflectionParser._isComponentRef = function _isComponentRef(value) {
|
|
775
|
-
return value["ownerId"] !== undefined && value["componentId"] !== undefined;
|
|
776
|
-
};
|
|
777
|
-
ReflectionParser._isMethodObject = function _isMethodObject(value) {
|
|
778
|
-
return Array.isArray(value == null ? void 0 : value.params);
|
|
779
|
-
};
|
|
780
|
-
return ReflectionParser;
|
|
781
|
-
}();
|
|
782
|
-
ReflectionParser.customParseComponentHandles = new Map();
|
|
783
|
-
|
|
784
|
-
var InterpolableValueType = /*#__PURE__*/ function(InterpolableValueType) {
|
|
785
|
-
InterpolableValueType[InterpolableValueType["Float"] = 0] = "Float";
|
|
786
|
-
InterpolableValueType[InterpolableValueType["FloatArray"] = 1] = "FloatArray";
|
|
787
|
-
InterpolableValueType[InterpolableValueType["Vector2"] = 2] = "Vector2";
|
|
788
|
-
InterpolableValueType[InterpolableValueType["Vector3"] = 3] = "Vector3";
|
|
789
|
-
InterpolableValueType[InterpolableValueType["Vector4"] = 4] = "Vector4";
|
|
790
|
-
InterpolableValueType[InterpolableValueType["Quaternion"] = 5] = "Quaternion";
|
|
791
|
-
InterpolableValueType[InterpolableValueType["Color"] = 6] = "Color";
|
|
792
|
-
InterpolableValueType[InterpolableValueType["Array"] = 7] = "Array";
|
|
793
|
-
InterpolableValueType[InterpolableValueType["Boolean"] = 8] = "Boolean";
|
|
794
|
-
InterpolableValueType[InterpolableValueType["Rect"] = 9] = "Rect";
|
|
795
|
-
InterpolableValueType[InterpolableValueType["ReferResource"] = 10] = "ReferResource";
|
|
796
|
-
return InterpolableValueType;
|
|
797
|
-
}({});
|
|
798
|
-
exports.AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
799
|
-
function AnimationClipDecoder() {}
|
|
800
|
-
AnimationClipDecoder.decode = function decode(engine, bufferReader) {
|
|
801
|
-
return new Promise(function(resolve) {
|
|
802
|
-
var name = bufferReader.nextStr();
|
|
803
|
-
var clip = new engineCore.AnimationClip(name);
|
|
804
|
-
var eventsLen = bufferReader.nextUint16();
|
|
805
|
-
for(var i = 0; i < eventsLen; ++i){
|
|
806
|
-
var event = new engineCore.AnimationEvent();
|
|
807
|
-
event.time = bufferReader.nextFloat32();
|
|
808
|
-
event.functionName = bufferReader.nextStr();
|
|
809
|
-
event.parameter = JSON.parse(bufferReader.nextStr()).val;
|
|
810
|
-
clip.addEvent(event);
|
|
811
|
-
}
|
|
812
|
-
var curveBindingsLen = bufferReader.nextUint16();
|
|
813
|
-
for(var i1 = 0; i1 < curveBindingsLen; ++i1){
|
|
814
|
-
var relativePath = bufferReader.nextStr();
|
|
815
|
-
var componentStr = bufferReader.nextStr();
|
|
816
|
-
var componentType = engineCore.Loader.getClass(componentStr);
|
|
817
|
-
var property = bufferReader.nextStr();
|
|
818
|
-
var getProperty = bufferReader.nextStr();
|
|
819
|
-
var curve = void 0;
|
|
820
|
-
var interpolation = bufferReader.nextUint8();
|
|
821
|
-
var keysLen = bufferReader.nextUint16();
|
|
822
|
-
var curveType = bufferReader.nextStr();
|
|
823
|
-
switch(curveType){
|
|
824
|
-
case "AnimationFloatCurve":
|
|
825
|
-
{
|
|
826
|
-
curve = new engineCore.AnimationFloatCurve();
|
|
827
|
-
curve.interpolation = interpolation;
|
|
828
|
-
for(var j = 0; j < keysLen; ++j){
|
|
829
|
-
var keyframe = new engineCore.Keyframe();
|
|
830
|
-
keyframe.time = bufferReader.nextFloat32();
|
|
831
|
-
keyframe.value = bufferReader.nextFloat32();
|
|
832
|
-
keyframe.inTangent = bufferReader.nextFloat32();
|
|
833
|
-
keyframe.outTangent = bufferReader.nextFloat32();
|
|
834
|
-
curve.addKey(keyframe);
|
|
835
|
-
}
|
|
836
|
-
break;
|
|
837
|
-
}
|
|
838
|
-
case "AnimationArrayCurve":
|
|
839
|
-
{
|
|
840
|
-
curve = new engineCore.AnimationArrayCurve();
|
|
841
|
-
curve.interpolation = interpolation;
|
|
842
|
-
for(var j1 = 0; j1 < keysLen; ++j1){
|
|
843
|
-
var keyframe1 = new engineCore.Keyframe();
|
|
844
|
-
keyframe1.time = bufferReader.nextFloat32();
|
|
845
|
-
var len = bufferReader.nextUint16();
|
|
846
|
-
keyframe1.value = Array.from(bufferReader.nextFloat32Array(len));
|
|
847
|
-
keyframe1.inTangent = Array.from(bufferReader.nextFloat32Array(len));
|
|
848
|
-
keyframe1.outTangent = Array.from(bufferReader.nextFloat32Array(len));
|
|
849
|
-
curve.addKey(keyframe1);
|
|
850
|
-
}
|
|
851
|
-
break;
|
|
852
|
-
}
|
|
853
|
-
case "AnimationFloatArrayCurve":
|
|
854
|
-
{
|
|
855
|
-
curve = new engineCore.AnimationFloatArrayCurve();
|
|
856
|
-
curve.interpolation = interpolation;
|
|
857
|
-
for(var j2 = 0; j2 < keysLen; ++j2){
|
|
858
|
-
var keyframe2 = new engineCore.Keyframe();
|
|
859
|
-
keyframe2.time = bufferReader.nextFloat32();
|
|
860
|
-
var len1 = bufferReader.nextUint16();
|
|
861
|
-
keyframe2.value = bufferReader.nextFloat32Array(len1);
|
|
862
|
-
keyframe2.inTangent = Array.from(bufferReader.nextFloat32Array(len1));
|
|
863
|
-
keyframe2.outTangent = Array.from(bufferReader.nextFloat32Array(len1));
|
|
864
|
-
curve.addKey(keyframe2);
|
|
865
|
-
}
|
|
866
|
-
break;
|
|
867
|
-
}
|
|
868
|
-
case "AnimationVector2Curve":
|
|
869
|
-
{
|
|
870
|
-
curve = new engineCore.AnimationVector2Curve();
|
|
871
|
-
curve.interpolation = interpolation;
|
|
872
|
-
for(var j3 = 0; j3 < keysLen; ++j3){
|
|
873
|
-
var keyframe3 = new engineCore.Keyframe();
|
|
874
|
-
keyframe3.time = bufferReader.nextFloat32();
|
|
875
|
-
keyframe3.value = new engineMath.Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
876
|
-
keyframe3.inTangent = new engineMath.Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
877
|
-
keyframe3.outTangent = new engineMath.Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
878
|
-
curve.addKey(keyframe3);
|
|
879
|
-
}
|
|
880
|
-
break;
|
|
881
|
-
}
|
|
882
|
-
case "AnimationVector3Curve":
|
|
883
|
-
{
|
|
884
|
-
curve = new engineCore.AnimationVector3Curve();
|
|
885
|
-
curve.interpolation = interpolation;
|
|
886
|
-
for(var j4 = 0; j4 < keysLen; ++j4){
|
|
887
|
-
var keyframe4 = new engineCore.Keyframe();
|
|
888
|
-
keyframe4.time = bufferReader.nextFloat32();
|
|
889
|
-
keyframe4.value = new engineMath.Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
890
|
-
keyframe4.inTangent = new engineMath.Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
891
|
-
keyframe4.outTangent = new engineMath.Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
892
|
-
curve.addKey(keyframe4);
|
|
893
|
-
}
|
|
894
|
-
break;
|
|
895
|
-
}
|
|
896
|
-
case "AnimationVector4Curve":
|
|
897
|
-
{
|
|
898
|
-
curve = new engineCore.AnimationVector4Curve();
|
|
899
|
-
curve.interpolation = interpolation;
|
|
900
|
-
var keyframe5 = new engineCore.Keyframe();
|
|
901
|
-
keyframe5.time = bufferReader.nextFloat32();
|
|
902
|
-
keyframe5.value = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
903
|
-
keyframe5.inTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
904
|
-
keyframe5.outTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
905
|
-
curve.addKey(keyframe5);
|
|
906
|
-
break;
|
|
907
|
-
}
|
|
908
|
-
case "AnimationColorCurve":
|
|
909
|
-
{
|
|
910
|
-
curve = new engineCore.AnimationColorCurve();
|
|
911
|
-
curve.interpolation = interpolation;
|
|
912
|
-
for(var j5 = 0; j5 < keysLen; ++j5){
|
|
913
|
-
var keyframe6 = new engineCore.Keyframe();
|
|
914
|
-
keyframe6.time = bufferReader.nextFloat32();
|
|
915
|
-
keyframe6.value = new engineMath.Color(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
916
|
-
keyframe6.inTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
917
|
-
keyframe6.outTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
918
|
-
curve.addKey(keyframe6);
|
|
919
|
-
}
|
|
920
|
-
break;
|
|
921
|
-
}
|
|
922
|
-
case "AnimationQuaternionCurve":
|
|
923
|
-
{
|
|
924
|
-
curve = new engineCore.AnimationQuaternionCurve();
|
|
925
|
-
curve.interpolation = interpolation;
|
|
926
|
-
for(var j6 = 0; j6 < keysLen; ++j6){
|
|
927
|
-
var keyframe7 = new engineCore.Keyframe();
|
|
928
|
-
keyframe7.time = bufferReader.nextFloat32();
|
|
929
|
-
keyframe7.value = new engineMath.Quaternion(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
930
|
-
keyframe7.inTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
931
|
-
keyframe7.outTangent = new engineMath.Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
|
|
932
|
-
curve.addKey(keyframe7);
|
|
933
|
-
}
|
|
934
|
-
break;
|
|
935
|
-
}
|
|
936
|
-
case "AnimationRefCurve":
|
|
937
|
-
{
|
|
938
|
-
curve = new engineCore.AnimationRefCurve();
|
|
939
|
-
curve.interpolation = interpolation;
|
|
940
|
-
for(var j7 = 0; j7 < keysLen; ++j7){
|
|
941
|
-
var keyframe8 = new engineCore.Keyframe();
|
|
942
|
-
keyframe8.time = bufferReader.nextFloat32();
|
|
943
|
-
var str = bufferReader.nextStr();
|
|
944
|
-
if (str) {
|
|
945
|
-
keyframe8.value = JSON.parse(str);
|
|
946
|
-
} else {
|
|
947
|
-
keyframe8.value = null;
|
|
948
|
-
}
|
|
949
|
-
curve.addKey(keyframe8);
|
|
950
|
-
}
|
|
951
|
-
break;
|
|
952
|
-
}
|
|
953
|
-
case "AnimationBoolCurve":
|
|
954
|
-
{
|
|
955
|
-
curve = new engineCore.AnimationBoolCurve();
|
|
956
|
-
curve.interpolation = interpolation;
|
|
957
|
-
for(var j8 = 0; j8 < keysLen; ++j8){
|
|
958
|
-
var keyframe9 = new engineCore.Keyframe();
|
|
959
|
-
keyframe9.time = bufferReader.nextFloat32();
|
|
960
|
-
keyframe9.value = bufferReader.nextUint8() === 1;
|
|
961
|
-
curve.addKey(keyframe9);
|
|
962
|
-
}
|
|
963
|
-
break;
|
|
964
|
-
}
|
|
965
|
-
case "AnimationStringCurve":
|
|
966
|
-
{
|
|
967
|
-
curve = new engineCore.AnimationStringCurve();
|
|
968
|
-
curve.interpolation = interpolation;
|
|
969
|
-
for(var j9 = 0; j9 < keysLen; ++j9){
|
|
970
|
-
var keyframe10 = new engineCore.Keyframe();
|
|
971
|
-
keyframe10.time = bufferReader.nextFloat32();
|
|
972
|
-
keyframe10.value = bufferReader.nextStr();
|
|
973
|
-
curve.addKey(keyframe10);
|
|
808
|
+
if (Array.isArray(value)) {
|
|
809
|
+
return Promise.all(value.map(function(item) {
|
|
810
|
+
return _this.parseBasicType(item);
|
|
811
|
+
}));
|
|
812
|
+
} else if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value != null) {
|
|
813
|
+
if (ReflectionParser._isClassType(value)) {
|
|
814
|
+
return Promise.resolve(engineCore.Loader.getClass(value["classType"]));
|
|
815
|
+
} else if (ReflectionParser._isClass(value)) {
|
|
816
|
+
// class object
|
|
817
|
+
return this.parseClassObject(value);
|
|
818
|
+
} else if (ReflectionParser._isAssetRef(value)) {
|
|
819
|
+
var _this1 = this, context = _this1._context;
|
|
820
|
+
// reference object
|
|
821
|
+
// @ts-ignore
|
|
822
|
+
return context.resourceManager.getResourceByRef(value).then(function(resource) {
|
|
823
|
+
if (context.type === ParserType.Prefab) {
|
|
824
|
+
// @ts-ignore
|
|
825
|
+
context.resource._addDependenceAsset(resource);
|
|
826
|
+
}
|
|
827
|
+
return resource;
|
|
828
|
+
});
|
|
829
|
+
} else if (ReflectionParser._isComponentRef(value)) {
|
|
830
|
+
return this._context.getComponentByRef(value);
|
|
831
|
+
} else if (ReflectionParser._isEntityRef(value)) {
|
|
832
|
+
// entity reference
|
|
833
|
+
return Promise.resolve(this._context.entityMap.get(value.entityId));
|
|
834
|
+
} else if (originValue) {
|
|
835
|
+
var _this2, _loop = function(key) {
|
|
836
|
+
if (key === "methods") {
|
|
837
|
+
var methods = value[key];
|
|
838
|
+
for(var methodName in methods){
|
|
839
|
+
var methodParams = methods[methodName];
|
|
840
|
+
for(var i = 0, count = methodParams.length; i < count; i++){
|
|
841
|
+
var params = methodParams[i];
|
|
842
|
+
var promise = _this2.parseMethod(originValue, methodName, params);
|
|
843
|
+
promises.push(promise);
|
|
974
844
|
}
|
|
975
|
-
break;
|
|
976
845
|
}
|
|
846
|
+
} else {
|
|
847
|
+
promises.push(_this2.parseBasicType(value[key], originValue[key]).then(function(v) {
|
|
848
|
+
return originValue[key] = v;
|
|
849
|
+
}));
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
var promises = [];
|
|
853
|
+
for(var key in value)_this2 = this, _loop(key);
|
|
854
|
+
return Promise.all(promises).then(function() {
|
|
855
|
+
return originValue;
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
// primitive type
|
|
860
|
+
return Promise.resolve(value);
|
|
861
|
+
};
|
|
862
|
+
_proto._getEntityByConfig = function _getEntityByConfig(entityConfig) {
|
|
863
|
+
var _this = this;
|
|
864
|
+
// @ts-ignore
|
|
865
|
+
var assetRefId = entityConfig.assetRefId;
|
|
866
|
+
var engine = this._context.engine;
|
|
867
|
+
if (assetRefId) {
|
|
868
|
+
return engine.resourceManager// @ts-ignore
|
|
869
|
+
.getResourceByRef({
|
|
870
|
+
refId: assetRefId,
|
|
871
|
+
key: entityConfig.key,
|
|
872
|
+
isClone: entityConfig.isClone
|
|
873
|
+
}).then(function(entity) {
|
|
874
|
+
// @ts-ignore
|
|
875
|
+
var resource = engine.resourceManager._objectPool[assetRefId];
|
|
876
|
+
if (_this._context.type === ParserType.Prefab) {
|
|
877
|
+
// @ts-ignore
|
|
878
|
+
_this._context.resource._addDependenceAsset(resource);
|
|
977
879
|
}
|
|
978
|
-
|
|
880
|
+
entity.name = entityConfig.name;
|
|
881
|
+
return entity;
|
|
882
|
+
});
|
|
883
|
+
} else {
|
|
884
|
+
var transform = entityConfig.transform;
|
|
885
|
+
var entity = new engineCore.Entity(engine, entityConfig.name, transform ? engineCore.Loader.getClass(transform.class) : engineCore.Transform);
|
|
886
|
+
return Promise.resolve(entity);
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
ReflectionParser.registerCustomParseComponent = function registerCustomParseComponent(componentType, handle) {
|
|
890
|
+
this.customParseComponentHandles[componentType] = handle;
|
|
891
|
+
};
|
|
892
|
+
ReflectionParser._isClass = function _isClass(value) {
|
|
893
|
+
return value["class"] !== undefined;
|
|
894
|
+
};
|
|
895
|
+
ReflectionParser._isClassType = function _isClassType(value) {
|
|
896
|
+
return value["classType"] !== undefined;
|
|
897
|
+
};
|
|
898
|
+
ReflectionParser._isAssetRef = function _isAssetRef(value) {
|
|
899
|
+
return value["refId"] !== undefined;
|
|
900
|
+
};
|
|
901
|
+
ReflectionParser._isEntityRef = function _isEntityRef(value) {
|
|
902
|
+
return value["entityId"] !== undefined;
|
|
903
|
+
};
|
|
904
|
+
ReflectionParser._isComponentRef = function _isComponentRef(value) {
|
|
905
|
+
return value["ownerId"] !== undefined && value["componentId"] !== undefined;
|
|
906
|
+
};
|
|
907
|
+
ReflectionParser._isMethodObject = function _isMethodObject(value) {
|
|
908
|
+
return Array.isArray(value == null ? void 0 : value.params);
|
|
909
|
+
};
|
|
910
|
+
return ReflectionParser;
|
|
911
|
+
}();
|
|
912
|
+
ReflectionParser.customParseComponentHandles = new Map();
|
|
913
|
+
|
|
914
|
+
exports.Texture2DDecoder = /*#__PURE__*/ function() {
|
|
915
|
+
function Texture2DDecoder() {}
|
|
916
|
+
Texture2DDecoder.decode = function decode(engine, bufferReader, restoredTexture) {
|
|
917
|
+
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
918
|
+
var objectId = bufferReader.nextStr();
|
|
919
|
+
var mipmap = !!bufferReader.nextUint8();
|
|
920
|
+
var filterMode = bufferReader.nextUint8();
|
|
921
|
+
var anisoLevel = bufferReader.nextUint8();
|
|
922
|
+
var wrapModeU = bufferReader.nextUint8();
|
|
923
|
+
var wrapModeV = bufferReader.nextUint8();
|
|
924
|
+
var format = bufferReader.nextUint8();
|
|
925
|
+
var width = bufferReader.nextUint16();
|
|
926
|
+
var height = bufferReader.nextUint16();
|
|
927
|
+
var isPixelBuffer = bufferReader.nextUint8();
|
|
928
|
+
var mipCount = bufferReader.nextUint8();
|
|
929
|
+
var imagesData = bufferReader.nextImagesData(mipCount);
|
|
930
|
+
var texture2D = restoredTexture || new engineCore.Texture2D(engine, width, height, format, mipmap);
|
|
931
|
+
texture2D.filterMode = filterMode;
|
|
932
|
+
texture2D.anisoLevel = anisoLevel;
|
|
933
|
+
texture2D.wrapModeU = wrapModeU;
|
|
934
|
+
texture2D.wrapModeV = wrapModeV;
|
|
935
|
+
if (isPixelBuffer) {
|
|
936
|
+
var pixelBuffer = imagesData[0];
|
|
937
|
+
texture2D.setPixelBuffer(pixelBuffer);
|
|
938
|
+
if (mipmap) {
|
|
939
|
+
texture2D.generateMipmaps();
|
|
940
|
+
for(var i = 1; i < mipCount; i++){
|
|
941
|
+
var pixelBuffer1 = imagesData[i];
|
|
942
|
+
texture2D.setPixelBuffer(pixelBuffer1, i);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
// @ts-ignore
|
|
946
|
+
engine.resourceManager._objectPool[objectId] = texture2D;
|
|
947
|
+
resolve(texture2D);
|
|
948
|
+
} else {
|
|
949
|
+
var blob = new window.Blob([
|
|
950
|
+
imagesData[0]
|
|
951
|
+
]);
|
|
952
|
+
var img = new Image();
|
|
953
|
+
img.onload = function() {
|
|
954
|
+
texture2D.setImageSource(img);
|
|
955
|
+
var completedCount = 0;
|
|
956
|
+
var onComplete = function() {
|
|
957
|
+
completedCount++;
|
|
958
|
+
if (completedCount >= mipCount) {
|
|
959
|
+
resolve(texture2D);
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
onComplete();
|
|
963
|
+
if (mipmap) {
|
|
964
|
+
var _loop = function(i) {
|
|
965
|
+
var blob = new window.Blob([
|
|
966
|
+
imagesData[i]
|
|
967
|
+
]);
|
|
968
|
+
var img = new Image();
|
|
969
|
+
img.onload = function() {
|
|
970
|
+
texture2D.setImageSource(img, i);
|
|
971
|
+
onComplete();
|
|
972
|
+
};
|
|
973
|
+
img.src = URL.createObjectURL(blob);
|
|
974
|
+
};
|
|
975
|
+
texture2D.generateMipmaps();
|
|
976
|
+
for(var i = 1; i < mipCount; i++)_loop(i);
|
|
977
|
+
}
|
|
978
|
+
};
|
|
979
|
+
img.src = URL.createObjectURL(blob);
|
|
979
980
|
}
|
|
980
|
-
resolve(clip);
|
|
981
981
|
});
|
|
982
982
|
};
|
|
983
|
-
return
|
|
983
|
+
return Texture2DDecoder;
|
|
984
984
|
}();
|
|
985
|
-
exports.
|
|
986
|
-
decoder("
|
|
987
|
-
], exports.
|
|
988
|
-
|
|
989
|
-
var MaterialLoaderType = /*#__PURE__*/ function(MaterialLoaderType) {
|
|
990
|
-
MaterialLoaderType["Vector2"] = "Vector2";
|
|
991
|
-
MaterialLoaderType["Vector3"] = "Vector3";
|
|
992
|
-
MaterialLoaderType["Vector4"] = "Vector4";
|
|
993
|
-
MaterialLoaderType["Color"] = "Color";
|
|
994
|
-
MaterialLoaderType["Float"] = "Float";
|
|
995
|
-
MaterialLoaderType["Texture"] = "Texture";
|
|
996
|
-
MaterialLoaderType["Boolean"] = "Boolean";
|
|
997
|
-
MaterialLoaderType["Integer"] = "Integer";
|
|
998
|
-
return MaterialLoaderType;
|
|
999
|
-
}({});
|
|
985
|
+
exports.Texture2DDecoder = __decorate([
|
|
986
|
+
decoder("Texture2D")
|
|
987
|
+
], exports.Texture2DDecoder);
|
|
1000
988
|
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
}
|
|
989
|
+
exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
|
|
990
|
+
_inherits(EditorTextureLoader, Loader);
|
|
991
|
+
function EditorTextureLoader() {
|
|
992
|
+
return Loader.apply(this, arguments) || this;
|
|
993
|
+
}
|
|
994
|
+
var _proto = EditorTextureLoader.prototype;
|
|
995
|
+
_proto.load = function load(item, resourceManager) {
|
|
996
|
+
var requestConfig = _extends({}, item, {
|
|
997
|
+
type: "arraybuffer"
|
|
998
|
+
});
|
|
999
|
+
var url = item.url;
|
|
1000
|
+
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
1001
|
+
resourceManager// @ts-ignore
|
|
1002
|
+
._request(url, requestConfig).then(function(data) {
|
|
1003
|
+
decode(data, resourceManager.engine).then(function(texture) {
|
|
1004
|
+
resourceManager.addContentRestorer(new EditorTexture2DContentRestorer(texture, url, requestConfig));
|
|
1005
|
+
resolve(texture);
|
|
1006
|
+
});
|
|
1007
|
+
}).catch(reject);
|
|
1008
|
+
});
|
|
1009
|
+
};
|
|
1010
|
+
return EditorTextureLoader;
|
|
1011
|
+
}(engineCore.Loader);
|
|
1012
|
+
exports.EditorTextureLoader = __decorate([
|
|
1013
|
+
engineCore.resourceLoader("EditorTexture2D", [
|
|
1014
|
+
"prefab"
|
|
1015
|
+
], true)
|
|
1016
|
+
], exports.EditorTextureLoader);
|
|
1017
|
+
var EditorTexture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
|
|
1018
|
+
_inherits(EditorTexture2DContentRestorer, ContentRestorer);
|
|
1019
|
+
function EditorTexture2DContentRestorer(resource, url, requestConfig) {
|
|
1020
|
+
var _this;
|
|
1021
|
+
_this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
|
|
1022
|
+
return _this;
|
|
1023
|
+
}
|
|
1024
|
+
var _proto = EditorTexture2DContentRestorer.prototype;
|
|
1025
|
+
_proto.restoreContent = function restoreContent() {
|
|
1026
|
+
var texture = this.resource;
|
|
1027
|
+
var engine = texture.engine;
|
|
1028
|
+
return engine.resourceManager// @ts-ignore
|
|
1029
|
+
._request(this.url, this.requestConfig).then(function(data) {
|
|
1030
|
+
return decode(data, engine, texture);
|
|
1031
|
+
});
|
|
1032
|
+
};
|
|
1033
|
+
return EditorTexture2DContentRestorer;
|
|
1034
|
+
}(engineCore.ContentRestorer);
|
|
1006
1035
|
|
|
1007
1036
|
function _instanceof(left, right) {
|
|
1008
1037
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
@@ -1406,42 +1435,34 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
1406
1435
|
* @param sceneData - scene data which is exported by editor
|
|
1407
1436
|
* @returns a promise of scene
|
|
1408
1437
|
*/ SceneParser.parse = function parse(engine, sceneData) {
|
|
1409
|
-
var scene = new engineCore.Scene(engine);
|
|
1410
|
-
var context = new ParserContext(engine, ParserType.Scene, scene);
|
|
1411
|
-
var parser = new SceneParser(sceneData, context, scene);
|
|
1412
|
-
parser.start();
|
|
1413
|
-
return parser.promise.then(function() {
|
|
1414
|
-
return scene;
|
|
1415
|
-
});
|
|
1416
|
-
};
|
|
1417
|
-
return SceneParser;
|
|
1418
|
-
}(HierarchyParser);
|
|
1419
|
-
|
|
1420
|
-
exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
|
|
1421
|
-
_inherits(EditorTextureLoader, Loader);
|
|
1422
|
-
function EditorTextureLoader() {
|
|
1423
|
-
return Loader.apply(this, arguments) || this;
|
|
1424
|
-
}
|
|
1425
|
-
var _proto = EditorTextureLoader.prototype;
|
|
1426
|
-
_proto.load = function load(item, resourceManager) {
|
|
1427
|
-
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
1428
|
-
resourceManager// @ts-ignore
|
|
1429
|
-
._request(item.url, _extends({}, item, {
|
|
1430
|
-
type: "arraybuffer"
|
|
1431
|
-
})).then(function(data) {
|
|
1432
|
-
decode(data, resourceManager.engine).then(function(texture) {
|
|
1433
|
-
resolve(texture);
|
|
1434
|
-
});
|
|
1435
|
-
}).catch(reject);
|
|
1438
|
+
var scene = new engineCore.Scene(engine);
|
|
1439
|
+
var context = new ParserContext(engine, ParserType.Scene, scene);
|
|
1440
|
+
var parser = new SceneParser(sceneData, context, scene);
|
|
1441
|
+
parser.start();
|
|
1442
|
+
return parser.promise.then(function() {
|
|
1443
|
+
return scene;
|
|
1436
1444
|
});
|
|
1437
1445
|
};
|
|
1438
|
-
return
|
|
1439
|
-
}(
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
]
|
|
1444
|
-
]
|
|
1446
|
+
return SceneParser;
|
|
1447
|
+
}(HierarchyParser);
|
|
1448
|
+
|
|
1449
|
+
var MaterialLoaderType = /*#__PURE__*/ function(MaterialLoaderType) {
|
|
1450
|
+
MaterialLoaderType["Vector2"] = "Vector2";
|
|
1451
|
+
MaterialLoaderType["Vector3"] = "Vector3";
|
|
1452
|
+
MaterialLoaderType["Vector4"] = "Vector4";
|
|
1453
|
+
MaterialLoaderType["Color"] = "Color";
|
|
1454
|
+
MaterialLoaderType["Float"] = "Float";
|
|
1455
|
+
MaterialLoaderType["Texture"] = "Texture";
|
|
1456
|
+
MaterialLoaderType["Boolean"] = "Boolean";
|
|
1457
|
+
MaterialLoaderType["Integer"] = "Integer";
|
|
1458
|
+
return MaterialLoaderType;
|
|
1459
|
+
}({});
|
|
1460
|
+
|
|
1461
|
+
var SpecularMode = /*#__PURE__*/ function(SpecularMode) {
|
|
1462
|
+
SpecularMode["Sky"] = "Sky";
|
|
1463
|
+
SpecularMode["Custom"] = "Custom";
|
|
1464
|
+
return SpecularMode;
|
|
1465
|
+
}({});
|
|
1445
1466
|
|
|
1446
1467
|
/**
|
|
1447
1468
|
* Decode engine binary resource.
|
|
@@ -1449,9 +1470,16 @@ exports.EditorTextureLoader = __decorate([
|
|
|
1449
1470
|
* @param engine - engine
|
|
1450
1471
|
* @returns
|
|
1451
1472
|
*/ function decode(arrayBuffer, engine) {
|
|
1473
|
+
for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
1474
|
+
args[_key - 2] = arguments[_key];
|
|
1475
|
+
}
|
|
1476
|
+
var _decoderMap_header_type;
|
|
1452
1477
|
var header = FileHeader.decode(arrayBuffer);
|
|
1453
1478
|
var bufferReader = new BufferReader(new Uint8Array(arrayBuffer), header.headerLength, header.dataLength);
|
|
1454
|
-
return decoderMap[header.type].decode(
|
|
1479
|
+
return (_decoderMap_header_type = decoderMap[header.type]).decode.apply(_decoderMap_header_type, [].concat([
|
|
1480
|
+
engine,
|
|
1481
|
+
bufferReader
|
|
1482
|
+
], args)).then(function(object) {
|
|
1455
1483
|
object.name = header.name;
|
|
1456
1484
|
return object;
|
|
1457
1485
|
});
|
|
@@ -1667,10 +1695,11 @@ var EnvLoader = /*#__PURE__*/ function(Loader) {
|
|
|
1667
1695
|
type: "arraybuffer"
|
|
1668
1696
|
});
|
|
1669
1697
|
var engine = resourceManager.engine;
|
|
1698
|
+
var url = item.url;
|
|
1670
1699
|
resourceManager// @ts-ignore
|
|
1671
|
-
._request(
|
|
1700
|
+
._request(url, requestConfig).then(function(arraybuffer) {
|
|
1672
1701
|
var texture = EnvLoader._setTextureByBuffer(engine, arraybuffer);
|
|
1673
|
-
engine.resourceManager.addContentRestorer(new EnvContentRestorer(texture,
|
|
1702
|
+
engine.resourceManager.addContentRestorer(new EnvContentRestorer(texture, url, requestConfig));
|
|
1674
1703
|
var ambientLight = new engineCore.AmbientLight(engine);
|
|
1675
1704
|
var sh = new engineMath.SphericalHarmonics3();
|
|
1676
1705
|
ambientLight.diffuseMode = engineCore.DiffuseMode.SphericalHarmonics;
|
|
@@ -1725,9 +1754,12 @@ EnvLoader = __decorate([
|
|
|
1725
1754
|
_proto.restoreContent = function restoreContent() {
|
|
1726
1755
|
var _this = this;
|
|
1727
1756
|
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1757
|
+
var resource = _this.resource;
|
|
1758
|
+
var engine = resource.engine;
|
|
1759
|
+
engine.resourceManager// @ts-ignore
|
|
1760
|
+
._request(_this.url, _this.requestConfig).then(function(buffer) {
|
|
1761
|
+
EnvLoader._setTextureByBuffer(engine, buffer, resource);
|
|
1762
|
+
resolve(resource);
|
|
1731
1763
|
}).catch(reject);
|
|
1732
1764
|
});
|
|
1733
1765
|
};
|
|
@@ -1794,35 +1826,232 @@ var FontLoader = /*#__PURE__*/ function(Loader) {
|
|
|
1794
1826
|
reject(e);
|
|
1795
1827
|
});
|
|
1796
1828
|
});
|
|
1797
|
-
};
|
|
1798
|
-
_proto._registerFont = function _registerFont(fontName, fontUrl) {
|
|
1799
|
-
return _async_to_generator(function() {
|
|
1800
|
-
var fontFace;
|
|
1801
|
-
return __generator(this, function(_state) {
|
|
1802
|
-
switch(_state.label){
|
|
1803
|
-
case 0:
|
|
1804
|
-
fontFace = new FontFace(fontName, "url(" + fontUrl + ")");
|
|
1805
|
-
return [
|
|
1806
|
-
4,
|
|
1807
|
-
fontFace.load()
|
|
1808
|
-
];
|
|
1809
|
-
case 1:
|
|
1810
|
-
_state.sent();
|
|
1811
|
-
document.fonts.add(fontFace);
|
|
1812
|
-
return [
|
|
1813
|
-
2
|
|
1814
|
-
];
|
|
1815
|
-
}
|
|
1816
|
-
});
|
|
1817
|
-
})();
|
|
1818
|
-
};
|
|
1819
|
-
return FontLoader;
|
|
1820
|
-
}(engineCore.Loader);
|
|
1821
|
-
FontLoader = __decorate([
|
|
1822
|
-
engineCore.resourceLoader(engineCore.AssetType.Font, [
|
|
1823
|
-
"font"
|
|
1824
|
-
], false)
|
|
1825
|
-
], FontLoader);
|
|
1829
|
+
};
|
|
1830
|
+
_proto._registerFont = function _registerFont(fontName, fontUrl) {
|
|
1831
|
+
return _async_to_generator(function() {
|
|
1832
|
+
var fontFace;
|
|
1833
|
+
return __generator(this, function(_state) {
|
|
1834
|
+
switch(_state.label){
|
|
1835
|
+
case 0:
|
|
1836
|
+
fontFace = new FontFace(fontName, "url(" + fontUrl + ")");
|
|
1837
|
+
return [
|
|
1838
|
+
4,
|
|
1839
|
+
fontFace.load()
|
|
1840
|
+
];
|
|
1841
|
+
case 1:
|
|
1842
|
+
_state.sent();
|
|
1843
|
+
document.fonts.add(fontFace);
|
|
1844
|
+
return [
|
|
1845
|
+
2
|
|
1846
|
+
];
|
|
1847
|
+
}
|
|
1848
|
+
});
|
|
1849
|
+
})();
|
|
1850
|
+
};
|
|
1851
|
+
return FontLoader;
|
|
1852
|
+
}(engineCore.Loader);
|
|
1853
|
+
FontLoader = __decorate([
|
|
1854
|
+
engineCore.resourceLoader(engineCore.AssetType.Font, [
|
|
1855
|
+
"font"
|
|
1856
|
+
], false)
|
|
1857
|
+
], FontLoader);
|
|
1858
|
+
|
|
1859
|
+
// Source: https://github.com/zeux/meshoptimizer/blob/master/js/meshopt_decoder.js
|
|
1860
|
+
var ready;
|
|
1861
|
+
function getMeshoptDecoder() {
|
|
1862
|
+
if (ready) return ready;
|
|
1863
|
+
var wasm_base = "b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb";
|
|
1864
|
+
var wasm_simd = "b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb";
|
|
1865
|
+
var wasmpack = new Uint8Array([
|
|
1866
|
+
32,
|
|
1867
|
+
0,
|
|
1868
|
+
65,
|
|
1869
|
+
2,
|
|
1870
|
+
1,
|
|
1871
|
+
106,
|
|
1872
|
+
34,
|
|
1873
|
+
33,
|
|
1874
|
+
3,
|
|
1875
|
+
128,
|
|
1876
|
+
11,
|
|
1877
|
+
4,
|
|
1878
|
+
13,
|
|
1879
|
+
64,
|
|
1880
|
+
6,
|
|
1881
|
+
253,
|
|
1882
|
+
10,
|
|
1883
|
+
7,
|
|
1884
|
+
15,
|
|
1885
|
+
116,
|
|
1886
|
+
127,
|
|
1887
|
+
5,
|
|
1888
|
+
8,
|
|
1889
|
+
12,
|
|
1890
|
+
40,
|
|
1891
|
+
16,
|
|
1892
|
+
19,
|
|
1893
|
+
54,
|
|
1894
|
+
20,
|
|
1895
|
+
9,
|
|
1896
|
+
27,
|
|
1897
|
+
255,
|
|
1898
|
+
113,
|
|
1899
|
+
17,
|
|
1900
|
+
42,
|
|
1901
|
+
67,
|
|
1902
|
+
24,
|
|
1903
|
+
23,
|
|
1904
|
+
146,
|
|
1905
|
+
148,
|
|
1906
|
+
18,
|
|
1907
|
+
14,
|
|
1908
|
+
22,
|
|
1909
|
+
45,
|
|
1910
|
+
70,
|
|
1911
|
+
69,
|
|
1912
|
+
56,
|
|
1913
|
+
114,
|
|
1914
|
+
101,
|
|
1915
|
+
21,
|
|
1916
|
+
25,
|
|
1917
|
+
63,
|
|
1918
|
+
75,
|
|
1919
|
+
136,
|
|
1920
|
+
108,
|
|
1921
|
+
28,
|
|
1922
|
+
118,
|
|
1923
|
+
29,
|
|
1924
|
+
73,
|
|
1925
|
+
115
|
|
1926
|
+
]);
|
|
1927
|
+
// @ts-ignore
|
|
1928
|
+
var wasm = engineCore.SystemInfo._detectSIMDSupported() ? wasm_simd : wasm_base;
|
|
1929
|
+
var instance;
|
|
1930
|
+
ready = WebAssembly.instantiate(unpack(wasm)).then(function(result) {
|
|
1931
|
+
instance = result.instance;
|
|
1932
|
+
instance.exports.__wasm_call_ctors();
|
|
1933
|
+
}).then(function() {
|
|
1934
|
+
return {
|
|
1935
|
+
workerCount: 4,
|
|
1936
|
+
ready: ready,
|
|
1937
|
+
useWorkers: function useWorkers(workerCount) {
|
|
1938
|
+
this.workerCount = workerCount != null ? workerCount : this.workerCount;
|
|
1939
|
+
initWorkers(this.workerCount);
|
|
1940
|
+
},
|
|
1941
|
+
decodeGltfBuffer: function decodeGltfBuffer(count, stride, source, mode, filter) {
|
|
1942
|
+
if (this.workerCount > 0 && workers.length === 0) this.useWorkers();
|
|
1943
|
+
if (workers.length > 0) return decodeWorker(count, stride, source, decoders[mode], filters[filter]);
|
|
1944
|
+
return ready.then(function() {
|
|
1945
|
+
var target = new Uint8Array(count * stride);
|
|
1946
|
+
decode(instance.exports[decoders[mode]], target, count, stride, source, instance.exports[filters[filter]]);
|
|
1947
|
+
return target;
|
|
1948
|
+
});
|
|
1949
|
+
},
|
|
1950
|
+
release: function release() {
|
|
1951
|
+
for(var i = 0; i < workers.length; i++){
|
|
1952
|
+
workers[i].object.terminate();
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
};
|
|
1956
|
+
});
|
|
1957
|
+
function unpack(data) {
|
|
1958
|
+
var result = new Uint8Array(data.length);
|
|
1959
|
+
for(var i = 0; i < data.length; ++i){
|
|
1960
|
+
var ch = data.charCodeAt(i);
|
|
1961
|
+
result[i] = ch > 96 ? ch - 97 : ch > 64 ? ch - 39 : ch + 4;
|
|
1962
|
+
}
|
|
1963
|
+
var write = 0;
|
|
1964
|
+
for(var i1 = 0; i1 < data.length; ++i1){
|
|
1965
|
+
result[write++] = result[i1] < 60 ? wasmpack[result[i1]] : (result[i1] - 60) * 64 + result[++i1];
|
|
1966
|
+
}
|
|
1967
|
+
return result.buffer.slice(0, write);
|
|
1968
|
+
}
|
|
1969
|
+
function decode(fun, target, count, size, source, filter) {
|
|
1970
|
+
var sbrk = instance.exports.sbrk;
|
|
1971
|
+
var count4 = count + 3 & ~3;
|
|
1972
|
+
var tp = sbrk(count4 * size);
|
|
1973
|
+
var sp = sbrk(source.length);
|
|
1974
|
+
var heap = new Uint8Array(instance.exports.memory.buffer);
|
|
1975
|
+
heap.set(source, sp);
|
|
1976
|
+
var res = fun(tp, count, size, sp, source.length);
|
|
1977
|
+
if (res == 0 && filter) {
|
|
1978
|
+
filter(tp, count4, size);
|
|
1979
|
+
}
|
|
1980
|
+
target.set(heap.subarray(tp, tp + count * size));
|
|
1981
|
+
sbrk(tp - sbrk(0));
|
|
1982
|
+
if (res != 0) {
|
|
1983
|
+
throw new Error("Malformed buffer data: " + res);
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
var filters = {
|
|
1987
|
+
NONE: "",
|
|
1988
|
+
OCTAHEDRAL: "meshopt_decodeFilterOct",
|
|
1989
|
+
QUATERNION: "meshopt_decodeFilterQuat",
|
|
1990
|
+
EXPONENTIAL: "meshopt_decodeFilterExp"
|
|
1991
|
+
};
|
|
1992
|
+
var decoders = {
|
|
1993
|
+
ATTRIBUTES: "meshopt_decodeVertexBuffer",
|
|
1994
|
+
TRIANGLES: "meshopt_decodeIndexBuffer",
|
|
1995
|
+
INDICES: "meshopt_decodeIndexSequence"
|
|
1996
|
+
};
|
|
1997
|
+
var workers = [];
|
|
1998
|
+
var requestId = 0;
|
|
1999
|
+
function createWorker(url) {
|
|
2000
|
+
var worker = {
|
|
2001
|
+
object: new Worker(url),
|
|
2002
|
+
pending: 0,
|
|
2003
|
+
requests: {}
|
|
2004
|
+
};
|
|
2005
|
+
worker.object.onmessage = function(event) {
|
|
2006
|
+
var data = event.data;
|
|
2007
|
+
worker.pending -= data.count;
|
|
2008
|
+
worker.requests[data.id][data.action](data.value);
|
|
2009
|
+
delete worker.requests[data.id];
|
|
2010
|
+
};
|
|
2011
|
+
return worker;
|
|
2012
|
+
}
|
|
2013
|
+
function initWorkers(count) {
|
|
2014
|
+
var source = "var instance; var ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(unpack(wasm)) + "]), {})" + ".then(function(result) {instance = result.instance; instance.exports.__wasm_call_ctors();});\n" + "self.onmessage = workerProcess;\n" + 'function decode(fun, target, count, size, source, filter) {\n const sbrk = instance.exports.sbrk;\n const count4 = (count + 3) & ~3;\n const tp = sbrk(count4 * size);\n const sp = sbrk(source.length);\n const heap = new Uint8Array(instance.exports.memory.buffer);\n heap.set(source, sp);\n const res = fun(tp, count, size, sp, source.length);\n if (res == 0 && filter) {\n filter(tp, count4, size);\n }\n target.set(heap.subarray(tp, tp + count * size));\n sbrk(tp - sbrk(0));\n if (res != 0) {\n throw new Error("Malformed buffer data: " + res);\n }\n }\n' + 'function workerProcess(event) {\n ready.then(function () {\n const data = event.data;\n try {\n const target = new Uint8Array(data.count * data.size);\n decode(instance.exports[data.mode], target, data.count, data.size, data.source, instance.exports[data.filter]);\n self.postMessage({ id: data.id, count: data.count, action: "resolve", value: target }, [target.buffer]);\n } catch (error) {\n self.postMessage({\n id: data.id,\n count: data.count,\n action: "reject",\n value: error\n });\n }\n });\n }';
|
|
2015
|
+
var blob = new Blob([
|
|
2016
|
+
source
|
|
2017
|
+
], {
|
|
2018
|
+
type: "text/javascript"
|
|
2019
|
+
});
|
|
2020
|
+
var url = URL.createObjectURL(blob);
|
|
2021
|
+
for(var i = 0; i < count; ++i){
|
|
2022
|
+
workers[i] = createWorker(url);
|
|
2023
|
+
}
|
|
2024
|
+
URL.revokeObjectURL(url);
|
|
2025
|
+
}
|
|
2026
|
+
function decodeWorker(count, size, source, mode, filter) {
|
|
2027
|
+
var worker = workers[0];
|
|
2028
|
+
for(var i = 1; i < workers.length; ++i){
|
|
2029
|
+
if (workers[i].pending < worker.pending) {
|
|
2030
|
+
worker = workers[i];
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
return new Promise(function(resolve, reject) {
|
|
2034
|
+
var data = new Uint8Array(source);
|
|
2035
|
+
var id = requestId++;
|
|
2036
|
+
worker.pending += count;
|
|
2037
|
+
worker.requests[id] = {
|
|
2038
|
+
resolve: resolve,
|
|
2039
|
+
reject: reject
|
|
2040
|
+
};
|
|
2041
|
+
worker.object.postMessage({
|
|
2042
|
+
id: id,
|
|
2043
|
+
count: count,
|
|
2044
|
+
size: size,
|
|
2045
|
+
source: data,
|
|
2046
|
+
mode: mode,
|
|
2047
|
+
filter: filter
|
|
2048
|
+
}, [
|
|
2049
|
+
data.buffer
|
|
2050
|
+
]);
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
2053
|
+
return ready;
|
|
2054
|
+
}
|
|
1826
2055
|
|
|
1827
2056
|
/**
|
|
1828
2057
|
* The glTF resource.
|
|
@@ -1850,14 +2079,16 @@ FontLoader = __decorate([
|
|
|
1850
2079
|
materials && this._disassociationSuperResource(materials);
|
|
1851
2080
|
if (meshes) {
|
|
1852
2081
|
for(var i = 0, n = meshes.length; i < n; i++){
|
|
1853
|
-
|
|
2082
|
+
var meshArr = meshes[i];
|
|
2083
|
+
meshArr && this._disassociationSuperResource(meshArr);
|
|
1854
2084
|
}
|
|
1855
2085
|
}
|
|
1856
2086
|
};
|
|
1857
2087
|
_proto._disassociationSuperResource = function _disassociationSuperResource(resources) {
|
|
1858
2088
|
for(var i = 0, n = resources.length; i < n; i++){
|
|
1859
|
-
// @ts-ignore
|
|
1860
|
-
|
|
2089
|
+
var // @ts-ignore
|
|
2090
|
+
_resources_i;
|
|
2091
|
+
(_resources_i = resources[i]) == null ? void 0 : _resources_i._disassociationSuperResource(this);
|
|
1861
2092
|
}
|
|
1862
2093
|
};
|
|
1863
2094
|
_create_class(GLTFResource, [
|
|
@@ -2057,6 +2288,7 @@ FontLoader = __decorate([
|
|
|
2057
2288
|
this.params = params;
|
|
2058
2289
|
this.accessorBufferCache = {};
|
|
2059
2290
|
this.needAnimatorController = false;
|
|
2291
|
+
this./** @internal */ _getPromises = [];
|
|
2060
2292
|
this._resourceCache = new Map();
|
|
2061
2293
|
this._progress = {
|
|
2062
2294
|
taskDetail: {},
|
|
@@ -2081,7 +2313,7 @@ FontLoader = __decorate([
|
|
|
2081
2313
|
var _this = this;
|
|
2082
2314
|
var parser = GLTFParserContext._parsers[type];
|
|
2083
2315
|
if (!parser) {
|
|
2084
|
-
return
|
|
2316
|
+
return engineCore.AssetPromise.resolve(null);
|
|
2085
2317
|
}
|
|
2086
2318
|
var cache = this._resourceCache;
|
|
2087
2319
|
var cacheKey = index === undefined ? "" + type : type + ":" + index;
|
|
@@ -2097,7 +2329,7 @@ FontLoader = __decorate([
|
|
|
2097
2329
|
if (index === undefined) {
|
|
2098
2330
|
resource = type === 8 ? glTFItems.map(function(_, index) {
|
|
2099
2331
|
return _this.get(type, index);
|
|
2100
|
-
}) :
|
|
2332
|
+
}) : engineCore.AssetPromise.all(glTFItems.map(function(_, index) {
|
|
2101
2333
|
return _this.get(type, index);
|
|
2102
2334
|
}));
|
|
2103
2335
|
} else {
|
|
@@ -2105,12 +2337,15 @@ FontLoader = __decorate([
|
|
|
2105
2337
|
isSubAsset && this._handleSubAsset(resource, type, index);
|
|
2106
2338
|
}
|
|
2107
2339
|
} else {
|
|
2108
|
-
resource =
|
|
2340
|
+
resource = engineCore.AssetPromise.resolve(null);
|
|
2109
2341
|
}
|
|
2110
2342
|
} else {
|
|
2111
2343
|
resource = parser.parse(this, index);
|
|
2112
2344
|
isSubAsset && this._handleSubAsset(resource, type, index);
|
|
2113
2345
|
}
|
|
2346
|
+
if (_instanceof(resource, engineCore.AssetPromise)) {
|
|
2347
|
+
this._getPromises.push(resource);
|
|
2348
|
+
}
|
|
2114
2349
|
cache.set(cacheKey, resource);
|
|
2115
2350
|
return resource;
|
|
2116
2351
|
};
|
|
@@ -2119,7 +2354,7 @@ FontLoader = __decorate([
|
|
|
2119
2354
|
var promise = this.get(0).then(function(json) {
|
|
2120
2355
|
_this.glTF = json;
|
|
2121
2356
|
_this.needAnimatorController = !!(json.skins || json.animations);
|
|
2122
|
-
return
|
|
2357
|
+
return engineCore.AssetPromise.all([
|
|
2123
2358
|
_this.get(1),
|
|
2124
2359
|
_this.get(5),
|
|
2125
2360
|
_this.get(6),
|
|
@@ -2182,6 +2417,8 @@ FontLoader = __decorate([
|
|
|
2182
2417
|
_this.resourceManager._onSubAssetSuccess(url, "defaultSceneRoot", item);
|
|
2183
2418
|
}
|
|
2184
2419
|
}
|
|
2420
|
+
}).catch(function(e) {
|
|
2421
|
+
engineCore.Logger.error("GLTFParserContext", "Failed to load " + glTFResourceKey + " " + index + ": " + e);
|
|
2185
2422
|
});
|
|
2186
2423
|
}
|
|
2187
2424
|
};
|
|
@@ -2360,13 +2597,15 @@ function registerGLTFParser(pipeline) {
|
|
|
2360
2597
|
bufferInfo.restoreInfo = new BufferDataRestoreInfo(new RestoreDataAccessor(bufferIndex, TypedArray, offset1, count1));
|
|
2361
2598
|
}
|
|
2362
2599
|
return bufferInfo;
|
|
2600
|
+
}).catch(function(e) {
|
|
2601
|
+
engineCore.Logger.error("GLTFUtil getAccessorBuffer error", e);
|
|
2363
2602
|
});
|
|
2364
2603
|
} else {
|
|
2365
2604
|
var count = accessorCount * dataElementSize;
|
|
2366
2605
|
var data = new TypedArray(count);
|
|
2367
2606
|
var bufferInfo = new BufferInfo(data, false, elementStride);
|
|
2368
2607
|
bufferInfo.restoreInfo = new BufferDataRestoreInfo(new RestoreDataAccessor(undefined, TypedArray, undefined, count));
|
|
2369
|
-
promise =
|
|
2608
|
+
promise = engineCore.AssetPromise.resolve(bufferInfo);
|
|
2370
2609
|
}
|
|
2371
2610
|
return accessor.sparse ? promise.then(function(bufferInfo) {
|
|
2372
2611
|
return GLTFUtils.processingSparseData(context, accessor, bufferInfo).then(function() {
|
|
@@ -2401,7 +2640,7 @@ function registerGLTFParser(pipeline) {
|
|
|
2401
2640
|
var _accessor_sparse = accessor.sparse, count = _accessor_sparse.count, indices = _accessor_sparse.indices, values = _accessor_sparse.values;
|
|
2402
2641
|
var indicesBufferView = bufferViews[indices.bufferView];
|
|
2403
2642
|
var valuesBufferView = bufferViews[values.bufferView];
|
|
2404
|
-
return
|
|
2643
|
+
return engineCore.AssetPromise.all([
|
|
2405
2644
|
context.get(GLTFParserType.BufferView, indices.bufferView),
|
|
2406
2645
|
context.get(GLTFParserType.BufferView, values.bufferView)
|
|
2407
2646
|
]).then(function(param) {
|
|
@@ -2428,6 +2667,8 @@ function registerGLTFParser(pipeline) {
|
|
|
2428
2667
|
}
|
|
2429
2668
|
}
|
|
2430
2669
|
bufferInfo.data = data;
|
|
2670
|
+
}).catch(function(e) {
|
|
2671
|
+
engineCore.Logger.error("GLTFUtil processingSparseData error", e);
|
|
2431
2672
|
});
|
|
2432
2673
|
};
|
|
2433
2674
|
GLTFUtils.getIndexFormat = function getIndexFormat(type) {
|
|
@@ -3397,15 +3638,20 @@ exports.KTX2Loader = /*#__PURE__*/ function(Loader) {
|
|
|
3397
3638
|
* @internal
|
|
3398
3639
|
*/ _proto.load = function load(item, resourceManager) {
|
|
3399
3640
|
return new engineCore.AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
3400
|
-
|
|
3401
|
-
._request(item.url, {
|
|
3641
|
+
var requestConfig = _extends({}, item, {
|
|
3402
3642
|
type: "arraybuffer"
|
|
3403
|
-
})
|
|
3643
|
+
});
|
|
3644
|
+
var url = item.url;
|
|
3645
|
+
resourceManager// @ts-ignore
|
|
3646
|
+
._request(url, requestConfig).onProgress(setTaskCompleteProgress, setTaskDetailProgress).then(function(buffer) {
|
|
3404
3647
|
return KTX2Loader._parseBuffer(new Uint8Array(buffer), resourceManager.engine, item.params).then(function(param) {
|
|
3405
3648
|
var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
|
|
3406
3649
|
return KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params);
|
|
3650
|
+
}).then(function(texture) {
|
|
3651
|
+
resourceManager.addContentRestorer(new KTX2ContentRestorer(texture, url, requestConfig));
|
|
3652
|
+
resolve(texture);
|
|
3407
3653
|
});
|
|
3408
|
-
}).
|
|
3654
|
+
}).catch(reject);
|
|
3409
3655
|
});
|
|
3410
3656
|
};
|
|
3411
3657
|
/**
|
|
@@ -3444,7 +3690,7 @@ exports.KTX2Loader = /*#__PURE__*/ function(Loader) {
|
|
|
3444
3690
|
};
|
|
3445
3691
|
});
|
|
3446
3692
|
};
|
|
3447
|
-
/** @internal */ KTX2Loader._createTextureByBuffer = function _createTextureByBuffer(engine, transcodeResult, targetFormat, params) {
|
|
3693
|
+
/** @internal */ KTX2Loader._createTextureByBuffer = function _createTextureByBuffer(engine, transcodeResult, targetFormat, params, restoredTexture) {
|
|
3448
3694
|
var width = transcodeResult.width, height = transcodeResult.height, faces = transcodeResult.faces;
|
|
3449
3695
|
var faceCount = faces.length;
|
|
3450
3696
|
var mipmaps = faces[0];
|
|
@@ -3452,13 +3698,13 @@ exports.KTX2Loader = /*#__PURE__*/ function(Loader) {
|
|
|
3452
3698
|
var engineFormat = this._getEngineTextureFormat(targetFormat, transcodeResult);
|
|
3453
3699
|
var texture;
|
|
3454
3700
|
if (faceCount !== 6) {
|
|
3455
|
-
texture = new engineCore.Texture2D(engine, width, height, engineFormat, mipmap);
|
|
3701
|
+
texture = restoredTexture || new engineCore.Texture2D(engine, width, height, engineFormat, mipmap);
|
|
3456
3702
|
for(var mipLevel = 0; mipLevel < mipmaps.length; mipLevel++){
|
|
3457
3703
|
var data = mipmaps[mipLevel].data;
|
|
3458
3704
|
texture.setPixelBuffer(data, mipLevel);
|
|
3459
3705
|
}
|
|
3460
3706
|
} else {
|
|
3461
|
-
texture = new engineCore.TextureCube(engine, height, engineFormat, mipmap);
|
|
3707
|
+
texture = restoredTexture || new engineCore.TextureCube(engine, height, engineFormat, mipmap);
|
|
3462
3708
|
for(var i = 0; i < faces.length; i++){
|
|
3463
3709
|
var faceData = faces[i];
|
|
3464
3710
|
for(var mipLevel1 = 0; mipLevel1 < mipmaps.length; mipLevel1++){
|
|
@@ -3574,6 +3820,30 @@ exports.KTX2Loader = __decorate([
|
|
|
3574
3820
|
"ktx2"
|
|
3575
3821
|
])
|
|
3576
3822
|
], exports.KTX2Loader);
|
|
3823
|
+
var KTX2ContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
|
|
3824
|
+
_inherits(KTX2ContentRestorer, ContentRestorer);
|
|
3825
|
+
function KTX2ContentRestorer(resource, url, requestConfig) {
|
|
3826
|
+
var _this;
|
|
3827
|
+
_this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
|
|
3828
|
+
return _this;
|
|
3829
|
+
}
|
|
3830
|
+
var _proto = KTX2ContentRestorer.prototype;
|
|
3831
|
+
_proto.restoreContent = function restoreContent() {
|
|
3832
|
+
var _this = this;
|
|
3833
|
+
var _this1 = this, resource = _this1.resource, requestConfig = _this1.requestConfig;
|
|
3834
|
+
var engine = resource.engine;
|
|
3835
|
+
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
3836
|
+
engine.resourceManager// @ts-ignore
|
|
3837
|
+
._request(_this.url, requestConfig).then(function(buffer) {
|
|
3838
|
+
return exports.KTX2Loader._parseBuffer(new Uint8Array(buffer), engine, requestConfig.params).then(function(param) {
|
|
3839
|
+
var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
|
|
3840
|
+
return exports.KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params, resource);
|
|
3841
|
+
});
|
|
3842
|
+
}).then(resolve).catch(reject);
|
|
3843
|
+
});
|
|
3844
|
+
};
|
|
3845
|
+
return KTX2ContentRestorer;
|
|
3846
|
+
}(engineCore.ContentRestorer);
|
|
3577
3847
|
/** Used for initialize KTX2 transcoder. */ var KTX2Transcoder = /*#__PURE__*/ function(KTX2Transcoder) {
|
|
3578
3848
|
/** BinomialLLC transcoder. */ KTX2Transcoder[KTX2Transcoder["BinomialLLC"] = 0] = "BinomialLLC";
|
|
3579
3849
|
/** Khronos transcoder. */ KTX2Transcoder[KTX2Transcoder["Khronos"] = 1] = "Khronos";
|
|
@@ -3910,16 +4180,14 @@ exports.KTX2Loader = __decorate([
|
|
|
3910
4180
|
for(var _len = arguments.length, extra = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++){
|
|
3911
4181
|
extra[_key - 5] = arguments[_key];
|
|
3912
4182
|
}
|
|
4183
|
+
var _parser;
|
|
3913
4184
|
var parser = GLTFParser.getExtensionParser(extensionName, GLTFExtensionMode.AdditiveParse);
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
ownerSchema
|
|
3921
|
-
], extra));
|
|
3922
|
-
}
|
|
4185
|
+
parser == null ? void 0 : (_parser = parser).additiveParse.apply(_parser, [].concat([
|
|
4186
|
+
context,
|
|
4187
|
+
parseResource,
|
|
4188
|
+
extensionSchema,
|
|
4189
|
+
ownerSchema
|
|
4190
|
+
], extra));
|
|
3923
4191
|
};
|
|
3924
4192
|
return GLTFParser;
|
|
3925
4193
|
}();
|
|
@@ -3985,7 +4253,7 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3985
4253
|
var animationInfo = context.glTF.animations[index];
|
|
3986
4254
|
var _animationInfo_name = animationInfo.name, name = _animationInfo_name === void 0 ? "AnimationClip" + index : _animationInfo_name;
|
|
3987
4255
|
var animationClipPromise = GLTFParser.executeExtensionsCreateAndParse(animationInfo.extensions, context, animationInfo) || GLTFAnimationParser._parseStandardProperty(context, new engineCore.AnimationClip(name), animationInfo);
|
|
3988
|
-
return
|
|
4256
|
+
return engineCore.AssetPromise.resolve(animationClipPromise).then(function(animationClip) {
|
|
3989
4257
|
GLTFParser.executeExtensionsAdditiveAndParse(animationInfo.extensions, context, animationClip, animationInfo);
|
|
3990
4258
|
return animationClip;
|
|
3991
4259
|
});
|
|
@@ -3997,7 +4265,7 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3997
4265
|
var glTFSampler = samplers[j];
|
|
3998
4266
|
var inputAccessor = accessors[glTFSampler.input];
|
|
3999
4267
|
var outputAccessor = accessors[glTFSampler.output];
|
|
4000
|
-
var promise =
|
|
4268
|
+
var promise = engineCore.AssetPromise.all([
|
|
4001
4269
|
GLTFUtils.getAccessorBuffer(context, bufferViews, inputAccessor),
|
|
4002
4270
|
GLTFUtils.getAccessorBuffer(context, bufferViews, outputAccessor)
|
|
4003
4271
|
]).then(function(bufferInfos) {
|
|
@@ -4048,7 +4316,7 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4048
4316
|
// parse samplers
|
|
4049
4317
|
for(var j = 0, m = len; j < m; j++)_loop(j);
|
|
4050
4318
|
promises.push(context.get(GLTFParserType.Scene));
|
|
4051
|
-
return
|
|
4319
|
+
return engineCore.AssetPromise.all(promises).then(function() {
|
|
4052
4320
|
for(var j = 0, m = channels.length; j < m; j++){
|
|
4053
4321
|
var glTFChannel = channels[j];
|
|
4054
4322
|
var target = glTFChannel.target;
|
|
@@ -4178,7 +4446,7 @@ exports.GLTFBufferParser = /*#__PURE__*/ function(GLTFParser) {
|
|
|
4178
4446
|
var _proto = GLTFBufferParser.prototype;
|
|
4179
4447
|
_proto.parse = function parse(context, index) {
|
|
4180
4448
|
var buffers = context.glTF.buffers;
|
|
4181
|
-
return context.buffers ?
|
|
4449
|
+
return context.buffers ? engineCore.AssetPromise.resolve(context.buffers[index]) : this._parseSingleBuffer(context, buffers[index]);
|
|
4182
4450
|
};
|
|
4183
4451
|
_proto._parseSingleBuffer = function _parseSingleBuffer(context, bufferInfo) {
|
|
4184
4452
|
var glTFResource = context.glTFResource, contentRestorer = context.contentRestorer, resourceManager = context.resourceManager;
|
|
@@ -4265,7 +4533,7 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4265
4533
|
material.name = materialInfo.name;
|
|
4266
4534
|
GLTFMaterialParser._parseStandardProperty(context, material, materialInfo);
|
|
4267
4535
|
}
|
|
4268
|
-
return
|
|
4536
|
+
return engineCore.AssetPromise.resolve(material).then(function(material) {
|
|
4269
4537
|
// @ts-ignore
|
|
4270
4538
|
material || (material = engine._basicResources._getBlinnPhongMaterial());
|
|
4271
4539
|
GLTFParser.executeExtensionsAdditiveAndParse(materialInfo.extensions, context, material, materialInfo);
|
|
@@ -4295,6 +4563,8 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4295
4563
|
context.get(GLTFParserType.Texture, baseColorTexture.index).then(function(texture) {
|
|
4296
4564
|
material.baseTexture = texture;
|
|
4297
4565
|
GLTFParser.executeExtensionsAdditiveAndParse(baseColorTexture.extensions, context, material, baseColorTexture);
|
|
4566
|
+
}).catch(function(e) {
|
|
4567
|
+
engineCore.Logger.error("GLTFMaterialParser: baseColorTexture error", e);
|
|
4298
4568
|
});
|
|
4299
4569
|
}
|
|
4300
4570
|
if (material.constructor === engineCore.PBRMaterial) {
|
|
@@ -4304,6 +4574,8 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4304
4574
|
GLTFMaterialParser._checkOtherTextureTransform(metallicRoughnessTexture, "Roughness metallic");
|
|
4305
4575
|
context.get(GLTFParserType.Texture, metallicRoughnessTexture.index).then(function(texture) {
|
|
4306
4576
|
material.roughnessMetallicTexture = texture;
|
|
4577
|
+
}).catch(function(e) {
|
|
4578
|
+
engineCore.Logger.error("GLTFMaterialParser: metallicRoughnessTexture error", e);
|
|
4307
4579
|
});
|
|
4308
4580
|
}
|
|
4309
4581
|
}
|
|
@@ -4313,6 +4585,8 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4313
4585
|
GLTFMaterialParser._checkOtherTextureTransform(emissiveTexture, "Emissive");
|
|
4314
4586
|
context.get(GLTFParserType.Texture, emissiveTexture.index).then(function(texture) {
|
|
4315
4587
|
material.emissiveTexture = texture;
|
|
4588
|
+
}).catch(function(e) {
|
|
4589
|
+
engineCore.Logger.error("GLTFMaterialParser: emissiveTexture error", e);
|
|
4316
4590
|
});
|
|
4317
4591
|
}
|
|
4318
4592
|
if (emissiveFactor) {
|
|
@@ -4323,6 +4597,8 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4323
4597
|
GLTFMaterialParser._checkOtherTextureTransform(normalTexture, "Normal");
|
|
4324
4598
|
context.get(GLTFParserType.Texture, index).then(function(texture) {
|
|
4325
4599
|
material.normalTexture = texture;
|
|
4600
|
+
}).catch(function(e) {
|
|
4601
|
+
engineCore.Logger.error("GLTFMaterialParser: emissiveTexture error", e);
|
|
4326
4602
|
});
|
|
4327
4603
|
if (scale !== undefined) {
|
|
4328
4604
|
material.normalTextureIntensity = scale;
|
|
@@ -4333,6 +4609,8 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4333
4609
|
GLTFMaterialParser._checkOtherTextureTransform(occlusionTexture, "Occlusion");
|
|
4334
4610
|
context.get(GLTFParserType.Texture, index1).then(function(texture) {
|
|
4335
4611
|
material.occlusionTexture = texture;
|
|
4612
|
+
}).catch(function(e) {
|
|
4613
|
+
engineCore.Logger.error("GLTFMaterialParser: occlusionTexture error", e);
|
|
4336
4614
|
});
|
|
4337
4615
|
if (strength !== undefined) {
|
|
4338
4616
|
material.occlusionTextureIntensity = strength;
|
|
@@ -4376,7 +4654,7 @@ exports.GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4376
4654
|
_proto.parse = function parse(context, index) {
|
|
4377
4655
|
var _loop = function(i, length) {
|
|
4378
4656
|
var gltfPrimitive = meshInfo.primitives[i];
|
|
4379
|
-
primitivePromises[i] = new
|
|
4657
|
+
primitivePromises[i] = new engineCore.AssetPromise(function(resolve, reject) {
|
|
4380
4658
|
var mesh = GLTFParser.executeExtensionsCreateAndParse(gltfPrimitive.extensions, context, gltfPrimitive, meshInfo);
|
|
4381
4659
|
if (mesh) {
|
|
4382
4660
|
if (_instanceof(mesh, engineCore.ModelMesh)) {
|
|
@@ -4397,7 +4675,7 @@ exports.GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4397
4675
|
var meshRestoreInfo = new ModelMeshRestoreInfo();
|
|
4398
4676
|
meshRestoreInfo.mesh = mesh1;
|
|
4399
4677
|
context.contentRestorer.meshes.push(meshRestoreInfo);
|
|
4400
|
-
GLTFMeshParser._parseMeshFromGLTFPrimitive(context, mesh1, meshRestoreInfo, meshInfo, gltfPrimitive, glTF, context.params.keepMeshData).then(resolve);
|
|
4678
|
+
GLTFMeshParser._parseMeshFromGLTFPrimitive(context, mesh1, meshRestoreInfo, meshInfo, gltfPrimitive, glTF, context.params.keepMeshData).then(resolve, reject);
|
|
4401
4679
|
}
|
|
4402
4680
|
});
|
|
4403
4681
|
};
|
|
@@ -4406,7 +4684,7 @@ exports.GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4406
4684
|
var engine = glTFResource.engine;
|
|
4407
4685
|
var primitivePromises = new Array();
|
|
4408
4686
|
for(var i = 0, length = meshInfo.primitives.length; i < length; i++)_loop(i);
|
|
4409
|
-
return
|
|
4687
|
+
return engineCore.AssetPromise.all(primitivePromises);
|
|
4410
4688
|
};
|
|
4411
4689
|
/**
|
|
4412
4690
|
* @internal
|
|
@@ -4489,7 +4767,7 @@ exports.GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4489
4767
|
var bufferBindIndex = 0;
|
|
4490
4768
|
var promises = new Array();
|
|
4491
4769
|
for(var attribute in attributes)_loop(attribute);
|
|
4492
|
-
return
|
|
4770
|
+
return engineCore.AssetPromise.all(promises).then(function() {
|
|
4493
4771
|
mesh.setVertexElements(vertexElements);
|
|
4494
4772
|
// Indices
|
|
4495
4773
|
if (indices !== undefined) {
|
|
@@ -4539,7 +4817,7 @@ exports.GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4539
4817
|
var tangentTarget = targets["TANGENT"];
|
|
4540
4818
|
var hasNormal = normalTarget !== undefined;
|
|
4541
4819
|
var hasTangent = tangentTarget !== undefined;
|
|
4542
|
-
var promise =
|
|
4820
|
+
var promise = engineCore.AssetPromise.all([
|
|
4543
4821
|
_this._getBlendShapeData(context, glTF, accessors[targets["POSITION"]]),
|
|
4544
4822
|
hasNormal ? _this._getBlendShapeData(context, glTF, accessors[normalTarget]) : null,
|
|
4545
4823
|
hasTangent ? _this._getBlendShapeData(context, glTF, accessors[tangentTarget]) : null
|
|
@@ -4559,7 +4837,7 @@ exports.GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4559
4837
|
var blendShapeCount = glTFTargets.length;
|
|
4560
4838
|
var blendShapeCollection = new Array(blendShapeCount);
|
|
4561
4839
|
for(var i = 0; i < blendShapeCount; i++)_this = this, _loop(i);
|
|
4562
|
-
return
|
|
4840
|
+
return engineCore.AssetPromise.all(promises).then(function() {
|
|
4563
4841
|
for(var _iterator = _create_for_of_iterator_helper_loose(blendShapeCollection), _step; !(_step = _iterator()).done;){
|
|
4564
4842
|
var blendShape = _step.value;
|
|
4565
4843
|
mesh.addBlendShape(blendShape.blendShape);
|
|
@@ -4606,7 +4884,7 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4606
4884
|
for(var i1 = 0; i1 < sceneNodes.length; i1++){
|
|
4607
4885
|
promises.push(this._parseEntityComponent(context, sceneNodes[i1]));
|
|
4608
4886
|
}
|
|
4609
|
-
return
|
|
4887
|
+
return engineCore.AssetPromise.all(promises).then(function() {
|
|
4610
4888
|
GLTFParser.executeExtensionsAdditiveAndParse(sceneExtensions, context, sceneRoot, sceneInfo);
|
|
4611
4889
|
return sceneRoot;
|
|
4612
4890
|
});
|
|
@@ -4624,7 +4902,7 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4624
4902
|
if (meshID !== undefined) {
|
|
4625
4903
|
promise = this._createRenderer(context, entityInfo, entity);
|
|
4626
4904
|
}
|
|
4627
|
-
return
|
|
4905
|
+
return engineCore.AssetPromise.resolve(promise).then(function() {
|
|
4628
4906
|
var promises = [];
|
|
4629
4907
|
var children = entityInfo.children;
|
|
4630
4908
|
if (children) {
|
|
@@ -4632,7 +4910,7 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4632
4910
|
promises.push(_this._parseEntityComponent(context, children[i]));
|
|
4633
4911
|
}
|
|
4634
4912
|
}
|
|
4635
|
-
return
|
|
4913
|
+
return engineCore.AssetPromise.all(promises);
|
|
4636
4914
|
});
|
|
4637
4915
|
};
|
|
4638
4916
|
_proto._createCamera = function _createCamera(resource, cameraSchema, entity) {
|
|
@@ -4681,10 +4959,10 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4681
4959
|
var _glTFMeshPrimitives_i_material;
|
|
4682
4960
|
materialPromises[i] = context.get(GLTFParserType.Material, (_glTFMeshPrimitives_i_material = glTFMeshPrimitives[i].material) != null ? _glTFMeshPrimitives_i_material : -1);
|
|
4683
4961
|
}
|
|
4684
|
-
return
|
|
4962
|
+
return engineCore.AssetPromise.all([
|
|
4685
4963
|
context.get(GLTFParserType.Mesh, meshID),
|
|
4686
4964
|
skinID !== undefined && context.get(GLTFParserType.Skin, skinID),
|
|
4687
|
-
|
|
4965
|
+
engineCore.AssetPromise.all(materialPromises)
|
|
4688
4966
|
]).then(function(param) {
|
|
4689
4967
|
var _loop = function(i) {
|
|
4690
4968
|
var material = materials[i] || basicResources._getBlinnPhongMaterial();
|
|
@@ -4719,6 +4997,8 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4719
4997
|
// @ts-ignore
|
|
4720
4998
|
var basicResources = context.glTFResource.engine._basicResources;
|
|
4721
4999
|
for(var i = 0; i < rendererCount; i++)_loop(i);
|
|
5000
|
+
}).catch(function(e) {
|
|
5001
|
+
engineCore.Logger.error("GLTFSceneParser: create renderer error", e);
|
|
4722
5002
|
});
|
|
4723
5003
|
};
|
|
4724
5004
|
_proto._computeLocalBounds = function _computeLocalBounds(skinnedMeshRenderer, mesh, bones, rootBone, inverseBindMatrices) {
|
|
@@ -4803,7 +5083,7 @@ exports.GLTFSkinParser = /*#__PURE__*/ function(GLTFParser) {
|
|
|
4803
5083
|
}
|
|
4804
5084
|
return skin;
|
|
4805
5085
|
});
|
|
4806
|
-
return
|
|
5086
|
+
return engineCore.AssetPromise.resolve(skinPromise);
|
|
4807
5087
|
};
|
|
4808
5088
|
_proto._findSkeletonRootBone = function _findSkeletonRootBone(joints, entities) {
|
|
4809
5089
|
var paths = {};
|
|
@@ -4853,7 +5133,7 @@ exports.GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4853
5133
|
if (!texture) {
|
|
4854
5134
|
texture = GLTFTextureParser._parseTexture(context, imageIndex, textureIndex, sampler, textureName);
|
|
4855
5135
|
}
|
|
4856
|
-
return
|
|
5136
|
+
return engineCore.AssetPromise.resolve(texture).then(function(texture) {
|
|
4857
5137
|
GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, texture, textureInfo);
|
|
4858
5138
|
// @ts-ignore
|
|
4859
5139
|
texture._associationSuperResource(glTFResource);
|
|
@@ -4898,6 +5178,8 @@ exports.GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4898
5178
|
context.contentRestorer.bufferTextures.push(bufferTextureRestoreInfo);
|
|
4899
5179
|
return texture;
|
|
4900
5180
|
});
|
|
5181
|
+
}).catch(function(e) {
|
|
5182
|
+
engineCore.Logger.error("GLTFTextureParser: image buffer error", e);
|
|
4901
5183
|
});
|
|
4902
5184
|
}
|
|
4903
5185
|
return texture;
|
|
@@ -4927,286 +5209,93 @@ exports.GLTFValidator = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4927
5209
|
for(var i = 0; i < extensionsUsed.length; i++){
|
|
4928
5210
|
var extensionUsed = extensionsUsed[i];
|
|
4929
5211
|
if (!GLTFParser.hasExtensionParser(extensionUsed)) {
|
|
4930
|
-
engineCore.Logger.warn("Extension " + extensionUsed + " is not implemented, you can customize this extension in gltf.");
|
|
4931
|
-
}
|
|
4932
|
-
}
|
|
4933
|
-
}
|
|
4934
|
-
if (extensionsRequired) {
|
|
4935
|
-
engineCore.Logger.info("extensionsRequired: " + extensionsRequired);
|
|
4936
|
-
for(var i1 = 0; i1 < extensionsRequired.length; i1++){
|
|
4937
|
-
var extensionRequired = extensionsRequired[i1];
|
|
4938
|
-
if (!GLTFParser.hasExtensionParser(extensionRequired)) {
|
|
4939
|
-
engineCore.Logger.error("GLTF parser has not supported required extension " + extensionRequired + ".");
|
|
4940
|
-
}
|
|
4941
|
-
}
|
|
4942
|
-
}
|
|
4943
|
-
return Promise.resolve(null);
|
|
4944
|
-
};
|
|
4945
|
-
return GLTFValidator;
|
|
4946
|
-
}(GLTFParser);
|
|
4947
|
-
exports.GLTFValidator = __decorate([
|
|
4948
|
-
registerGLTFParser(GLTFParserType.Validator)
|
|
4949
|
-
], exports.GLTFValidator);
|
|
4950
|
-
|
|
4951
|
-
exports.GLTFBufferViewParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
4952
|
-
_inherits(GLTFBufferViewParser, GLTFParser1);
|
|
4953
|
-
function GLTFBufferViewParser() {
|
|
4954
|
-
return GLTFParser1.apply(this, arguments) || this;
|
|
4955
|
-
}
|
|
4956
|
-
var _proto = GLTFBufferViewParser.prototype;
|
|
4957
|
-
_proto.parse = function parse(context, index) {
|
|
4958
|
-
var bufferView = context.glTF.bufferViews[index];
|
|
4959
|
-
var extensions = bufferView.extensions, _bufferView_byteOffset = bufferView.byteOffset, byteOffset = _bufferView_byteOffset === void 0 ? 0 : _bufferView_byteOffset, byteLength = bufferView.byteLength, bufferIndex = bufferView.buffer;
|
|
4960
|
-
return extensions ? GLTFParser.executeExtensionsCreateAndParse(extensions, context, bufferView) : context.get(GLTFParserType.Buffer, bufferIndex).then(function(buffer) {
|
|
4961
|
-
return new Uint8Array(buffer, byteOffset, byteLength);
|
|
4962
|
-
});
|
|
4963
|
-
};
|
|
4964
|
-
return GLTFBufferViewParser;
|
|
4965
|
-
}(GLTFParser);
|
|
4966
|
-
exports.GLTFBufferViewParser = __decorate([
|
|
4967
|
-
registerGLTFParser(GLTFParserType.BufferView)
|
|
4968
|
-
], exports.GLTFBufferViewParser);
|
|
4969
|
-
|
|
4970
|
-
exports.GLTFAnimatorControllerParser = /*#__PURE__*/ function(GLTFParser) {
|
|
4971
|
-
_inherits(GLTFAnimatorControllerParser, GLTFParser);
|
|
4972
|
-
function GLTFAnimatorControllerParser() {
|
|
4973
|
-
return GLTFParser.apply(this, arguments) || this;
|
|
4974
|
-
}
|
|
4975
|
-
var _proto = GLTFAnimatorControllerParser.prototype;
|
|
4976
|
-
_proto.parse = function parse(context) {
|
|
4977
|
-
var _this = this;
|
|
4978
|
-
if (!context.needAnimatorController) {
|
|
4979
|
-
return Promise.resolve(null);
|
|
4980
|
-
}
|
|
4981
|
-
return context.get(GLTFParserType.Animation).then(function(animations) {
|
|
4982
|
-
var animatorController = _this._createAnimatorController(context, animations);
|
|
4983
|
-
return Promise.resolve(animatorController);
|
|
4984
|
-
});
|
|
4985
|
-
};
|
|
4986
|
-
_proto._createAnimatorController = function _createAnimatorController(context, animations) {
|
|
4987
|
-
var glTFResource = context.glTFResource;
|
|
4988
|
-
var engine = glTFResource.engine;
|
|
4989
|
-
var animatorController = new engineCore.AnimatorController(engine);
|
|
4990
|
-
var layer = new engineCore.AnimatorControllerLayer("layer");
|
|
4991
|
-
var animatorStateMachine = new engineCore.AnimatorStateMachine();
|
|
4992
|
-
animatorController.addLayer(layer);
|
|
4993
|
-
layer.stateMachine = animatorStateMachine;
|
|
4994
|
-
if (animations) {
|
|
4995
|
-
for(var i = 0; i < animations.length; i++){
|
|
4996
|
-
var animationClip = animations[i];
|
|
4997
|
-
var name = animationClip.name;
|
|
4998
|
-
var uniqueName = animatorStateMachine.makeUniqueStateName(name);
|
|
4999
|
-
if (uniqueName !== name) {
|
|
5000
|
-
console.warn("AnimatorState name is existed, name: " + name + " reset to " + uniqueName);
|
|
5001
|
-
}
|
|
5002
|
-
var animatorState = animatorStateMachine.addState(uniqueName);
|
|
5003
|
-
animatorState.clip = animationClip;
|
|
5004
|
-
}
|
|
5005
|
-
}
|
|
5006
|
-
return animatorController;
|
|
5007
|
-
};
|
|
5008
|
-
return GLTFAnimatorControllerParser;
|
|
5009
|
-
}(GLTFParser);
|
|
5010
|
-
exports.GLTFAnimatorControllerParser = __decorate([
|
|
5011
|
-
registerGLTFParser(GLTFParserType.AnimatorController)
|
|
5012
|
-
], exports.GLTFAnimatorControllerParser);
|
|
5013
|
-
|
|
5014
|
-
// Source: https://github.com/zeux/meshoptimizer/blob/master/js/meshopt_decoder.js
|
|
5015
|
-
var ready;
|
|
5016
|
-
function getMeshoptDecoder() {
|
|
5017
|
-
if (ready) return ready;
|
|
5018
|
-
var wasm_base = "b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb";
|
|
5019
|
-
var wasm_simd = "b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb";
|
|
5020
|
-
var wasmpack = new Uint8Array([
|
|
5021
|
-
32,
|
|
5022
|
-
0,
|
|
5023
|
-
65,
|
|
5024
|
-
2,
|
|
5025
|
-
1,
|
|
5026
|
-
106,
|
|
5027
|
-
34,
|
|
5028
|
-
33,
|
|
5029
|
-
3,
|
|
5030
|
-
128,
|
|
5031
|
-
11,
|
|
5032
|
-
4,
|
|
5033
|
-
13,
|
|
5034
|
-
64,
|
|
5035
|
-
6,
|
|
5036
|
-
253,
|
|
5037
|
-
10,
|
|
5038
|
-
7,
|
|
5039
|
-
15,
|
|
5040
|
-
116,
|
|
5041
|
-
127,
|
|
5042
|
-
5,
|
|
5043
|
-
8,
|
|
5044
|
-
12,
|
|
5045
|
-
40,
|
|
5046
|
-
16,
|
|
5047
|
-
19,
|
|
5048
|
-
54,
|
|
5049
|
-
20,
|
|
5050
|
-
9,
|
|
5051
|
-
27,
|
|
5052
|
-
255,
|
|
5053
|
-
113,
|
|
5054
|
-
17,
|
|
5055
|
-
42,
|
|
5056
|
-
67,
|
|
5057
|
-
24,
|
|
5058
|
-
23,
|
|
5059
|
-
146,
|
|
5060
|
-
148,
|
|
5061
|
-
18,
|
|
5062
|
-
14,
|
|
5063
|
-
22,
|
|
5064
|
-
45,
|
|
5065
|
-
70,
|
|
5066
|
-
69,
|
|
5067
|
-
56,
|
|
5068
|
-
114,
|
|
5069
|
-
101,
|
|
5070
|
-
21,
|
|
5071
|
-
25,
|
|
5072
|
-
63,
|
|
5073
|
-
75,
|
|
5074
|
-
136,
|
|
5075
|
-
108,
|
|
5076
|
-
28,
|
|
5077
|
-
118,
|
|
5078
|
-
29,
|
|
5079
|
-
73,
|
|
5080
|
-
115
|
|
5081
|
-
]);
|
|
5082
|
-
// @ts-ignore
|
|
5083
|
-
var wasm = engineCore.SystemInfo._detectSIMDSupported() ? wasm_simd : wasm_base;
|
|
5084
|
-
var instance;
|
|
5085
|
-
ready = WebAssembly.instantiate(unpack(wasm)).then(function(result) {
|
|
5086
|
-
instance = result.instance;
|
|
5087
|
-
instance.exports.__wasm_call_ctors();
|
|
5088
|
-
}).then(function() {
|
|
5089
|
-
return {
|
|
5090
|
-
workerCount: 4,
|
|
5091
|
-
ready: ready,
|
|
5092
|
-
useWorkers: function useWorkers(workerCount) {
|
|
5093
|
-
this.workerCount = workerCount != null ? workerCount : this.workerCount;
|
|
5094
|
-
initWorkers(this.workerCount);
|
|
5095
|
-
},
|
|
5096
|
-
decodeGltfBuffer: function decodeGltfBuffer(count, stride, source, mode, filter) {
|
|
5097
|
-
if (this.workerCount > 0 && workers.length === 0) this.useWorkers();
|
|
5098
|
-
if (workers.length > 0) return decodeWorker(count, stride, source, decoders[mode], filters[filter]);
|
|
5099
|
-
return ready.then(function() {
|
|
5100
|
-
var target = new Uint8Array(count * stride);
|
|
5101
|
-
decode(instance.exports[decoders[mode]], target, count, stride, source, instance.exports[filters[filter]]);
|
|
5102
|
-
return target;
|
|
5103
|
-
});
|
|
5104
|
-
},
|
|
5105
|
-
release: function release() {
|
|
5106
|
-
for(var i = 0; i < workers.length; i++){
|
|
5107
|
-
workers[i].object.terminate();
|
|
5212
|
+
engineCore.Logger.warn("Extension " + extensionUsed + " is not implemented, you can customize this extension in gltf.");
|
|
5108
5213
|
}
|
|
5109
5214
|
}
|
|
5110
|
-
};
|
|
5111
|
-
});
|
|
5112
|
-
function unpack(data) {
|
|
5113
|
-
var result = new Uint8Array(data.length);
|
|
5114
|
-
for(var i = 0; i < data.length; ++i){
|
|
5115
|
-
var ch = data.charCodeAt(i);
|
|
5116
|
-
result[i] = ch > 96 ? ch - 97 : ch > 64 ? ch - 39 : ch + 4;
|
|
5117
|
-
}
|
|
5118
|
-
var write = 0;
|
|
5119
|
-
for(var i1 = 0; i1 < data.length; ++i1){
|
|
5120
|
-
result[write++] = result[i1] < 60 ? wasmpack[result[i1]] : (result[i1] - 60) * 64 + result[++i1];
|
|
5121
|
-
}
|
|
5122
|
-
return result.buffer.slice(0, write);
|
|
5123
|
-
}
|
|
5124
|
-
function decode(fun, target, count, size, source, filter) {
|
|
5125
|
-
var sbrk = instance.exports.sbrk;
|
|
5126
|
-
var count4 = count + 3 & ~3;
|
|
5127
|
-
var tp = sbrk(count4 * size);
|
|
5128
|
-
var sp = sbrk(source.length);
|
|
5129
|
-
var heap = new Uint8Array(instance.exports.memory.buffer);
|
|
5130
|
-
heap.set(source, sp);
|
|
5131
|
-
var res = fun(tp, count, size, sp, source.length);
|
|
5132
|
-
if (res == 0 && filter) {
|
|
5133
|
-
filter(tp, count4, size);
|
|
5134
5215
|
}
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5216
|
+
if (extensionsRequired) {
|
|
5217
|
+
engineCore.Logger.info("extensionsRequired: " + extensionsRequired);
|
|
5218
|
+
for(var i1 = 0; i1 < extensionsRequired.length; i1++){
|
|
5219
|
+
var extensionRequired = extensionsRequired[i1];
|
|
5220
|
+
if (!GLTFParser.hasExtensionParser(extensionRequired)) {
|
|
5221
|
+
engineCore.Logger.error("GLTF parser has not supported required extension " + extensionRequired + ".");
|
|
5222
|
+
}
|
|
5223
|
+
}
|
|
5139
5224
|
}
|
|
5140
|
-
|
|
5141
|
-
var filters = {
|
|
5142
|
-
NONE: "",
|
|
5143
|
-
OCTAHEDRAL: "meshopt_decodeFilterOct",
|
|
5144
|
-
QUATERNION: "meshopt_decodeFilterQuat",
|
|
5145
|
-
EXPONENTIAL: "meshopt_decodeFilterExp"
|
|
5146
|
-
};
|
|
5147
|
-
var decoders = {
|
|
5148
|
-
ATTRIBUTES: "meshopt_decodeVertexBuffer",
|
|
5149
|
-
TRIANGLES: "meshopt_decodeIndexBuffer",
|
|
5150
|
-
INDICES: "meshopt_decodeIndexSequence"
|
|
5225
|
+
return engineCore.AssetPromise.resolve(null);
|
|
5151
5226
|
};
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
worker.pending -= data.count;
|
|
5163
|
-
worker.requests[data.id][data.action](data.value);
|
|
5164
|
-
delete worker.requests[data.id];
|
|
5165
|
-
};
|
|
5166
|
-
return worker;
|
|
5227
|
+
return GLTFValidator;
|
|
5228
|
+
}(GLTFParser);
|
|
5229
|
+
exports.GLTFValidator = __decorate([
|
|
5230
|
+
registerGLTFParser(GLTFParserType.Validator)
|
|
5231
|
+
], exports.GLTFValidator);
|
|
5232
|
+
|
|
5233
|
+
exports.GLTFBufferViewParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
5234
|
+
_inherits(GLTFBufferViewParser, GLTFParser1);
|
|
5235
|
+
function GLTFBufferViewParser() {
|
|
5236
|
+
return GLTFParser1.apply(this, arguments) || this;
|
|
5167
5237
|
}
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
var
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5238
|
+
var _proto = GLTFBufferViewParser.prototype;
|
|
5239
|
+
_proto.parse = function parse(context, index) {
|
|
5240
|
+
var bufferView = context.glTF.bufferViews[index];
|
|
5241
|
+
var extensions = bufferView.extensions, _bufferView_byteOffset = bufferView.byteOffset, byteOffset = _bufferView_byteOffset === void 0 ? 0 : _bufferView_byteOffset, byteLength = bufferView.byteLength, bufferIndex = bufferView.buffer;
|
|
5242
|
+
return extensions ? GLTFParser.executeExtensionsCreateAndParse(extensions, context, bufferView) : context.get(GLTFParserType.Buffer, bufferIndex).then(function(buffer) {
|
|
5243
|
+
return new Uint8Array(buffer, byteOffset, byteLength);
|
|
5244
|
+
}).catch(function(e) {
|
|
5245
|
+
engineCore.Logger.error("GLTFBufferViewParser: buffer error", e);
|
|
5174
5246
|
});
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5247
|
+
};
|
|
5248
|
+
return GLTFBufferViewParser;
|
|
5249
|
+
}(GLTFParser);
|
|
5250
|
+
exports.GLTFBufferViewParser = __decorate([
|
|
5251
|
+
registerGLTFParser(GLTFParserType.BufferView)
|
|
5252
|
+
], exports.GLTFBufferViewParser);
|
|
5253
|
+
|
|
5254
|
+
exports.GLTFAnimatorControllerParser = /*#__PURE__*/ function(GLTFParser) {
|
|
5255
|
+
_inherits(GLTFAnimatorControllerParser, GLTFParser);
|
|
5256
|
+
function GLTFAnimatorControllerParser() {
|
|
5257
|
+
return GLTFParser.apply(this, arguments) || this;
|
|
5180
5258
|
}
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
}
|
|
5259
|
+
var _proto = GLTFAnimatorControllerParser.prototype;
|
|
5260
|
+
_proto.parse = function parse(context) {
|
|
5261
|
+
var _this = this;
|
|
5262
|
+
if (!context.needAnimatorController) {
|
|
5263
|
+
return engineCore.AssetPromise.resolve(null);
|
|
5187
5264
|
}
|
|
5188
|
-
return
|
|
5189
|
-
var
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
resolve: resolve,
|
|
5194
|
-
reject: reject
|
|
5195
|
-
};
|
|
5196
|
-
worker.object.postMessage({
|
|
5197
|
-
id: id,
|
|
5198
|
-
count: count,
|
|
5199
|
-
size: size,
|
|
5200
|
-
source: data,
|
|
5201
|
-
mode: mode,
|
|
5202
|
-
filter: filter
|
|
5203
|
-
}, [
|
|
5204
|
-
data.buffer
|
|
5205
|
-
]);
|
|
5265
|
+
return context.get(GLTFParserType.Animation).then(function(animations) {
|
|
5266
|
+
var animatorController = _this._createAnimatorController(context, animations);
|
|
5267
|
+
return engineCore.AssetPromise.resolve(animatorController);
|
|
5268
|
+
}).catch(function(e) {
|
|
5269
|
+
engineCore.Logger.error("GLTFAnimatorControllerParser: animator controller error", e);
|
|
5206
5270
|
});
|
|
5207
|
-
}
|
|
5208
|
-
|
|
5209
|
-
|
|
5271
|
+
};
|
|
5272
|
+
_proto._createAnimatorController = function _createAnimatorController(context, animations) {
|
|
5273
|
+
var glTFResource = context.glTFResource;
|
|
5274
|
+
var engine = glTFResource.engine;
|
|
5275
|
+
var animatorController = new engineCore.AnimatorController(engine);
|
|
5276
|
+
var layer = new engineCore.AnimatorControllerLayer("layer");
|
|
5277
|
+
var animatorStateMachine = new engineCore.AnimatorStateMachine();
|
|
5278
|
+
animatorController.addLayer(layer);
|
|
5279
|
+
layer.stateMachine = animatorStateMachine;
|
|
5280
|
+
if (animations) {
|
|
5281
|
+
for(var i = 0; i < animations.length; i++){
|
|
5282
|
+
var animationClip = animations[i];
|
|
5283
|
+
var name = animationClip.name;
|
|
5284
|
+
var uniqueName = animatorStateMachine.makeUniqueStateName(name);
|
|
5285
|
+
if (uniqueName !== name) {
|
|
5286
|
+
console.warn("AnimatorState name is existed, name: " + name + " reset to " + uniqueName);
|
|
5287
|
+
}
|
|
5288
|
+
var animatorState = animatorStateMachine.addState(uniqueName);
|
|
5289
|
+
animatorState.clip = animationClip;
|
|
5290
|
+
}
|
|
5291
|
+
}
|
|
5292
|
+
return animatorController;
|
|
5293
|
+
};
|
|
5294
|
+
return GLTFAnimatorControllerParser;
|
|
5295
|
+
}(GLTFParser);
|
|
5296
|
+
exports.GLTFAnimatorControllerParser = __decorate([
|
|
5297
|
+
registerGLTFParser(GLTFParserType.AnimatorController)
|
|
5298
|
+
], exports.GLTFAnimatorControllerParser);
|
|
5210
5299
|
|
|
5211
5300
|
exports.GLTFLoader = /*#__PURE__*/ function(Loader) {
|
|
5212
5301
|
_inherits(GLTFLoader, Loader);
|
|
@@ -5231,10 +5320,19 @@ exports.GLTFLoader = /*#__PURE__*/ function(Loader) {
|
|
|
5231
5320
|
var context = new GLTFParserContext(glTFResource, resourceManager, _extends({
|
|
5232
5321
|
keepMeshData: false
|
|
5233
5322
|
}, params));
|
|
5234
|
-
return new engineCore.AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
5323
|
+
return new engineCore.AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress, onTaskCancel) {
|
|
5235
5324
|
context._setTaskCompleteProgress = setTaskCompleteProgress;
|
|
5236
5325
|
context._setTaskDetailProgress = setTaskDetailProgress;
|
|
5237
|
-
|
|
5326
|
+
onTaskCancel(function() {
|
|
5327
|
+
var getPromises = context._getPromises;
|
|
5328
|
+
for(var i = 0, n = getPromises.length; i < n; i++){
|
|
5329
|
+
getPromises[i].cancel();
|
|
5330
|
+
}
|
|
5331
|
+
});
|
|
5332
|
+
context.parse().then(resolve).catch(function(e) {
|
|
5333
|
+
glTFResource.destroy();
|
|
5334
|
+
reject(e);
|
|
5335
|
+
});
|
|
5238
5336
|
});
|
|
5239
5337
|
};
|
|
5240
5338
|
/**
|
|
@@ -5322,10 +5420,11 @@ var HDRLoader = /*#__PURE__*/ function(Loader) {
|
|
|
5322
5420
|
var requestConfig = _extends({}, item, {
|
|
5323
5421
|
type: "arraybuffer"
|
|
5324
5422
|
});
|
|
5423
|
+
var url = item.url;
|
|
5325
5424
|
resourceManager// @ts-ignore
|
|
5326
|
-
._request(
|
|
5425
|
+
._request(url, requestConfig).then(function(buffer) {
|
|
5327
5426
|
var texture = HDRLoader._setTextureByBuffer(engine, buffer);
|
|
5328
|
-
engine.resourceManager.addContentRestorer(new HDRContentRestorer(texture,
|
|
5427
|
+
engine.resourceManager.addContentRestorer(new HDRContentRestorer(texture, url, requestConfig));
|
|
5329
5428
|
resolve(texture);
|
|
5330
5429
|
}).catch(reject);
|
|
5331
5430
|
});
|
|
@@ -5630,9 +5729,12 @@ HDRLoader = __decorate([
|
|
|
5630
5729
|
_proto.restoreContent = function restoreContent() {
|
|
5631
5730
|
var _this = this;
|
|
5632
5731
|
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5732
|
+
var resource = _this.resource;
|
|
5733
|
+
var engine = resource.engine;
|
|
5734
|
+
engine.resourceManager// @ts-ignore
|
|
5735
|
+
._request(_this.url, _this.requestConfig).then(function(buffer) {
|
|
5736
|
+
HDRLoader._setTextureByBuffer(engine, buffer, resource);
|
|
5737
|
+
resolve(resource);
|
|
5636
5738
|
}).catch(reject);
|
|
5637
5739
|
});
|
|
5638
5740
|
};
|
|
@@ -5888,11 +5990,12 @@ var KTXLoader = /*#__PURE__*/ function(Loader) {
|
|
|
5888
5990
|
}
|
|
5889
5991
|
var _proto = KTXLoader.prototype;
|
|
5890
5992
|
_proto.load = function load(item, resourceManager) {
|
|
5993
|
+
var requestConfig = _extends({}, item, {
|
|
5994
|
+
type: "arraybuffer"
|
|
5995
|
+
});
|
|
5891
5996
|
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
5892
5997
|
resourceManager// @ts-ignore
|
|
5893
|
-
._request(item.url,
|
|
5894
|
-
type: "arraybuffer"
|
|
5895
|
-
})).then(function(bin) {
|
|
5998
|
+
._request(item.url, requestConfig).then(function(bin) {
|
|
5896
5999
|
var parsedData = parseSingleKTX(bin);
|
|
5897
6000
|
var width = parsedData.width, height = parsedData.height, mipmaps = parsedData.mipmaps, engineFormat = parsedData.engineFormat;
|
|
5898
6001
|
var mipmap = mipmaps.length > 1;
|
|
@@ -5901,6 +6004,7 @@ var KTXLoader = /*#__PURE__*/ function(Loader) {
|
|
|
5901
6004
|
var _mipmaps_miplevel = mipmaps[miplevel], width1 = _mipmaps_miplevel.width, height1 = _mipmaps_miplevel.height, data = _mipmaps_miplevel.data;
|
|
5902
6005
|
texture.setPixelBuffer(data, miplevel, 0, 0, width1, height1);
|
|
5903
6006
|
}
|
|
6007
|
+
resourceManager.addContentRestorer(new KTXContentRestorer(texture, item.url, requestConfig));
|
|
5904
6008
|
resolve(texture);
|
|
5905
6009
|
}).catch(function(e) {
|
|
5906
6010
|
reject(e);
|
|
@@ -5914,6 +6018,34 @@ KTXLoader = __decorate([
|
|
|
5914
6018
|
"ktx"
|
|
5915
6019
|
])
|
|
5916
6020
|
], KTXLoader);
|
|
6021
|
+
var KTXContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
|
|
6022
|
+
_inherits(KTXContentRestorer, ContentRestorer);
|
|
6023
|
+
function KTXContentRestorer(resource, url, requestConfig) {
|
|
6024
|
+
var _this;
|
|
6025
|
+
_this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
|
|
6026
|
+
return _this;
|
|
6027
|
+
}
|
|
6028
|
+
var _proto = KTXContentRestorer.prototype;
|
|
6029
|
+
_proto.restoreContent = function restoreContent() {
|
|
6030
|
+
var _this = this;
|
|
6031
|
+
var resource = this.resource;
|
|
6032
|
+
var engine = resource.engine;
|
|
6033
|
+
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
6034
|
+
engine.resourceManager// @ts-ignore
|
|
6035
|
+
._request(_this.url, _this.requestConfig).then(function(bin) {
|
|
6036
|
+
var mipmaps = parseSingleKTX(bin).mipmaps;
|
|
6037
|
+
for(var miplevel = 0; miplevel < mipmaps.length; miplevel++){
|
|
6038
|
+
var _mipmaps_miplevel = mipmaps[miplevel], width = _mipmaps_miplevel.width, height = _mipmaps_miplevel.height, data = _mipmaps_miplevel.data;
|
|
6039
|
+
resource.setPixelBuffer(data, miplevel, 0, 0, width, height);
|
|
6040
|
+
}
|
|
6041
|
+
resolve(resource);
|
|
6042
|
+
}).catch(function(e) {
|
|
6043
|
+
reject(e);
|
|
6044
|
+
});
|
|
6045
|
+
});
|
|
6046
|
+
};
|
|
6047
|
+
return KTXContentRestorer;
|
|
6048
|
+
}(engineCore.ContentRestorer);
|
|
5917
6049
|
|
|
5918
6050
|
function parseProperty(object, key, value) {
|
|
5919
6051
|
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object") {
|
|
@@ -6018,13 +6150,16 @@ var MeshLoader = /*#__PURE__*/ function(Loader) {
|
|
|
6018
6150
|
}
|
|
6019
6151
|
var _proto = MeshLoader.prototype;
|
|
6020
6152
|
_proto.load = function load(item, resourceManager) {
|
|
6153
|
+
var requestConfig = _extends({}, item, {
|
|
6154
|
+
type: "arraybuffer"
|
|
6155
|
+
});
|
|
6156
|
+
var url = item.url;
|
|
6021
6157
|
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
6022
6158
|
resourceManager// @ts-ignore
|
|
6023
|
-
._request(
|
|
6024
|
-
type: "arraybuffer"
|
|
6025
|
-
})).then(function(data) {
|
|
6159
|
+
._request(url, requestConfig).then(function(data) {
|
|
6026
6160
|
return decode(data, resourceManager.engine);
|
|
6027
6161
|
}).then(function(mesh) {
|
|
6162
|
+
resourceManager.addContentRestorer(new MeshContentRestorer(mesh, url, requestConfig));
|
|
6028
6163
|
resolve(mesh);
|
|
6029
6164
|
}).catch(reject);
|
|
6030
6165
|
});
|
|
@@ -6036,6 +6171,29 @@ MeshLoader = __decorate([
|
|
|
6036
6171
|
"mesh"
|
|
6037
6172
|
])
|
|
6038
6173
|
], MeshLoader);
|
|
6174
|
+
var MeshContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
|
|
6175
|
+
_inherits(MeshContentRestorer, ContentRestorer);
|
|
6176
|
+
function MeshContentRestorer(resource, url, requestConfig) {
|
|
6177
|
+
var _this;
|
|
6178
|
+
_this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
|
|
6179
|
+
return _this;
|
|
6180
|
+
}
|
|
6181
|
+
var _proto = MeshContentRestorer.prototype;
|
|
6182
|
+
_proto.restoreContent = function restoreContent() {
|
|
6183
|
+
var _this = this;
|
|
6184
|
+
var resource = this.resource;
|
|
6185
|
+
var engine = resource.engine;
|
|
6186
|
+
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
6187
|
+
engine.resourceManager// @ts-ignore
|
|
6188
|
+
._request(_this.url, _this.requestConfig).then(function(data) {
|
|
6189
|
+
return decode(data, engine, resource);
|
|
6190
|
+
}).then(function(mesh) {
|
|
6191
|
+
resolve(mesh);
|
|
6192
|
+
}).catch(reject);
|
|
6193
|
+
});
|
|
6194
|
+
};
|
|
6195
|
+
return MeshContentRestorer;
|
|
6196
|
+
}(engineCore.ContentRestorer);
|
|
6039
6197
|
|
|
6040
6198
|
var PrimitiveMeshLoader = /*#__PURE__*/ function(Loader) {
|
|
6041
6199
|
_inherits(PrimitiveMeshLoader, Loader);
|
|
@@ -6782,18 +6940,24 @@ var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
6782
6940
|
exports.GLTFMaterialParser._checkOtherTextureTransform(clearcoatTexture, "Clear coat");
|
|
6783
6941
|
context.get(GLTFParserType.Texture, clearcoatTexture.index).then(function(texture) {
|
|
6784
6942
|
material.clearCoatTexture = texture;
|
|
6943
|
+
}).catch(function(e) {
|
|
6944
|
+
engineCore.Logger.error("KHR_materials_clearcoat: clearcoat texture error", e);
|
|
6785
6945
|
});
|
|
6786
6946
|
}
|
|
6787
6947
|
if (clearcoatRoughnessTexture) {
|
|
6788
6948
|
exports.GLTFMaterialParser._checkOtherTextureTransform(clearcoatRoughnessTexture, "Clear coat roughness");
|
|
6789
6949
|
context.get(GLTFParserType.Texture, clearcoatRoughnessTexture.index).then(function(texture) {
|
|
6790
6950
|
material.clearCoatRoughnessTexture = texture;
|
|
6951
|
+
}).catch(function(e) {
|
|
6952
|
+
engineCore.Logger.error("KHR_materials_clearcoat: clearcoat roughness texture error", e);
|
|
6791
6953
|
});
|
|
6792
6954
|
}
|
|
6793
6955
|
if (clearcoatNormalTexture) {
|
|
6794
6956
|
exports.GLTFMaterialParser._checkOtherTextureTransform(clearcoatNormalTexture, "Clear coat normal");
|
|
6795
6957
|
context.get(GLTFParserType.Texture, clearcoatNormalTexture.index).then(function(texture) {
|
|
6796
6958
|
material.clearCoatNormalTexture = texture;
|
|
6959
|
+
}).catch(function(e) {
|
|
6960
|
+
engineCore.Logger.error("KHR_materials_clearcoat: clearcoat normal texture error", e);
|
|
6797
6961
|
});
|
|
6798
6962
|
}
|
|
6799
6963
|
};
|
|
@@ -6836,6 +7000,8 @@ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionPa
|
|
|
6836
7000
|
context.get(GLTFParserType.Texture, diffuseTexture.index).then(function(texture) {
|
|
6837
7001
|
material.baseTexture = texture;
|
|
6838
7002
|
GLTFParser.executeExtensionsAdditiveAndParse(diffuseTexture.extensions, context, material, diffuseTexture);
|
|
7003
|
+
}).catch(function(e) {
|
|
7004
|
+
engineCore.Logger.error("KHR_materials_pbrSpecularGlossiness: diffuse texture error", e);
|
|
6839
7005
|
});
|
|
6840
7006
|
}
|
|
6841
7007
|
if (specularFactor) {
|
|
@@ -6848,6 +7014,8 @@ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionPa
|
|
|
6848
7014
|
exports.GLTFMaterialParser._checkOtherTextureTransform(specularGlossinessTexture, "Specular glossiness");
|
|
6849
7015
|
context.get(GLTFParserType.Texture, specularGlossinessTexture.index).then(function(texture) {
|
|
6850
7016
|
material.specularGlossinessTexture = texture;
|
|
7017
|
+
}).catch(function(e) {
|
|
7018
|
+
engineCore.Logger.error("KHR_materials_pbrSpecularGlossiness: specular glossiness texture error", e);
|
|
6851
7019
|
});
|
|
6852
7020
|
}
|
|
6853
7021
|
material.name = ownerSchema.name;
|
|
@@ -6876,12 +7044,16 @@ var KHR_materials_sheen = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
6876
7044
|
exports.GLTFMaterialParser._checkOtherTextureTransform(sheenColorTexture, "Sheen texture");
|
|
6877
7045
|
context.get(GLTFParserType.Texture, sheenColorTexture.index).then(function(texture) {
|
|
6878
7046
|
material.sheenColorTexture = texture;
|
|
7047
|
+
}).catch(function(e) {
|
|
7048
|
+
engineCore.Logger.error("KHR_materials_sheen: sheenColorTexture error", e);
|
|
6879
7049
|
});
|
|
6880
7050
|
}
|
|
6881
7051
|
if (sheenRoughnessTexture) {
|
|
6882
7052
|
exports.GLTFMaterialParser._checkOtherTextureTransform(sheenRoughnessTexture, "SheenRoughness texture");
|
|
6883
7053
|
context.get(GLTFParserType.Texture, sheenRoughnessTexture.index).then(function(texture) {
|
|
6884
7054
|
material.sheenRoughnessTexture = texture;
|
|
7055
|
+
}).catch(function(e) {
|
|
7056
|
+
engineCore.Logger.error("KHR_materials_sheen: sheenRoughnessTexture error", e);
|
|
6885
7057
|
});
|
|
6886
7058
|
}
|
|
6887
7059
|
};
|
|
@@ -6904,6 +7076,8 @@ var KHR_materials_transmission = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
6904
7076
|
exports.GLTFMaterialParser._checkOtherTextureTransform(transmissionTexture, "Transmission texture");
|
|
6905
7077
|
context.get(GLTFParserType.Texture, transmissionTexture.index).then(function(texture) {
|
|
6906
7078
|
material.transmissionTexture = texture;
|
|
7079
|
+
}).catch(function(e) {
|
|
7080
|
+
engineCore.Logger.error("KHR_materials_transmission: transmission texture error", e);
|
|
6907
7081
|
});
|
|
6908
7082
|
}
|
|
6909
7083
|
};
|
|
@@ -6949,6 +7123,8 @@ var KHR_materials_variants = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
6949
7123
|
return variantNames[index].name;
|
|
6950
7124
|
})
|
|
6951
7125
|
});
|
|
7126
|
+
}).catch(function(e) {
|
|
7127
|
+
engineCore.Logger.error("KHR_materials_variants: material error", e);
|
|
6952
7128
|
});
|
|
6953
7129
|
};
|
|
6954
7130
|
var _glTFResource;
|
|
@@ -6982,6 +7158,8 @@ var KHR_materials_volume = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
6982
7158
|
exports.GLTFMaterialParser._checkOtherTextureTransform(thicknessTexture, "Thickness texture");
|
|
6983
7159
|
context.get(GLTFParserType.Texture, thicknessTexture.index).then(function(texture) {
|
|
6984
7160
|
material.thicknessTexture = texture;
|
|
7161
|
+
}).catch(function(e) {
|
|
7162
|
+
engineCore.Logger.error("KHR_materials_volume: thickness texture error", e);
|
|
6985
7163
|
});
|
|
6986
7164
|
}
|
|
6987
7165
|
};
|
|
@@ -7009,57 +7187,48 @@ var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
7009
7187
|
}
|
|
7010
7188
|
var _proto = KHR_texture_basisu.prototype;
|
|
7011
7189
|
_proto.createAndParse = function createAndParse(context, schema, textureInfo) {
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
}).onProgress(undefined, context._onTaskDetail).then(function(texture) {
|
|
7027
|
-
if (!texture.name) {
|
|
7028
|
-
texture.name = textureName || imageName || "texture_" + index;
|
|
7029
|
-
}
|
|
7030
|
-
if (sampler !== undefined) {
|
|
7031
|
-
GLTFUtils.parseSampler(texture, samplerInfo);
|
|
7032
|
-
}
|
|
7033
|
-
return texture;
|
|
7034
|
-
});
|
|
7035
|
-
context._addTaskCompletePromise(promise);
|
|
7036
|
-
return [
|
|
7037
|
-
2,
|
|
7038
|
-
promise
|
|
7039
|
-
];
|
|
7040
|
-
} else {
|
|
7041
|
-
bufferView = glTF.bufferViews[bufferViewIndex];
|
|
7042
|
-
return [
|
|
7043
|
-
2,
|
|
7044
|
-
context.get(GLTFParserType.Buffer, bufferView.buffer).then(function(buffer) {
|
|
7045
|
-
var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
|
|
7046
|
-
return exports.KTX2Loader._parseBuffer(imageBuffer, engine).then(function(param) {
|
|
7047
|
-
var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
|
|
7048
|
-
return exports.KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params);
|
|
7049
|
-
}).then(function(texture) {
|
|
7050
|
-
texture.name = textureName || imageName || "texture_" + bufferViewIndex;
|
|
7051
|
-
if (sampler !== undefined) {
|
|
7052
|
-
GLTFUtils.parseSampler(texture, samplerInfo);
|
|
7053
|
-
}
|
|
7054
|
-
var bufferTextureRestoreInfo = new BufferTextureRestoreInfo(texture, bufferView, mimeType);
|
|
7055
|
-
context.contentRestorer.bufferTextures.push(bufferTextureRestoreInfo);
|
|
7056
|
-
return texture;
|
|
7057
|
-
});
|
|
7058
|
-
})
|
|
7059
|
-
];
|
|
7190
|
+
var glTF = context.glTF, glTFResource = context.glTFResource;
|
|
7191
|
+
var engine = glTFResource.engine, url = glTFResource.url;
|
|
7192
|
+
var sampler = textureInfo.sampler, textureName = textureInfo.name;
|
|
7193
|
+
var source = schema.source;
|
|
7194
|
+
var _glTF_images_source = glTF.images[source], uri = _glTF_images_source.uri, bufferViewIndex = _glTF_images_source.bufferView, mimeType = _glTF_images_source.mimeType, imageName = _glTF_images_source.name;
|
|
7195
|
+
var samplerInfo = sampler !== undefined && GLTFUtils.getSamplerInfo(glTF.samplers[sampler]);
|
|
7196
|
+
if (uri) {
|
|
7197
|
+
var index = uri.lastIndexOf(".");
|
|
7198
|
+
var promise = engine.resourceManager.load({
|
|
7199
|
+
url: engineCore.Utils.resolveAbsoluteUrl(url, uri),
|
|
7200
|
+
type: engineCore.AssetType.KTX2
|
|
7201
|
+
}).onProgress(undefined, context._onTaskDetail).then(function(texture) {
|
|
7202
|
+
if (!texture.name) {
|
|
7203
|
+
texture.name = textureName || imageName || "texture_" + index;
|
|
7060
7204
|
}
|
|
7205
|
+
if (sampler !== undefined) {
|
|
7206
|
+
GLTFUtils.parseSampler(texture, samplerInfo);
|
|
7207
|
+
}
|
|
7208
|
+
return texture;
|
|
7061
7209
|
});
|
|
7062
|
-
|
|
7210
|
+
context._addTaskCompletePromise(promise);
|
|
7211
|
+
return promise;
|
|
7212
|
+
} else {
|
|
7213
|
+
var bufferView = glTF.bufferViews[bufferViewIndex];
|
|
7214
|
+
return context.get(GLTFParserType.Buffer, bufferView.buffer).then(function(buffer) {
|
|
7215
|
+
var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
|
|
7216
|
+
return exports.KTX2Loader._parseBuffer(imageBuffer, engine).then(function(param) {
|
|
7217
|
+
var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
|
|
7218
|
+
return exports.KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params);
|
|
7219
|
+
}).then(function(texture) {
|
|
7220
|
+
texture.name = textureName || imageName || "texture_" + bufferViewIndex;
|
|
7221
|
+
if (sampler !== undefined) {
|
|
7222
|
+
GLTFUtils.parseSampler(texture, samplerInfo);
|
|
7223
|
+
}
|
|
7224
|
+
var bufferTextureRestoreInfo = new BufferTextureRestoreInfo(texture, bufferView, mimeType);
|
|
7225
|
+
context.contentRestorer.bufferTextures.push(bufferTextureRestoreInfo);
|
|
7226
|
+
return texture;
|
|
7227
|
+
});
|
|
7228
|
+
}).catch(function(e) {
|
|
7229
|
+
engineCore.Logger.error("KHR_texture_basisu: buffer error", e);
|
|
7230
|
+
});
|
|
7231
|
+
}
|
|
7063
7232
|
};
|
|
7064
7233
|
return KHR_texture_basisu;
|
|
7065
7234
|
}(GLTFExtensionParser);
|
|
@@ -7149,6 +7318,8 @@ var EXT_meshopt_compression = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
7149
7318
|
return getMeshoptDecoder().then(function(decoder) {
|
|
7150
7319
|
return decoder.decodeGltfBuffer(schema.count, schema.byteStride, new Uint8Array(arrayBuffer, schema.byteOffset, schema.byteLength), schema.mode, schema.filter);
|
|
7151
7320
|
});
|
|
7321
|
+
}).catch(function(e) {
|
|
7322
|
+
engineCore.Logger.error("EXT_meshopt_compression: buffer error", e);
|
|
7152
7323
|
});
|
|
7153
7324
|
};
|
|
7154
7325
|
return EXT_meshopt_compression;
|
|
@@ -7171,6 +7342,8 @@ var KHR_materials_anisotropy = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
7171
7342
|
exports.GLTFMaterialParser._checkOtherTextureTransform(anisotropyTexture, "Anisotropy texture");
|
|
7172
7343
|
context.get(GLTFParserType.Texture, anisotropyTexture.index).then(function(texture) {
|
|
7173
7344
|
material.anisotropyTexture = texture;
|
|
7345
|
+
}).catch(function(e) {
|
|
7346
|
+
engineCore.Logger.error("KHR_materials_anisotropy: anisotropy texture error", e);
|
|
7174
7347
|
});
|
|
7175
7348
|
}
|
|
7176
7349
|
};
|
|
@@ -7195,12 +7368,16 @@ var KHR_materials_iridescence = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
7195
7368
|
exports.GLTFMaterialParser._checkOtherTextureTransform(iridescenceTexture, "Iridescence texture");
|
|
7196
7369
|
context.get(GLTFParserType.Texture, iridescenceTexture.index).then(function(texture) {
|
|
7197
7370
|
material.iridescenceTexture = texture;
|
|
7371
|
+
}).catch(function(e) {
|
|
7372
|
+
engineCore.Logger.error("KHR_materials_iridescence: iridescence texture error", e);
|
|
7198
7373
|
});
|
|
7199
7374
|
}
|
|
7200
7375
|
if (iridescenceThicknessTexture) {
|
|
7201
7376
|
exports.GLTFMaterialParser._checkOtherTextureTransform(iridescenceThicknessTexture, "IridescenceThickness texture");
|
|
7202
7377
|
context.get(GLTFParserType.Texture, iridescenceThicknessTexture.index).then(function(texture) {
|
|
7203
7378
|
material.iridescenceThicknessTexture = texture;
|
|
7379
|
+
}).catch(function(e) {
|
|
7380
|
+
engineCore.Logger.error("KHR_materials_iridescence: iridescence thickness error", e);
|
|
7204
7381
|
});
|
|
7205
7382
|
}
|
|
7206
7383
|
};
|
|
@@ -7227,19 +7404,10 @@ var EXT_texture_webp = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
7227
7404
|
}
|
|
7228
7405
|
var _proto = EXT_texture_webp.prototype;
|
|
7229
7406
|
_proto.createAndParse = function createAndParse(context, schema, textureInfo, textureIndex) {
|
|
7230
|
-
var
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
webPIndex = schema.source;
|
|
7235
|
-
sampler = textureInfo.sampler, tmp = textureInfo.source, fallbackIndex = tmp === void 0 ? 0 : tmp, textureName = textureInfo.name;
|
|
7236
|
-
texture = exports.GLTFTextureParser._parseTexture(context, _this._supportWebP ? webPIndex : fallbackIndex, textureIndex, sampler, textureName);
|
|
7237
|
-
return [
|
|
7238
|
-
2,
|
|
7239
|
-
texture
|
|
7240
|
-
];
|
|
7241
|
-
});
|
|
7242
|
-
})();
|
|
7407
|
+
var webPIndex = schema.source;
|
|
7408
|
+
var sampler = textureInfo.sampler, tmp = textureInfo.source, fallbackIndex = tmp === void 0 ? 0 : tmp, textureName = textureInfo.name;
|
|
7409
|
+
var texture = exports.GLTFTextureParser._parseTexture(context, this._supportWebP ? webPIndex : fallbackIndex, textureIndex, sampler, textureName);
|
|
7410
|
+
return texture;
|
|
7243
7411
|
};
|
|
7244
7412
|
return EXT_texture_webp;
|
|
7245
7413
|
}(GLTFExtensionParser);
|