@galacean/engine-loader 1.3.24 → 1.4.0-alpha.1

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 CHANGED
@@ -39,6 +39,12 @@ function _inherits(subClass, superClass) {
39
39
  if (superClass) _set_prototype_of(subClass, superClass);
40
40
  }
41
41
 
42
+ function _type_of(obj) {
43
+ "@swc/helpers - typeof";
44
+
45
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
46
+ }
47
+
42
48
  /******************************************************************************
43
49
  Copyright (c) Microsoft Corporation.
44
50
 
@@ -62,8 +68,8 @@ function __decorate(decorators, target, key, desc) {
62
68
  }
63
69
 
64
70
  function __generator(thisArg, body) {
65
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
66
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
71
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
72
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
67
73
  function verb(n) { return function (v) { return step([n, v]); }; }
68
74
  function step(op) {
69
75
  if (f) throw new TypeError("Generator is already executing.");
@@ -493,17 +499,18 @@ exports.Texture2DDecoder = __decorate([
493
499
  ], exports.Texture2DDecoder);
494
500
 
495
501
  function _is_native_reflect_construct() {
496
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
497
- if (Reflect.construct.sham) return false;
498
- if (typeof Proxy === "function") return true;
499
-
502
+ // Since Reflect.construct can't be properly polyfilled, some
503
+ // implementations (e.g. core-js@2) don't set the correct internal slots.
504
+ // Those polyfills don't allow us to subclass built-ins, so we need to
505
+ // use our fallback implementation.
500
506
  try {
501
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
502
-
503
- return true;
504
- } catch (e) {
505
- return false;
506
- }
507
+ // If the internal slots aren't set, this throws an error similar to
508
+ // TypeError: this is not a Boolean object.
509
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
510
+ } catch (_) {}
511
+ return (_is_native_reflect_construct = function() {
512
+ return !!result;
513
+ })();
507
514
  }
508
515
 
509
516
  function _construct(Parent, args, Class) {
@@ -524,11 +531,11 @@ function _construct(Parent, args, Class) {
524
531
  return _construct.apply(null, arguments);
525
532
  }
526
533
 
527
- exports.ParserType = void 0;
528
- (function(ParserType) {
534
+ var ParserType = /*#__PURE__*/ function(ParserType) {
529
535
  ParserType[ParserType["Prefab"] = 0] = "Prefab";
530
536
  ParserType[ParserType["Scene"] = 1] = "Scene";
531
- })(exports.ParserType || (exports.ParserType = {}));
537
+ return ParserType;
538
+ }({});
532
539
  /**
533
540
  * Parser context
534
541
  * @export
@@ -579,7 +586,7 @@ var ReflectionParser = /*#__PURE__*/ function() {
579
586
  var _entityConfig_layer;
580
587
  entity.layer = (_entityConfig_layer = entityConfig.layer) != null ? _entityConfig_layer : entity.layer;
581
588
  // @ts-ignore
582
- _this._context.type === exports.ParserType.Prefab && entity._markAsTemplate(_this._context.resource);
589
+ _this._context.type === ParserType.Prefab && entity._markAsTemplate(_this._context.resource);
583
590
  return entity;
584
591
  });
585
592
  };
@@ -607,14 +614,14 @@ var ReflectionParser = /*#__PURE__*/ function() {
607
614
  }
608
615
  }
609
616
  if (item.props) {
610
- var _this = this, _loop = function(key) {
617
+ var _this, _loop = function(key) {
611
618
  var value = item.props[key];
612
619
  var promise = _this.parseBasicType(value, instance[key]).then(function(v) {
613
620
  return instance[key] = v;
614
621
  });
615
622
  promises.push(promise);
616
623
  };
617
- for(var key in item.props)_loop(key);
624
+ for(var key in item.props)_this = this, _loop(key);
618
625
  }
619
626
  return Promise.all(promises).then(function() {
620
627
  var handle = ReflectionParser.customParseComponentHandles[instance.constructor.name];
@@ -637,7 +644,7 @@ var ReflectionParser = /*#__PURE__*/ function() {
637
644
  return Promise.all(value.map(function(item) {
638
645
  return _this.parseBasicType(item);
639
646
  }));
640
- } else if (typeof value === "object" && value != null) {
647
+ } else if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value != null) {
641
648
  if (ReflectionParser._isClass(value)) {
642
649
  // class object
643
650
  return this.parseClassObject(value);
@@ -646,7 +653,7 @@ var ReflectionParser = /*#__PURE__*/ function() {
646
653
  // reference object
647
654
  // @ts-ignore
648
655
  return context.resourceManager.getResourceByRef(value).then(function(resource) {
649
- if (context.type === exports.ParserType.Prefab) {
656
+ if (context.type === ParserType.Prefab) {
650
657
  // @ts-ignore
651
658
  context.resource._addDependenceAsset(resource);
652
659
  }
@@ -656,7 +663,7 @@ var ReflectionParser = /*#__PURE__*/ function() {
656
663
  // entity reference
657
664
  return Promise.resolve(this._context.entityMap.get(value.entityId));
658
665
  } else if (originValue) {
659
- var _this2 = this, _loop = function(key) {
666
+ var _this2, _loop = function(key) {
660
667
  if (key === "methods") {
661
668
  var methods = value[key];
662
669
  for(var methodName in methods){
@@ -674,7 +681,7 @@ var ReflectionParser = /*#__PURE__*/ function() {
674
681
  }
675
682
  };
676
683
  var promises = [];
677
- for(var key in value)_loop(key);
684
+ for(var key in value)_this2 = this, _loop(key);
678
685
  return Promise.all(promises).then(function() {
679
686
  return originValue;
680
687
  });
@@ -697,7 +704,7 @@ var ReflectionParser = /*#__PURE__*/ function() {
697
704
  }).then(function(entity) {
698
705
  // @ts-ignore
699
706
  var resource = engine.resourceManager._objectPool[assetRefId];
700
- if (_this._context.type === exports.ParserType.Prefab) {
707
+ if (_this._context.type === ParserType.Prefab) {
701
708
  // @ts-ignore
702
709
  _this._context.resource._addDependenceAsset(resource);
703
710
  }
@@ -723,12 +730,9 @@ var ReflectionParser = /*#__PURE__*/ function() {
723
730
  };
724
731
  return ReflectionParser;
725
732
  }();
726
- (function() {
727
- ReflectionParser.customParseComponentHandles = new Map();
728
- })();
733
+ ReflectionParser.customParseComponentHandles = new Map();
729
734
 
730
- exports.InterpolableValueType = void 0;
731
- (function(InterpolableValueType) {
735
+ var InterpolableValueType = /*#__PURE__*/ function(InterpolableValueType) {
732
736
  InterpolableValueType[InterpolableValueType["Float"] = 0] = "Float";
733
737
  InterpolableValueType[InterpolableValueType["FloatArray"] = 1] = "FloatArray";
734
738
  InterpolableValueType[InterpolableValueType["Vector2"] = 2] = "Vector2";
@@ -740,7 +744,8 @@ exports.InterpolableValueType = void 0;
740
744
  InterpolableValueType[InterpolableValueType["Boolean"] = 8] = "Boolean";
741
745
  InterpolableValueType[InterpolableValueType["Rect"] = 9] = "Rect";
742
746
  InterpolableValueType[InterpolableValueType["ReferResource"] = 10] = "ReferResource";
743
- })(exports.InterpolableValueType || (exports.InterpolableValueType = {}));
747
+ return InterpolableValueType;
748
+ }({});
744
749
  exports.AnimationClipDecoder = /*#__PURE__*/ function() {
745
750
  function AnimationClipDecoder() {}
746
751
  AnimationClipDecoder.decode = function decode(engine, bufferReader) {
@@ -932,8 +937,7 @@ exports.AnimationClipDecoder = __decorate([
932
937
  decoder("AnimationClip")
933
938
  ], exports.AnimationClipDecoder);
934
939
 
935
- exports.MaterialLoaderType = void 0;
936
- (function(MaterialLoaderType) {
940
+ var MaterialLoaderType = /*#__PURE__*/ function(MaterialLoaderType) {
937
941
  MaterialLoaderType["Vector2"] = "Vector2";
938
942
  MaterialLoaderType["Vector3"] = "Vector3";
939
943
  MaterialLoaderType["Vector4"] = "Vector4";
@@ -942,13 +946,14 @@ exports.MaterialLoaderType = void 0;
942
946
  MaterialLoaderType["Texture"] = "Texture";
943
947
  MaterialLoaderType["Boolean"] = "Boolean";
944
948
  MaterialLoaderType["Integer"] = "Integer";
945
- })(exports.MaterialLoaderType || (exports.MaterialLoaderType = {}));
949
+ return MaterialLoaderType;
950
+ }({});
946
951
 
947
- exports.SpecularMode = void 0;
948
- (function(SpecularMode) {
952
+ var SpecularMode = /*#__PURE__*/ function(SpecularMode) {
949
953
  SpecularMode["Sky"] = "Sky";
950
954
  SpecularMode["Custom"] = "Custom";
951
- })(exports.SpecularMode || (exports.SpecularMode = {}));
955
+ return SpecularMode;
956
+ }({});
952
957
 
953
958
  function _instanceof(left, right) {
954
959
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
@@ -997,13 +1002,11 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
997
1002
 
998
1003
  /**
999
1004
  * The Prefab resource.
1000
- */ var PrefabResource = /*#__PURE__*/ function(ReferResource1) {
1001
- _inherits(PrefabResource, ReferResource1);
1005
+ */ var PrefabResource = /*#__PURE__*/ function(ReferResource) {
1006
+ _inherits(PrefabResource, ReferResource);
1002
1007
  function PrefabResource(engine, url) {
1003
1008
  var _this;
1004
- _this = ReferResource1.call(this, engine) || this;
1005
- _this.url = url;
1006
- _this._dependenceAssets = new Set();
1009
+ _this = ReferResource.call(this, engine) || this, _this.url = url, _this._dependenceAssets = new Set();
1007
1010
  return _this;
1008
1011
  }
1009
1012
  var _proto = PrefabResource.prototype;
@@ -1023,7 +1026,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1023
1026
  };
1024
1027
  _proto._onDestroy = function _onDestroy() {
1025
1028
  var _this = this;
1026
- ReferResource1.prototype._onDestroy.call(this);
1029
+ ReferResource.prototype._onDestroy.call(this);
1027
1030
  this._root.destroy();
1028
1031
  this._dependenceAssets.forEach(function(asset) {
1029
1032
  // @ts-ignore
@@ -1098,10 +1101,9 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1098
1101
  };
1099
1102
  _proto._parsePrefabModification = function _parsePrefabModification() {
1100
1103
  var _loop = function(i, l) {
1101
- var _modifications;
1102
1104
  var entityConfig = entitiesConfig[i];
1103
1105
  var id = entityConfig.id, modifications = entityConfig.modifications;
1104
- if ((_modifications = modifications) == null ? void 0 : _modifications.length) {
1106
+ if (modifications == null ? void 0 : modifications.length) {
1105
1107
  var _promises;
1106
1108
  var rootEntity = entityMap.get(id);
1107
1109
  (_promises = promises).push.apply(_promises, [].concat(modifications.map(function(modification) {
@@ -1130,10 +1132,9 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1130
1132
  };
1131
1133
  _proto._parsePrefabRemovedEntities = function _parsePrefabRemovedEntities() {
1132
1134
  var _loop = function(i, l) {
1133
- var _removedEntities;
1134
1135
  var entityConfig = entitiesConfig[i];
1135
1136
  var id = entityConfig.id, removedEntities = entityConfig.removedEntities;
1136
- if ((_removedEntities = removedEntities) == null ? void 0 : _removedEntities.length) {
1137
+ if (removedEntities == null ? void 0 : removedEntities.length) {
1137
1138
  var _promises;
1138
1139
  var rootEntity = entityMap.get(id);
1139
1140
  (_promises = promises).push.apply(_promises, [].concat(removedEntities.map(function(target) {
@@ -1155,10 +1156,9 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1155
1156
  };
1156
1157
  _proto._parsePrefabRemovedComponents = function _parsePrefabRemovedComponents() {
1157
1158
  var _loop = function(i, l) {
1158
- var _removedComponents;
1159
1159
  var entityConfig = entitiesConfig[i];
1160
1160
  var id = entityConfig.id, removedComponents = entityConfig.removedComponents;
1161
- if ((_removedComponents = removedComponents) == null ? void 0 : _removedComponents.length) {
1161
+ if (removedComponents == null ? void 0 : removedComponents.length) {
1162
1162
  var _promises;
1163
1163
  var rootEntity = entityMap.get(id);
1164
1164
  (_promises = promises).concat.apply(_promises, [].concat(removedComponents.map(function(target) {
@@ -1216,7 +1216,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1216
1216
  refId: assetRefId
1217
1217
  }).then(function(prefabResource) {
1218
1218
  var entity = _instanceof(prefabResource, PrefabResource) ? prefabResource.instantiate() : prefabResource.instantiateSceneRoot();
1219
- var instanceContext = new ParserContext(engine, exports.ParserType.Prefab, null);
1219
+ var instanceContext = new ParserContext(engine, ParserType.Prefab, null);
1220
1220
  if (!entityConfig.parent) _this.context.rootIds.push(entityConfig.id);
1221
1221
  _this._generateInstanceContext(entity, instanceContext, "");
1222
1222
  _this._prefabContextMap.set(entity, instanceContext);
@@ -1295,12 +1295,11 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1295
1295
  return HierarchyParser;
1296
1296
  }();
1297
1297
 
1298
- /** @Internal */ var SceneParser = /*#__PURE__*/ function(HierarchyParser1) {
1299
- _inherits(SceneParser, HierarchyParser1);
1298
+ /** @Internal */ var SceneParser = /*#__PURE__*/ function(HierarchyParser) {
1299
+ _inherits(SceneParser, HierarchyParser);
1300
1300
  function SceneParser(data, context, scene) {
1301
1301
  var _this;
1302
- _this = HierarchyParser1.call(this, data, context) || this;
1303
- _this.scene = scene;
1302
+ _this = HierarchyParser.call(this, data, context) || this, _this.scene = scene;
1304
1303
  return _this;
1305
1304
  }
1306
1305
  var _proto = SceneParser.prototype;
@@ -1319,7 +1318,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1319
1318
  * @returns a promise of scene
1320
1319
  */ SceneParser.parse = function parse(engine, sceneData) {
1321
1320
  var scene = new engineCore.Scene(engine);
1322
- var context = new ParserContext(engine, exports.ParserType.Scene, scene);
1321
+ var context = new ParserContext(engine, ParserType.Scene, scene);
1323
1322
  var parser = new SceneParser(sceneData, context, scene);
1324
1323
  parser.start();
1325
1324
  return parser.promise.then(function() {
@@ -1329,10 +1328,10 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1329
1328
  return SceneParser;
1330
1329
  }(HierarchyParser);
1331
1330
 
1332
- exports.EditorTextureLoader = /*#__PURE__*/ function(Loader1) {
1333
- _inherits(EditorTextureLoader, Loader1);
1331
+ exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
1332
+ _inherits(EditorTextureLoader, Loader);
1334
1333
  function EditorTextureLoader() {
1335
- return Loader1.apply(this, arguments);
1334
+ return Loader.apply(this, arguments) || this;
1336
1335
  }
1337
1336
  var _proto = EditorTextureLoader.prototype;
1338
1337
  _proto.load = function load(item, resourceManager) {
@@ -1369,10 +1368,10 @@ exports.EditorTextureLoader = __decorate([
1369
1368
  });
1370
1369
  }
1371
1370
 
1372
- var AnimationClipLoader = /*#__PURE__*/ function(Loader1) {
1373
- _inherits(AnimationClipLoader, Loader1);
1371
+ var AnimationClipLoader = /*#__PURE__*/ function(Loader) {
1372
+ _inherits(AnimationClipLoader, Loader);
1374
1373
  function AnimationClipLoader() {
1375
- return Loader1.apply(this, arguments);
1374
+ return Loader.apply(this, arguments) || this;
1376
1375
  }
1377
1376
  var _proto = AnimationClipLoader.prototype;
1378
1377
  _proto.load = function load(item, resourceManager) {
@@ -1400,9 +1399,8 @@ var AnimationClipLoader = /*#__PURE__*/ function(Loader1) {
1400
1399
  });
1401
1400
  };
1402
1401
  _proto._parseKeyframeValue = function _parseKeyframeValue(keyframe, resourceManager) {
1403
- var _value;
1404
1402
  var value = keyframe.value;
1405
- if (typeof value === "object" && ((_value = value) == null ? void 0 : _value.refId)) {
1403
+ if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && (value == null ? void 0 : value.refId)) {
1406
1404
  return new Promise(function(resolve) {
1407
1405
  resourceManager// @ts-ignore
1408
1406
  .getResourceByRef(value).then(function(asset) {
@@ -1425,7 +1423,7 @@ AnimationClipLoader = __decorate([
1425
1423
  var AnimatorControllerLoader = /*#__PURE__*/ function(Loader1) {
1426
1424
  _inherits(AnimatorControllerLoader, Loader1);
1427
1425
  function AnimatorControllerLoader() {
1428
- return Loader1.apply(this, arguments);
1426
+ return Loader1.apply(this, arguments) || this;
1429
1427
  }
1430
1428
  var _proto = AnimatorControllerLoader.prototype;
1431
1429
  _proto.load = function load(item, resourceManager) {
@@ -1493,7 +1491,11 @@ var AnimatorControllerLoader = /*#__PURE__*/ function(Loader1) {
1493
1491
  animatorController.addLayer(layer);
1494
1492
  });
1495
1493
  parameters.forEach(function(parameterData) {
1496
- animatorController.addParameter(parameterData.name, parameterData.defaultValue);
1494
+ if (parameterData.isTrigger) {
1495
+ animatorController.addTriggerParameter(parameterData.name);
1496
+ } else {
1497
+ animatorController.addParameter(parameterData.name, parameterData.defaultValue);
1498
+ }
1497
1499
  });
1498
1500
  Promise.all(promises).then(function(clipData) {
1499
1501
  clipData.forEach(function(data) {
@@ -1507,6 +1509,8 @@ var AnimatorControllerLoader = /*#__PURE__*/ function(Loader1) {
1507
1509
  };
1508
1510
  _proto._createTransition = function _createTransition(transitionData, destinationState) {
1509
1511
  var transition = new engineCore.AnimatorStateTransition();
1512
+ transition.hasExitTime = transitionData.hasExitTime;
1513
+ transition.isFixedDuration = transitionData.isFixedDuration;
1510
1514
  transition.duration = transitionData.duration;
1511
1515
  transition.offset = transitionData.offset;
1512
1516
  transition.exitTime = transitionData.exitTime;
@@ -1516,7 +1520,7 @@ var AnimatorControllerLoader = /*#__PURE__*/ function(Loader1) {
1516
1520
  transition._isExit = transitionData.isExit;
1517
1521
  transition.destinationState = destinationState;
1518
1522
  transitionData.conditions.forEach(function(conditionData) {
1519
- transition.addCondition(conditionData.mode, conditionData.parameterName, conditionData.threshold);
1523
+ transition.addCondition(conditionData.parameterName, conditionData.mode, conditionData.threshold);
1520
1524
  });
1521
1525
  return transition;
1522
1526
  };
@@ -1531,10 +1535,10 @@ AnimatorControllerLoader = __decorate([
1531
1535
  function isBase64(url) {
1532
1536
  return /^data:(.+?);base64,/.test(url);
1533
1537
  }
1534
- var BufferLoader = /*#__PURE__*/ function(Loader1) {
1535
- _inherits(BufferLoader, Loader1);
1538
+ var BufferLoader = /*#__PURE__*/ function(Loader) {
1539
+ _inherits(BufferLoader, Loader);
1536
1540
  function BufferLoader() {
1537
- return Loader1.apply(this, arguments);
1541
+ return Loader.apply(this, arguments) || this;
1538
1542
  }
1539
1543
  var _proto = BufferLoader.prototype;
1540
1544
  _proto.load = function load(item, resourceManager) {
@@ -1562,40 +1566,26 @@ BufferLoader = __decorate([
1562
1566
  ], false)
1563
1567
  ], BufferLoader);
1564
1568
 
1565
- var EnvLoader = /*#__PURE__*/ function(Loader1) {
1566
- _inherits(EnvLoader, Loader1);
1569
+ var EnvLoader = /*#__PURE__*/ function(Loader) {
1570
+ _inherits(EnvLoader, Loader);
1567
1571
  function EnvLoader() {
1568
- return Loader1.apply(this, arguments);
1572
+ return Loader.apply(this, arguments) || this;
1569
1573
  }
1570
1574
  var _proto = EnvLoader.prototype;
1571
1575
  _proto.load = function load(item, resourceManager) {
1572
1576
  return new engineCore.AssetPromise(function(resolve, reject) {
1573
- resourceManager// @ts-ignore
1574
- ._request(item.url, _extends({}, item, {
1577
+ var requestConfig = _extends({}, item, {
1575
1578
  type: "arraybuffer"
1576
- })).then(function(arraybuffer) {
1577
- var _this;
1578
- var shArray = new Float32Array(arraybuffer, 0, 27);
1579
- var shByteLength = 27 * 4;
1580
- var size = (_this = new Uint16Array(arraybuffer, shByteLength, 1)) == null ? void 0 : _this[0];
1581
- var engine = resourceManager.engine;
1582
- var texture = new engineCore.TextureCube(engine, size);
1583
- texture.filterMode = engineCore.TextureFilterMode.Trilinear;
1584
- var mipmapCount = texture.mipmapCount;
1585
- var offset = shByteLength + 2;
1586
- for(var mipLevel = 0; mipLevel < mipmapCount; mipLevel++){
1587
- var mipSize = size >> mipLevel;
1588
- for(var face = 0; face < 6; face++){
1589
- var dataSize = mipSize * mipSize * 4;
1590
- var data = new Uint8Array(arraybuffer, offset, dataSize);
1591
- offset += dataSize;
1592
- texture.setPixelBuffer(engineCore.TextureCubeFace.PositiveX + face, data, mipLevel);
1593
- }
1594
- }
1579
+ });
1580
+ var engine = resourceManager.engine;
1581
+ resourceManager// @ts-ignore
1582
+ ._request(item.url, requestConfig).then(function(arraybuffer) {
1583
+ var texture = EnvLoader._setTextureByBuffer(engine, arraybuffer);
1584
+ engine.resourceManager.addContentRestorer(new EnvContentRestorer(texture, item.url, requestConfig));
1595
1585
  var ambientLight = new engineCore.AmbientLight(engine);
1596
1586
  var sh = new engineMath.SphericalHarmonics3();
1597
1587
  ambientLight.diffuseMode = engineCore.DiffuseMode.SphericalHarmonics;
1598
- sh.copyFromArray(shArray);
1588
+ sh.copyFromArray(new Float32Array(arraybuffer, 0, 27));
1599
1589
  ambientLight.diffuseSphericalHarmonics = sh;
1600
1590
  ambientLight.specularTexture = texture;
1601
1591
  ambientLight.specularTextureDecodeRGBM = true;
@@ -1605,6 +1595,27 @@ var EnvLoader = /*#__PURE__*/ function(Loader1) {
1605
1595
  });
1606
1596
  });
1607
1597
  };
1598
+ /**
1599
+ * @internal
1600
+ */ EnvLoader._setTextureByBuffer = function _setTextureByBuffer(engine, buffer, texture) {
1601
+ var _this;
1602
+ var shByteLength = 27 * 4;
1603
+ var size = (_this = new Uint16Array(buffer, shByteLength, 1)) == null ? void 0 : _this[0];
1604
+ texture || (texture = new engineCore.TextureCube(engine, size));
1605
+ texture.filterMode = engineCore.TextureFilterMode.Trilinear;
1606
+ var mipmapCount = texture.mipmapCount;
1607
+ var offset = shByteLength + 2;
1608
+ for(var mipLevel = 0; mipLevel < mipmapCount; mipLevel++){
1609
+ var mipSize = size >> mipLevel;
1610
+ for(var face = 0; face < 6; face++){
1611
+ var dataSize = mipSize * mipSize * 4;
1612
+ var data = new Uint8Array(buffer, offset, dataSize);
1613
+ offset += dataSize;
1614
+ texture.setPixelBuffer(engineCore.TextureCubeFace.PositiveX + face, data, mipLevel);
1615
+ }
1616
+ }
1617
+ return texture;
1618
+ };
1608
1619
  return EnvLoader;
1609
1620
  }(engineCore.Loader);
1610
1621
  EnvLoader = __decorate([
@@ -1612,6 +1623,27 @@ EnvLoader = __decorate([
1612
1623
  "env"
1613
1624
  ])
1614
1625
  ], EnvLoader);
1626
+ /**
1627
+ * @internal
1628
+ */ var EnvContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
1629
+ _inherits(EnvContentRestorer, ContentRestorer);
1630
+ function EnvContentRestorer(resource, url, requestConfig) {
1631
+ var _this;
1632
+ _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
1633
+ return _this;
1634
+ }
1635
+ var _proto = EnvContentRestorer.prototype;
1636
+ _proto.restoreContent = function restoreContent() {
1637
+ var _this = this;
1638
+ return new engineCore.AssetPromise(function(resolve, reject) {
1639
+ engineCore.request(_this.url, _this.requestConfig).then(function(buffer) {
1640
+ EnvLoader._setTextureByBuffer(_this.resource.engine, buffer, _this.resource);
1641
+ resolve(_this.resource);
1642
+ }).catch(reject);
1643
+ });
1644
+ };
1645
+ return EnvContentRestorer;
1646
+ }(engineCore.ContentRestorer);
1615
1647
 
1616
1648
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1617
1649
  try {
@@ -1644,10 +1676,10 @@ function _async_to_generator(fn) {
1644
1676
  };
1645
1677
  }
1646
1678
 
1647
- var FontLoader = /*#__PURE__*/ function(Loader1) {
1648
- _inherits(FontLoader, Loader1);
1679
+ var FontLoader = /*#__PURE__*/ function(Loader) {
1680
+ _inherits(FontLoader, Loader);
1649
1681
  function FontLoader() {
1650
- return Loader1.apply(this, arguments);
1682
+ return Loader.apply(this, arguments) || this;
1651
1683
  }
1652
1684
  var _proto = FontLoader.prototype;
1653
1685
  _proto.load = function load(item, resourceManager) {
@@ -1705,11 +1737,11 @@ FontLoader = __decorate([
1705
1737
 
1706
1738
  /**
1707
1739
  * The glTF resource.
1708
- */ var GLTFResource = /*#__PURE__*/ function(ReferResource1) {
1709
- _inherits(GLTFResource, ReferResource1);
1740
+ */ var GLTFResource = /*#__PURE__*/ function(ReferResource) {
1741
+ _inherits(GLTFResource, ReferResource);
1710
1742
  function GLTFResource(engine, url) {
1711
1743
  var _this;
1712
- _this = ReferResource1.call(this, engine) || this;
1744
+ _this = ReferResource.call(this, engine) || this;
1713
1745
  _this.url = url;
1714
1746
  return _this;
1715
1747
  }
@@ -1723,7 +1755,7 @@ FontLoader = __decorate([
1723
1755
  return sceneRoot.clone();
1724
1756
  };
1725
1757
  _proto._onDestroy = function _onDestroy() {
1726
- ReferResource1.prototype._onDestroy.call(this);
1758
+ ReferResource.prototype._onDestroy.call(this);
1727
1759
  var _this = this, textures = _this.textures, materials = _this.materials, meshes = _this.meshes;
1728
1760
  textures && this._disassociationSuperResource(textures);
1729
1761
  materials && this._disassociationSuperResource(materials);
@@ -1772,150 +1804,159 @@ FontLoader = __decorate([
1772
1804
 
1773
1805
  /**
1774
1806
  * Module for glTF 2.0 Interface
1775
- */ var AccessorComponentType;
1776
- (function(AccessorComponentType) {
1777
- AccessorComponentType[AccessorComponentType[/**
1807
+ */ /**
1808
+ * The datatype of the components in the attribute
1809
+ */ var AccessorComponentType = /*#__PURE__*/ function(AccessorComponentType) {
1810
+ /**
1778
1811
  * Byte
1779
- */ "BYTE"] = 5120] = "BYTE";
1780
- AccessorComponentType[AccessorComponentType[/**
1812
+ */ AccessorComponentType[AccessorComponentType["BYTE"] = 5120] = "BYTE";
1813
+ /**
1781
1814
  * Unsigned Byte
1782
- */ "UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE";
1783
- AccessorComponentType[AccessorComponentType[/**
1815
+ */ AccessorComponentType[AccessorComponentType["UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE";
1816
+ /**
1784
1817
  * Short
1785
- */ "SHORT"] = 5122] = "SHORT";
1786
- AccessorComponentType[AccessorComponentType[/**
1818
+ */ AccessorComponentType[AccessorComponentType["SHORT"] = 5122] = "SHORT";
1819
+ /**
1787
1820
  * Unsigned Short
1788
- */ "UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT";
1789
- AccessorComponentType[AccessorComponentType[/**
1821
+ */ AccessorComponentType[AccessorComponentType["UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT";
1822
+ /**
1790
1823
  * Unsigned Int
1791
- */ "UNSIGNED_INT"] = 5125] = "UNSIGNED_INT";
1792
- AccessorComponentType[AccessorComponentType[/**
1824
+ */ AccessorComponentType[AccessorComponentType["UNSIGNED_INT"] = 5125] = "UNSIGNED_INT";
1825
+ /**
1793
1826
  * Float
1794
- */ "FLOAT"] = 5126] = "FLOAT";
1795
- })(AccessorComponentType || (AccessorComponentType = {}));
1796
- exports.AccessorType = void 0;
1797
- (function(AccessorType) {
1798
- AccessorType[/**
1827
+ */ AccessorComponentType[AccessorComponentType["FLOAT"] = 5126] = "FLOAT";
1828
+ return AccessorComponentType;
1829
+ }({});
1830
+ /**
1831
+ * Specifies if the attirbute is a scalar, vector, or matrix
1832
+ */ var AccessorType = /*#__PURE__*/ function(AccessorType) {
1833
+ /**
1799
1834
  * Scalar
1800
- */ "SCALAR"] = "SCALAR";
1801
- AccessorType[/**
1835
+ */ AccessorType["SCALAR"] = "SCALAR";
1836
+ /**
1802
1837
  * Vector2
1803
- */ "VEC2"] = "VEC2";
1804
- AccessorType[/**
1838
+ */ AccessorType["VEC2"] = "VEC2";
1839
+ /**
1805
1840
  * Vector3
1806
- */ "VEC3"] = "VEC3";
1807
- AccessorType[/**
1841
+ */ AccessorType["VEC3"] = "VEC3";
1842
+ /**
1808
1843
  * Vector4
1809
- */ "VEC4"] = "VEC4";
1810
- AccessorType[/**
1844
+ */ AccessorType["VEC4"] = "VEC4";
1845
+ /**
1811
1846
  * Matrix2x2
1812
- */ "MAT2"] = "MAT2";
1813
- AccessorType[/**
1847
+ */ AccessorType["MAT2"] = "MAT2";
1848
+ /**
1814
1849
  * Matrix3x3
1815
- */ "MAT3"] = "MAT3";
1816
- AccessorType[/**
1850
+ */ AccessorType["MAT3"] = "MAT3";
1851
+ /**
1817
1852
  * Matrix4x4
1818
- */ "MAT4"] = "MAT4";
1819
- })(exports.AccessorType || (exports.AccessorType = {}));
1820
- var AnimationChannelTargetPath;
1821
- (function(AnimationChannelTargetPath) {
1822
- AnimationChannelTargetPath[/**
1853
+ */ AccessorType["MAT4"] = "MAT4";
1854
+ return AccessorType;
1855
+ }({});
1856
+ /**
1857
+ * The name of the node's TRS property to modify, or the weights of the Morph Targets it instantiates
1858
+ */ var AnimationChannelTargetPath = /*#__PURE__*/ function(AnimationChannelTargetPath) {
1859
+ /**
1823
1860
  * Translation
1824
- */ "TRANSLATION"] = "translation";
1825
- AnimationChannelTargetPath[/**
1861
+ */ AnimationChannelTargetPath["TRANSLATION"] = "translation";
1862
+ /**
1826
1863
  * Rotation
1827
- */ "ROTATION"] = "rotation";
1828
- AnimationChannelTargetPath[/**
1864
+ */ AnimationChannelTargetPath["ROTATION"] = "rotation";
1865
+ /**
1829
1866
  * Scale
1830
- */ "SCALE"] = "scale";
1831
- AnimationChannelTargetPath[/**
1867
+ */ AnimationChannelTargetPath["SCALE"] = "scale";
1868
+ /**
1832
1869
  * Weights
1833
- */ "WEIGHTS"] = "weights";
1834
- })(AnimationChannelTargetPath || (AnimationChannelTargetPath = {}));
1835
- var AnimationSamplerInterpolation;
1836
- (function(AnimationSamplerInterpolation) {
1837
- AnimationSamplerInterpolation[/**
1870
+ */ AnimationChannelTargetPath["WEIGHTS"] = "weights";
1871
+ return AnimationChannelTargetPath;
1872
+ }({});
1873
+ /**
1874
+ * Interpolation algorithm
1875
+ */ var AnimationSamplerInterpolation = /*#__PURE__*/ function(AnimationSamplerInterpolation) {
1876
+ /**
1838
1877
  * The animated values are linearly interpolated between keyframes
1839
- */ "Linear"] = "LINEAR";
1840
- AnimationSamplerInterpolation[/**
1878
+ */ AnimationSamplerInterpolation["Linear"] = "LINEAR";
1879
+ /**
1841
1880
  * The animated values remain constant to the output of the first keyframe, until the next keyframe
1842
- */ "Step"] = "STEP";
1843
- AnimationSamplerInterpolation[/**
1881
+ */ AnimationSamplerInterpolation["Step"] = "STEP";
1882
+ /**
1844
1883
  * The animation's interpolation is computed using a cubic spline with specified tangents
1845
- */ "CubicSpine"] = "CUBICSPLINE";
1846
- })(AnimationSamplerInterpolation || (AnimationSamplerInterpolation = {}));
1847
- var CameraType;
1848
- (function(CameraType) {
1849
- CameraType[/**
1884
+ */ AnimationSamplerInterpolation["CubicSpine"] = "CUBICSPLINE";
1885
+ return AnimationSamplerInterpolation;
1886
+ }({});
1887
+ /**
1888
+ * A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene
1889
+ */ var CameraType = /*#__PURE__*/ function(CameraType) {
1890
+ /**
1850
1891
  * A perspective camera containing properties to create a perspective projection matrix
1851
- */ "PERSPECTIVE"] = "perspective";
1852
- CameraType[/**
1892
+ */ CameraType["PERSPECTIVE"] = "perspective";
1893
+ /**
1853
1894
  * An orthographic camera containing properties to create an orthographic projection matrix
1854
- */ "ORTHOGRAPHIC"] = "orthographic";
1855
- })(CameraType || (CameraType = {}));
1856
- var ImageMimeType;
1857
- (function(ImageMimeType) {
1858
- ImageMimeType[/**
1859
- * JPEG Mime-type
1860
- */ "JPEG"] = "image/jpeg";
1861
- ImageMimeType[/**
1862
- * PNG Mime-type
1863
- */ "PNG"] = "image/png";
1864
- })(ImageMimeType || (ImageMimeType = {}));
1865
- var MaterialAlphaMode;
1866
- (function(MaterialAlphaMode) {
1867
- MaterialAlphaMode[/**
1895
+ */ CameraType["ORTHOGRAPHIC"] = "orthographic";
1896
+ return CameraType;
1897
+ }({});
1898
+ /**
1899
+ * The alpha rendering mode of the material
1900
+ */ var MaterialAlphaMode = /*#__PURE__*/ function(MaterialAlphaMode) {
1901
+ /**
1868
1902
  * The alpha value is ignored and the rendered output is fully opaque
1869
- */ "OPAQUE"] = "OPAQUE";
1870
- MaterialAlphaMode[/**
1903
+ */ MaterialAlphaMode["OPAQUE"] = "OPAQUE";
1904
+ /**
1871
1905
  * The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value
1872
- */ "MASK"] = "MASK";
1873
- MaterialAlphaMode[/**
1906
+ */ MaterialAlphaMode["MASK"] = "MASK";
1907
+ /**
1874
1908
  * The alpha value is used to composite the source and destination areas. The rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator)
1875
- */ "BLEND"] = "BLEND";
1876
- })(MaterialAlphaMode || (MaterialAlphaMode = {}));
1877
- var TextureMagFilter;
1878
- (function(TextureMagFilter) {
1879
- TextureMagFilter[TextureMagFilter[/**
1909
+ */ MaterialAlphaMode["BLEND"] = "BLEND";
1910
+ return MaterialAlphaMode;
1911
+ }({});
1912
+ /**
1913
+ * Magnification filter. Valid values correspond to WebGL enums: 9728 (NEAREST) and 9729 (LINEAR)
1914
+ */ var TextureMagFilter = /*#__PURE__*/ function(TextureMagFilter) {
1915
+ /**
1880
1916
  * Nearest
1881
- */ "NEAREST"] = 9728] = "NEAREST";
1882
- TextureMagFilter[TextureMagFilter[/**
1917
+ */ TextureMagFilter[TextureMagFilter["NEAREST"] = 9728] = "NEAREST";
1918
+ /**
1883
1919
  * Linear
1884
- */ "LINEAR"] = 9729] = "LINEAR";
1885
- })(TextureMagFilter || (TextureMagFilter = {}));
1886
- var TextureMinFilter;
1887
- (function(TextureMinFilter) {
1888
- TextureMinFilter[TextureMinFilter[/**
1920
+ */ TextureMagFilter[TextureMagFilter["LINEAR"] = 9729] = "LINEAR";
1921
+ return TextureMagFilter;
1922
+ }({});
1923
+ /**
1924
+ * Minification filter. All valid values correspond to WebGL enums
1925
+ */ var TextureMinFilter = /*#__PURE__*/ function(TextureMinFilter) {
1926
+ /**
1889
1927
  * Nearest
1890
- */ "NEAREST"] = 9728] = "NEAREST";
1891
- TextureMinFilter[TextureMinFilter[/**
1928
+ */ TextureMinFilter[TextureMinFilter["NEAREST"] = 9728] = "NEAREST";
1929
+ /**
1892
1930
  * Linear
1893
- */ "LINEAR"] = 9729] = "LINEAR";
1894
- TextureMinFilter[TextureMinFilter[/**
1931
+ */ TextureMinFilter[TextureMinFilter["LINEAR"] = 9729] = "LINEAR";
1932
+ /**
1895
1933
  * Nearest Mip-Map Nearest
1896
- */ "NEAREST_MIPMAP_NEAREST"] = 9984] = "NEAREST_MIPMAP_NEAREST";
1897
- TextureMinFilter[TextureMinFilter[/**
1934
+ */ TextureMinFilter[TextureMinFilter["NEAREST_MIPMAP_NEAREST"] = 9984] = "NEAREST_MIPMAP_NEAREST";
1935
+ /**
1898
1936
  * Linear Mipmap Nearest
1899
- */ "LINEAR_MIPMAP_NEAREST"] = 9985] = "LINEAR_MIPMAP_NEAREST";
1900
- TextureMinFilter[TextureMinFilter[/**
1937
+ */ TextureMinFilter[TextureMinFilter["LINEAR_MIPMAP_NEAREST"] = 9985] = "LINEAR_MIPMAP_NEAREST";
1938
+ /**
1901
1939
  * Nearest Mipmap Linear
1902
- */ "NEAREST_MIPMAP_LINEAR"] = 9986] = "NEAREST_MIPMAP_LINEAR";
1903
- TextureMinFilter[TextureMinFilter[/**
1940
+ */ TextureMinFilter[TextureMinFilter["NEAREST_MIPMAP_LINEAR"] = 9986] = "NEAREST_MIPMAP_LINEAR";
1941
+ /**
1904
1942
  * Linear Mipmap Linear
1905
- */ "LINEAR_MIPMAP_LINEAR"] = 9987] = "LINEAR_MIPMAP_LINEAR";
1906
- })(TextureMinFilter || (TextureMinFilter = {}));
1907
- var TextureWrapMode;
1908
- (function(TextureWrapMode) {
1909
- TextureWrapMode[TextureWrapMode[/**
1943
+ */ TextureMinFilter[TextureMinFilter["LINEAR_MIPMAP_LINEAR"] = 9987] = "LINEAR_MIPMAP_LINEAR";
1944
+ return TextureMinFilter;
1945
+ }({});
1946
+ /**
1947
+ * S (U) wrapping mode. All valid values correspond to WebGL enums
1948
+ */ var TextureWrapMode = /*#__PURE__*/ function(TextureWrapMode) {
1949
+ /**
1910
1950
  * Clamp to Edge
1911
- */ "CLAMP_TO_EDGE"] = 33071] = "CLAMP_TO_EDGE";
1912
- TextureWrapMode[TextureWrapMode[/**
1951
+ */ TextureWrapMode[TextureWrapMode["CLAMP_TO_EDGE"] = 33071] = "CLAMP_TO_EDGE";
1952
+ /**
1913
1953
  * Mirrored Repeat
1914
- */ "MIRRORED_REPEAT"] = 33648] = "MIRRORED_REPEAT";
1915
- TextureWrapMode[TextureWrapMode[/**
1954
+ */ TextureWrapMode[TextureWrapMode["MIRRORED_REPEAT"] = 33648] = "MIRRORED_REPEAT";
1955
+ /**
1916
1956
  * Repeat
1917
- */ "REPEAT"] = 10497] = "REPEAT";
1918
- })(TextureWrapMode || (TextureWrapMode = {}));
1957
+ */ TextureWrapMode[TextureWrapMode["REPEAT"] = 10497] = "REPEAT";
1958
+ return TextureWrapMode;
1959
+ }({});
1919
1960
 
1920
1961
  /**
1921
1962
  * @internal
@@ -2020,7 +2061,7 @@ var TextureWrapMode;
2020
2061
  task.total += 1;
2021
2062
  taskPromise.then(function() {
2022
2063
  _this._setTaskCompleteProgress(++task.loaded, task.total);
2023
- });
2064
+ }, function() {});
2024
2065
  };
2025
2066
  _proto._handleSubAsset = function _handleSubAsset(resource, type, index) {
2026
2067
  var _this = this;
@@ -2060,9 +2101,7 @@ var TextureWrapMode;
2060
2101
  };
2061
2102
  return GLTFParserContext;
2062
2103
  }();
2063
- (function() {
2064
- GLTFParserContext._parsers = {};
2065
- })();
2104
+ GLTFParserContext._parsers = {};
2066
2105
  /**
2067
2106
  * @internal
2068
2107
  */ var BufferInfo = function BufferInfo(data, interleaved, stride) {
@@ -2071,8 +2110,7 @@ var TextureWrapMode;
2071
2110
  this.stride = stride;
2072
2111
  this.vertexBindingInfos = {};
2073
2112
  };
2074
- exports.GLTFParserType = void 0;
2075
- (function(GLTFParserType) {
2113
+ var GLTFParserType = /*#__PURE__*/ function(GLTFParserType) {
2076
2114
  GLTFParserType[GLTFParserType["Schema"] = 0] = "Schema";
2077
2115
  GLTFParserType[GLTFParserType["Validator"] = 1] = "Validator";
2078
2116
  GLTFParserType[GLTFParserType["Scene"] = 2] = "Scene";
@@ -2085,9 +2123,10 @@ exports.GLTFParserType = void 0;
2085
2123
  GLTFParserType[GLTFParserType["Skin"] = 9] = "Skin";
2086
2124
  GLTFParserType[GLTFParserType["Animation"] = 10] = "Animation";
2087
2125
  GLTFParserType[GLTFParserType["AnimatorController"] = 11] = "AnimatorController";
2088
- })(exports.GLTFParserType || (exports.GLTFParserType = {}));
2089
- var _obj;
2090
- var glTFSchemaMap = (_obj = {}, _obj[2] = "scenes", _obj[3] = "buffers", _obj[5] = "textures", _obj[6] = "materials", _obj[7] = "meshes", _obj[8] = "nodes", _obj[9] = "skins", _obj[10] = "animations", _obj[4] = "bufferViews", _obj);
2126
+ return GLTFParserType;
2127
+ }({});
2128
+ var _obj$3;
2129
+ var glTFSchemaMap = (_obj$3 = {}, _obj$3[2] = "scenes", _obj$3[3] = "buffers", _obj$3[5] = "textures", _obj$3[6] = "materials", _obj$3[7] = "meshes", _obj$3[8] = "nodes", _obj$3[9] = "skins", _obj$3[10] = "animations", _obj$3[4] = "bufferViews", _obj$3);
2091
2130
  var _obj1;
2092
2131
  var glTFResourceMap = (_obj1 = {}, _obj1[2] = "_sceneRoots", _obj1[5] = "textures", _obj1[6] = "materials", _obj1[7] = "meshes", _obj1[8] = "entities", _obj1[9] = "skins", _obj1[10] = "animations", _obj1[11] = "animatorController", _obj1);
2093
2132
  function registerGLTFParser(pipeline) {
@@ -2143,19 +2182,19 @@ function registerGLTFParser(pipeline) {
2143
2182
  * Get the number of bytes occupied by accessor type.
2144
2183
  */ GLTFUtils.getAccessorTypeSize = function getAccessorTypeSize(accessorType) {
2145
2184
  switch(accessorType){
2146
- case exports.AccessorType.SCALAR:
2185
+ case AccessorType.SCALAR:
2147
2186
  return 1;
2148
- case exports.AccessorType.VEC2:
2187
+ case AccessorType.VEC2:
2149
2188
  return 2;
2150
- case exports.AccessorType.VEC3:
2189
+ case AccessorType.VEC3:
2151
2190
  return 3;
2152
- case exports.AccessorType.VEC4:
2191
+ case AccessorType.VEC4:
2153
2192
  return 4;
2154
- case exports.AccessorType.MAT2:
2193
+ case AccessorType.MAT2:
2155
2194
  return 4;
2156
- case exports.AccessorType.MAT3:
2195
+ case AccessorType.MAT3:
2157
2196
  return 9;
2158
- case exports.AccessorType.MAT4:
2197
+ case AccessorType.MAT4:
2159
2198
  return 16;
2160
2199
  }
2161
2200
  };
@@ -2203,7 +2242,7 @@ function registerGLTFParser(pipeline) {
2203
2242
  if (accessor.bufferView !== undefined) {
2204
2243
  var bufferViewIndex = accessor.bufferView;
2205
2244
  var bufferView = bufferViews[bufferViewIndex];
2206
- promise = context.get(exports.GLTFParserType.BufferView, accessor.bufferView).then(function(bufferViewData) {
2245
+ promise = context.get(GLTFParserType.BufferView, accessor.bufferView).then(function(bufferViewData) {
2207
2246
  var bufferIndex = bufferView.buffer;
2208
2247
  var _bufferViewData_byteOffset;
2209
2248
  var bufferByteOffset = (_bufferViewData_byteOffset = bufferViewData.byteOffset) != null ? _bufferViewData_byteOffset : 0;
@@ -2274,8 +2313,8 @@ function registerGLTFParser(pipeline) {
2274
2313
  var indicesBufferView = bufferViews[indices.bufferView];
2275
2314
  var valuesBufferView = bufferViews[values.bufferView];
2276
2315
  return Promise.all([
2277
- context.get(exports.GLTFParserType.BufferView, indices.bufferView),
2278
- context.get(exports.GLTFParserType.BufferView, values.bufferView)
2316
+ context.get(GLTFParserType.BufferView, indices.bufferView),
2317
+ context.get(GLTFParserType.BufferView, values.bufferView)
2279
2318
  ]).then(function(param) {
2280
2319
  var indicesUint8Array = param[0], valuesUin8Array = param[1];
2281
2320
  var _indices_byteOffset, _indicesUint8Array_byteOffset;
@@ -2480,23 +2519,13 @@ function registerGLTFParser(pipeline) {
2480
2519
  return GLTFUtils;
2481
2520
  }();
2482
2521
 
2483
- var DFDTransferFunction;
2484
- (function(DFDTransferFunction) {
2485
- DFDTransferFunction[DFDTransferFunction["linear"] = 1] = "linear";
2486
- DFDTransferFunction[DFDTransferFunction["sRGB"] = 2] = "sRGB";
2487
- })(DFDTransferFunction || (DFDTransferFunction = {}));
2488
- var ColorModel;
2489
- (function(ColorModel) {
2490
- ColorModel[ColorModel["ETC1S"] = 163] = "ETC1S";
2491
- ColorModel[ColorModel["UASTC"] = 166] = "UASTC";
2492
- })(ColorModel || (ColorModel = {}));
2493
- var SupercompressionScheme;
2494
- (function(SupercompressionScheme) {
2522
+ var SupercompressionScheme = /*#__PURE__*/ function(SupercompressionScheme) {
2495
2523
  SupercompressionScheme[SupercompressionScheme["None"] = 0] = "None";
2496
2524
  SupercompressionScheme[SupercompressionScheme["BasisLZ"] = 1] = "BasisLZ";
2497
2525
  SupercompressionScheme[SupercompressionScheme["Zstd"] = 2] = "Zstd";
2498
2526
  SupercompressionScheme[SupercompressionScheme["ZLib"] = 3] = "ZLib";
2499
- })(SupercompressionScheme || (SupercompressionScheme = {}));
2527
+ return SupercompressionScheme;
2528
+ }({});
2500
2529
  /** @internal */ var KTX2Container = /*#__PURE__*/ function() {
2501
2530
  function KTX2Container(buffer) {
2502
2531
  this.vkFormat = 0;
@@ -2666,17 +2695,17 @@ var SupercompressionScheme;
2666
2695
 
2667
2696
  /**
2668
2697
  * KTX2 transcode target format.
2669
- */ exports.KTX2TargetFormat = void 0;
2670
- (function(KTX2TargetFormat) {
2671
- KTX2TargetFormat[KTX2TargetFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "ASTC"] = 0] = "ASTC";
2672
- KTX2TargetFormat[KTX2TargetFormat[/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ "BC7"] = 1] = "BC7";
2673
- KTX2TargetFormat[KTX2TargetFormat[/** RGB(A) compressed format, 4 bits per pixel if no alpha channel, 8 bits per pixel if has alpha channel. */ "BC1_BC3"] = 2] = "BC1_BC3";
2674
- KTX2TargetFormat[KTX2TargetFormat[/** RGB(A) compressed format, 4 bits per pixel. */ "PVRTC"] = 3] = "PVRTC";
2675
- KTX2TargetFormat[KTX2TargetFormat[/** RGB(A) compressed format, 4 bits per pixel if no alpha channel, 8 bits per pixel if has alpha channel. */ "ETC"] = 4] = "ETC";
2676
- KTX2TargetFormat[KTX2TargetFormat[/** R format, 8 bits per pixel. */ "R8"] = 5] = "R8";
2677
- KTX2TargetFormat[KTX2TargetFormat[/** RG format, 16 bits per pixel. */ "R8G8"] = 6] = "R8G8";
2678
- KTX2TargetFormat[KTX2TargetFormat[/** RGBA format, 32 bits per pixel. */ "R8G8B8A8"] = 7] = "R8G8B8A8";
2679
- })(exports.KTX2TargetFormat || (exports.KTX2TargetFormat = {}));
2698
+ */ var KTX2TargetFormat = /*#__PURE__*/ function(KTX2TargetFormat) {
2699
+ /** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ KTX2TargetFormat[KTX2TargetFormat["ASTC"] = 0] = "ASTC";
2700
+ /** RGB(A) compressed format, 128 bits per 4x4 pixel block. */ KTX2TargetFormat[KTX2TargetFormat["BC7"] = 1] = "BC7";
2701
+ /** RGB(A) compressed format, 4 bits per pixel if no alpha channel, 8 bits per pixel if has alpha channel. */ KTX2TargetFormat[KTX2TargetFormat["BC1_BC3"] = 2] = "BC1_BC3";
2702
+ /** RGB(A) compressed format, 4 bits per pixel. */ KTX2TargetFormat[KTX2TargetFormat["PVRTC"] = 3] = "PVRTC";
2703
+ /** RGB(A) compressed format, 4 bits per pixel if no alpha channel, 8 bits per pixel if has alpha channel. */ KTX2TargetFormat[KTX2TargetFormat["ETC"] = 4] = "ETC";
2704
+ /** R format, 8 bits per pixel. */ KTX2TargetFormat[KTX2TargetFormat["R8"] = 5] = "R8";
2705
+ /** RG format, 16 bits per pixel. */ KTX2TargetFormat[KTX2TargetFormat["R8G8"] = 6] = "R8G8";
2706
+ /** RGBA format, 32 bits per pixel. */ KTX2TargetFormat[KTX2TargetFormat["R8G8B8A8"] = 7] = "R8G8B8A8";
2707
+ return KTX2TargetFormat;
2708
+ }({});
2680
2709
 
2681
2710
  /**
2682
2711
  * @internal
@@ -2890,7 +2919,7 @@ var _init = function init() {
2890
2919
  };
2891
2920
  var init = _init();
2892
2921
  function transcode(buffer, targetFormat, KTX2File) {
2893
- var getTranscodeFormatFromTarget = function getTranscodeFormatFromTarget(target, hasAlpha) {
2922
+ function getTranscodeFormatFromTarget(target, hasAlpha) {
2894
2923
  switch(target){
2895
2924
  case 2:
2896
2925
  return hasAlpha ? 3 : 2;
@@ -2905,8 +2934,8 @@ function transcode(buffer, targetFormat, KTX2File) {
2905
2934
  case 1:
2906
2935
  return 7;
2907
2936
  }
2908
- };
2909
- var concat = function concat(arrays) {
2937
+ }
2938
+ function concat(arrays) {
2910
2939
  if (arrays.length === 1) return arrays[0];
2911
2940
  var totalByteLength = 0;
2912
2941
  for(var i = 0; i < arrays.length; i++){
@@ -2919,37 +2948,12 @@ function transcode(buffer, targetFormat, KTX2File) {
2919
2948
  byteOffset += arrays[i1].byteLength;
2920
2949
  }
2921
2950
  return result;
2922
- };
2923
- var cleanup = function cleanup() {
2951
+ }
2952
+ var ktx2File = new KTX2File(new Uint8Array(buffer));
2953
+ function cleanup() {
2924
2954
  ktx2File.close();
2925
2955
  ktx2File.delete();
2926
- };
2927
- var BasisFormat;
2928
- (function(BasisFormat) {
2929
- BasisFormat[BasisFormat["ETC1"] = 0] = "ETC1";
2930
- BasisFormat[BasisFormat["ETC2"] = 1] = "ETC2";
2931
- BasisFormat[BasisFormat["BC1"] = 2] = "BC1";
2932
- BasisFormat[BasisFormat["BC3"] = 3] = "BC3";
2933
- BasisFormat[BasisFormat["BC4"] = 4] = "BC4";
2934
- BasisFormat[BasisFormat["BC5"] = 5] = "BC5";
2935
- BasisFormat[BasisFormat["BC7"] = 7] = "BC7";
2936
- BasisFormat[BasisFormat["PVRTC1_4_RGB"] = 8] = "PVRTC1_4_RGB";
2937
- BasisFormat[BasisFormat["PVRTC1_4_RGBA"] = 9] = "PVRTC1_4_RGBA";
2938
- BasisFormat[BasisFormat["ASTC_4x4"] = 10] = "ASTC_4x4";
2939
- BasisFormat[BasisFormat["RGBA8"] = 13] = "RGBA8";
2940
- })(BasisFormat || (BasisFormat = {}));
2941
- var TargetFormat;
2942
- (function(TargetFormat) {
2943
- TargetFormat[TargetFormat["ASTC"] = 0] = "ASTC";
2944
- TargetFormat[TargetFormat["BC7"] = 1] = "BC7";
2945
- TargetFormat[TargetFormat["BC1_BC3"] = 2] = "BC1_BC3";
2946
- TargetFormat[TargetFormat["PVRTC"] = 3] = "PVRTC";
2947
- TargetFormat[TargetFormat["ETC"] = 4] = "ETC";
2948
- TargetFormat[TargetFormat["R8"] = 5] = "R8";
2949
- TargetFormat[TargetFormat["RG8"] = 6] = "RG8";
2950
- TargetFormat[TargetFormat["RGBA8"] = 7] = "RGBA8";
2951
- })(TargetFormat || (TargetFormat = {}));
2952
- var ktx2File = new KTX2File(new Uint8Array(buffer));
2956
+ }
2953
2957
  if (!ktx2File.isValid()) {
2954
2958
  cleanup();
2955
2959
  throw new Error("Invalid or unsupported .ktx2 file");
@@ -3010,10 +3014,10 @@ function transcode(buffer, targetFormat, KTX2File) {
3010
3014
  };
3011
3015
  }
3012
3016
 
3013
- /** @internal */ var BinomialLLCTranscoder = /*#__PURE__*/ function(AbstractTranscoder1) {
3014
- _inherits(BinomialLLCTranscoder, AbstractTranscoder1);
3017
+ /** @internal */ var BinomialLLCTranscoder = /*#__PURE__*/ function(AbstractTranscoder) {
3018
+ _inherits(BinomialLLCTranscoder, AbstractTranscoder);
3015
3019
  function BinomialLLCTranscoder(workerLimitCount) {
3016
- return AbstractTranscoder1.call(this, workerLimitCount);
3020
+ return AbstractTranscoder.call(this, workerLimitCount) || this;
3017
3021
  }
3018
3022
  var _proto = BinomialLLCTranscoder.prototype;
3019
3023
  _proto._initTranscodeWorkerPool = function _initTranscodeWorkerPool() {
@@ -3075,7 +3079,60 @@ function transcode(buffer, targetFormat, KTX2File) {
3075
3079
  }(AbstractTranscoder);
3076
3080
 
3077
3081
  function TranscodeWorkerCode() {
3078
- var transcodeASTCAndBC7 = function transcodeASTCAndBC7(wasmTranscoder, compressedData, width, height) {
3082
+ var wasmPromise;
3083
+ /**
3084
+ * ZSTD (Zstandard) decoder.
3085
+ */ var ZSTDDecoder = /*#__PURE__*/ function() {
3086
+ function ZSTDDecoder() {}
3087
+ var _proto = ZSTDDecoder.prototype;
3088
+ _proto.init = function init() {
3089
+ if (!this._initPromise) {
3090
+ this._initPromise = fetch(ZSTDDecoder.WasmModuleURL).then(function(response) {
3091
+ if (response.ok) {
3092
+ return response.arrayBuffer();
3093
+ }
3094
+ throw new Error("Could not fetch the wasm component for the Zstandard decompression lib: " + response.status + " - " + response.statusText);
3095
+ }).then(function(arrayBuffer) {
3096
+ return WebAssembly.instantiate(arrayBuffer, ZSTDDecoder.IMPORT_OBJECT);
3097
+ }).then(this._init);
3098
+ }
3099
+ return this._initPromise;
3100
+ };
3101
+ _proto._init = function _init(result) {
3102
+ ZSTDDecoder.instance = result.instance;
3103
+ ZSTDDecoder.IMPORT_OBJECT.env.emscripten_notify_memory_growth(); // initialize heap.
3104
+ };
3105
+ _proto.decode = function decode(array, uncompressedSize) {
3106
+ if (uncompressedSize === void 0) uncompressedSize = 0;
3107
+ if (!ZSTDDecoder.instance) {
3108
+ throw new Error("ZSTDDecoder: Await .init() before decoding.");
3109
+ }
3110
+ var exports = ZSTDDecoder.instance.exports;
3111
+ // Write compressed data into WASM memory
3112
+ var compressedSize = array.byteLength;
3113
+ var compressedPtr = exports.malloc(compressedSize);
3114
+ ZSTDDecoder.heap.set(array, compressedPtr);
3115
+ // Decompress into WASM memory
3116
+ uncompressedSize = uncompressedSize || Number(exports.ZSTD_findDecompressedSize(compressedPtr, compressedSize));
3117
+ var uncompressedPtr = exports.malloc(uncompressedSize);
3118
+ var actualSize = exports.ZSTD_decompress(uncompressedPtr, uncompressedSize, compressedPtr, compressedSize);
3119
+ // Read decompressed data and free WASM memory
3120
+ var dec = ZSTDDecoder.heap.slice(uncompressedPtr, uncompressedPtr + actualSize);
3121
+ exports.free(compressedPtr);
3122
+ exports.free(uncompressedPtr);
3123
+ return dec;
3124
+ };
3125
+ return ZSTDDecoder;
3126
+ }();
3127
+ ZSTDDecoder.IMPORT_OBJECT = {
3128
+ env: {
3129
+ emscripten_notify_memory_growth: function emscripten_notify_memory_growth() {
3130
+ ZSTDDecoder.heap = new Uint8Array(ZSTDDecoder.instance.exports.memory.buffer);
3131
+ }
3132
+ }
3133
+ };
3134
+ ZSTDDecoder.WasmModuleURL = "https://mdn.alipayobjects.com/rms/afts/file/A*awNJR7KqIAEAAAAAAAAAAAAAARQnAQ/zstddec.wasm";
3135
+ function transcodeASTCAndBC7(wasmTranscoder, compressedData, width, height) {
3079
3136
  var nBlocks = (width + 3 >> 2) * (height + 3 >> 2);
3080
3137
  var texMemoryPages = nBlocks * 16 + 65535 >> 16;
3081
3138
  var memory = wasmTranscoder.memory;
@@ -3084,8 +3141,8 @@ function TranscodeWorkerCode() {
3084
3141
  var textureView = new Uint8Array(memory.buffer, 65536, nBlocks * 16);
3085
3142
  textureView.set(compressedData);
3086
3143
  return wasmTranscoder.transcode(nBlocks) === 0 ? textureView : null;
3087
- };
3088
- var initWasm = function initWasm(buffer) {
3144
+ }
3145
+ function initWasm(buffer) {
3089
3146
  wasmPromise = WebAssembly.instantiate(buffer, {
3090
3147
  env: {
3091
3148
  memory: new WebAssembly.Memory({
@@ -3096,8 +3153,9 @@ function TranscodeWorkerCode() {
3096
3153
  return moduleWrapper.instance.exports;
3097
3154
  });
3098
3155
  return wasmPromise;
3099
- };
3100
- var transcode = function transcode(data, needZstd, wasmModule) {
3156
+ }
3157
+ var zstdDecoder = new ZSTDDecoder();
3158
+ function transcode(data, needZstd, wasmModule) {
3101
3159
  var faceCount = data.length;
3102
3160
  var result = new Array(faceCount);
3103
3161
  var promise = Promise.resolve();
@@ -3130,65 +3188,7 @@ function TranscodeWorkerCode() {
3130
3188
  }
3131
3189
  return result;
3132
3190
  });
3133
- };
3134
- var wasmPromise;
3135
- /**
3136
- * ZSTD (Zstandard) decoder.
3137
- */ var ZSTDDecoder = /*#__PURE__*/ function() {
3138
- function ZSTDDecoder() {}
3139
- var _proto = ZSTDDecoder.prototype;
3140
- _proto.init = function init() {
3141
- if (!this._initPromise) {
3142
- this._initPromise = fetch(ZSTDDecoder.WasmModuleURL).then(function(response) {
3143
- if (response.ok) {
3144
- return response.arrayBuffer();
3145
- }
3146
- throw new Error("Could not fetch the wasm component for the Zstandard decompression lib: " + response.status + " - " + response.statusText);
3147
- }).then(function(arrayBuffer) {
3148
- return WebAssembly.instantiate(arrayBuffer, ZSTDDecoder.IMPORT_OBJECT);
3149
- }).then(this._init);
3150
- }
3151
- return this._initPromise;
3152
- };
3153
- _proto._init = function _init(result) {
3154
- ZSTDDecoder.instance = result.instance;
3155
- ZSTDDecoder.IMPORT_OBJECT.env.emscripten_notify_memory_growth(); // initialize heap.
3156
- };
3157
- _proto.decode = function decode(array, uncompressedSize) {
3158
- if (uncompressedSize === void 0) uncompressedSize = 0;
3159
- if (!ZSTDDecoder.instance) {
3160
- throw new Error("ZSTDDecoder: Await .init() before decoding.");
3161
- }
3162
- var exports = ZSTDDecoder.instance.exports;
3163
- // Write compressed data into WASM memory
3164
- var compressedSize = array.byteLength;
3165
- var compressedPtr = exports.malloc(compressedSize);
3166
- ZSTDDecoder.heap.set(array, compressedPtr);
3167
- // Decompress into WASM memory
3168
- uncompressedSize = uncompressedSize || Number(exports.ZSTD_findDecompressedSize(compressedPtr, compressedSize));
3169
- var uncompressedPtr = exports.malloc(uncompressedSize);
3170
- var actualSize = exports.ZSTD_decompress(uncompressedPtr, uncompressedSize, compressedPtr, compressedSize);
3171
- // Read decompressed data and free WASM memory
3172
- var dec = ZSTDDecoder.heap.slice(uncompressedPtr, uncompressedPtr + actualSize);
3173
- exports.free(compressedPtr);
3174
- exports.free(uncompressedPtr);
3175
- return dec;
3176
- };
3177
- return ZSTDDecoder;
3178
- }();
3179
- (function() {
3180
- ZSTDDecoder.IMPORT_OBJECT = {
3181
- env: {
3182
- emscripten_notify_memory_growth: function emscripten_notify_memory_growth() {
3183
- ZSTDDecoder.heap = new Uint8Array(ZSTDDecoder.instance.exports.memory.buffer);
3184
- }
3185
- }
3186
- };
3187
- })();
3188
- (function() {
3189
- ZSTDDecoder.WasmModuleURL = "https://mdn.alipayobjects.com/rms/afts/file/A*awNJR7KqIAEAAAAAAAAAAAAAARQnAQ/zstddec.wasm";
3190
- })();
3191
- var zstdDecoder = new ZSTDDecoder();
3191
+ }
3192
3192
  self.onmessage = function onmessage(event) {
3193
3193
  var message = event.data;
3194
3194
  switch(message.type){
@@ -3216,12 +3216,11 @@ function TranscodeWorkerCode() {
3216
3216
  };
3217
3217
  }
3218
3218
 
3219
- /** @internal */ var KhronosTranscoder = /*#__PURE__*/ function(AbstractTranscoder1) {
3220
- _inherits(KhronosTranscoder, AbstractTranscoder1);
3219
+ /** @internal */ var KhronosTranscoder = /*#__PURE__*/ function(AbstractTranscoder) {
3220
+ _inherits(KhronosTranscoder, AbstractTranscoder);
3221
3221
  function KhronosTranscoder(workerLimitCount, type) {
3222
3222
  var _this;
3223
- _this = AbstractTranscoder1.call(this, workerLimitCount) || this;
3224
- _this.type = type;
3223
+ _this = AbstractTranscoder.call(this, workerLimitCount) || this, _this.type = type;
3225
3224
  return _this;
3226
3225
  }
3227
3226
  var _proto = KhronosTranscoder.prototype;
@@ -3281,30 +3280,27 @@ function TranscodeWorkerCode() {
3281
3280
  };
3282
3281
  return KhronosTranscoder;
3283
3282
  }(AbstractTranscoder);
3284
- (function() {
3285
- var _obj;
3286
- KhronosTranscoder.transcoderMap = (_obj = {}, // TODO: support bc7
3287
- _obj[exports.KTX2TargetFormat.ASTC] = "https://mdn.alipayobjects.com/rms/afts/file/A*0jiKRK6D1-kAAAAAAAAAAAAAARQnAQ/uastc_astc.wasm", _obj);
3288
- })();
3289
-
3290
- var _KTX2Loader;
3291
- exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
3292
- _inherits(KTX2Loader1, Loader1);
3293
- function KTX2Loader1() {
3294
- return Loader1.apply(this, arguments);
3283
+ var _obj$2;
3284
+ KhronosTranscoder.transcoderMap = (_obj$2 = {}, // TODO: support bc7
3285
+ _obj$2[KTX2TargetFormat.ASTC] = "https://mdn.alipayobjects.com/rms/afts/file/A*0jiKRK6D1-kAAAAAAAAAAAAAARQnAQ/uastc_astc.wasm", _obj$2);
3286
+
3287
+ exports.KTX2Loader = /*#__PURE__*/ function(Loader) {
3288
+ _inherits(KTX2Loader, Loader);
3289
+ function KTX2Loader() {
3290
+ return Loader.apply(this, arguments) || this;
3295
3291
  }
3296
- var _proto = KTX2Loader1.prototype;
3292
+ var _proto = KTX2Loader.prototype;
3297
3293
  _proto.initialize = function initialize(_, configuration) {
3298
3294
  if (configuration.ktx2Loader) {
3299
3295
  var options = configuration.ktx2Loader;
3300
3296
  if (options.priorityFormats) {
3301
- exports.KTX2Loader._priorityFormats["etc1s"] = options.priorityFormats;
3302
- exports.KTX2Loader._priorityFormats["uastc"] = options.priorityFormats;
3297
+ KTX2Loader._priorityFormats["etc1s"] = options.priorityFormats;
3298
+ KTX2Loader._priorityFormats["uastc"] = options.priorityFormats;
3303
3299
  }
3304
- if (options.transcoder === /** Khronos transcoder. */ 1) {
3305
- return exports.KTX2Loader._getKhronosTranscoder(options.workerCount).init();
3300
+ if (options.transcoder === 1) {
3301
+ return KTX2Loader._getKhronosTranscoder(options.workerCount).init();
3306
3302
  } else {
3307
- return exports.KTX2Loader._getBinomialLLCTranscoder(options.workerCount).init();
3303
+ return KTX2Loader._getBinomialLLCTranscoder(options.workerCount).init();
3308
3304
  }
3309
3305
  }
3310
3306
  };
@@ -3316,9 +3312,9 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
3316
3312
  ._request(item.url, {
3317
3313
  type: "arraybuffer"
3318
3314
  }).onProgress(setTaskCompleteProgress, setTaskDetailProgress).then(function(buffer) {
3319
- return exports.KTX2Loader._parseBuffer(new Uint8Array(buffer), resourceManager.engine, item.params).then(function(param) {
3315
+ return KTX2Loader._parseBuffer(new Uint8Array(buffer), resourceManager.engine, item.params).then(function(param) {
3320
3316
  var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
3321
- return exports.KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params);
3317
+ return KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params);
3322
3318
  });
3323
3319
  }).then(resolve).catch(reject);
3324
3320
  });
@@ -3326,27 +3322,26 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
3326
3322
  /**
3327
3323
  * Release ktx2 transcoder worker.
3328
3324
  * @remarks If use loader after releasing, we should release again.
3329
- */ KTX2Loader1.release = function release() {
3325
+ */ KTX2Loader.release = function release() {
3330
3326
  if (this._binomialLLCTranscoder) this._binomialLLCTranscoder.destroy();
3331
3327
  if (this._khronosTranscoder) this._khronosTranscoder.destroy();
3332
3328
  this._binomialLLCTranscoder = null;
3333
3329
  this._khronosTranscoder = null;
3334
3330
  this._isBinomialInit = false;
3335
3331
  };
3336
- /** @internal */ KTX2Loader1._parseBuffer = function _parseBuffer(buffer, engine, params) {
3337
- var _params;
3332
+ /** @internal */ KTX2Loader._parseBuffer = function _parseBuffer(buffer, engine, params) {
3338
3333
  var ktx2Container = new KTX2Container(buffer);
3339
3334
  var _params_priorityFormats;
3340
- var formatPriorities = (_params_priorityFormats = (_params = params) == null ? void 0 : _params.priorityFormats) != null ? _params_priorityFormats : exports.KTX2Loader._priorityFormats[ktx2Container.isUASTC ? "uastc" : "etc1s"];
3341
- var targetFormat = exports.KTX2Loader._decideTargetFormat(engine, ktx2Container, formatPriorities);
3335
+ var formatPriorities = (_params_priorityFormats = params == null ? void 0 : params.priorityFormats) != null ? _params_priorityFormats : KTX2Loader._priorityFormats[ktx2Container.isUASTC ? "uastc" : "etc1s"];
3336
+ var targetFormat = KTX2Loader._decideTargetFormat(engine, ktx2Container, formatPriorities);
3342
3337
  var transcodeResultPromise;
3343
- if (exports.KTX2Loader._isBinomialInit || !KhronosTranscoder.transcoderMap[targetFormat] || !ktx2Container.isUASTC) {
3344
- var binomialLLCWorker = exports.KTX2Loader._getBinomialLLCTranscoder();
3338
+ if (KTX2Loader._isBinomialInit || !KhronosTranscoder.transcoderMap[targetFormat] || !ktx2Container.isUASTC) {
3339
+ var binomialLLCWorker = KTX2Loader._getBinomialLLCTranscoder();
3345
3340
  transcodeResultPromise = binomialLLCWorker.init().then(function() {
3346
3341
  return binomialLLCWorker.transcode(buffer, targetFormat);
3347
3342
  });
3348
3343
  } else {
3349
- var khronosWorker = exports.KTX2Loader._getKhronosTranscoder();
3344
+ var khronosWorker = KTX2Loader._getKhronosTranscoder();
3350
3345
  transcodeResultPromise = khronosWorker.init().then(function() {
3351
3346
  return khronosWorker.transcode(ktx2Container);
3352
3347
  });
@@ -3360,7 +3355,7 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
3360
3355
  };
3361
3356
  });
3362
3357
  };
3363
- /** @internal */ KTX2Loader1._createTextureByBuffer = function _createTextureByBuffer(engine, transcodeResult, targetFormat, params) {
3358
+ /** @internal */ KTX2Loader._createTextureByBuffer = function _createTextureByBuffer(engine, transcodeResult, targetFormat, params) {
3364
3359
  var width = transcodeResult.width, height = transcodeResult.height, faces = transcodeResult.faces;
3365
3360
  var faceCount = faces.length;
3366
3361
  var mipmaps = faces[0];
@@ -3390,20 +3385,20 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
3390
3385
  }
3391
3386
  return texture;
3392
3387
  };
3393
- KTX2Loader1._decideTargetFormat = function _decideTargetFormat(engine, ktx2Container, priorityFormats) {
3388
+ KTX2Loader._decideTargetFormat = function _decideTargetFormat(engine, ktx2Container, priorityFormats) {
3394
3389
  var renderer = engine._hardwareRenderer;
3395
3390
  var targetFormat = this._detectSupportedFormat(renderer, priorityFormats);
3396
- if (targetFormat === exports.KTX2TargetFormat.PVRTC && (!engineMath.MathUtil.isPowerOf2(ktx2Container.pixelWidth) || !engineMath.MathUtil.isPowerOf2(ktx2Container.pixelHeight) || ktx2Container.pixelWidth !== ktx2Container.pixelHeight)) {
3391
+ if (targetFormat === KTX2TargetFormat.PVRTC && (!engineMath.MathUtil.isPowerOf2(ktx2Container.pixelWidth) || !engineMath.MathUtil.isPowerOf2(ktx2Container.pixelHeight) || ktx2Container.pixelWidth !== ktx2Container.pixelHeight)) {
3397
3392
  engineCore.Logger.warn("PVRTC image need power of 2 and width===height, downgrade to RGBA8");
3398
- return exports.KTX2TargetFormat.R8G8B8A8;
3393
+ return KTX2TargetFormat.R8G8B8A8;
3399
3394
  }
3400
3395
  if (targetFormat === null) {
3401
3396
  engineCore.Logger.warn("Can't support any compressed texture, downgrade to RGBA8");
3402
- return exports.KTX2TargetFormat.R8G8B8A8;
3397
+ return KTX2TargetFormat.R8G8B8A8;
3403
3398
  }
3404
3399
  return targetFormat;
3405
3400
  };
3406
- KTX2Loader1._detectSupportedFormat = function _detectSupportedFormat(renderer, priorityFormats) {
3401
+ KTX2Loader._detectSupportedFormat = function _detectSupportedFormat(renderer, priorityFormats) {
3407
3402
  for(var i = 0; i < priorityFormats.length; i++){
3408
3403
  var format = priorityFormats[i];
3409
3404
  var capabilities = this._supportedMap[format];
@@ -3415,101 +3410,94 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
3415
3410
  }
3416
3411
  } else {
3417
3412
  switch(priorityFormats[i]){
3418
- case exports.KTX2TargetFormat.R8G8B8A8:
3413
+ case KTX2TargetFormat.R8G8B8A8:
3419
3414
  return format;
3420
- case exports.KTX2TargetFormat.R8:
3421
- case exports.KTX2TargetFormat.R8G8:
3415
+ case KTX2TargetFormat.R8:
3416
+ case KTX2TargetFormat.R8G8:
3422
3417
  if (renderer.isWebGL2) return format;
3423
3418
  }
3424
3419
  }
3425
3420
  }
3426
3421
  return null;
3427
3422
  };
3428
- KTX2Loader1._getBinomialLLCTranscoder = function _getBinomialLLCTranscoder(workerCount) {
3423
+ KTX2Loader._getBinomialLLCTranscoder = function _getBinomialLLCTranscoder(workerCount) {
3429
3424
  if (workerCount === void 0) workerCount = 4;
3430
- exports.KTX2Loader._isBinomialInit = true;
3425
+ KTX2Loader._isBinomialInit = true;
3431
3426
  var _this__binomialLLCTranscoder;
3432
3427
  return (_this__binomialLLCTranscoder = this._binomialLLCTranscoder) != null ? _this__binomialLLCTranscoder : this._binomialLLCTranscoder = new BinomialLLCTranscoder(workerCount);
3433
3428
  };
3434
- KTX2Loader1._getKhronosTranscoder = function _getKhronosTranscoder(workerCount) {
3429
+ KTX2Loader._getKhronosTranscoder = function _getKhronosTranscoder(workerCount) {
3435
3430
  if (workerCount === void 0) workerCount = 4;
3436
3431
  var _this__khronosTranscoder;
3437
- return (_this__khronosTranscoder = this._khronosTranscoder) != null ? _this__khronosTranscoder : this._khronosTranscoder = new KhronosTranscoder(workerCount, exports.KTX2TargetFormat.ASTC);
3432
+ return (_this__khronosTranscoder = this._khronosTranscoder) != null ? _this__khronosTranscoder : this._khronosTranscoder = new KhronosTranscoder(workerCount, KTX2TargetFormat.ASTC);
3438
3433
  };
3439
- KTX2Loader1._getEngineTextureFormat = function _getEngineTextureFormat(basisFormat, transcodeResult) {
3434
+ KTX2Loader._getEngineTextureFormat = function _getEngineTextureFormat(basisFormat, transcodeResult) {
3440
3435
  var hasAlpha = transcodeResult.hasAlpha;
3441
3436
  switch(basisFormat){
3442
- case exports.KTX2TargetFormat.ASTC:
3437
+ case KTX2TargetFormat.ASTC:
3443
3438
  return engineCore.TextureFormat.ASTC_4x4;
3444
- case exports.KTX2TargetFormat.ETC:
3439
+ case KTX2TargetFormat.ETC:
3445
3440
  return hasAlpha ? engineCore.TextureFormat.ETC2_RGBA8 : engineCore.TextureFormat.ETC2_RGB;
3446
- case exports.KTX2TargetFormat.BC7:
3441
+ case KTX2TargetFormat.BC7:
3447
3442
  return engineCore.TextureFormat.BC7;
3448
- case exports.KTX2TargetFormat.BC1_BC3:
3443
+ case KTX2TargetFormat.BC1_BC3:
3449
3444
  return hasAlpha ? engineCore.TextureFormat.BC3 : engineCore.TextureFormat.BC1;
3450
- case exports.KTX2TargetFormat.PVRTC:
3445
+ case KTX2TargetFormat.PVRTC:
3451
3446
  return hasAlpha ? engineCore.TextureFormat.PVRTC_RGBA4 : engineCore.TextureFormat.PVRTC_RGB4;
3452
- case exports.KTX2TargetFormat.R8G8B8A8:
3447
+ case KTX2TargetFormat.R8G8B8A8:
3453
3448
  return engineCore.TextureFormat.R8G8B8A8;
3454
3449
  }
3455
3450
  };
3456
- return KTX2Loader1;
3457
- }(engineCore.Loader), function() {
3458
- _KTX2Loader._isBinomialInit = false;
3459
- }(), function() {
3460
- _KTX2Loader._priorityFormats = {
3461
- etc1s: [
3462
- exports.KTX2TargetFormat.ETC,
3463
- exports.KTX2TargetFormat.BC7,
3464
- exports.KTX2TargetFormat.ASTC,
3465
- exports.KTX2TargetFormat.BC1_BC3,
3466
- exports.KTX2TargetFormat.PVRTC
3467
- ],
3468
- uastc: [
3469
- exports.KTX2TargetFormat.ASTC,
3470
- exports.KTX2TargetFormat.BC7,
3471
- exports.KTX2TargetFormat.ETC,
3472
- exports.KTX2TargetFormat.BC1_BC3,
3473
- exports.KTX2TargetFormat.PVRTC
3474
- ]
3475
- };
3476
- }(), function() {
3477
- var _obj;
3478
- _KTX2Loader._supportedMap = (_obj = {}, _obj[exports.KTX2TargetFormat.ASTC] = [
3479
- engineCore.GLCapabilityType.astc
3480
- ], _obj[exports.KTX2TargetFormat.ETC] = [
3481
- engineCore.GLCapabilityType.etc
3482
- ], _obj[exports.KTX2TargetFormat.BC7] = [
3483
- engineCore.GLCapabilityType.bptc
3484
- ], _obj[exports.KTX2TargetFormat.BC1_BC3] = [
3485
- engineCore.GLCapabilityType.s3tc
3486
- ], _obj[exports.KTX2TargetFormat.PVRTC] = [
3487
- engineCore.GLCapabilityType.pvrtc,
3488
- engineCore.GLCapabilityType.pvrtc_webkit
3489
- ], _obj);
3490
- }(), _KTX2Loader);
3451
+ return KTX2Loader;
3452
+ }(engineCore.Loader);
3453
+ exports.KTX2Loader._isBinomialInit = false;
3454
+ exports.KTX2Loader._priorityFormats = {
3455
+ etc1s: [
3456
+ KTX2TargetFormat.ETC,
3457
+ KTX2TargetFormat.BC7,
3458
+ KTX2TargetFormat.ASTC,
3459
+ KTX2TargetFormat.BC1_BC3,
3460
+ KTX2TargetFormat.PVRTC
3461
+ ],
3462
+ uastc: [
3463
+ KTX2TargetFormat.ASTC,
3464
+ KTX2TargetFormat.BC7,
3465
+ KTX2TargetFormat.ETC,
3466
+ KTX2TargetFormat.BC1_BC3,
3467
+ KTX2TargetFormat.PVRTC
3468
+ ]
3469
+ };
3470
+ var _obj$1;
3471
+ exports.KTX2Loader._supportedMap = (_obj$1 = {}, _obj$1[KTX2TargetFormat.ASTC] = [
3472
+ engineCore.GLCapabilityType.astc
3473
+ ], _obj$1[KTX2TargetFormat.ETC] = [
3474
+ engineCore.GLCapabilityType.etc
3475
+ ], _obj$1[KTX2TargetFormat.BC7] = [
3476
+ engineCore.GLCapabilityType.bptc
3477
+ ], _obj$1[KTX2TargetFormat.BC1_BC3] = [
3478
+ engineCore.GLCapabilityType.s3tc
3479
+ ], _obj$1[KTX2TargetFormat.PVRTC] = [
3480
+ engineCore.GLCapabilityType.pvrtc,
3481
+ engineCore.GLCapabilityType.pvrtc_webkit
3482
+ ], _obj$1);
3491
3483
  exports.KTX2Loader = __decorate([
3492
3484
  engineCore.resourceLoader(engineCore.AssetType.KTX2, [
3493
3485
  "ktx2"
3494
3486
  ])
3495
3487
  ], exports.KTX2Loader);
3496
- exports.KTX2Transcoder = void 0;
3497
- (function(KTX2Transcoder) {
3498
- KTX2Transcoder[KTX2Transcoder[/** BinomialLLC transcoder. */ "BinomialLLC"] = 0] = "BinomialLLC";
3499
- KTX2Transcoder[KTX2Transcoder["Khronos"] = 1] = "Khronos";
3500
- })(exports.KTX2Transcoder || (exports.KTX2Transcoder = {}));
3488
+ /** Used for initialize KTX2 transcoder. */ var KTX2Transcoder = /*#__PURE__*/ function(KTX2Transcoder) {
3489
+ /** BinomialLLC transcoder. */ KTX2Transcoder[KTX2Transcoder["BinomialLLC"] = 0] = "BinomialLLC";
3490
+ /** Khronos transcoder. */ KTX2Transcoder[KTX2Transcoder["Khronos"] = 1] = "Khronos";
3491
+ return KTX2Transcoder;
3492
+ }({});
3501
3493
 
3502
3494
  /**
3503
3495
  * @internal
3504
- */ var GLTFContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
3505
- _inherits(GLTFContentRestorer, ContentRestorer1);
3496
+ */ var GLTFContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
3497
+ _inherits(GLTFContentRestorer, ContentRestorer);
3506
3498
  function GLTFContentRestorer() {
3507
3499
  var _this;
3508
- _this = ContentRestorer1.apply(this, arguments) || this;
3509
- _this.bufferRequests = [];
3510
- _this.glbBufferSlices = [];
3511
- _this.bufferTextures = [];
3512
- _this.meshes = [];
3500
+ _this = ContentRestorer.apply(this, arguments) || this, _this.bufferRequests = [], _this.glbBufferSlices = [], _this.bufferTextures = [], _this.meshes = [];
3513
3501
  return _this;
3514
3502
  }
3515
3503
  var _proto = GLTFContentRestorer.prototype;
@@ -3712,16 +3700,18 @@ exports.KTX2Transcoder = void 0;
3712
3700
  };
3713
3701
  return GLTFExtensionParser;
3714
3702
  }();
3715
- exports.GLTFExtensionMode = void 0;
3716
- (function(GLTFExtensionMode) {
3717
- GLTFExtensionMode[GLTFExtensionMode[/**
3703
+ /**
3704
+ * glTF Extension mode.
3705
+ */ var GLTFExtensionMode = /*#__PURE__*/ function(GLTFExtensionMode) {
3706
+ /**
3718
3707
  * Cerate instance and parse mode.
3719
3708
  * @remarks
3720
3709
  * If the glTF property has multiple extensions of `CreateAndParse` mode, only execute the last one.
3721
3710
  * If this method is registered, the default pipeline processing will be ignored.
3722
- */ "CreateAndParse"] = 0] = "CreateAndParse";
3723
- GLTFExtensionMode[GLTFExtensionMode[/** Additive parse mode. */ "AdditiveParse"] = 1] = "AdditiveParse";
3724
- })(exports.GLTFExtensionMode || (exports.GLTFExtensionMode = {}));
3711
+ */ GLTFExtensionMode[GLTFExtensionMode["CreateAndParse"] = 0] = "CreateAndParse";
3712
+ /** Additive parse mode. */ GLTFExtensionMode[GLTFExtensionMode["AdditiveParse"] = 1] = "AdditiveParse";
3713
+ return GLTFExtensionMode;
3714
+ }({});
3725
3715
 
3726
3716
  /**
3727
3717
  * Base class of glTF parser.
@@ -3745,7 +3735,12 @@ exports.GLTFExtensionMode = void 0;
3745
3735
  var _GLTFParser;
3746
3736
  var extensionName = extensionArray[i];
3747
3737
  var extensionSchema = extensions[extensionName];
3748
- resource = (_GLTFParser = GLTFParser)._createAndParse.apply(_GLTFParser, [].concat(extensionName, context, extensionSchema, ownerSchema, extra));
3738
+ resource = (_GLTFParser = GLTFParser)._createAndParse.apply(_GLTFParser, [].concat([
3739
+ extensionName,
3740
+ context,
3741
+ extensionSchema,
3742
+ ownerSchema
3743
+ ], extra));
3749
3744
  if (resource) {
3750
3745
  return resource;
3751
3746
  }
@@ -3765,7 +3760,13 @@ exports.GLTFExtensionMode = void 0;
3765
3760
  for(var extensionName in extensions){
3766
3761
  var _GLTFParser;
3767
3762
  var extensionSchema = extensions[extensionName];
3768
- (_GLTFParser = GLTFParser)._additiveParse.apply(_GLTFParser, [].concat(extensionName, context, parseResource, extensionSchema, ownerSchema, extra));
3763
+ (_GLTFParser = GLTFParser)._additiveParse.apply(_GLTFParser, [].concat([
3764
+ extensionName,
3765
+ context,
3766
+ parseResource,
3767
+ extensionSchema,
3768
+ ownerSchema
3769
+ ], extra));
3769
3770
  }
3770
3771
  };
3771
3772
  /**
@@ -3782,9 +3783,8 @@ exports.GLTFExtensionMode = void 0;
3782
3783
  * @param mode - GLTF extension mode
3783
3784
  * @returns GLTF extension parser
3784
3785
  */ GLTFParser.getExtensionParser = function getExtensionParser(extensionName, mode) {
3785
- var _parsers;
3786
3786
  var parsers = GLTFParser._extensionParsers[extensionName];
3787
- var length = (_parsers = parsers) == null ? void 0 : _parsers.length;
3787
+ var length = parsers == null ? void 0 : parsers.length;
3788
3788
  if (length) {
3789
3789
  // only use the last parser.
3790
3790
  for(var i = length - 1; i >= 0; --i){
@@ -3807,27 +3807,34 @@ exports.GLTFExtensionMode = void 0;
3807
3807
  for(var _len = arguments.length, extra = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++){
3808
3808
  extra[_key - 4] = arguments[_key];
3809
3809
  }
3810
- var parser = GLTFParser.getExtensionParser(extensionName, exports.GLTFExtensionMode.CreateAndParse);
3810
+ var parser = GLTFParser.getExtensionParser(extensionName, GLTFExtensionMode.CreateAndParse);
3811
3811
  if (parser) {
3812
3812
  var _parser;
3813
- return (_parser = parser).createAndParse.apply(_parser, [].concat(context, extensionSchema, ownerSchema, extra));
3813
+ return (_parser = parser).createAndParse.apply(_parser, [].concat([
3814
+ context,
3815
+ extensionSchema,
3816
+ ownerSchema
3817
+ ], extra));
3814
3818
  }
3815
3819
  };
3816
3820
  GLTFParser._additiveParse = function _additiveParse(extensionName, context, parseResource, extensionSchema, ownerSchema) {
3817
3821
  for(var _len = arguments.length, extra = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++){
3818
3822
  extra[_key - 5] = arguments[_key];
3819
3823
  }
3820
- var parser = GLTFParser.getExtensionParser(extensionName, exports.GLTFExtensionMode.AdditiveParse);
3824
+ var parser = GLTFParser.getExtensionParser(extensionName, GLTFExtensionMode.AdditiveParse);
3821
3825
  if (parser) {
3822
3826
  var _parser;
3823
- (_parser = parser).additiveParse.apply(_parser, [].concat(context, parseResource, extensionSchema, ownerSchema, extra));
3827
+ (_parser = parser).additiveParse.apply(_parser, [].concat([
3828
+ context,
3829
+ parseResource,
3830
+ extensionSchema,
3831
+ ownerSchema
3832
+ ], extra));
3824
3833
  }
3825
3834
  };
3826
3835
  return GLTFParser;
3827
3836
  }();
3828
- (function() {
3829
- GLTFParser._extensionParsers = {};
3830
- })();
3837
+ GLTFParser._extensionParsers = {};
3831
3838
  /**
3832
3839
  * Declare ExtensionParser's decorator.
3833
3840
  * @param extensionName - Extension name
@@ -3839,10 +3846,10 @@ exports.GLTFExtensionMode = void 0;
3839
3846
  };
3840
3847
  }
3841
3848
 
3842
- exports.GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser1) {
3843
- _inherits(GLTFSchemaParser, GLTFParser1);
3849
+ exports.GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser) {
3850
+ _inherits(GLTFSchemaParser, GLTFParser);
3844
3851
  function GLTFSchemaParser() {
3845
- return GLTFParser1.apply(this, arguments);
3852
+ return GLTFParser.apply(this, arguments) || this;
3846
3853
  }
3847
3854
  var _proto = GLTFSchemaParser.prototype;
3848
3855
  _proto.parse = function parse(context) {
@@ -3856,16 +3863,14 @@ exports.GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser1) {
3856
3863
  var remoteUrl = resourceManager._getRemoteUrl(url);
3857
3864
  return resourceManager// @ts-ignore
3858
3865
  ._requestByRemoteUrl(remoteUrl, requestConfig).onProgress(undefined, context._onTaskDetail).then(function(buffer) {
3859
- var _parseResult;
3860
3866
  var parseResult = GLTFUtils.parseGLB(context, buffer);
3861
3867
  // If the buffer is a GLB file, we need to restore the buffer data
3862
- if ((_parseResult = parseResult) == null ? void 0 : _parseResult.glTF) {
3868
+ if (parseResult == null ? void 0 : parseResult.glTF) {
3863
3869
  restoreBufferRequests.push(new BufferRequestInfo(remoteUrl, requestConfig));
3864
3870
  }
3865
3871
  return parseResult;
3866
3872
  }).then(function(result) {
3867
- var _result;
3868
- if ((_result = result) == null ? void 0 : _result.glTF) {
3873
+ if (result == null ? void 0 : result.glTF) {
3869
3874
  contentRestorer.isGLB = true;
3870
3875
  context.buffers = result.buffers;
3871
3876
  return result.glTF;
@@ -3878,19 +3883,19 @@ exports.GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser1) {
3878
3883
  return GLTFSchemaParser;
3879
3884
  }(GLTFParser);
3880
3885
  exports.GLTFSchemaParser = __decorate([
3881
- registerGLTFParser(exports.GLTFParserType.Schema)
3886
+ registerGLTFParser(GLTFParserType.Schema)
3882
3887
  ], exports.GLTFSchemaParser);
3883
3888
 
3884
3889
  exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
3885
- _inherits(GLTFAnimationParser1, GLTFParser1);
3886
- function GLTFAnimationParser1() {
3887
- return GLTFParser1.apply(this, arguments);
3890
+ _inherits(GLTFAnimationParser, GLTFParser1);
3891
+ function GLTFAnimationParser() {
3892
+ return GLTFParser1.apply(this, arguments) || this;
3888
3893
  }
3889
- var _proto = GLTFAnimationParser1.prototype;
3894
+ var _proto = GLTFAnimationParser.prototype;
3890
3895
  _proto.parse = function parse(context, index) {
3891
3896
  var animationInfo = context.glTF.animations[index];
3892
3897
  var _animationInfo_name = animationInfo.name, name = _animationInfo_name === void 0 ? "AnimationClip" + index : _animationInfo_name;
3893
- var animationClipPromise = GLTFParser.executeExtensionsCreateAndParse(animationInfo.extensions, context, animationInfo) || exports.GLTFAnimationParser._parseStandardProperty(context, new engineCore.AnimationClip(name), animationInfo);
3898
+ var animationClipPromise = GLTFParser.executeExtensionsCreateAndParse(animationInfo.extensions, context, animationInfo) || GLTFAnimationParser._parseStandardProperty(context, new engineCore.AnimationClip(name), animationInfo);
3894
3899
  return Promise.resolve(animationClipPromise).then(function(animationClip) {
3895
3900
  GLTFParser.executeExtensionsAdditiveAndParse(animationInfo.extensions, context, animationClip, animationInfo);
3896
3901
  return animationClip;
@@ -3898,7 +3903,7 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
3898
3903
  };
3899
3904
  /**
3900
3905
  * @internal
3901
- */ GLTFAnimationParser1._parseStandardProperty = function _parseStandardProperty(context, animationClip, animationInfo) {
3906
+ */ GLTFAnimationParser._parseStandardProperty = function _parseStandardProperty(context, animationClip, animationInfo) {
3902
3907
  var _loop = function(j, m) {
3903
3908
  var glTFSampler = samplers[j];
3904
3909
  var inputAccessor = accessors[glTFSampler.input];
@@ -3949,11 +3954,11 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
3949
3954
  var channels = animationInfo.channels, samplers = animationInfo.samplers;
3950
3955
  var len = samplers.length;
3951
3956
  var sampleDataCollection = new Array(len);
3952
- var entities = context.get(exports.GLTFParserType.Entity);
3957
+ var entities = context.get(GLTFParserType.Entity);
3953
3958
  var promises = new Array();
3954
3959
  // parse samplers
3955
3960
  for(var j = 0, m = len; j < m; j++)_loop(j);
3956
- promises.push(context.get(exports.GLTFParserType.Scene));
3961
+ promises.push(context.get(GLTFParserType.Scene));
3957
3962
  return Promise.all(promises).then(function() {
3958
3963
  for(var j = 0, m = channels.length; j < m; j++){
3959
3964
  var glTFChannel = channels[j];
@@ -4002,7 +4007,7 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
4002
4007
  return animationClip;
4003
4008
  });
4004
4009
  };
4005
- GLTFAnimationParser1._addCurve = function _addCurve(animationChannelTargetPath, glTFChannel, sampleDataCollection) {
4010
+ GLTFAnimationParser._addCurve = function _addCurve(animationChannelTargetPath, glTFChannel, sampleDataCollection) {
4006
4011
  var sampleData = sampleDataCollection[glTFChannel.sampler];
4007
4012
  var input = sampleData.input, output = sampleData.output, outputSize = sampleData.outputSize;
4008
4013
  switch(animationChannelTargetPath){
@@ -4070,16 +4075,16 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
4070
4075
  }
4071
4076
  }
4072
4077
  };
4073
- return GLTFAnimationParser1;
4078
+ return GLTFAnimationParser;
4074
4079
  }(GLTFParser);
4075
4080
  exports.GLTFAnimationParser = __decorate([
4076
- registerGLTFParser(exports.GLTFParserType.Animation)
4081
+ registerGLTFParser(GLTFParserType.Animation)
4077
4082
  ], exports.GLTFAnimationParser);
4078
4083
 
4079
- exports.GLTFBufferParser = /*#__PURE__*/ function(GLTFParser1) {
4080
- _inherits(GLTFBufferParser, GLTFParser1);
4084
+ exports.GLTFBufferParser = /*#__PURE__*/ function(GLTFParser) {
4085
+ _inherits(GLTFBufferParser, GLTFParser);
4081
4086
  function GLTFBufferParser() {
4082
- return GLTFParser1.apply(this, arguments);
4087
+ return GLTFParser.apply(this, arguments) || this;
4083
4088
  }
4084
4089
  var _proto = GLTFBufferParser.prototype;
4085
4090
  _proto.parse = function parse(context, index) {
@@ -4105,13 +4110,13 @@ exports.GLTFBufferParser = /*#__PURE__*/ function(GLTFParser1) {
4105
4110
  return GLTFBufferParser;
4106
4111
  }(GLTFParser);
4107
4112
  exports.GLTFBufferParser = __decorate([
4108
- registerGLTFParser(exports.GLTFParserType.Buffer)
4113
+ registerGLTFParser(GLTFParserType.Buffer)
4109
4114
  ], exports.GLTFBufferParser);
4110
4115
 
4111
4116
  exports.GLTFEntityParser = /*#__PURE__*/ function(GLTFParser1) {
4112
4117
  _inherits(GLTFEntityParser, GLTFParser1);
4113
4118
  function GLTFEntityParser() {
4114
- return GLTFParser1.apply(this, arguments);
4119
+ return GLTFParser1.apply(this, arguments) || this;
4115
4120
  }
4116
4121
  var _proto = GLTFEntityParser.prototype;
4117
4122
  _proto.parse = function parse(context, index) {
@@ -4142,7 +4147,7 @@ exports.GLTFEntityParser = /*#__PURE__*/ function(GLTFParser1) {
4142
4147
  if (children) {
4143
4148
  for(var i = 0; i < children.length; i++){
4144
4149
  var childIndex = children[i];
4145
- var childEntity = context.get(exports.GLTFParserType.Entity, childIndex);
4150
+ var childEntity = context.get(GLTFParserType.Entity, childIndex);
4146
4151
  entity.addChild(childEntity);
4147
4152
  }
4148
4153
  }
@@ -4152,15 +4157,15 @@ exports.GLTFEntityParser = /*#__PURE__*/ function(GLTFParser1) {
4152
4157
  return GLTFEntityParser;
4153
4158
  }(GLTFParser);
4154
4159
  exports.GLTFEntityParser = __decorate([
4155
- registerGLTFParser(exports.GLTFParserType.Entity)
4160
+ registerGLTFParser(GLTFParserType.Entity)
4156
4161
  ], exports.GLTFEntityParser);
4157
4162
 
4158
4163
  exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4159
- _inherits(GLTFMaterialParser1, GLTFParser1);
4160
- function GLTFMaterialParser1() {
4161
- return GLTFParser1.apply(this, arguments);
4164
+ _inherits(GLTFMaterialParser, GLTFParser1);
4165
+ function GLTFMaterialParser() {
4166
+ return GLTFParser1.apply(this, arguments) || this;
4162
4167
  }
4163
- var _proto = GLTFMaterialParser1.prototype;
4168
+ var _proto = GLTFMaterialParser.prototype;
4164
4169
  _proto.parse = function parse(context, index) {
4165
4170
  var materialInfo = context.glTF.materials[index];
4166
4171
  var glTFResource = context.glTFResource;
@@ -4169,23 +4174,23 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4169
4174
  if (!material) {
4170
4175
  material = new engineCore.PBRMaterial(engine);
4171
4176
  material.name = materialInfo.name;
4172
- exports.GLTFMaterialParser._parseStandardProperty(context, material, materialInfo);
4177
+ GLTFMaterialParser._parseStandardProperty(context, material, materialInfo);
4173
4178
  }
4174
4179
  return Promise.resolve(material).then(function(material) {
4175
- material || (material = exports.GLTFMaterialParser._getDefaultMaterial(engine));
4180
+ material || (material = GLTFMaterialParser._getDefaultMaterial(engine));
4176
4181
  GLTFParser.executeExtensionsAdditiveAndParse(materialInfo.extensions, context, material, materialInfo);
4177
4182
  // @ts-ignore
4178
4183
  material._associationSuperResource(glTFResource);
4179
4184
  return material;
4180
4185
  });
4181
4186
  };
4182
- /** @internal */ GLTFMaterialParser1._getDefaultMaterial = function _getDefaultMaterial(engine) {
4187
+ /** @internal */ GLTFMaterialParser._getDefaultMaterial = function _getDefaultMaterial(engine) {
4183
4188
  var _GLTFMaterialParser;
4184
- return (_GLTFMaterialParser = exports.GLTFMaterialParser)._defaultMaterial || (_GLTFMaterialParser._defaultMaterial = new engineCore.BlinnPhongMaterial(engine));
4189
+ return (_GLTFMaterialParser = GLTFMaterialParser)._defaultMaterial || (_GLTFMaterialParser._defaultMaterial = new engineCore.BlinnPhongMaterial(engine));
4185
4190
  };
4186
4191
  /**
4187
4192
  * @internal
4188
- */ GLTFMaterialParser1._checkOtherTextureTransform = function _checkOtherTextureTransform(texture, textureName) {
4193
+ */ GLTFMaterialParser._checkOtherTextureTransform = function _checkOtherTextureTransform(texture, textureName) {
4189
4194
  var _texture_extensions;
4190
4195
  if ((_texture_extensions = texture.extensions) == null ? void 0 : _texture_extensions.KHR_texture_transform) {
4191
4196
  engineCore.Logger.warn("" + textureName + " texture always use the KHR_texture_transform of the base texture.");
@@ -4193,7 +4198,7 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4193
4198
  };
4194
4199
  /**
4195
4200
  * @internal
4196
- */ GLTFMaterialParser1._parseStandardProperty = function _parseStandardProperty(context, material, materialInfo) {
4201
+ */ GLTFMaterialParser._parseStandardProperty = function _parseStandardProperty(context, material, materialInfo) {
4197
4202
  var pbrMetallicRoughness = materialInfo.pbrMetallicRoughness, normalTexture = materialInfo.normalTexture, occlusionTexture = materialInfo.occlusionTexture, emissiveTexture = materialInfo.emissiveTexture, emissiveFactor = materialInfo.emissiveFactor, alphaMode = materialInfo.alphaMode, alphaCutoff = materialInfo.alphaCutoff, doubleSided = materialInfo.doubleSided;
4198
4203
  if (pbrMetallicRoughness) {
4199
4204
  var baseColorFactor = pbrMetallicRoughness.baseColorFactor, baseColorTexture = pbrMetallicRoughness.baseColorTexture, metallicFactor = pbrMetallicRoughness.metallicFactor, roughnessFactor = pbrMetallicRoughness.roughnessFactor, metallicRoughnessTexture = pbrMetallicRoughness.metallicRoughnessTexture;
@@ -4201,7 +4206,7 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4201
4206
  material.baseColor = new engineMath.Color(engineMath.Color.linearToGammaSpace(baseColorFactor[0]), engineMath.Color.linearToGammaSpace(baseColorFactor[1]), engineMath.Color.linearToGammaSpace(baseColorFactor[2]), baseColorFactor[3]);
4202
4207
  }
4203
4208
  if (baseColorTexture) {
4204
- context.get(exports.GLTFParserType.Texture, baseColorTexture.index).then(function(texture) {
4209
+ context.get(GLTFParserType.Texture, baseColorTexture.index).then(function(texture) {
4205
4210
  material.baseTexture = texture;
4206
4211
  GLTFParser.executeExtensionsAdditiveAndParse(baseColorTexture.extensions, context, material, baseColorTexture);
4207
4212
  });
@@ -4210,8 +4215,8 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4210
4215
  material.metallic = metallicFactor != null ? metallicFactor : 1;
4211
4216
  material.roughness = roughnessFactor != null ? roughnessFactor : 1;
4212
4217
  if (metallicRoughnessTexture) {
4213
- exports.GLTFMaterialParser._checkOtherTextureTransform(metallicRoughnessTexture, "Roughness metallic");
4214
- context.get(exports.GLTFParserType.Texture, metallicRoughnessTexture.index).then(function(texture) {
4218
+ GLTFMaterialParser._checkOtherTextureTransform(metallicRoughnessTexture, "Roughness metallic");
4219
+ context.get(GLTFParserType.Texture, metallicRoughnessTexture.index).then(function(texture) {
4215
4220
  material.roughnessMetallicTexture = texture;
4216
4221
  });
4217
4222
  }
@@ -4219,8 +4224,8 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4219
4224
  }
4220
4225
  if (material.constructor === engineCore.PBRMaterial || material.constructor === engineCore.PBRSpecularMaterial) {
4221
4226
  if (emissiveTexture) {
4222
- exports.GLTFMaterialParser._checkOtherTextureTransform(emissiveTexture, "Emissive");
4223
- context.get(exports.GLTFParserType.Texture, emissiveTexture.index).then(function(texture) {
4227
+ GLTFMaterialParser._checkOtherTextureTransform(emissiveTexture, "Emissive");
4228
+ context.get(GLTFParserType.Texture, emissiveTexture.index).then(function(texture) {
4224
4229
  material.emissiveTexture = texture;
4225
4230
  });
4226
4231
  }
@@ -4229,8 +4234,8 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4229
4234
  }
4230
4235
  if (normalTexture) {
4231
4236
  var index = normalTexture.index, scale = normalTexture.scale;
4232
- exports.GLTFMaterialParser._checkOtherTextureTransform(normalTexture, "Normal");
4233
- context.get(exports.GLTFParserType.Texture, index).then(function(texture) {
4237
+ GLTFMaterialParser._checkOtherTextureTransform(normalTexture, "Normal");
4238
+ context.get(GLTFParserType.Texture, index).then(function(texture) {
4234
4239
  material.normalTexture = texture;
4235
4240
  });
4236
4241
  if (scale !== undefined) {
@@ -4239,8 +4244,8 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4239
4244
  }
4240
4245
  if (occlusionTexture) {
4241
4246
  var index1 = occlusionTexture.index, strength = occlusionTexture.strength, texCoord = occlusionTexture.texCoord;
4242
- exports.GLTFMaterialParser._checkOtherTextureTransform(occlusionTexture, "Occlusion");
4243
- context.get(exports.GLTFParserType.Texture, index1).then(function(texture) {
4247
+ GLTFMaterialParser._checkOtherTextureTransform(occlusionTexture, "Occlusion");
4248
+ context.get(GLTFParserType.Texture, index1).then(function(texture) {
4244
4249
  material.occlusionTexture = texture;
4245
4250
  });
4246
4251
  if (strength !== undefined) {
@@ -4270,19 +4275,18 @@ exports.GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4270
4275
  break;
4271
4276
  }
4272
4277
  };
4273
- return GLTFMaterialParser1;
4278
+ return GLTFMaterialParser;
4274
4279
  }(GLTFParser);
4275
4280
  exports.GLTFMaterialParser = __decorate([
4276
- registerGLTFParser(exports.GLTFParserType.Material)
4281
+ registerGLTFParser(GLTFParserType.Material)
4277
4282
  ], exports.GLTFMaterialParser);
4278
4283
 
4279
- var _GLTFMeshParser;
4280
- exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
4281
- _inherits(GLTFMeshParser1, GLTFParser1);
4282
- function GLTFMeshParser1() {
4283
- return GLTFParser1.apply(this, arguments);
4284
+ exports.GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
4285
+ _inherits(GLTFMeshParser, GLTFParser1);
4286
+ function GLTFMeshParser() {
4287
+ return GLTFParser1.apply(this, arguments) || this;
4284
4288
  }
4285
- var _proto = GLTFMeshParser1.prototype;
4289
+ var _proto = GLTFMeshParser.prototype;
4286
4290
  _proto.parse = function parse(context, index) {
4287
4291
  var _loop = function(i, length) {
4288
4292
  var gltfPrimitive = meshInfo.primitives[i];
@@ -4307,7 +4311,7 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
4307
4311
  var meshRestoreInfo = new ModelMeshRestoreInfo();
4308
4312
  meshRestoreInfo.mesh = mesh1;
4309
4313
  context.contentRestorer.meshes.push(meshRestoreInfo);
4310
- exports.GLTFMeshParser._parseMeshFromGLTFPrimitive(context, mesh1, meshRestoreInfo, meshInfo, gltfPrimitive, glTF, context.params.keepMeshData).then(resolve);
4314
+ GLTFMeshParser._parseMeshFromGLTFPrimitive(context, mesh1, meshRestoreInfo, meshInfo, gltfPrimitive, glTF, context.params.keepMeshData).then(resolve);
4311
4315
  }
4312
4316
  });
4313
4317
  };
@@ -4320,7 +4324,7 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
4320
4324
  };
4321
4325
  /**
4322
4326
  * @internal
4323
- */ GLTFMeshParser1._parseMeshFromGLTFPrimitive = function _parseMeshFromGLTFPrimitive(context, mesh, meshRestoreInfo, gltfMesh, gltfPrimitive, gltf, keepMeshData) {
4327
+ */ GLTFMeshParser._parseMeshFromGLTFPrimitive = function _parseMeshFromGLTFPrimitive(context, mesh, meshRestoreInfo, gltfMesh, gltfPrimitive, gltf, keepMeshData) {
4324
4328
  var _loop = function(attribute) {
4325
4329
  var accessor = accessors[attributes[attribute]];
4326
4330
  var promise = GLTFUtils.getAccessorBuffer(context, gltf.bufferViews, accessor).then(function(accessorBuffer) {
@@ -4371,7 +4375,7 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
4371
4375
  min.copyFromArray(accessor.min);
4372
4376
  max.copyFromArray(accessor.max);
4373
4377
  } else {
4374
- var position = exports.GLTFMeshParser._tempVector3;
4378
+ var position = GLTFMeshParser._tempVector3;
4375
4379
  min.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
4376
4380
  max.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
4377
4381
  var baseOffset = elementOffset / vertices.BYTES_PER_ELEMENT;
@@ -4415,7 +4419,7 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
4415
4419
  }
4416
4420
  // BlendShapes
4417
4421
  if (targets) {
4418
- promises.push(exports.GLTFMeshParser._createBlendShape(context, mesh, meshRestoreInfo, gltfMesh, gltfPrimitive, targets));
4422
+ promises.push(GLTFMeshParser._createBlendShape(context, mesh, meshRestoreInfo, gltfMesh, gltfPrimitive, targets));
4419
4423
  }
4420
4424
  return Promise.all(promises).then(function() {
4421
4425
  mesh.uploadData(!keepMeshData);
@@ -4423,7 +4427,7 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
4423
4427
  });
4424
4428
  });
4425
4429
  };
4426
- GLTFMeshParser1._getBlendShapeData = function _getBlendShapeData(context, glTF, accessor) {
4430
+ GLTFMeshParser._getBlendShapeData = function _getBlendShapeData(context, glTF, accessor) {
4427
4431
  return GLTFUtils.getAccessorBuffer(context, glTF.bufferViews, accessor).then(function(bufferInfo) {
4428
4432
  var buffer = bufferInfo.data;
4429
4433
  var _accessor_byteOffset;
@@ -4439,8 +4443,8 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
4439
4443
  };
4440
4444
  /**
4441
4445
  * @internal
4442
- */ GLTFMeshParser1._createBlendShape = function _createBlendShape(context, mesh, meshRestoreInfo, glTFMesh, gltfPrimitive, glTFTargets) {
4443
- var _this = this, _loop = function(i) {
4446
+ */ GLTFMeshParser._createBlendShape = function _createBlendShape(context, mesh, meshRestoreInfo, glTFMesh, gltfPrimitive, glTFTargets) {
4447
+ var _this, _loop = function(i) {
4444
4448
  var blendShapeData = {};
4445
4449
  blendShapeCollection[i] = blendShapeData;
4446
4450
  var name = blendShapeNames ? blendShapeNames[i] : "blendShape" + i;
@@ -4454,12 +4458,11 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
4454
4458
  hasNormal ? _this._getBlendShapeData(context, glTF, accessors[normalTarget]) : null,
4455
4459
  hasTangent ? _this._getBlendShapeData(context, glTF, accessors[tangentTarget]) : null
4456
4460
  ]).then(function(vertices) {
4457
- var _tangentData;
4458
4461
  var positionData = vertices[0], normalData = vertices[1], tangentData = vertices[2];
4459
4462
  var blendShape = new engineCore.BlendShape(name);
4460
4463
  blendShape.addFrame(1.0, positionData.vertices, hasNormal ? normalData.vertices : null, hasTangent ? tangentData.vertices : null);
4461
4464
  blendShapeData.blendShape = blendShape;
4462
- blendShapeData.restoreInfo = new BlendShapeRestoreInfo(blendShape, positionData.restoreInfo, hasNormal ? normalData.restoreInfo : null, hasTangent ? (_tangentData = tangentData) == null ? void 0 : _tangentData.restoreInfo : null);
4465
+ blendShapeData.restoreInfo = new BlendShapeRestoreInfo(blendShape, positionData.restoreInfo, hasNormal ? normalData.restoreInfo : null, hasTangent ? tangentData == null ? void 0 : tangentData.restoreInfo : null);
4463
4466
  });
4464
4467
  promises.push(promise);
4465
4468
  };
@@ -4469,7 +4472,7 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
4469
4472
  var promises = new Array();
4470
4473
  var blendShapeCount = glTFTargets.length;
4471
4474
  var blendShapeCollection = new Array(blendShapeCount);
4472
- for(var i = 0; i < blendShapeCount; i++)_loop(i);
4475
+ for(var i = 0; i < blendShapeCount; i++)_this = this, _loop(i);
4473
4476
  return Promise.all(promises).then(function() {
4474
4477
  for(var _iterator = _create_for_of_iterator_helper_loose(blendShapeCollection), _step; !(_step = _iterator()).done;){
4475
4478
  var blendShape = _step.value;
@@ -4478,18 +4481,17 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
4478
4481
  }
4479
4482
  });
4480
4483
  };
4481
- return GLTFMeshParser1;
4482
- }(GLTFParser), function() {
4483
- _GLTFMeshParser._tempVector3 = new engineMath.Vector3();
4484
- }(), _GLTFMeshParser);
4484
+ return GLTFMeshParser;
4485
+ }(GLTFParser);
4486
+ exports.GLTFMeshParser._tempVector3 = new engineMath.Vector3();
4485
4487
  exports.GLTFMeshParser = __decorate([
4486
- registerGLTFParser(exports.GLTFParserType.Mesh)
4488
+ registerGLTFParser(GLTFParserType.Mesh)
4487
4489
  ], exports.GLTFMeshParser);
4488
4490
 
4489
4491
  exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4490
4492
  _inherits(GLTFSceneParser, GLTFParser1);
4491
4493
  function GLTFSceneParser() {
4492
- return GLTFParser1.apply(this, arguments);
4494
+ return GLTFParser1.apply(this, arguments) || this;
4493
4495
  }
4494
4496
  var _proto = GLTFSceneParser.prototype;
4495
4497
  _proto.parse = function parse(context, index) {
@@ -4501,13 +4503,13 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4501
4503
  var sceneNodes = sceneInfo.nodes || [];
4502
4504
  var sceneRoot;
4503
4505
  if (sceneNodes.length === 1) {
4504
- sceneRoot = context.get(exports.GLTFParserType.Entity, sceneNodes[0]);
4506
+ sceneRoot = context.get(GLTFParserType.Entity, sceneNodes[0]);
4505
4507
  } else {
4506
4508
  sceneRoot = new engineCore.Entity(engine, "GLTF_ROOT");
4507
4509
  // @ts-ignore
4508
4510
  sceneRoot._markAsTemplate(glTFResource);
4509
4511
  for(var i = 0; i < sceneNodes.length; i++){
4510
- var childEntity = context.get(exports.GLTFParserType.Entity, sceneNodes[i]);
4512
+ var childEntity = context.get(GLTFParserType.Entity, sceneNodes[i]);
4511
4513
  sceneRoot.addChild(childEntity);
4512
4514
  }
4513
4515
  }
@@ -4528,7 +4530,7 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4528
4530
  var glTF = context.glTF, glTFResource = context.glTFResource;
4529
4531
  var entityInfo = glTF.nodes[index];
4530
4532
  var cameraID = entityInfo.camera, meshID = entityInfo.mesh;
4531
- var entity = context.get(exports.GLTFParserType.Entity, index);
4533
+ var entity = context.get(GLTFParserType.Entity, index);
4532
4534
  var promise;
4533
4535
  if (cameraID !== undefined) {
4534
4536
  this._createCamera(glTFResource, glTF.cameras[cameraID], entity);
@@ -4591,11 +4593,11 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4591
4593
  var materialPromises = new Array(rendererCount);
4592
4594
  for(var i = 0; i < rendererCount; i++){
4593
4595
  var _glTFMeshPrimitives_i_material;
4594
- materialPromises[i] = context.get(exports.GLTFParserType.Material, (_glTFMeshPrimitives_i_material = glTFMeshPrimitives[i].material) != null ? _glTFMeshPrimitives_i_material : -1);
4596
+ materialPromises[i] = context.get(GLTFParserType.Material, (_glTFMeshPrimitives_i_material = glTFMeshPrimitives[i].material) != null ? _glTFMeshPrimitives_i_material : -1);
4595
4597
  }
4596
4598
  return Promise.all([
4597
- context.get(exports.GLTFParserType.Mesh, meshID),
4598
- skinID !== undefined && context.get(exports.GLTFParserType.Skin, skinID),
4599
+ context.get(GLTFParserType.Mesh, meshID),
4600
+ skinID !== undefined && context.get(GLTFParserType.Skin, skinID),
4599
4601
  Promise.all(materialPromises)
4600
4602
  ]).then(function(param) {
4601
4603
  var _loop = function(i) {
@@ -4666,13 +4668,13 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4666
4668
  return GLTFSceneParser;
4667
4669
  }(GLTFParser);
4668
4670
  exports.GLTFSceneParser = __decorate([
4669
- registerGLTFParser(exports.GLTFParserType.Scene)
4671
+ registerGLTFParser(GLTFParserType.Scene)
4670
4672
  ], exports.GLTFSceneParser);
4671
4673
 
4672
- exports.GLTFSkinParser = /*#__PURE__*/ function(GLTFParser1) {
4673
- _inherits(GLTFSkinParser, GLTFParser1);
4674
+ exports.GLTFSkinParser = /*#__PURE__*/ function(GLTFParser) {
4675
+ _inherits(GLTFSkinParser, GLTFParser);
4674
4676
  function GLTFSkinParser() {
4675
- return GLTFParser1.apply(this, arguments);
4677
+ return GLTFParser.apply(this, arguments) || this;
4676
4678
  }
4677
4679
  var _proto = GLTFSkinParser.prototype;
4678
4680
  _proto.parse = function parse(context, index) {
@@ -4687,7 +4689,7 @@ exports.GLTFSkinParser = /*#__PURE__*/ function(GLTFParser1) {
4687
4689
  // parse IBM
4688
4690
  var accessor = glTF.accessors[inverseBindMatrices];
4689
4691
  var skinPromise = GLTFUtils.getAccessorBuffer(context, glTF.bufferViews, accessor).then(function(bufferInfo) {
4690
- var entities = context.get(exports.GLTFParserType.Entity);
4692
+ var entities = context.get(GLTFParserType.Entity);
4691
4693
  var buffer = bufferInfo.data;
4692
4694
  for(var i = 0; i < jointCount; i++){
4693
4695
  var inverseBindMatrix = new engineMath.Matrix();
@@ -4746,23 +4748,22 @@ exports.GLTFSkinParser = /*#__PURE__*/ function(GLTFParser1) {
4746
4748
  return GLTFSkinParser;
4747
4749
  }(GLTFParser);
4748
4750
  exports.GLTFSkinParser = __decorate([
4749
- registerGLTFParser(exports.GLTFParserType.Skin)
4751
+ registerGLTFParser(GLTFParserType.Skin)
4750
4752
  ], exports.GLTFSkinParser);
4751
4753
 
4752
- var _GLTFTextureParser;
4753
- exports.GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1) {
4754
- _inherits(GLTFTextureParser1, GLTFParser1);
4755
- function GLTFTextureParser1() {
4756
- return GLTFParser1.apply(this, arguments);
4754
+ exports.GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1) {
4755
+ _inherits(GLTFTextureParser, GLTFParser1);
4756
+ function GLTFTextureParser() {
4757
+ return GLTFParser1.apply(this, arguments) || this;
4757
4758
  }
4758
- var _proto = GLTFTextureParser1.prototype;
4759
+ var _proto = GLTFTextureParser.prototype;
4759
4760
  _proto.parse = function parse(context, textureIndex) {
4760
4761
  var textureInfo = context.glTF.textures[textureIndex];
4761
4762
  var glTFResource = context.glTFResource;
4762
4763
  var sampler = textureInfo.sampler, tmp = textureInfo.source, imageIndex = tmp === void 0 ? 0 : tmp, textureName = textureInfo.name, extensions = textureInfo.extensions;
4763
4764
  var texture = GLTFParser.executeExtensionsCreateAndParse(extensions, context, textureInfo, textureIndex);
4764
4765
  if (!texture) {
4765
- texture = exports.GLTFTextureParser._parseTexture(context, imageIndex, textureIndex, sampler, textureName);
4766
+ texture = GLTFTextureParser._parseTexture(context, imageIndex, textureIndex, sampler, textureName);
4766
4767
  }
4767
4768
  return Promise.resolve(texture).then(function(texture) {
4768
4769
  GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, texture, textureInfo);
@@ -4771,7 +4772,7 @@ exports.GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFPar
4771
4772
  return texture;
4772
4773
  });
4773
4774
  };
4774
- /** @internal */ GLTFTextureParser1._parseTexture = function _parseTexture(context, imageIndex, textureIndex, sampler, textureName) {
4775
+ /** @internal */ GLTFTextureParser._parseTexture = function _parseTexture(context, imageIndex, textureIndex, sampler, textureName) {
4775
4776
  var glTFResource = context.glTFResource, glTF = context.glTF;
4776
4777
  var engine = glTFResource.engine, url = glTFResource.url;
4777
4778
  var _glTF_images_imageIndex = glTF.images[imageIndex], uri = _glTF_images_imageIndex.uri, bufferViewIndex = _glTF_images_imageIndex.bufferView, mimeType = _glTF_images_imageIndex.mimeType, imageName = _glTF_images_imageIndex.name;
@@ -4779,7 +4780,6 @@ exports.GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFPar
4779
4780
  var samplerInfo = useSampler && GLTFUtils.getSamplerInfo(glTF.samplers[sampler]);
4780
4781
  var texture;
4781
4782
  if (uri) {
4782
- var _samplerInfo;
4783
4783
  var extIndex = uri.lastIndexOf(".");
4784
4784
  var ext = uri.substring(extIndex + 1);
4785
4785
  var type = ext.startsWith("ktx") ? engineCore.AssetType.KTX : engineCore.AssetType.Texture2D;
@@ -4787,7 +4787,7 @@ exports.GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFPar
4787
4787
  url: engineCore.Utils.resolveAbsoluteUrl(url, uri),
4788
4788
  type: type,
4789
4789
  params: {
4790
- mipmap: (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap
4790
+ mipmap: samplerInfo == null ? void 0 : samplerInfo.mipmap
4791
4791
  }
4792
4792
  }).onProgress(undefined, context._onTaskDetail).then(function(texture) {
4793
4793
  texture.name = textureName || imageName || texture.name || "texture_" + textureIndex;
@@ -4797,12 +4797,11 @@ exports.GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFPar
4797
4797
  context._addTaskCompletePromise(texture);
4798
4798
  } else {
4799
4799
  var bufferView = glTF.bufferViews[bufferViewIndex];
4800
- texture = context.get(exports.GLTFParserType.Buffer).then(function(buffers) {
4800
+ texture = context.get(GLTFParserType.Buffer).then(function(buffers) {
4801
4801
  var buffer = buffers[bufferView.buffer];
4802
4802
  var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
4803
4803
  return GLTFUtils.loadImageBuffer(imageBuffer, mimeType).then(function(image) {
4804
- var _samplerInfo;
4805
- var texture = new engineCore.Texture2D(engine, image.width, image.height, undefined, (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap);
4804
+ var texture = new engineCore.Texture2D(engine, image.width, image.height, undefined, samplerInfo == null ? void 0 : samplerInfo.mipmap);
4806
4805
  texture.setImageSource(image);
4807
4806
  texture.generateMipmaps();
4808
4807
  texture.name = textureName || imageName || "texture_" + textureIndex;
@@ -4815,19 +4814,18 @@ exports.GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFPar
4815
4814
  }
4816
4815
  return texture;
4817
4816
  };
4818
- return GLTFTextureParser1;
4819
- }(GLTFParser), function() {
4820
- var _obj;
4821
- /** @internal */ _GLTFTextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = engineCore.TextureWrapMode.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = engineCore.TextureWrapMode.Mirror, _obj[TextureWrapMode.REPEAT] = engineCore.TextureWrapMode.Repeat, _obj);
4822
- }(), _GLTFTextureParser);
4817
+ return GLTFTextureParser;
4818
+ }(GLTFParser);
4819
+ var _obj;
4820
+ /** @internal */ exports.GLTFTextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = engineCore.TextureWrapMode.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = engineCore.TextureWrapMode.Mirror, _obj[TextureWrapMode.REPEAT] = engineCore.TextureWrapMode.Repeat, _obj);
4823
4821
  exports.GLTFTextureParser = __decorate([
4824
- registerGLTFParser(exports.GLTFParserType.Texture)
4822
+ registerGLTFParser(GLTFParserType.Texture)
4825
4823
  ], exports.GLTFTextureParser);
4826
4824
 
4827
4825
  exports.GLTFValidator = /*#__PURE__*/ function(GLTFParser1) {
4828
4826
  _inherits(GLTFValidator, GLTFParser1);
4829
4827
  function GLTFValidator() {
4830
- return GLTFParser1.apply(this, arguments);
4828
+ return GLTFParser1.apply(this, arguments) || this;
4831
4829
  }
4832
4830
  var _proto = GLTFValidator.prototype;
4833
4831
  _proto.parse = function parse(context) {
@@ -4859,32 +4857,32 @@ exports.GLTFValidator = /*#__PURE__*/ function(GLTFParser1) {
4859
4857
  return GLTFValidator;
4860
4858
  }(GLTFParser);
4861
4859
  exports.GLTFValidator = __decorate([
4862
- registerGLTFParser(exports.GLTFParserType.Validator)
4860
+ registerGLTFParser(GLTFParserType.Validator)
4863
4861
  ], exports.GLTFValidator);
4864
4862
 
4865
4863
  exports.GLTFBufferViewParser = /*#__PURE__*/ function(GLTFParser1) {
4866
4864
  _inherits(GLTFBufferViewParser, GLTFParser1);
4867
4865
  function GLTFBufferViewParser() {
4868
- return GLTFParser1.apply(this, arguments);
4866
+ return GLTFParser1.apply(this, arguments) || this;
4869
4867
  }
4870
4868
  var _proto = GLTFBufferViewParser.prototype;
4871
4869
  _proto.parse = function parse(context, index) {
4872
4870
  var bufferView = context.glTF.bufferViews[index];
4873
4871
  var extensions = bufferView.extensions, _bufferView_byteOffset = bufferView.byteOffset, byteOffset = _bufferView_byteOffset === void 0 ? 0 : _bufferView_byteOffset, byteLength = bufferView.byteLength, bufferIndex = bufferView.buffer;
4874
- return extensions ? GLTFParser.executeExtensionsCreateAndParse(extensions, context, bufferView) : context.get(exports.GLTFParserType.Buffer, bufferIndex).then(function(buffer) {
4872
+ return extensions ? GLTFParser.executeExtensionsCreateAndParse(extensions, context, bufferView) : context.get(GLTFParserType.Buffer, bufferIndex).then(function(buffer) {
4875
4873
  return new Uint8Array(buffer, byteOffset, byteLength);
4876
4874
  });
4877
4875
  };
4878
4876
  return GLTFBufferViewParser;
4879
4877
  }(GLTFParser);
4880
4878
  exports.GLTFBufferViewParser = __decorate([
4881
- registerGLTFParser(exports.GLTFParserType.BufferView)
4879
+ registerGLTFParser(GLTFParserType.BufferView)
4882
4880
  ], exports.GLTFBufferViewParser);
4883
4881
 
4884
- exports.GLTFAnimatorControllerParser = /*#__PURE__*/ function(GLTFParser1) {
4885
- _inherits(GLTFAnimatorControllerParser, GLTFParser1);
4882
+ exports.GLTFAnimatorControllerParser = /*#__PURE__*/ function(GLTFParser) {
4883
+ _inherits(GLTFAnimatorControllerParser, GLTFParser);
4886
4884
  function GLTFAnimatorControllerParser() {
4887
- return GLTFParser1.apply(this, arguments);
4885
+ return GLTFParser.apply(this, arguments) || this;
4888
4886
  }
4889
4887
  var _proto = GLTFAnimatorControllerParser.prototype;
4890
4888
  _proto.parse = function parse(context) {
@@ -4892,7 +4890,7 @@ exports.GLTFAnimatorControllerParser = /*#__PURE__*/ function(GLTFParser1) {
4892
4890
  if (!context.needAnimatorController) {
4893
4891
  return Promise.resolve(null);
4894
4892
  }
4895
- return context.get(exports.GLTFParserType.Animation).then(function(animations) {
4893
+ return context.get(GLTFParserType.Animation).then(function(animations) {
4896
4894
  var animatorController = _this._createAnimatorController(context, animations);
4897
4895
  return Promise.resolve(animatorController);
4898
4896
  });
@@ -4922,95 +4920,12 @@ exports.GLTFAnimatorControllerParser = /*#__PURE__*/ function(GLTFParser1) {
4922
4920
  return GLTFAnimatorControllerParser;
4923
4921
  }(GLTFParser);
4924
4922
  exports.GLTFAnimatorControllerParser = __decorate([
4925
- registerGLTFParser(exports.GLTFParserType.AnimatorController)
4923
+ registerGLTFParser(GLTFParserType.AnimatorController)
4926
4924
  ], exports.GLTFAnimatorControllerParser);
4927
4925
 
4928
4926
  // Source: https://github.com/zeux/meshoptimizer/blob/master/js/meshopt_decoder.js
4929
4927
  var ready;
4930
4928
  function getMeshoptDecoder() {
4931
- var unpack = function unpack(data) {
4932
- var result = new Uint8Array(data.length);
4933
- for(var i = 0; i < data.length; ++i){
4934
- var ch = data.charCodeAt(i);
4935
- result[i] = ch > 96 ? ch - 97 : ch > 64 ? ch - 39 : ch + 4;
4936
- }
4937
- var write = 0;
4938
- for(var i1 = 0; i1 < data.length; ++i1){
4939
- result[write++] = result[i1] < 60 ? wasmpack[result[i1]] : (result[i1] - 60) * 64 + result[++i1];
4940
- }
4941
- return result.buffer.slice(0, write);
4942
- };
4943
- var decode = function decode(fun, target, count, size, source, filter) {
4944
- var sbrk = instance.exports.sbrk;
4945
- var count4 = count + 3 & ~3;
4946
- var tp = sbrk(count4 * size);
4947
- var sp = sbrk(source.length);
4948
- var heap = new Uint8Array(instance.exports.memory.buffer);
4949
- heap.set(source, sp);
4950
- var res = fun(tp, count, size, sp, source.length);
4951
- if (res == 0 && filter) {
4952
- filter(tp, count4, size);
4953
- }
4954
- target.set(heap.subarray(tp, tp + count * size));
4955
- sbrk(tp - sbrk(0));
4956
- if (res != 0) {
4957
- throw new Error("Malformed buffer data: " + res);
4958
- }
4959
- };
4960
- var createWorker = function createWorker(url) {
4961
- var worker = {
4962
- object: new Worker(url),
4963
- pending: 0,
4964
- requests: {}
4965
- };
4966
- worker.object.onmessage = function(event) {
4967
- var data = event.data;
4968
- worker.pending -= data.count;
4969
- worker.requests[data.id][data.action](data.value);
4970
- delete worker.requests[data.id];
4971
- };
4972
- return worker;
4973
- };
4974
- var initWorkers = function initWorkers(count) {
4975
- 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 }';
4976
- var blob = new Blob([
4977
- source
4978
- ], {
4979
- type: "text/javascript"
4980
- });
4981
- var url = URL.createObjectURL(blob);
4982
- for(var i = 0; i < count; ++i){
4983
- workers[i] = createWorker(url);
4984
- }
4985
- URL.revokeObjectURL(url);
4986
- };
4987
- var decodeWorker = function decodeWorker(count, size, source, mode, filter) {
4988
- var worker = workers[0];
4989
- for(var i = 1; i < workers.length; ++i){
4990
- if (workers[i].pending < worker.pending) {
4991
- worker = workers[i];
4992
- }
4993
- }
4994
- return new Promise(function(resolve, reject) {
4995
- var data = new Uint8Array(source);
4996
- var id = requestId++;
4997
- worker.pending += count;
4998
- worker.requests[id] = {
4999
- resolve: resolve,
5000
- reject: reject
5001
- };
5002
- worker.object.postMessage({
5003
- id: id,
5004
- count: count,
5005
- size: size,
5006
- source: data,
5007
- mode: mode,
5008
- filter: filter
5009
- }, [
5010
- data.buffer
5011
- ]);
5012
- });
5013
- };
5014
4929
  if (ready) return ready;
5015
4930
  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";
5016
4931
  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";
@@ -5106,6 +5021,35 @@ function getMeshoptDecoder() {
5106
5021
  }
5107
5022
  };
5108
5023
  });
5024
+ function unpack(data) {
5025
+ var result = new Uint8Array(data.length);
5026
+ for(var i = 0; i < data.length; ++i){
5027
+ var ch = data.charCodeAt(i);
5028
+ result[i] = ch > 96 ? ch - 97 : ch > 64 ? ch - 39 : ch + 4;
5029
+ }
5030
+ var write = 0;
5031
+ for(var i1 = 0; i1 < data.length; ++i1){
5032
+ result[write++] = result[i1] < 60 ? wasmpack[result[i1]] : (result[i1] - 60) * 64 + result[++i1];
5033
+ }
5034
+ return result.buffer.slice(0, write);
5035
+ }
5036
+ function decode(fun, target, count, size, source, filter) {
5037
+ var sbrk = instance.exports.sbrk;
5038
+ var count4 = count + 3 & ~3;
5039
+ var tp = sbrk(count4 * size);
5040
+ var sp = sbrk(source.length);
5041
+ var heap = new Uint8Array(instance.exports.memory.buffer);
5042
+ heap.set(source, sp);
5043
+ var res = fun(tp, count, size, sp, source.length);
5044
+ if (res == 0 && filter) {
5045
+ filter(tp, count4, size);
5046
+ }
5047
+ target.set(heap.subarray(tp, tp + count * size));
5048
+ sbrk(tp - sbrk(0));
5049
+ if (res != 0) {
5050
+ throw new Error("Malformed buffer data: " + res);
5051
+ }
5052
+ }
5109
5053
  var filters = {
5110
5054
  NONE: "",
5111
5055
  OCTAHEDRAL: "meshopt_decodeFilterOct",
@@ -5119,13 +5063,67 @@ function getMeshoptDecoder() {
5119
5063
  };
5120
5064
  var workers = [];
5121
5065
  var requestId = 0;
5066
+ function createWorker(url) {
5067
+ var worker = {
5068
+ object: new Worker(url),
5069
+ pending: 0,
5070
+ requests: {}
5071
+ };
5072
+ worker.object.onmessage = function(event) {
5073
+ var data = event.data;
5074
+ worker.pending -= data.count;
5075
+ worker.requests[data.id][data.action](data.value);
5076
+ delete worker.requests[data.id];
5077
+ };
5078
+ return worker;
5079
+ }
5080
+ function initWorkers(count) {
5081
+ 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 }';
5082
+ var blob = new Blob([
5083
+ source
5084
+ ], {
5085
+ type: "text/javascript"
5086
+ });
5087
+ var url = URL.createObjectURL(blob);
5088
+ for(var i = 0; i < count; ++i){
5089
+ workers[i] = createWorker(url);
5090
+ }
5091
+ URL.revokeObjectURL(url);
5092
+ }
5093
+ function decodeWorker(count, size, source, mode, filter) {
5094
+ var worker = workers[0];
5095
+ for(var i = 1; i < workers.length; ++i){
5096
+ if (workers[i].pending < worker.pending) {
5097
+ worker = workers[i];
5098
+ }
5099
+ }
5100
+ return new Promise(function(resolve, reject) {
5101
+ var data = new Uint8Array(source);
5102
+ var id = requestId++;
5103
+ worker.pending += count;
5104
+ worker.requests[id] = {
5105
+ resolve: resolve,
5106
+ reject: reject
5107
+ };
5108
+ worker.object.postMessage({
5109
+ id: id,
5110
+ count: count,
5111
+ size: size,
5112
+ source: data,
5113
+ mode: mode,
5114
+ filter: filter
5115
+ }, [
5116
+ data.buffer
5117
+ ]);
5118
+ });
5119
+ }
5122
5120
  return ready;
5123
5121
  }
5124
5122
 
5125
- exports.GLTFLoader = /*#__PURE__*/ function(Loader1) {
5126
- _inherits(GLTFLoader, Loader1);
5123
+ exports.GLTFLoader = /*#__PURE__*/ function(Loader) {
5124
+ _inherits(GLTFLoader, Loader);
5127
5125
  function GLTFLoader() {
5128
- return Loader1.apply(this, arguments);
5126
+ return Loader.apply(this, arguments) || this;
5129
5127
  }
5130
5128
  var _proto = GLTFLoader.prototype;
5131
5129
  _proto.initialize = function initialize(_, configuration) {
@@ -5170,12 +5168,11 @@ exports.GLTFLoader = __decorate([
5170
5168
  ])
5171
5169
  ], exports.GLTFLoader);
5172
5170
 
5173
- var PrefabParser = /*#__PURE__*/ function(HierarchyParser1) {
5174
- _inherits(PrefabParser, HierarchyParser1);
5171
+ var PrefabParser = /*#__PURE__*/ function(HierarchyParser) {
5172
+ _inherits(PrefabParser, HierarchyParser);
5175
5173
  function PrefabParser(data, context, prefabResource) {
5176
5174
  var _this;
5177
- _this = HierarchyParser1.call(this, data, context) || this;
5178
- _this.prefabResource = prefabResource;
5175
+ _this = HierarchyParser.call(this, data, context) || this, _this.prefabResource = prefabResource;
5179
5176
  return _this;
5180
5177
  }
5181
5178
  var _proto = PrefabParser.prototype;
@@ -5188,7 +5185,7 @@ var PrefabParser = /*#__PURE__*/ function(HierarchyParser1) {
5188
5185
  };
5189
5186
  PrefabParser.parse = function parse(engine, url, data) {
5190
5187
  var prefabResource = new PrefabResource(engine, url);
5191
- var context = new ParserContext(engine, exports.ParserType.Prefab, prefabResource);
5188
+ var context = new ParserContext(engine, ParserType.Prefab, prefabResource);
5192
5189
  var parser = new PrefabParser(data, context, prefabResource);
5193
5190
  parser.start();
5194
5191
  return parser.promise.then(function() {
@@ -5198,10 +5195,10 @@ var PrefabParser = /*#__PURE__*/ function(HierarchyParser1) {
5198
5195
  return PrefabParser;
5199
5196
  }(HierarchyParser);
5200
5197
 
5201
- var PrefabLoader = /*#__PURE__*/ function(Loader1) {
5202
- _inherits(PrefabLoader, Loader1);
5198
+ var PrefabLoader = /*#__PURE__*/ function(Loader) {
5199
+ _inherits(PrefabLoader, Loader);
5203
5200
  function PrefabLoader() {
5204
- return Loader1.apply(this, arguments);
5201
+ return Loader.apply(this, arguments) || this;
5205
5202
  }
5206
5203
  var _proto = PrefabLoader.prototype;
5207
5204
  _proto.load = function load(item, resourceManager) {
@@ -5223,15 +5220,14 @@ PrefabLoader = __decorate([
5223
5220
  ])
5224
5221
  ], PrefabLoader);
5225
5222
 
5226
- var _HDRLoader;
5227
5223
  var PI = Math.PI;
5228
- var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/HDR_Image_Reader.shtml
5229
- /*#__PURE__*/ function(Loader1) {
5230
- _inherits(HDRLoader1, Loader1);
5231
- function HDRLoader1() {
5232
- return Loader1.apply(this, arguments);
5224
+ // referenece: https://www.flipcode.com/archives/HDR_Image_Reader.shtml
5225
+ var HDRLoader = /*#__PURE__*/ function(Loader) {
5226
+ _inherits(HDRLoader, Loader);
5227
+ function HDRLoader() {
5228
+ return Loader.apply(this, arguments) || this;
5233
5229
  }
5234
- var _proto = HDRLoader1.prototype;
5230
+ var _proto = HDRLoader.prototype;
5235
5231
  _proto.load = function load(item, resourceManager) {
5236
5232
  return new engineCore.AssetPromise(function(resolve, reject) {
5237
5233
  var engine = resourceManager.engine;
@@ -5248,7 +5244,7 @@ var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/H
5248
5244
  };
5249
5245
  /**
5250
5246
  * @internal
5251
- */ HDRLoader1._setTextureByBuffer = function _setTextureByBuffer(engine, buffer, texture) {
5247
+ */ HDRLoader._setTextureByBuffer = function _setTextureByBuffer(engine, buffer, texture) {
5252
5248
  var bufferArray = new Uint8Array(buffer);
5253
5249
  var _HDRLoader__parseHeader = HDRLoader._parseHeader(bufferArray), width = _HDRLoader__parseHeader.width, height = _HDRLoader__parseHeader.height, dataPosition = _HDRLoader__parseHeader.dataPosition;
5254
5250
  var cubeSize = height >> 1;
@@ -5261,7 +5257,7 @@ var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/H
5261
5257
  texture.generateMipmaps();
5262
5258
  return texture;
5263
5259
  };
5264
- HDRLoader1._convertToCubemap = function _convertToCubemap(pixels, inputWidth, inputHeight, size) {
5260
+ HDRLoader._convertToCubemap = function _convertToCubemap(pixels, inputWidth, inputHeight, size) {
5265
5261
  if (!pixels) {
5266
5262
  throw "ConvertPanoramaToCubemap: input cannot be null";
5267
5263
  }
@@ -5283,7 +5279,7 @@ var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/H
5283
5279
  textureBack
5284
5280
  ];
5285
5281
  };
5286
- HDRLoader1._createCubemapData = function _createCubemapData(texSize, faceData, pixels, inputWidth, inputHeight) {
5282
+ HDRLoader._createCubemapData = function _createCubemapData(texSize, faceData, pixels, inputWidth, inputHeight) {
5287
5283
  var textureArray = new Uint8ClampedArray(texSize * texSize * 4);
5288
5284
  var rotDX1 = this._tempVector3.set(0, 0, 0).add(faceData[1]).subtract(faceData[0]).scale(1 / texSize);
5289
5285
  var rotDX2 = this._temp2Vector3.set(0, 0, 0).add(faceData[3]).subtract(faceData[2]).scale(1 / texSize);
@@ -5311,7 +5307,7 @@ var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/H
5311
5307
  }
5312
5308
  return textureArray;
5313
5309
  };
5314
- HDRLoader1._calcProjectionSpherical = function _calcProjectionSpherical(vDir, pixels, inputWidth, inputHeight) {
5310
+ HDRLoader._calcProjectionSpherical = function _calcProjectionSpherical(vDir, pixels, inputWidth, inputHeight) {
5315
5311
  var theta = Math.atan2(vDir.z, vDir.x);
5316
5312
  var phi = Math.acos(vDir.y);
5317
5313
  while(theta < -PI){
@@ -5344,7 +5340,7 @@ var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/H
5344
5340
  var a = pixels[index + 3];
5345
5341
  return new engineMath.Color(r, g, b, a);
5346
5342
  };
5347
- HDRLoader1._readStringLine = function _readStringLine(uint8array, startIndex) {
5343
+ HDRLoader._readStringLine = function _readStringLine(uint8array, startIndex) {
5348
5344
  var line = "";
5349
5345
  var character = "";
5350
5346
  for(var i = startIndex; i < uint8array.length - startIndex; i++){
@@ -5356,7 +5352,7 @@ var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/H
5356
5352
  }
5357
5353
  return line;
5358
5354
  };
5359
- HDRLoader1._parseHeader = function _parseHeader(uint8array) {
5355
+ HDRLoader._parseHeader = function _parseHeader(uint8array) {
5360
5356
  var height = 0;
5361
5357
  var width = 0;
5362
5358
  var line = this._readStringLine(uint8array, 0);
@@ -5398,7 +5394,7 @@ var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/H
5398
5394
  dataPosition: lineIndex
5399
5395
  };
5400
5396
  };
5401
- HDRLoader1._readPixels = function _readPixels(buffer, width, height) {
5397
+ HDRLoader._readPixels = function _readPixels(buffer, width, height) {
5402
5398
  var scanLineWidth = width;
5403
5399
  var byteLength = buffer.byteLength;
5404
5400
  var dataRGBA = new Uint8Array(4 * width * height);
@@ -5460,14 +5456,14 @@ var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/H
5460
5456
  }
5461
5457
  return dataRGBA;
5462
5458
  };
5463
- HDRLoader1._RGBEToLinear = function _RGBEToLinear(color) {
5459
+ HDRLoader._RGBEToLinear = function _RGBEToLinear(color) {
5464
5460
  var scaleFactor = Math.pow(2, color.a - 128) / 255;
5465
5461
  color.r *= scaleFactor;
5466
5462
  color.g *= scaleFactor;
5467
5463
  color.b *= scaleFactor;
5468
5464
  color.a = 1;
5469
5465
  };
5470
- HDRLoader1._linearToRGBM = function _linearToRGBM(color, maxRange) {
5466
+ HDRLoader._linearToRGBM = function _linearToRGBM(color, maxRange) {
5471
5467
  var maxRGB = Math.max(color.r, Math.max(color.g, color.b));
5472
5468
  var M = Math.min(maxRGB / maxRange, 1);
5473
5469
  M = Math.ceil(M * 255);
@@ -5477,76 +5473,57 @@ var HDRLoader = (_HDRLoader = // referenece: https://www.flipcode.com/archives/H
5477
5473
  color.b *= scaleFactor;
5478
5474
  color.a *= M;
5479
5475
  };
5480
- return HDRLoader1;
5481
- }(engineCore.Loader), function() {
5482
- _HDRLoader._rightBottomBack = new engineMath.Vector3(1.0, -1.0, -1.0);
5483
- }(), function() {
5484
- _HDRLoader._rightBottomFront = new engineMath.Vector3(1.0, -1.0, 1.0);
5485
- }(), function() {
5486
- _HDRLoader._rightUpBack = new engineMath.Vector3(1.0, 1.0, -1.0);
5487
- }(), function() {
5488
- _HDRLoader._rightUpFront = new engineMath.Vector3(1.0, 1.0, 1.0);
5489
- }(), function() {
5490
- _HDRLoader._leftBottomBack = new engineMath.Vector3(-1.0, -1.0, -1.0);
5491
- }(), function() {
5492
- _HDRLoader._leftBottomFront = new engineMath.Vector3(-1.0, -1.0, 1.0);
5493
- }(), function() {
5494
- _HDRLoader._leftUpBack = new engineMath.Vector3(-1.0, 1.0, -1.0);
5495
- }(), function() {
5496
- _HDRLoader._leftUpFront = new engineMath.Vector3(-1.0, 1.0, 1.0);
5497
- }(), function() {
5498
- _HDRLoader._faceRight = [
5499
- _HDRLoader._rightBottomBack,
5500
- _HDRLoader._rightBottomFront,
5501
- _HDRLoader._rightUpBack,
5502
- _HDRLoader._rightUpFront
5503
- ];
5504
- }(), function() {
5505
- _HDRLoader._faceLeft = [
5506
- _HDRLoader._leftBottomFront,
5507
- _HDRLoader._leftBottomBack,
5508
- _HDRLoader._leftUpFront,
5509
- _HDRLoader._leftUpBack
5510
- ];
5511
- }(), function() {
5512
- _HDRLoader._faceUp = [
5513
- _HDRLoader._leftBottomFront,
5514
- _HDRLoader._rightBottomFront,
5515
- _HDRLoader._leftBottomBack,
5516
- _HDRLoader._rightBottomBack
5517
- ];
5518
- }(), function() {
5519
- _HDRLoader._faceBottom = [
5520
- _HDRLoader._leftUpBack,
5521
- _HDRLoader._rightUpBack,
5522
- _HDRLoader._leftUpFront,
5523
- _HDRLoader._rightUpFront
5524
- ];
5525
- }(), function() {
5526
- _HDRLoader._faceFront = [
5527
- _HDRLoader._leftBottomBack,
5528
- _HDRLoader._rightBottomBack,
5529
- _HDRLoader._leftUpBack,
5530
- _HDRLoader._rightUpBack
5531
- ];
5532
- }(), function() {
5533
- _HDRLoader._faceBack = [
5534
- _HDRLoader._rightBottomFront,
5535
- _HDRLoader._leftBottomFront,
5536
- _HDRLoader._rightUpFront,
5537
- _HDRLoader._leftUpFront
5538
- ];
5539
- }(), function() {
5540
- _HDRLoader._tempVector3 = new engineMath.Vector3();
5541
- }(), function() {
5542
- _HDRLoader._temp2Vector3 = new engineMath.Vector3();
5543
- }(), function() {
5544
- _HDRLoader._temp3Vector3 = new engineMath.Vector3();
5545
- }(), function() {
5546
- _HDRLoader._temp4Vector3 = new engineMath.Vector3();
5547
- }(), function() {
5548
- _HDRLoader._temp5Vector3 = new engineMath.Vector3();
5549
- }(), _HDRLoader);
5476
+ return HDRLoader;
5477
+ }(engineCore.Loader);
5478
+ HDRLoader._rightBottomBack = new engineMath.Vector3(1.0, -1.0, -1.0);
5479
+ HDRLoader._rightBottomFront = new engineMath.Vector3(1.0, -1.0, 1.0);
5480
+ HDRLoader._rightUpBack = new engineMath.Vector3(1.0, 1.0, -1.0);
5481
+ HDRLoader._rightUpFront = new engineMath.Vector3(1.0, 1.0, 1.0);
5482
+ HDRLoader._leftBottomBack = new engineMath.Vector3(-1.0, -1.0, -1.0);
5483
+ HDRLoader._leftBottomFront = new engineMath.Vector3(-1.0, -1.0, 1.0);
5484
+ HDRLoader._leftUpBack = new engineMath.Vector3(-1.0, 1.0, -1.0);
5485
+ HDRLoader._leftUpFront = new engineMath.Vector3(-1.0, 1.0, 1.0);
5486
+ HDRLoader._faceRight = [
5487
+ HDRLoader._rightBottomBack,
5488
+ HDRLoader._rightBottomFront,
5489
+ HDRLoader._rightUpBack,
5490
+ HDRLoader._rightUpFront
5491
+ ];
5492
+ HDRLoader._faceLeft = [
5493
+ HDRLoader._leftBottomFront,
5494
+ HDRLoader._leftBottomBack,
5495
+ HDRLoader._leftUpFront,
5496
+ HDRLoader._leftUpBack
5497
+ ];
5498
+ HDRLoader._faceUp = [
5499
+ HDRLoader._leftBottomFront,
5500
+ HDRLoader._rightBottomFront,
5501
+ HDRLoader._leftBottomBack,
5502
+ HDRLoader._rightBottomBack
5503
+ ];
5504
+ HDRLoader._faceBottom = [
5505
+ HDRLoader._leftUpBack,
5506
+ HDRLoader._rightUpBack,
5507
+ HDRLoader._leftUpFront,
5508
+ HDRLoader._rightUpFront
5509
+ ];
5510
+ HDRLoader._faceFront = [
5511
+ HDRLoader._leftBottomBack,
5512
+ HDRLoader._rightBottomBack,
5513
+ HDRLoader._leftUpBack,
5514
+ HDRLoader._rightUpBack
5515
+ ];
5516
+ HDRLoader._faceBack = [
5517
+ HDRLoader._rightBottomFront,
5518
+ HDRLoader._leftBottomFront,
5519
+ HDRLoader._rightUpFront,
5520
+ HDRLoader._leftUpFront
5521
+ ];
5522
+ HDRLoader._tempVector3 = new engineMath.Vector3();
5523
+ HDRLoader._temp2Vector3 = new engineMath.Vector3();
5524
+ HDRLoader._temp3Vector3 = new engineMath.Vector3();
5525
+ HDRLoader._temp4Vector3 = new engineMath.Vector3();
5526
+ HDRLoader._temp5Vector3 = new engineMath.Vector3();
5550
5527
  HDRLoader = __decorate([
5551
5528
  engineCore.resourceLoader(engineCore.AssetType.HDR, [
5552
5529
  "hdr"
@@ -5554,13 +5531,11 @@ HDRLoader = __decorate([
5554
5531
  ], HDRLoader);
5555
5532
  /**
5556
5533
  * @internal
5557
- */ var HDRContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
5558
- _inherits(HDRContentRestorer, ContentRestorer1);
5534
+ */ var HDRContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
5535
+ _inherits(HDRContentRestorer, ContentRestorer);
5559
5536
  function HDRContentRestorer(resource, url, requestConfig) {
5560
5537
  var _this;
5561
- _this = ContentRestorer1.call(this, resource) || this;
5562
- _this.url = url;
5563
- _this.requestConfig = requestConfig;
5538
+ _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
5564
5539
  return _this;
5565
5540
  }
5566
5541
  var _proto = HDRContentRestorer.prototype;
@@ -5576,10 +5551,10 @@ HDRLoader = __decorate([
5576
5551
  return HDRContentRestorer;
5577
5552
  }(engineCore.ContentRestorer);
5578
5553
 
5579
- var JSONLoader = /*#__PURE__*/ function(Loader1) {
5580
- _inherits(JSONLoader, Loader1);
5554
+ var JSONLoader = /*#__PURE__*/ function(Loader) {
5555
+ _inherits(JSONLoader, Loader);
5581
5556
  function JSONLoader() {
5582
- return Loader1.apply(this, arguments);
5557
+ return Loader.apply(this, arguments) || this;
5583
5558
  }
5584
5559
  var _proto = JSONLoader.prototype;
5585
5560
  _proto.load = function load(item, resourceManager) {
@@ -5781,10 +5756,10 @@ function parseCubeKTX(dataArray) {
5781
5756
  };
5782
5757
  }
5783
5758
 
5784
- var KTXCubeLoader = /*#__PURE__*/ function(Loader1) {
5785
- _inherits(KTXCubeLoader, Loader1);
5759
+ var KTXCubeLoader = /*#__PURE__*/ function(Loader) {
5760
+ _inherits(KTXCubeLoader, Loader);
5786
5761
  function KTXCubeLoader() {
5787
- return Loader1.apply(this, arguments);
5762
+ return Loader.apply(this, arguments) || this;
5788
5763
  }
5789
5764
  var _proto = KTXCubeLoader.prototype;
5790
5765
  _proto.load = function load(item, resourceManager) {
@@ -5818,10 +5793,10 @@ KTXCubeLoader = __decorate([
5818
5793
  engineCore.resourceLoader(engineCore.AssetType.KTXCube, [])
5819
5794
  ], KTXCubeLoader);
5820
5795
 
5821
- var KTXLoader = /*#__PURE__*/ function(Loader1) {
5822
- _inherits(KTXLoader, Loader1);
5796
+ var KTXLoader = /*#__PURE__*/ function(Loader) {
5797
+ _inherits(KTXLoader, Loader);
5823
5798
  function KTXLoader() {
5824
- return Loader1.apply(this, arguments);
5799
+ return Loader.apply(this, arguments) || this;
5825
5800
  }
5826
5801
  var _proto = KTXLoader.prototype;
5827
5802
  _proto.load = function load(item, resourceManager) {
@@ -5853,7 +5828,7 @@ KTXLoader = __decorate([
5853
5828
  ], KTXLoader);
5854
5829
 
5855
5830
  function parseProperty(object, key, value) {
5856
- if (typeof value === "object") {
5831
+ if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object") {
5857
5832
  for(var subKey in value){
5858
5833
  parseProperty(object[key], subKey, value[subKey]);
5859
5834
  }
@@ -5861,10 +5836,10 @@ function parseProperty(object, key, value) {
5861
5836
  object[key] = value;
5862
5837
  }
5863
5838
  }
5864
- var MaterialLoader = /*#__PURE__*/ function(Loader1) {
5865
- _inherits(MaterialLoader, Loader1);
5839
+ var MaterialLoader = /*#__PURE__*/ function(Loader) {
5840
+ _inherits(MaterialLoader, Loader);
5866
5841
  function MaterialLoader() {
5867
- return Loader1.apply(this, arguments);
5842
+ return Loader.apply(this, arguments) || this;
5868
5843
  }
5869
5844
  var _proto = MaterialLoader.prototype;
5870
5845
  _proto.load = function load(item, resourceManager) {
@@ -5892,31 +5867,31 @@ var MaterialLoader = /*#__PURE__*/ function(Loader1) {
5892
5867
  var _loop = function(key) {
5893
5868
  var _shaderData_key = shaderData[key], type = _shaderData_key.type, value = _shaderData_key.value;
5894
5869
  switch(type){
5895
- case exports.MaterialLoaderType.Vector2:
5870
+ case MaterialLoaderType.Vector2:
5896
5871
  materialShaderData.setVector2(key, new engineMath.Vector2(value.x, value.y));
5897
5872
  break;
5898
- case exports.MaterialLoaderType.Vector3:
5873
+ case MaterialLoaderType.Vector3:
5899
5874
  materialShaderData.setVector3(key, new engineMath.Vector3(value.x, value.y, value.z));
5900
5875
  break;
5901
- case exports.MaterialLoaderType.Vector4:
5876
+ case MaterialLoaderType.Vector4:
5902
5877
  materialShaderData.setVector4(key, new engineMath.Vector4(value.x, value.y, value.z, value.w));
5903
5878
  break;
5904
- case exports.MaterialLoaderType.Color:
5879
+ case MaterialLoaderType.Color:
5905
5880
  materialShaderData.setColor(key, new engineMath.Color(value.r, value.g, value.b, value.a));
5906
5881
  break;
5907
- case exports.MaterialLoaderType.Float:
5882
+ case MaterialLoaderType.Float:
5908
5883
  materialShaderData.setFloat(key, value);
5909
5884
  break;
5910
- case exports.MaterialLoaderType.Texture:
5885
+ case MaterialLoaderType.Texture:
5911
5886
  texturePromises.push(// @ts-ignore
5912
5887
  engine.resourceManager.getResourceByRef(value).then(function(texture) {
5913
5888
  materialShaderData.setTexture(key, texture);
5914
5889
  }));
5915
5890
  break;
5916
- case exports.MaterialLoaderType.Boolean:
5891
+ case MaterialLoaderType.Boolean:
5917
5892
  materialShaderData.setInt(key, value ? 1 : 0);
5918
5893
  break;
5919
- case exports.MaterialLoaderType.Integer:
5894
+ case MaterialLoaderType.Integer:
5920
5895
  materialShaderData.setInt(key, Number(value));
5921
5896
  break;
5922
5897
  }
@@ -5948,10 +5923,10 @@ MaterialLoader = __decorate([
5948
5923
  ])
5949
5924
  ], MaterialLoader);
5950
5925
 
5951
- var MeshLoader = /*#__PURE__*/ function(Loader1) {
5952
- _inherits(MeshLoader, Loader1);
5926
+ var MeshLoader = /*#__PURE__*/ function(Loader) {
5927
+ _inherits(MeshLoader, Loader);
5953
5928
  function MeshLoader() {
5954
- return Loader1.apply(this, arguments);
5929
+ return Loader.apply(this, arguments) || this;
5955
5930
  }
5956
5931
  var _proto = MeshLoader.prototype;
5957
5932
  _proto.load = function load(item, resourceManager) {
@@ -5974,10 +5949,10 @@ MeshLoader = __decorate([
5974
5949
  ])
5975
5950
  ], MeshLoader);
5976
5951
 
5977
- var PrimitiveMeshLoader = /*#__PURE__*/ function(Loader1) {
5978
- _inherits(PrimitiveMeshLoader, Loader1);
5952
+ var PrimitiveMeshLoader = /*#__PURE__*/ function(Loader) {
5953
+ _inherits(PrimitiveMeshLoader, Loader);
5979
5954
  function PrimitiveMeshLoader() {
5980
- return Loader1.apply(this, arguments);
5955
+ return Loader.apply(this, arguments) || this;
5981
5956
  }
5982
5957
  var _proto = PrimitiveMeshLoader.prototype;
5983
5958
  _proto.load = function load(item, resourceManager) {
@@ -6011,21 +5986,11 @@ PrimitiveMeshLoader = __decorate([
6011
5986
  "mesh"
6012
5987
  ], false)
6013
5988
  ], PrimitiveMeshLoader);
6014
- var /** @internal */ PrimitiveMeshType;
6015
- (function(PrimitiveMeshType) {
6016
- PrimitiveMeshType["Sphere"] = "sphere";
6017
- PrimitiveMeshType["Cuboid"] = "cuboid";
6018
- PrimitiveMeshType["Plane"] = "plane";
6019
- PrimitiveMeshType["Cylinder"] = "cylinder";
6020
- PrimitiveMeshType["Torus"] = "torus";
6021
- PrimitiveMeshType["Cone"] = "cone";
6022
- PrimitiveMeshType["Capsule"] = "capsule";
6023
- })(PrimitiveMeshType || (PrimitiveMeshType = {}));
6024
-
6025
- var ProjectLoader = /*#__PURE__*/ function(Loader1) {
6026
- _inherits(ProjectLoader, Loader1);
5989
+
5990
+ var ProjectLoader = /*#__PURE__*/ function(Loader) {
5991
+ _inherits(ProjectLoader, Loader);
6027
5992
  function ProjectLoader() {
6028
- return Loader1.apply(this, arguments);
5993
+ return Loader.apply(this, arguments) || this;
6029
5994
  }
6030
5995
  var _proto = ProjectLoader.prototype;
6031
5996
  _proto.load = function load(item, resourceManager) {
@@ -6055,10 +6020,10 @@ ProjectLoader = __decorate([
6055
6020
  ], false)
6056
6021
  ], ProjectLoader);
6057
6022
 
6058
- var SourceFontLoader = /*#__PURE__*/ function(Loader1) {
6059
- _inherits(SourceFontLoader, Loader1);
6023
+ var SourceFontLoader = /*#__PURE__*/ function(Loader) {
6024
+ _inherits(SourceFontLoader, Loader);
6060
6025
  function SourceFontLoader() {
6061
- return Loader1.apply(this, arguments);
6026
+ return Loader.apply(this, arguments) || this;
6062
6027
  }
6063
6028
  var _proto = SourceFontLoader.prototype;
6064
6029
  _proto.load = function load(item, resourceManager) {
@@ -6105,14 +6070,11 @@ SourceFontLoader = __decorate([
6105
6070
  ], false)
6106
6071
  ], SourceFontLoader);
6107
6072
 
6108
- var SpriteAtlasLoader = /*#__PURE__*/ function(Loader1) {
6109
- _inherits(SpriteAtlasLoader, Loader1);
6073
+ var SpriteAtlasLoader = /*#__PURE__*/ function(Loader) {
6074
+ _inherits(SpriteAtlasLoader, Loader);
6110
6075
  function SpriteAtlasLoader() {
6111
6076
  var _this;
6112
- _this = Loader1.apply(this, arguments) || this;
6113
- _this._tempRect = new engineMath.Rect();
6114
- _this._tempVec2 = new engineMath.Vector2();
6115
- _this._tempVec4 = new engineMath.Vector4();
6077
+ _this = Loader.apply(this, arguments) || this, _this._tempRect = new engineMath.Rect(), _this._tempVec2 = new engineMath.Vector2(), _this._tempVec4 = new engineMath.Vector4();
6116
6078
  return _this;
6117
6079
  }
6118
6080
  var _proto = SpriteAtlasLoader.prototype;
@@ -6201,10 +6163,10 @@ SpriteAtlasLoader = __decorate([
6201
6163
  ], false)
6202
6164
  ], SpriteAtlasLoader);
6203
6165
 
6204
- var SpriteLoader = /*#__PURE__*/ function(Loader1) {
6205
- _inherits(SpriteLoader, Loader1);
6166
+ var SpriteLoader = /*#__PURE__*/ function(Loader) {
6167
+ _inherits(SpriteLoader, Loader);
6206
6168
  function SpriteLoader() {
6207
- return Loader1.apply(this, arguments);
6169
+ return Loader.apply(this, arguments) || this;
6208
6170
  }
6209
6171
  var _proto = SpriteLoader.prototype;
6210
6172
  _proto.load = function load(item, resourceManager) {
@@ -6253,13 +6215,11 @@ SpriteLoader = __decorate([
6253
6215
 
6254
6216
  /**
6255
6217
  * @internal
6256
- */ var Texture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
6257
- _inherits(Texture2DContentRestorer, ContentRestorer1);
6218
+ */ var Texture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
6219
+ _inherits(Texture2DContentRestorer, ContentRestorer);
6258
6220
  function Texture2DContentRestorer(resource, url, requestConfig) {
6259
6221
  var _this;
6260
- _this = ContentRestorer1.call(this, resource) || this;
6261
- _this.url = url;
6262
- _this.requestConfig = requestConfig;
6222
+ _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
6263
6223
  return _this;
6264
6224
  }
6265
6225
  var _proto = Texture2DContentRestorer.prototype;
@@ -6275,10 +6235,10 @@ SpriteLoader = __decorate([
6275
6235
  return Texture2DContentRestorer;
6276
6236
  }(engineCore.ContentRestorer);
6277
6237
 
6278
- var Texture2DLoader = /*#__PURE__*/ function(Loader1) {
6279
- _inherits(Texture2DLoader, Loader1);
6238
+ var Texture2DLoader = /*#__PURE__*/ function(Loader) {
6239
+ _inherits(Texture2DLoader, Loader);
6280
6240
  function Texture2DLoader() {
6281
- return Loader1.apply(this, arguments);
6241
+ return Loader.apply(this, arguments) || this;
6282
6242
  }
6283
6243
  var _proto = Texture2DLoader.prototype;
6284
6244
  _proto.load = function load(item, resourceManager) {
@@ -6322,13 +6282,11 @@ Texture2DLoader = __decorate([
6322
6282
 
6323
6283
  /**
6324
6284
  * @internal
6325
- */ var TextureCubeContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
6326
- _inherits(TextureCubeContentRestorer, ContentRestorer1);
6285
+ */ var TextureCubeContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
6286
+ _inherits(TextureCubeContentRestorer, ContentRestorer);
6327
6287
  function TextureCubeContentRestorer(resource, urls, requestConfig) {
6328
6288
  var _this;
6329
- _this = ContentRestorer1.call(this, resource) || this;
6330
- _this.urls = urls;
6331
- _this.requestConfig = requestConfig;
6289
+ _this = ContentRestorer.call(this, resource) || this, _this.urls = urls, _this.requestConfig = requestConfig;
6332
6290
  return _this;
6333
6291
  }
6334
6292
  var _proto = TextureCubeContentRestorer.prototype;
@@ -6352,10 +6310,10 @@ Texture2DLoader = __decorate([
6352
6310
  return TextureCubeContentRestorer;
6353
6311
  }(engineCore.ContentRestorer);
6354
6312
 
6355
- var TextureCubeLoader = /*#__PURE__*/ function(Loader1) {
6356
- _inherits(TextureCubeLoader, Loader1);
6313
+ var TextureCubeLoader = /*#__PURE__*/ function(Loader) {
6314
+ _inherits(TextureCubeLoader, Loader);
6357
6315
  function TextureCubeLoader() {
6358
- return Loader1.apply(this, arguments);
6316
+ return Loader.apply(this, arguments) || this;
6359
6317
  }
6360
6318
  var _proto = TextureCubeLoader.prototype;
6361
6319
  _proto.load = function load(item, resourceManager) {
@@ -6393,13 +6351,51 @@ TextureCubeLoader = __decorate([
6393
6351
  ])
6394
6352
  ], TextureCubeLoader);
6395
6353
 
6396
- var _ShaderChunkLoader;
6397
- var ShaderChunkLoader = (_ShaderChunkLoader = /*#__PURE__*/ function(Loader1) {
6398
- _inherits(ShaderChunkLoader1, Loader1);
6399
- function ShaderChunkLoader1() {
6400
- return Loader1.apply(this, arguments);
6354
+ var AudioLoader = /*#__PURE__*/ function(Loader) {
6355
+ _inherits(AudioLoader, Loader);
6356
+ function AudioLoader() {
6357
+ return Loader.apply(this, arguments) || this;
6358
+ }
6359
+ var _proto = AudioLoader.prototype;
6360
+ _proto.load = function load(item, resourceManager) {
6361
+ return new engineCore.AssetPromise(function(resolve, reject) {
6362
+ var url = item.url;
6363
+ var requestConfig = _extends({}, item, {
6364
+ type: "arraybuffer"
6365
+ });
6366
+ // @ts-ignore
6367
+ resourceManager._request(url, requestConfig).then(function(arrayBuffer) {
6368
+ var audioClip = new engineCore.AudioClip(resourceManager.engine);
6369
+ engineCore.AudioManager.getContext().decodeAudioData(arrayBuffer).then(function(result) {
6370
+ // @ts-ignore
6371
+ audioClip._setAudioSource(result);
6372
+ if (url.indexOf("data:") !== 0) {
6373
+ var index = url.lastIndexOf("/");
6374
+ audioClip.name = url.substring(index + 1);
6375
+ }
6376
+ resolve(audioClip);
6377
+ }).catch(function(e) {
6378
+ reject(e);
6379
+ });
6380
+ });
6381
+ });
6382
+ };
6383
+ return AudioLoader;
6384
+ }(engineCore.Loader);
6385
+ AudioLoader = __decorate([
6386
+ engineCore.resourceLoader(engineCore.AssetType.Audio, [
6387
+ "mp3",
6388
+ "ogg",
6389
+ "wav"
6390
+ ])
6391
+ ], AudioLoader);
6392
+
6393
+ var ShaderChunkLoader = /*#__PURE__*/ function(Loader) {
6394
+ _inherits(ShaderChunkLoader, Loader);
6395
+ function ShaderChunkLoader() {
6396
+ return Loader.apply(this, arguments) || this;
6401
6397
  }
6402
- var _proto = ShaderChunkLoader1.prototype;
6398
+ var _proto = ShaderChunkLoader.prototype;
6403
6399
  _proto.load = function load(item, resourceManager) {
6404
6400
  var url = item.url;
6405
6401
  // @ts-ignore
@@ -6412,7 +6408,7 @@ var ShaderChunkLoader = (_ShaderChunkLoader = /*#__PURE__*/ function(Loader1) {
6412
6408
  };
6413
6409
  /**
6414
6410
  * @internal
6415
- */ ShaderChunkLoader1._loadChunksInCode = function _loadChunksInCode(code, basePath, resourceManager) {
6411
+ */ ShaderChunkLoader._loadChunksInCode = function _loadChunksInCode(code, basePath, resourceManager) {
6416
6412
  var shaderChunkPaths = new Array();
6417
6413
  var matches = code.matchAll(ShaderChunkLoader._shaderIncludeRegex);
6418
6414
  for(var _iterator = _create_for_of_iterator_helper_loose(matches), _step; !(_step = _iterator()).done;){
@@ -6429,23 +6425,21 @@ var ShaderChunkLoader = (_ShaderChunkLoader = /*#__PURE__*/ function(Loader1) {
6429
6425
  });
6430
6426
  }));
6431
6427
  };
6432
- return ShaderChunkLoader1;
6433
- }(engineCore.Loader), function() {
6434
- _ShaderChunkLoader._shaderIncludeRegex = /\s#include\s+"([./][^\\"]+)"/gm;
6435
- }(), _ShaderChunkLoader);
6428
+ return ShaderChunkLoader;
6429
+ }(engineCore.Loader);
6430
+ ShaderChunkLoader._shaderIncludeRegex = /#include\s+"([./][^\\"]+)"/gm;
6436
6431
  ShaderChunkLoader = __decorate([
6437
6432
  engineCore.resourceLoader("ShaderChunk", [
6438
6433
  "glsl"
6439
6434
  ])
6440
6435
  ], ShaderChunkLoader);
6441
6436
 
6442
- var _ShaderLoader;
6443
- var ShaderLoader = (_ShaderLoader = /*#__PURE__*/ function(Loader1) {
6444
- _inherits(ShaderLoader1, Loader1);
6445
- function ShaderLoader1() {
6446
- return Loader1.apply(this, arguments);
6437
+ var ShaderLoader = /*#__PURE__*/ function(Loader) {
6438
+ _inherits(ShaderLoader, Loader);
6439
+ function ShaderLoader() {
6440
+ return Loader.apply(this, arguments) || this;
6447
6441
  }
6448
- var _proto = ShaderLoader1.prototype;
6442
+ var _proto = ShaderLoader.prototype;
6449
6443
  _proto.load = function load(item, resourceManager) {
6450
6444
  var _this = this;
6451
6445
  var url = item.url;
@@ -6469,10 +6463,9 @@ var ShaderLoader = (_ShaderLoader = /*#__PURE__*/ function(Loader1) {
6469
6463
  var match = code.match(ShaderLoader._builtinRegex);
6470
6464
  if (match && match[1]) return match[1];
6471
6465
  };
6472
- return ShaderLoader1;
6473
- }(engineCore.Loader), function() {
6474
- _ShaderLoader._builtinRegex = /^\s*\/\/\s*@builtin\s+(\w+)/;
6475
- }(), _ShaderLoader);
6466
+ return ShaderLoader;
6467
+ }(engineCore.Loader);
6468
+ ShaderLoader._builtinRegex = /^\s*\/\/\s*@builtin\s+(\w+)/;
6476
6469
  ShaderLoader = __decorate([
6477
6470
  engineCore.resourceLoader(engineCore.AssetType.Shader, [
6478
6471
  "gs",
@@ -6480,10 +6473,10 @@ ShaderLoader = __decorate([
6480
6473
  ])
6481
6474
  ], ShaderLoader);
6482
6475
 
6483
- var SceneLoader = /*#__PURE__*/ function(Loader1) {
6484
- _inherits(SceneLoader, Loader1);
6476
+ var SceneLoader = /*#__PURE__*/ function(Loader) {
6477
+ _inherits(SceneLoader, Loader);
6485
6478
  function SceneLoader() {
6486
- return Loader1.apply(this, arguments);
6479
+ return Loader.apply(this, arguments) || this;
6487
6480
  }
6488
6481
  var _proto = SceneLoader.prototype;
6489
6482
  _proto.load = function load(item, resourceManager) {
@@ -6498,7 +6491,7 @@ var SceneLoader = /*#__PURE__*/ function(Loader1) {
6498
6491
  // parse ambient light
6499
6492
  var ambient = data.scene.ambient;
6500
6493
  if (ambient) {
6501
- var useCustomAmbient = ambient.specularMode === exports.SpecularMode.Custom;
6494
+ var useCustomAmbient = ambient.specularMode === SpecularMode.Custom;
6502
6495
  var useSH = ambient.diffuseMode === engineCore.DiffuseMode.SphericalHarmonics;
6503
6496
  scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
6504
6497
  scene.ambientLight.specularIntensity = ambient.specularIntensity;
@@ -6508,20 +6501,17 @@ var SceneLoader = /*#__PURE__*/ function(Loader1) {
6508
6501
  if (useCustomAmbient && ambient.customAmbientLight) {
6509
6502
  promises.push(// @ts-ignore
6510
6503
  resourceManager.getResourceByRef(ambient.customAmbientLight).then(function(ambientLight) {
6511
- var _ambientLight;
6512
- scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
6504
+ scene.ambientLight.specularTexture = ambientLight == null ? void 0 : ambientLight.specularTexture;
6513
6505
  }));
6514
6506
  }
6515
6507
  if (ambient.ambientLight && (!useCustomAmbient || useSH)) {
6516
6508
  promises.push(// @ts-ignore
6517
6509
  resourceManager.getResourceByRef(ambient.ambientLight).then(function(ambientLight) {
6518
6510
  if (!useCustomAmbient) {
6519
- var _ambientLight;
6520
- scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
6511
+ scene.ambientLight.specularTexture = ambientLight == null ? void 0 : ambientLight.specularTexture;
6521
6512
  }
6522
6513
  if (useSH) {
6523
- var _ambientLight1;
6524
- scene.ambientLight.diffuseSphericalHarmonics = (_ambientLight1 = ambientLight) == null ? void 0 : _ambientLight1.diffuseSphericalHarmonics;
6514
+ scene.ambientLight.diffuseSphericalHarmonics = ambientLight == null ? void 0 : ambientLight.diffuseSphericalHarmonics;
6525
6515
  }
6526
6516
  }));
6527
6517
  }
@@ -6642,10 +6632,10 @@ ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _asy
6642
6632
  });
6643
6633
  }));
6644
6634
 
6645
- var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser1) {
6646
- _inherits(KHR_lights_punctual, GLTFExtensionParser1);
6635
+ var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser) {
6636
+ _inherits(KHR_lights_punctual, GLTFExtensionParser);
6647
6637
  function KHR_lights_punctual() {
6648
- return GLTFExtensionParser1.apply(this, arguments);
6638
+ return GLTFExtensionParser.apply(this, arguments) || this;
6649
6639
  }
6650
6640
  var _proto = KHR_lights_punctual.prototype;
6651
6641
  _proto.additiveParse = function additiveParse(context, entity, extensionSchema) {
@@ -6680,13 +6670,13 @@ var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser1) {
6680
6670
  return KHR_lights_punctual;
6681
6671
  }(GLTFExtensionParser);
6682
6672
  KHR_lights_punctual = __decorate([
6683
- registerGLTFExtension("KHR_lights_punctual", exports.GLTFExtensionMode.AdditiveParse)
6673
+ registerGLTFExtension("KHR_lights_punctual", GLTFExtensionMode.AdditiveParse)
6684
6674
  ], KHR_lights_punctual);
6685
6675
 
6686
- var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser1) {
6687
- _inherits(KHR_materials_clearcoat, GLTFExtensionParser1);
6676
+ var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser) {
6677
+ _inherits(KHR_materials_clearcoat, GLTFExtensionParser);
6688
6678
  function KHR_materials_clearcoat() {
6689
- return GLTFExtensionParser1.apply(this, arguments);
6679
+ return GLTFExtensionParser.apply(this, arguments) || this;
6690
6680
  }
6691
6681
  var _proto = KHR_materials_clearcoat.prototype;
6692
6682
  _proto.additiveParse = function additiveParse(context, material, schema) {
@@ -6695,19 +6685,19 @@ var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser1) {
6695
6685
  material.clearCoatRoughness = clearcoatRoughnessFactor;
6696
6686
  if (clearcoatTexture) {
6697
6687
  exports.GLTFMaterialParser._checkOtherTextureTransform(clearcoatTexture, "Clear coat");
6698
- context.get(exports.GLTFParserType.Texture, clearcoatTexture.index).then(function(texture) {
6688
+ context.get(GLTFParserType.Texture, clearcoatTexture.index).then(function(texture) {
6699
6689
  material.clearCoatTexture = texture;
6700
6690
  });
6701
6691
  }
6702
6692
  if (clearcoatRoughnessTexture) {
6703
6693
  exports.GLTFMaterialParser._checkOtherTextureTransform(clearcoatRoughnessTexture, "Clear coat roughness");
6704
- context.get(exports.GLTFParserType.Texture, clearcoatRoughnessTexture.index).then(function(texture) {
6694
+ context.get(GLTFParserType.Texture, clearcoatRoughnessTexture.index).then(function(texture) {
6705
6695
  material.clearCoatRoughnessTexture = texture;
6706
6696
  });
6707
6697
  }
6708
6698
  if (clearcoatNormalTexture) {
6709
6699
  exports.GLTFMaterialParser._checkOtherTextureTransform(clearcoatNormalTexture, "Clear coat normal");
6710
- context.get(exports.GLTFParserType.Texture, clearcoatNormalTexture.index).then(function(texture) {
6700
+ context.get(GLTFParserType.Texture, clearcoatNormalTexture.index).then(function(texture) {
6711
6701
  material.clearCoatNormalTexture = texture;
6712
6702
  });
6713
6703
  }
@@ -6715,13 +6705,13 @@ var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser1) {
6715
6705
  return KHR_materials_clearcoat;
6716
6706
  }(GLTFExtensionParser);
6717
6707
  KHR_materials_clearcoat = __decorate([
6718
- registerGLTFExtension("KHR_materials_clearcoat", exports.GLTFExtensionMode.AdditiveParse)
6708
+ registerGLTFExtension("KHR_materials_clearcoat", GLTFExtensionMode.AdditiveParse)
6719
6709
  ], KHR_materials_clearcoat);
6720
6710
 
6721
- var KHR_materials_ior = /*#__PURE__*/ function(GLTFExtensionParser1) {
6722
- _inherits(KHR_materials_ior, GLTFExtensionParser1);
6711
+ var KHR_materials_ior = /*#__PURE__*/ function(GLTFExtensionParser) {
6712
+ _inherits(KHR_materials_ior, GLTFExtensionParser);
6723
6713
  function KHR_materials_ior() {
6724
- return GLTFExtensionParser1.apply(this, arguments);
6714
+ return GLTFExtensionParser.apply(this, arguments) || this;
6725
6715
  }
6726
6716
  var _proto = KHR_materials_ior.prototype;
6727
6717
  _proto.additiveParse = function additiveParse(context, material, schema) {
@@ -6731,13 +6721,13 @@ var KHR_materials_ior = /*#__PURE__*/ function(GLTFExtensionParser1) {
6731
6721
  return KHR_materials_ior;
6732
6722
  }(GLTFExtensionParser);
6733
6723
  KHR_materials_ior = __decorate([
6734
- registerGLTFExtension("KHR_materials_ior", exports.GLTFExtensionMode.AdditiveParse)
6724
+ registerGLTFExtension("KHR_materials_ior", GLTFExtensionMode.AdditiveParse)
6735
6725
  ], KHR_materials_ior);
6736
6726
 
6737
- var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionParser1) {
6738
- _inherits(KHR_materials_pbrSpecularGlossiness, GLTFExtensionParser1);
6727
+ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionParser) {
6728
+ _inherits(KHR_materials_pbrSpecularGlossiness, GLTFExtensionParser);
6739
6729
  function KHR_materials_pbrSpecularGlossiness() {
6740
- return GLTFExtensionParser1.apply(this, arguments);
6730
+ return GLTFExtensionParser.apply(this, arguments) || this;
6741
6731
  }
6742
6732
  var _proto = KHR_materials_pbrSpecularGlossiness.prototype;
6743
6733
  _proto.createAndParse = function createAndParse(context, schema, ownerSchema) {
@@ -6748,7 +6738,7 @@ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionPa
6748
6738
  material.baseColor = new engineMath.Color(engineMath.Color.linearToGammaSpace(diffuseFactor[0]), engineMath.Color.linearToGammaSpace(diffuseFactor[1]), engineMath.Color.linearToGammaSpace(diffuseFactor[2]), diffuseFactor[3]);
6749
6739
  }
6750
6740
  if (diffuseTexture) {
6751
- context.get(exports.GLTFParserType.Texture, diffuseTexture.index).then(function(texture) {
6741
+ context.get(GLTFParserType.Texture, diffuseTexture.index).then(function(texture) {
6752
6742
  material.baseTexture = texture;
6753
6743
  GLTFParser.executeExtensionsAdditiveAndParse(diffuseTexture.extensions, context, material, diffuseTexture);
6754
6744
  });
@@ -6761,7 +6751,7 @@ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionPa
6761
6751
  }
6762
6752
  if (specularGlossinessTexture) {
6763
6753
  exports.GLTFMaterialParser._checkOtherTextureTransform(specularGlossinessTexture, "Specular glossiness");
6764
- context.get(exports.GLTFParserType.Texture, specularGlossinessTexture.index).then(function(texture) {
6754
+ context.get(GLTFParserType.Texture, specularGlossinessTexture.index).then(function(texture) {
6765
6755
  material.specularGlossinessTexture = texture;
6766
6756
  });
6767
6757
  }
@@ -6772,13 +6762,44 @@ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionPa
6772
6762
  return KHR_materials_pbrSpecularGlossiness;
6773
6763
  }(GLTFExtensionParser);
6774
6764
  KHR_materials_pbrSpecularGlossiness = __decorate([
6775
- registerGLTFExtension("KHR_materials_pbrSpecularGlossiness", exports.GLTFExtensionMode.CreateAndParse)
6765
+ registerGLTFExtension("KHR_materials_pbrSpecularGlossiness", GLTFExtensionMode.CreateAndParse)
6776
6766
  ], KHR_materials_pbrSpecularGlossiness);
6777
6767
 
6778
- var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser1) {
6779
- _inherits(KHR_materials_unlit, GLTFExtensionParser1);
6768
+ var KHR_materials_sheen = /*#__PURE__*/ function(GLTFExtensionParser) {
6769
+ _inherits(KHR_materials_sheen, GLTFExtensionParser);
6770
+ function KHR_materials_sheen() {
6771
+ return GLTFExtensionParser.apply(this, arguments) || this;
6772
+ }
6773
+ var _proto = KHR_materials_sheen.prototype;
6774
+ _proto.additiveParse = function additiveParse(context, material, schema) {
6775
+ var sheenColorFactor = schema.sheenColorFactor, sheenColorTexture = schema.sheenColorTexture, _schema_sheenRoughnessFactor = schema.sheenRoughnessFactor, sheenRoughnessFactor = _schema_sheenRoughnessFactor === void 0 ? 0 : _schema_sheenRoughnessFactor, sheenRoughnessTexture = schema.sheenRoughnessTexture;
6776
+ if (sheenColorFactor) {
6777
+ material.sheenColor.set(engineMath.Color.linearToGammaSpace(sheenColorFactor[0]), engineMath.Color.linearToGammaSpace(sheenColorFactor[1]), engineMath.Color.linearToGammaSpace(sheenColorFactor[2]), undefined);
6778
+ }
6779
+ material.sheenRoughness = sheenRoughnessFactor;
6780
+ if (sheenColorTexture) {
6781
+ exports.GLTFMaterialParser._checkOtherTextureTransform(sheenColorTexture, "Sheen texture");
6782
+ context.get(GLTFParserType.Texture, sheenColorTexture.index).then(function(texture) {
6783
+ material.sheenColorTexture = texture;
6784
+ });
6785
+ }
6786
+ if (sheenRoughnessTexture) {
6787
+ exports.GLTFMaterialParser._checkOtherTextureTransform(sheenRoughnessTexture, "SheenRoughness texture");
6788
+ context.get(GLTFParserType.Texture, sheenRoughnessTexture.index).then(function(texture) {
6789
+ material.sheenRoughnessTexture = texture;
6790
+ });
6791
+ }
6792
+ };
6793
+ return KHR_materials_sheen;
6794
+ }(GLTFExtensionParser);
6795
+ KHR_materials_sheen = __decorate([
6796
+ registerGLTFExtension("KHR_materials_sheen", GLTFExtensionMode.AdditiveParse)
6797
+ ], KHR_materials_sheen);
6798
+
6799
+ var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser) {
6800
+ _inherits(KHR_materials_unlit, GLTFExtensionParser);
6780
6801
  function KHR_materials_unlit() {
6781
- return GLTFExtensionParser1.apply(this, arguments);
6802
+ return GLTFExtensionParser.apply(this, arguments) || this;
6782
6803
  }
6783
6804
  var _proto = KHR_materials_unlit.prototype;
6784
6805
  _proto.createAndParse = function createAndParse(context, _, ownerSchema) {
@@ -6791,19 +6812,19 @@ var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser1) {
6791
6812
  return KHR_materials_unlit;
6792
6813
  }(GLTFExtensionParser);
6793
6814
  KHR_materials_unlit = __decorate([
6794
- registerGLTFExtension("KHR_materials_unlit", exports.GLTFExtensionMode.CreateAndParse)
6815
+ registerGLTFExtension("KHR_materials_unlit", GLTFExtensionMode.CreateAndParse)
6795
6816
  ], KHR_materials_unlit);
6796
6817
 
6797
- var KHR_materials_variants = /*#__PURE__*/ function(GLTFExtensionParser1) {
6798
- _inherits(KHR_materials_variants, GLTFExtensionParser1);
6818
+ var KHR_materials_variants = /*#__PURE__*/ function(GLTFExtensionParser) {
6819
+ _inherits(KHR_materials_variants, GLTFExtensionParser);
6799
6820
  function KHR_materials_variants() {
6800
- return GLTFExtensionParser1.apply(this, arguments);
6821
+ return GLTFExtensionParser.apply(this, arguments) || this;
6801
6822
  }
6802
6823
  var _proto = KHR_materials_variants.prototype;
6803
6824
  _proto.additiveParse = function additiveParse(context, renderer, schema) {
6804
6825
  var _loop = function(i) {
6805
6826
  var _mappings_i = mappings[i], materialIndex = _mappings_i.material, variants = _mappings_i.variants;
6806
- context.get(exports.GLTFParserType.Material, materialIndex).then(function(material) {
6827
+ context.get(GLTFParserType.Material, materialIndex).then(function(material) {
6807
6828
  extensionData.push({
6808
6829
  renderer: renderer,
6809
6830
  material: material,
@@ -6824,24 +6845,24 @@ var KHR_materials_variants = /*#__PURE__*/ function(GLTFExtensionParser1) {
6824
6845
  return KHR_materials_variants;
6825
6846
  }(GLTFExtensionParser);
6826
6847
  KHR_materials_variants = __decorate([
6827
- registerGLTFExtension("KHR_materials_variants", exports.GLTFExtensionMode.AdditiveParse)
6848
+ registerGLTFExtension("KHR_materials_variants", GLTFExtensionMode.AdditiveParse)
6828
6849
  ], KHR_materials_variants);
6829
6850
 
6830
- var KHR_mesh_quantization = /*#__PURE__*/ function(GLTFExtensionParser1) {
6831
- _inherits(KHR_mesh_quantization, GLTFExtensionParser1);
6851
+ var KHR_mesh_quantization = /*#__PURE__*/ function(GLTFExtensionParser) {
6852
+ _inherits(KHR_mesh_quantization, GLTFExtensionParser);
6832
6853
  function KHR_mesh_quantization() {
6833
- return GLTFExtensionParser1.apply(this, arguments);
6854
+ return GLTFExtensionParser.apply(this, arguments) || this;
6834
6855
  }
6835
6856
  return KHR_mesh_quantization;
6836
6857
  }(GLTFExtensionParser);
6837
6858
  KHR_mesh_quantization = __decorate([
6838
- registerGLTFExtension("KHR_mesh_quantization", exports.GLTFExtensionMode.AdditiveParse)
6859
+ registerGLTFExtension("KHR_mesh_quantization", GLTFExtensionMode.AdditiveParse)
6839
6860
  ], KHR_mesh_quantization);
6840
6861
 
6841
- var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser1) {
6842
- _inherits(KHR_texture_basisu, GLTFExtensionParser1);
6862
+ var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser) {
6863
+ _inherits(KHR_texture_basisu, GLTFExtensionParser);
6843
6864
  function KHR_texture_basisu() {
6844
- return GLTFExtensionParser1.apply(this, arguments);
6865
+ return GLTFExtensionParser.apply(this, arguments) || this;
6845
6866
  }
6846
6867
  var _proto = KHR_texture_basisu.prototype;
6847
6868
  _proto.createAndParse = function createAndParse(context, schema, textureInfo) {
@@ -6877,7 +6898,7 @@ var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser1) {
6877
6898
  bufferView = glTF.bufferViews[bufferViewIndex];
6878
6899
  return [
6879
6900
  2,
6880
- context.get(exports.GLTFParserType.Buffer, bufferView.buffer).then(function(buffer) {
6901
+ context.get(GLTFParserType.Buffer, bufferView.buffer).then(function(buffer) {
6881
6902
  var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
6882
6903
  return exports.KTX2Loader._parseBuffer(imageBuffer, engine).then(function(param) {
6883
6904
  var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
@@ -6900,13 +6921,13 @@ var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser1) {
6900
6921
  return KHR_texture_basisu;
6901
6922
  }(GLTFExtensionParser);
6902
6923
  KHR_texture_basisu = __decorate([
6903
- registerGLTFExtension("KHR_texture_basisu", exports.GLTFExtensionMode.CreateAndParse)
6924
+ registerGLTFExtension("KHR_texture_basisu", GLTFExtensionMode.CreateAndParse)
6904
6925
  ], KHR_texture_basisu);
6905
6926
 
6906
- var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser1) {
6907
- _inherits(KHR_texture_transform, GLTFExtensionParser1);
6927
+ var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser) {
6928
+ _inherits(KHR_texture_transform, GLTFExtensionParser);
6908
6929
  function KHR_texture_transform() {
6909
- return GLTFExtensionParser1.apply(this, arguments);
6930
+ return GLTFExtensionParser.apply(this, arguments) || this;
6910
6931
  }
6911
6932
  var _proto = KHR_texture_transform.prototype;
6912
6933
  _proto.additiveParse = function additiveParse(context, material, schema) {
@@ -6929,13 +6950,13 @@ var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser1) {
6929
6950
  return KHR_texture_transform;
6930
6951
  }(GLTFExtensionParser);
6931
6952
  KHR_texture_transform = __decorate([
6932
- registerGLTFExtension("KHR_texture_transform", exports.GLTFExtensionMode.AdditiveParse)
6953
+ registerGLTFExtension("KHR_texture_transform", GLTFExtensionMode.AdditiveParse)
6933
6954
  ], KHR_texture_transform);
6934
6955
 
6935
- var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser1) {
6936
- _inherits(GALACEAN_materials_remap, GLTFExtensionParser1);
6956
+ var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser) {
6957
+ _inherits(GALACEAN_materials_remap, GLTFExtensionParser);
6937
6958
  function GALACEAN_materials_remap() {
6938
- return GLTFExtensionParser1.apply(this, arguments);
6959
+ return GLTFExtensionParser.apply(this, arguments) || this;
6939
6960
  }
6940
6961
  var _proto = GALACEAN_materials_remap.prototype;
6941
6962
  _proto.createAndParse = function createAndParse(context, schema) {
@@ -6948,13 +6969,13 @@ var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser1) {
6948
6969
  return GALACEAN_materials_remap;
6949
6970
  }(GLTFExtensionParser);
6950
6971
  GALACEAN_materials_remap = __decorate([
6951
- registerGLTFExtension("GALACEAN_materials_remap", exports.GLTFExtensionMode.CreateAndParse)
6972
+ registerGLTFExtension("GALACEAN_materials_remap", GLTFExtensionMode.CreateAndParse)
6952
6973
  ], GALACEAN_materials_remap);
6953
6974
 
6954
- var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser1) {
6955
- _inherits(GALACEAN_animation_event, GLTFExtensionParser1);
6975
+ var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser) {
6976
+ _inherits(GALACEAN_animation_event, GLTFExtensionParser);
6956
6977
  function GALACEAN_animation_event() {
6957
- return GLTFExtensionParser1.apply(this, arguments);
6978
+ return GLTFExtensionParser.apply(this, arguments) || this;
6958
6979
  }
6959
6980
  var _proto = GALACEAN_animation_event.prototype;
6960
6981
  _proto.additiveParse = function additiveParse(context, animationClip, schema) {
@@ -6971,17 +6992,17 @@ var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser1) {
6971
6992
  return GALACEAN_animation_event;
6972
6993
  }(GLTFExtensionParser);
6973
6994
  GALACEAN_animation_event = __decorate([
6974
- registerGLTFExtension("GALACEAN_animation_event", exports.GLTFExtensionMode.AdditiveParse)
6995
+ registerGLTFExtension("GALACEAN_animation_event", GLTFExtensionMode.AdditiveParse)
6975
6996
  ], GALACEAN_animation_event);
6976
6997
 
6977
- var EXT_meshopt_compression = /*#__PURE__*/ function(GLTFExtensionParser1) {
6978
- _inherits(EXT_meshopt_compression, GLTFExtensionParser1);
6998
+ var EXT_meshopt_compression = /*#__PURE__*/ function(GLTFExtensionParser) {
6999
+ _inherits(EXT_meshopt_compression, GLTFExtensionParser);
6979
7000
  function EXT_meshopt_compression() {
6980
- return GLTFExtensionParser1.apply(this, arguments);
7001
+ return GLTFExtensionParser.apply(this, arguments) || this;
6981
7002
  }
6982
7003
  var _proto = EXT_meshopt_compression.prototype;
6983
7004
  _proto.createAndParse = function createAndParse(context, schema) {
6984
- return context.get(exports.GLTFParserType.Buffer, schema.buffer).then(function(arrayBuffer) {
7005
+ return context.get(GLTFParserType.Buffer, schema.buffer).then(function(arrayBuffer) {
6985
7006
  return getMeshoptDecoder().then(function(decoder) {
6986
7007
  return decoder.decodeGltfBuffer(schema.count, schema.byteStride, new Uint8Array(arrayBuffer, schema.byteOffset, schema.byteLength), schema.mode, schema.filter);
6987
7008
  });
@@ -6990,13 +7011,13 @@ var EXT_meshopt_compression = /*#__PURE__*/ function(GLTFExtensionParser1) {
6990
7011
  return EXT_meshopt_compression;
6991
7012
  }(GLTFExtensionParser);
6992
7013
  EXT_meshopt_compression = __decorate([
6993
- registerGLTFExtension("EXT_meshopt_compression", exports.GLTFExtensionMode.CreateAndParse)
7014
+ registerGLTFExtension("EXT_meshopt_compression", GLTFExtensionMode.CreateAndParse)
6994
7015
  ], EXT_meshopt_compression);
6995
7016
 
6996
- var KHR_materials_anisotropy = /*#__PURE__*/ function(GLTFExtensionParser1) {
6997
- _inherits(KHR_materials_anisotropy, GLTFExtensionParser1);
7017
+ var KHR_materials_anisotropy = /*#__PURE__*/ function(GLTFExtensionParser) {
7018
+ _inherits(KHR_materials_anisotropy, GLTFExtensionParser);
6998
7019
  function KHR_materials_anisotropy() {
6999
- return GLTFExtensionParser1.apply(this, arguments);
7020
+ return GLTFExtensionParser.apply(this, arguments) || this;
7000
7021
  }
7001
7022
  var _proto = KHR_materials_anisotropy.prototype;
7002
7023
  _proto.additiveParse = function additiveParse(context, material, schema) {
@@ -7005,7 +7026,7 @@ var KHR_materials_anisotropy = /*#__PURE__*/ function(GLTFExtensionParser1) {
7005
7026
  material.anisotropyRotation = anisotropyRotation;
7006
7027
  if (anisotropyTexture) {
7007
7028
  exports.GLTFMaterialParser._checkOtherTextureTransform(anisotropyTexture, "Anisotropy texture");
7008
- context.get(exports.GLTFParserType.Texture, anisotropyTexture.index).then(function(texture) {
7029
+ context.get(GLTFParserType.Texture, anisotropyTexture.index).then(function(texture) {
7009
7030
  material.anisotropyTexture = texture;
7010
7031
  });
7011
7032
  }
@@ -7013,15 +7034,44 @@ var KHR_materials_anisotropy = /*#__PURE__*/ function(GLTFExtensionParser1) {
7013
7034
  return KHR_materials_anisotropy;
7014
7035
  }(GLTFExtensionParser);
7015
7036
  KHR_materials_anisotropy = __decorate([
7016
- registerGLTFExtension("KHR_materials_anisotropy", exports.GLTFExtensionMode.AdditiveParse)
7037
+ registerGLTFExtension("KHR_materials_anisotropy", GLTFExtensionMode.AdditiveParse)
7017
7038
  ], KHR_materials_anisotropy);
7018
7039
 
7019
- var EXT_texture_webp = /*#__PURE__*/ function(GLTFExtensionParser1) {
7020
- _inherits(EXT_texture_webp, GLTFExtensionParser1);
7040
+ var KHR_materials_iridescence = /*#__PURE__*/ function(GLTFExtensionParser) {
7041
+ _inherits(KHR_materials_iridescence, GLTFExtensionParser);
7042
+ function KHR_materials_iridescence() {
7043
+ return GLTFExtensionParser.apply(this, arguments) || this;
7044
+ }
7045
+ var _proto = KHR_materials_iridescence.prototype;
7046
+ _proto.additiveParse = function additiveParse(context, material, schema) {
7047
+ var _schema_iridescenceFactor = schema.iridescenceFactor, iridescenceFactor = _schema_iridescenceFactor === void 0 ? 0 : _schema_iridescenceFactor, iridescenceTexture = schema.iridescenceTexture, _schema_iridescenceIor = schema.iridescenceIor, iridescenceIor = _schema_iridescenceIor === void 0 ? 1.3 : _schema_iridescenceIor, _schema_iridescenceThicknessMinimum = schema.iridescenceThicknessMinimum, iridescenceThicknessMinimum = _schema_iridescenceThicknessMinimum === void 0 ? 100 : _schema_iridescenceThicknessMinimum, _schema_iridescenceThicknessMaximum = schema.iridescenceThicknessMaximum, iridescenceThicknessMaximum = _schema_iridescenceThicknessMaximum === void 0 ? 400 : _schema_iridescenceThicknessMaximum, iridescenceThicknessTexture = schema.iridescenceThicknessTexture;
7048
+ material.iridescence = iridescenceFactor;
7049
+ material.iridescenceIOR = iridescenceIor;
7050
+ material.iridescenceThicknessRange.set(iridescenceThicknessMinimum, iridescenceThicknessMaximum);
7051
+ if (iridescenceTexture) {
7052
+ exports.GLTFMaterialParser._checkOtherTextureTransform(iridescenceTexture, "Iridescence texture");
7053
+ context.get(GLTFParserType.Texture, iridescenceTexture.index).then(function(texture) {
7054
+ material.iridescenceTexture = texture;
7055
+ });
7056
+ }
7057
+ if (iridescenceThicknessTexture) {
7058
+ exports.GLTFMaterialParser._checkOtherTextureTransform(iridescenceThicknessTexture, "IridescenceThickness texture");
7059
+ context.get(GLTFParserType.Texture, iridescenceThicknessTexture.index).then(function(texture) {
7060
+ material.iridescenceThicknessTexture = texture;
7061
+ });
7062
+ }
7063
+ };
7064
+ return KHR_materials_iridescence;
7065
+ }(GLTFExtensionParser);
7066
+ KHR_materials_iridescence = __decorate([
7067
+ registerGLTFExtension("KHR_materials_iridescence", GLTFExtensionMode.AdditiveParse)
7068
+ ], KHR_materials_iridescence);
7069
+
7070
+ var EXT_texture_webp = /*#__PURE__*/ function(GLTFExtensionParser) {
7071
+ _inherits(EXT_texture_webp, GLTFExtensionParser);
7021
7072
  function EXT_texture_webp() {
7022
7073
  var _this;
7023
- _this = GLTFExtensionParser1.call(this) || this;
7024
- _this._supportWebP = false;
7074
+ _this = GLTFExtensionParser.call(this) || this, _this._supportWebP = false;
7025
7075
  // @ts-ignore
7026
7076
  if (engineCore.SystemInfo._isBrowser) {
7027
7077
  var testCanvas = document.createElement("canvas");
@@ -7051,21 +7101,30 @@ var EXT_texture_webp = /*#__PURE__*/ function(GLTFExtensionParser1) {
7051
7101
  return EXT_texture_webp;
7052
7102
  }(GLTFExtensionParser);
7053
7103
  EXT_texture_webp = __decorate([
7054
- registerGLTFExtension("EXT_texture_webp", exports.GLTFExtensionMode.CreateAndParse)
7104
+ registerGLTFExtension("EXT_texture_webp", GLTFExtensionMode.CreateAndParse)
7055
7105
  ], EXT_texture_webp);
7056
7106
 
7107
+ exports.AccessorType = AccessorType;
7057
7108
  exports.BufferInfo = BufferInfo;
7058
7109
  exports.BufferReader = BufferReader;
7059
7110
  exports.FileHeader = FileHeader;
7111
+ exports.GLTFExtensionMode = GLTFExtensionMode;
7060
7112
  exports.GLTFExtensionParser = GLTFExtensionParser;
7061
7113
  exports.GLTFParser = GLTFParser;
7062
7114
  exports.GLTFParserContext = GLTFParserContext;
7115
+ exports.GLTFParserType = GLTFParserType;
7063
7116
  exports.GLTFResource = GLTFResource;
7064
7117
  exports.GLTFUtils = GLTFUtils;
7118
+ exports.InterpolableValueType = InterpolableValueType;
7119
+ exports.KTX2TargetFormat = KTX2TargetFormat;
7120
+ exports.KTX2Transcoder = KTX2Transcoder;
7121
+ exports.MaterialLoaderType = MaterialLoaderType;
7065
7122
  exports.ParserContext = ParserContext;
7123
+ exports.ParserType = ParserType;
7066
7124
  exports.PrefabResource = PrefabResource;
7067
7125
  exports.ReflectionParser = ReflectionParser;
7068
7126
  exports.SceneParser = SceneParser;
7127
+ exports.SpecularMode = SpecularMode;
7069
7128
  exports.decode = decode;
7070
7129
  exports.decoder = decoder;
7071
7130
  exports.decoderMap = decoderMap;