@galacean/engine 1.4.14 → 1.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -7625,7 +7625,7 @@
7625
7625
  return relativeUrl;
7626
7626
  }
7627
7627
  if (!/^https?:/.test(baseUrl)) {
7628
- var fileSchema = "files://";
7628
+ var fileSchema = "file://";
7629
7629
  baseUrl = fileSchema + baseUrl;
7630
7630
  return new URL(relativeUrl, baseUrl).href.substring(fileSchema.length);
7631
7631
  }
@@ -24198,12 +24198,24 @@
24198
24198
  this._onCancelHandler && this._onCancelHandler();
24199
24199
  return this;
24200
24200
  };
24201
- /**
24202
- * Return a new resource Promise through the provided asset promise collection.
24203
- * The resolved of the new AssetPromise will be triggered when all the Promises in the provided set are completed.
24204
- * @param - Promise Collection
24205
- * @returns AssetPromise
24206
- */ AssetPromise.all = function all(promises) {
24201
+ AssetPromise.resolve = function resolve(value) {
24202
+ if (value === undefined) {
24203
+ return new AssetPromise(function(resolve) {
24204
+ return resolve();
24205
+ });
24206
+ } else if (_instanceof1$2(value, AssetPromise) || _instanceof1$2(value, Promise)) {
24207
+ return new AssetPromise(function(resolve, reject) {
24208
+ value.then(function(resolved) {
24209
+ return resolve(resolved);
24210
+ }, reject);
24211
+ });
24212
+ } else {
24213
+ return new AssetPromise(function(resolve) {
24214
+ return resolve(value);
24215
+ });
24216
+ }
24217
+ };
24218
+ AssetPromise.all = function all(values) {
24207
24219
  return new AssetPromise(function(resolve, reject, setTaskCompleteProgress) {
24208
24220
  var onComplete = function onComplete(index, resultValue) {
24209
24221
  completed++;
@@ -24214,7 +24226,7 @@
24214
24226
  }
24215
24227
  };
24216
24228
  var onProgress = function onProgress(promise, index) {
24217
- if (_instanceof1$2(promise, Promise) || _instanceof1$2(promise, AssetPromise)) {
24229
+ if (_instanceof1$2(promise, AssetPromise) || _instanceof1$2(promise, Promise)) {
24218
24230
  promise.then(function(value) {
24219
24231
  onComplete(index, value);
24220
24232
  }, reject);
@@ -24224,14 +24236,14 @@
24224
24236
  });
24225
24237
  }
24226
24238
  };
24227
- var count = promises.length;
24239
+ var count = Array.from(values).length;
24228
24240
  var results = new Array(count);
24229
24241
  var completed = 0;
24230
24242
  if (count === 0) {
24231
24243
  return resolve(results);
24232
24244
  }
24233
24245
  for(var i = 0; i < count; i++){
24234
- onProgress(promises[i], i);
24246
+ onProgress(values[i], i);
24235
24247
  }
24236
24248
  });
24237
24249
  };
@@ -24809,12 +24821,12 @@
24809
24821
  var obj = this._objectPool[refId];
24810
24822
  var promise;
24811
24823
  if (obj) {
24812
- promise = Promise.resolve(obj);
24824
+ promise = AssetPromise.resolve(obj);
24813
24825
  } else {
24814
24826
  var resourceConfig = this._idResourceMap[refId];
24815
24827
  if (!resourceConfig) {
24816
24828
  Logger.warn("refId:" + refId + " is not find in this._idResourceMap.");
24817
- return Promise.resolve(null);
24829
+ return AssetPromise.resolve(null);
24818
24830
  }
24819
24831
  var url = resourceConfig.virtualPath;
24820
24832
  if (key) {
@@ -25614,344 +25626,6 @@
25614
25626
  exports.Collider = __decorate$1([
25615
25627
  dependentComponents(Transform, DependentMode.CheckOnly)
25616
25628
  ], exports.Collider);
25617
- /**
25618
- * Describes a contact point where the collision occurs.
25619
- */ var ContactPoint = function ContactPoint() {
25620
- /** The position of the contact point between the shapes, in world space. */ this.position = new Vector3();
25621
- /** The normal of the contacting surfaces at the contact point. The normal direction points from the other shape to the self shape. */ this.normal = new Vector3();
25622
- /** The impulse applied at the contact point, in world space. Divide by the simulation time step to get a force value. */ this.impulse = new Vector3();
25623
- };
25624
- /**
25625
- * Collision information between two shapes when they collide.
25626
- */ var Collision = /*#__PURE__*/ function() {
25627
- function Collision() {}
25628
- var _proto = Collision.prototype;
25629
- /**
25630
- * Get contact points.
25631
- * @param outContacts - The result of contact points
25632
- * @returns The actual count of contact points
25633
- *
25634
- * @remarks To optimize performance, the engine does not modify the length of the array you pass.
25635
- * You need to obtain the actual number of contact points from the function's return value.
25636
- */ _proto.getContacts = function getContacts(outContacts) {
25637
- var nativeCollision = this._nativeCollision;
25638
- var smallerShapeId = Math.min(nativeCollision.shape0Id, nativeCollision.shape1Id);
25639
- var factor = this.shape.id === smallerShapeId ? 1 : -1;
25640
- var nativeContactPoints = nativeCollision.getContacts();
25641
- var length = nativeContactPoints.size();
25642
- for(var i = 0; i < length; i++){
25643
- var _outContacts, _i;
25644
- var nativeContractPoint = nativeContactPoints.get(i);
25645
- var contact = (_outContacts = outContacts)[_i = i] || (_outContacts[_i] = new ContactPoint());
25646
- contact.position.copyFrom(nativeContractPoint.position);
25647
- contact.normal.copyFrom(nativeContractPoint.normal).scale(factor);
25648
- contact.impulse.copyFrom(nativeContractPoint.impulse).scale(factor);
25649
- contact.separation = nativeContractPoint.separation;
25650
- }
25651
- return length;
25652
- };
25653
- _create_class$2(Collision, [
25654
- {
25655
- key: "contactCount",
25656
- get: /**
25657
- * Count of contact points.
25658
- */ function get() {
25659
- return this._nativeCollision.contactCount;
25660
- }
25661
- }
25662
- ]);
25663
- return Collision;
25664
- }();
25665
- /**
25666
- * A physics scene is a collection of colliders and constraints which can interact.
25667
- */ var PhysicsScene = /*#__PURE__*/ function() {
25668
- function PhysicsScene(scene) {
25669
- this._restTime = 0;
25670
- this._fixedTimeStep = 1 / 60;
25671
- this._colliders = new DisorderedArray();
25672
- this._gravity = new Vector3(0, -9.81, 0);
25673
- this._onContactEnter = function(nativeCollision) {
25674
- var physicalObjectsMap = Engine._physicalObjectsMap;
25675
- var shape0Id = nativeCollision.shape0Id, shape1Id = nativeCollision.shape1Id;
25676
- var shape1 = physicalObjectsMap[shape0Id];
25677
- var shape2 = physicalObjectsMap[shape1Id];
25678
- var collision = PhysicsScene._collision;
25679
- collision._nativeCollision = nativeCollision;
25680
- shape1.collider.entity._scripts.forEach(function(element) {
25681
- collision.shape = shape2;
25682
- element.onCollisionEnter(collision);
25683
- }, function(element, index) {
25684
- element._entityScriptsIndex = index;
25685
- });
25686
- shape2.collider.entity._scripts.forEach(function(element) {
25687
- collision.shape = shape1;
25688
- element.onCollisionEnter(collision);
25689
- }, function(element, index) {
25690
- element._entityScriptsIndex = index;
25691
- });
25692
- };
25693
- this._onContactExit = function(nativeCollision) {
25694
- var physicalObjectsMap = Engine._physicalObjectsMap;
25695
- var shape0Id = nativeCollision.shape0Id, shape1Id = nativeCollision.shape1Id;
25696
- var shape1 = physicalObjectsMap[shape0Id];
25697
- var shape2 = physicalObjectsMap[shape1Id];
25698
- var collision = PhysicsScene._collision;
25699
- collision._nativeCollision = nativeCollision;
25700
- shape1.collider.entity._scripts.forEach(function(element) {
25701
- collision.shape = shape2;
25702
- element.onCollisionExit(collision);
25703
- }, function(element, index) {
25704
- element._entityScriptsIndex = index;
25705
- });
25706
- shape2.collider.entity._scripts.forEach(function(element) {
25707
- collision.shape = shape1;
25708
- element.onCollisionExit(collision);
25709
- }, function(element, index) {
25710
- element._entityScriptsIndex = index;
25711
- });
25712
- };
25713
- this._onContactStay = function(nativeCollision) {
25714
- var physicalObjectsMap = Engine._physicalObjectsMap;
25715
- var shape0Id = nativeCollision.shape0Id, shape1Id = nativeCollision.shape1Id;
25716
- var shape1 = physicalObjectsMap[shape0Id];
25717
- var shape2 = physicalObjectsMap[shape1Id];
25718
- var collision = PhysicsScene._collision;
25719
- collision._nativeCollision = nativeCollision;
25720
- shape1.collider.entity._scripts.forEach(function(element) {
25721
- collision.shape = shape2;
25722
- element.onCollisionStay(collision);
25723
- }, function(element, index) {
25724
- element._entityScriptsIndex = index;
25725
- });
25726
- shape2.collider.entity._scripts.forEach(function(element) {
25727
- collision.shape = shape1;
25728
- element.onCollisionStay(collision);
25729
- }, function(element, index) {
25730
- element._entityScriptsIndex = index;
25731
- });
25732
- };
25733
- this._onTriggerEnter = function(obj1, obj2) {
25734
- var physicalObjectsMap = Engine._physicalObjectsMap;
25735
- var shape1 = physicalObjectsMap[obj1];
25736
- var shape2 = physicalObjectsMap[obj2];
25737
- shape1.collider.entity._scripts.forEach(function(element) {
25738
- element.onTriggerEnter(shape2);
25739
- }, function(element, index) {
25740
- element._entityScriptsIndex = index;
25741
- });
25742
- shape2.collider.entity._scripts.forEach(function(element) {
25743
- element.onTriggerEnter(shape1);
25744
- }, function(element, index) {
25745
- element._entityScriptsIndex = index;
25746
- });
25747
- };
25748
- this._onTriggerExit = function(obj1, obj2) {
25749
- var physicalObjectsMap = Engine._physicalObjectsMap;
25750
- var shape1 = physicalObjectsMap[obj1];
25751
- var shape2 = physicalObjectsMap[obj2];
25752
- shape1.collider.entity._scripts.forEach(function(element) {
25753
- element.onTriggerExit(shape2);
25754
- }, function(element, index) {
25755
- element._entityScriptsIndex = index;
25756
- });
25757
- shape2.collider.entity._scripts.forEach(function(element) {
25758
- element.onTriggerExit(shape1);
25759
- }, function(element, index) {
25760
- element._entityScriptsIndex = index;
25761
- });
25762
- };
25763
- this._onTriggerStay = function(obj1, obj2) {
25764
- var physicalObjectsMap = Engine._physicalObjectsMap;
25765
- var shape1 = physicalObjectsMap[obj1];
25766
- var shape2 = physicalObjectsMap[obj2];
25767
- shape1.collider.entity._scripts.forEach(function(element) {
25768
- element.onTriggerStay(shape2);
25769
- }, function(element, index) {
25770
- element._entityScriptsIndex = index;
25771
- });
25772
- shape2.collider.entity._scripts.forEach(function(element) {
25773
- element.onTriggerStay(shape1);
25774
- }, function(element, index) {
25775
- element._entityScriptsIndex = index;
25776
- });
25777
- };
25778
- this._scene = scene;
25779
- this._setGravity = this._setGravity.bind(this);
25780
- //@ts-ignore
25781
- this._gravity._onValueChanged = this._setGravity;
25782
- var engine = scene.engine;
25783
- if (engine._physicsInitialized) {
25784
- this._nativePhysicsScene = PhysicsScene._nativePhysics.createPhysicsScene(engine._nativePhysicsManager, this._onContactEnter, this._onContactExit, this._onContactStay, this._onTriggerEnter, this._onTriggerExit, this._onTriggerStay);
25785
- }
25786
- }
25787
- var _proto = PhysicsScene.prototype;
25788
- _proto.raycast = function raycast(ray, distanceOrResult, layerMaskOrResult, outHitResult) {
25789
- var hitResult;
25790
- var distance = Number.MAX_VALUE;
25791
- if (typeof distanceOrResult === "number") {
25792
- distance = distanceOrResult;
25793
- } else if (distanceOrResult != undefined) {
25794
- hitResult = distanceOrResult;
25795
- }
25796
- var layerMask = Layer.Everything;
25797
- if (typeof layerMaskOrResult === "number") {
25798
- layerMask = layerMaskOrResult;
25799
- } else if (layerMaskOrResult != undefined) {
25800
- hitResult = layerMaskOrResult;
25801
- }
25802
- if (outHitResult) {
25803
- hitResult = outHitResult;
25804
- }
25805
- var onRaycast = function onRaycast(obj) {
25806
- var shape = Engine._physicalObjectsMap[obj];
25807
- if (!shape) {
25808
- return false;
25809
- }
25810
- return shape.collider.entity.layer & layerMask && shape.isSceneQuery;
25811
- };
25812
- var outIDX;
25813
- var outDistance;
25814
- var outPosition;
25815
- var outNormal;
25816
- if (hitResult != undefined) {
25817
- var result = this._nativePhysicsScene.raycast(ray, distance, onRaycast, function(idx, distance, position, normal) {
25818
- outIDX = idx;
25819
- outDistance = distance;
25820
- outPosition = position;
25821
- outNormal = normal;
25822
- });
25823
- if (result) {
25824
- var hitShape = Engine._physicalObjectsMap[outIDX];
25825
- hitResult.entity = hitShape._collider.entity;
25826
- hitResult.shape = hitShape;
25827
- hitResult.distance = outDistance;
25828
- hitResult.point.copyFrom(outPosition);
25829
- hitResult.normal.copyFrom(outNormal);
25830
- return true;
25831
- } else {
25832
- hitResult.entity = null;
25833
- hitResult.shape = null;
25834
- hitResult.distance = 0;
25835
- hitResult.point.set(0, 0, 0);
25836
- hitResult.normal.set(0, 0, 0);
25837
- return false;
25838
- }
25839
- } else {
25840
- return this._nativePhysicsScene.raycast(ray, distance, onRaycast);
25841
- }
25842
- };
25843
- /**
25844
- * Call on every frame to update pose of objects.
25845
- * @internal
25846
- */ _proto._update = function _update(deltaTime) {
25847
- var _this = this, fixedTimeStep = _this._fixedTimeStep, nativePhysicsManager = _this._nativePhysicsScene;
25848
- var componentsManager = this._scene._componentsManager;
25849
- var simulateTime = this._restTime + deltaTime;
25850
- var step = Math.floor(simulateTime / fixedTimeStep);
25851
- this._restTime = simulateTime - step * fixedTimeStep;
25852
- for(var i = 0; i < step; i++){
25853
- componentsManager.callScriptOnPhysicsUpdate();
25854
- this._callColliderOnUpdate();
25855
- nativePhysicsManager.update(fixedTimeStep);
25856
- this._callColliderOnLateUpdate();
25857
- }
25858
- };
25859
- /**
25860
- * Add collider into the manager.
25861
- * @param collider - StaticCollider or DynamicCollider.
25862
- * @internal
25863
- */ _proto._addCollider = function _addCollider(collider) {
25864
- if (collider._index === -1) {
25865
- collider._index = this._colliders.length;
25866
- this._colliders.add(collider);
25867
- }
25868
- this._nativePhysicsScene.addCollider(collider._nativeCollider);
25869
- };
25870
- /**
25871
- * Add character controller into the manager.
25872
- * @param controller - Character Controller.
25873
- * @internal
25874
- */ _proto._addCharacterController = function _addCharacterController(controller) {
25875
- if (controller._index === -1) {
25876
- controller._index = this._colliders.length;
25877
- this._colliders.add(controller);
25878
- }
25879
- this._nativePhysicsScene.addCharacterController(controller._nativeCollider);
25880
- };
25881
- /**
25882
- * Remove collider.
25883
- * @param collider - StaticCollider or DynamicCollider.
25884
- * @internal
25885
- */ _proto._removeCollider = function _removeCollider(collider) {
25886
- var replaced = this._colliders.deleteByIndex(collider._index);
25887
- replaced && (replaced._index = collider._index);
25888
- collider._index = -1;
25889
- this._nativePhysicsScene.removeCollider(collider._nativeCollider);
25890
- };
25891
- /**
25892
- * Remove collider.
25893
- * @param controller - Character Controller.
25894
- * @internal
25895
- */ _proto._removeCharacterController = function _removeCharacterController(controller) {
25896
- var replaced = this._colliders.deleteByIndex(controller._index);
25897
- replaced && (replaced._index = controller._index);
25898
- controller._index = -1;
25899
- this._nativePhysicsScene.removeCharacterController(controller._nativeCollider);
25900
- };
25901
- /**
25902
- * @internal
25903
- */ _proto._callColliderOnUpdate = function _callColliderOnUpdate() {
25904
- var elements = this._colliders._elements;
25905
- for(var i = this._colliders.length - 1; i >= 0; --i){
25906
- elements[i]._onUpdate();
25907
- }
25908
- };
25909
- /**
25910
- * @internal
25911
- */ _proto._callColliderOnLateUpdate = function _callColliderOnLateUpdate() {
25912
- var elements = this._colliders._elements;
25913
- for(var i = this._colliders.length - 1; i >= 0; --i){
25914
- elements[i]._onLateUpdate();
25915
- }
25916
- };
25917
- /**
25918
- * @internal
25919
- */ _proto._gc = function _gc() {
25920
- this._colliders.garbageCollection();
25921
- };
25922
- _proto._setGravity = function _setGravity() {
25923
- this._nativePhysicsScene.setGravity(this._gravity);
25924
- };
25925
- _create_class$2(PhysicsScene, [
25926
- {
25927
- key: "gravity",
25928
- get: /**
25929
- * The gravity of physics scene.
25930
- */ function get() {
25931
- return this._gravity;
25932
- },
25933
- set: function set(value) {
25934
- var gravity = this._gravity;
25935
- if (gravity !== value) {
25936
- gravity.copyFrom(value);
25937
- }
25938
- }
25939
- },
25940
- {
25941
- key: "fixedTimeStep",
25942
- get: /**
25943
- * The fixed time step in seconds at which physics are performed.
25944
- */ function get() {
25945
- return this._fixedTimeStep;
25946
- },
25947
- set: function set(value) {
25948
- this._fixedTimeStep = Math.max(value, MathUtil.zeroTolerance);
25949
- }
25950
- }
25951
- ]);
25952
- return PhysicsScene;
25953
- }();
25954
- PhysicsScene._collision = new Collision();
25955
25629
  /**
25956
25630
  * The up axis of the collider shape.
25957
25631
  */ var ControllerNonWalkableMode = /*#__PURE__*/ function(ControllerNonWalkableMode) {
@@ -25966,7 +25640,7 @@
25966
25640
  function CharacterController(entity) {
25967
25641
  var _this;
25968
25642
  _this = Collider.call(this, entity) || this, _this._stepOffset = 0.5, _this._nonWalkableMode = ControllerNonWalkableMode.PreventClimbing, _this._upDirection = new Vector3(0, 1, 0), _this._slopeLimit = 45;
25969
- _this._nativeCollider = PhysicsScene._nativePhysics.createCharacterController();
25643
+ _this._nativeCollider = Engine._nativePhysics.createCharacterController();
25970
25644
  _this._setUpDirection = _this._setUpDirection.bind(_this);
25971
25645
  //@ts-ignore
25972
25646
  _this._upDirection._onValueChanged = _this._setUpDirection;
@@ -26115,7 +25789,7 @@
26115
25789
  var _this;
26116
25790
  _this = Collider.call(this, entity) || this, _this._linearDamping = 0, _this._angularDamping = 0.05, _this._linearVelocity = new Vector3(), _this._angularVelocity = new Vector3(), _this._mass = 1.0, _this._centerOfMass = new Vector3(), _this._inertiaTensor = new Vector3(1, 1, 1), _this._maxAngularVelocity = 18000 / Math.PI, _this._maxDepenetrationVelocity = 1.0000000331813535e32, _this._solverIterations = 4, _this._useGravity = true, _this._isKinematic = false, _this._constraints = 0, _this._collisionDetectionMode = 0, _this._sleepThreshold = 5e-3, _this._automaticCenterOfMass = true, _this._automaticInertiaTensor = true;
26117
25791
  var transform = _this.entity.transform;
26118
- _this._nativeCollider = PhysicsScene._nativePhysics.createDynamicCollider(transform.worldPosition, transform.worldRotationQuaternion);
25792
+ _this._nativeCollider = Engine._nativePhysics.createDynamicCollider(transform.worldPosition, transform.worldRotationQuaternion);
26119
25793
  _this._setLinearVelocity = _this._setLinearVelocity.bind(_this);
26120
25794
  _this._setAngularVelocity = _this._setAngularVelocity.bind(_this);
26121
25795
  _this._handleCenterOfMassChanged = _this._handleCenterOfMassChanged.bind(_this);
@@ -26586,7 +26260,7 @@
26586
26260
  this._staticFriction = 0.6;
26587
26261
  this._bounceCombine = PhysicsMaterialCombineMode.Average;
26588
26262
  this._frictionCombine = PhysicsMaterialCombineMode.Average;
26589
- this._nativeMaterial = PhysicsScene._nativePhysics.createPhysicsMaterial(this._staticFriction, this._dynamicFriction, this._bounciness, this._bounceCombine, this._frictionCombine);
26263
+ this._nativeMaterial = Engine._nativePhysics.createPhysicsMaterial(this._staticFriction, this._dynamicFriction, this._bounciness, this._bounceCombine, this._frictionCombine);
26590
26264
  }
26591
26265
  var _proto = PhysicsMaterial.prototype;
26592
26266
  /**
@@ -26669,6 +26343,350 @@
26669
26343
  ]);
26670
26344
  return PhysicsMaterial;
26671
26345
  }();
26346
+ /**
26347
+ * Describes a contact point where the collision occurs.
26348
+ */ var ContactPoint = function ContactPoint() {
26349
+ /** The position of the contact point between the shapes, in world space. */ this.position = new Vector3();
26350
+ /** The normal of the contacting surfaces at the contact point. The normal direction points from the other shape to the self shape. */ this.normal = new Vector3();
26351
+ /** The impulse applied at the contact point, in world space. Divide by the simulation time step to get a force value. */ this.impulse = new Vector3();
26352
+ };
26353
+ /**
26354
+ * Collision information between two shapes when they collide.
26355
+ */ var Collision = /*#__PURE__*/ function() {
26356
+ function Collision() {}
26357
+ var _proto = Collision.prototype;
26358
+ /**
26359
+ * Get contact points.
26360
+ * @param outContacts - The result of contact points
26361
+ * @returns The actual count of contact points
26362
+ *
26363
+ * @remarks To optimize performance, the engine does not modify the length of the array you pass.
26364
+ * You need to obtain the actual number of contact points from the function's return value.
26365
+ */ _proto.getContacts = function getContacts(outContacts) {
26366
+ var nativeCollision = this._nativeCollision;
26367
+ var smallerShapeId = Math.min(nativeCollision.shape0Id, nativeCollision.shape1Id);
26368
+ var factor = this.shape.id === smallerShapeId ? 1 : -1;
26369
+ var nativeContactPoints = nativeCollision.getContacts();
26370
+ var length = nativeContactPoints.size();
26371
+ for(var i = 0; i < length; i++){
26372
+ var _outContacts, _i;
26373
+ var nativeContractPoint = nativeContactPoints.get(i);
26374
+ var contact = (_outContacts = outContacts)[_i = i] || (_outContacts[_i] = new ContactPoint());
26375
+ contact.position.copyFrom(nativeContractPoint.position);
26376
+ contact.normal.copyFrom(nativeContractPoint.normal).scale(factor);
26377
+ contact.impulse.copyFrom(nativeContractPoint.impulse).scale(factor);
26378
+ contact.separation = nativeContractPoint.separation;
26379
+ }
26380
+ return length;
26381
+ };
26382
+ _create_class$2(Collision, [
26383
+ {
26384
+ key: "contactCount",
26385
+ get: /**
26386
+ * Count of contact points.
26387
+ */ function get() {
26388
+ return this._nativeCollision.contactCount;
26389
+ }
26390
+ }
26391
+ ]);
26392
+ return Collision;
26393
+ }();
26394
+ /**
26395
+ * A physics scene is a collection of colliders and constraints which can interact.
26396
+ */ var PhysicsScene = /*#__PURE__*/ function() {
26397
+ function PhysicsScene(scene) {
26398
+ this._restTime = 0;
26399
+ this._fixedTimeStep = 1 / 60;
26400
+ this._colliders = new DisorderedArray();
26401
+ this._gravity = new Vector3(0, -9.81, 0);
26402
+ this._onContactEnter = function(nativeCollision) {
26403
+ var physicalObjectsMap = Engine._physicalObjectsMap;
26404
+ var shape0Id = nativeCollision.shape0Id, shape1Id = nativeCollision.shape1Id;
26405
+ var shape1 = physicalObjectsMap[shape0Id];
26406
+ var shape2 = physicalObjectsMap[shape1Id];
26407
+ var collision = PhysicsScene._collision;
26408
+ collision._nativeCollision = nativeCollision;
26409
+ shape1.collider.entity._scripts.forEach(function(element) {
26410
+ collision.shape = shape2;
26411
+ element.onCollisionEnter(collision);
26412
+ }, function(element, index) {
26413
+ element._entityScriptsIndex = index;
26414
+ });
26415
+ shape2.collider.entity._scripts.forEach(function(element) {
26416
+ collision.shape = shape1;
26417
+ element.onCollisionEnter(collision);
26418
+ }, function(element, index) {
26419
+ element._entityScriptsIndex = index;
26420
+ });
26421
+ };
26422
+ this._onContactExit = function(nativeCollision) {
26423
+ var physicalObjectsMap = Engine._physicalObjectsMap;
26424
+ var shape0Id = nativeCollision.shape0Id, shape1Id = nativeCollision.shape1Id;
26425
+ var shape1 = physicalObjectsMap[shape0Id];
26426
+ var shape2 = physicalObjectsMap[shape1Id];
26427
+ var collision = PhysicsScene._collision;
26428
+ collision._nativeCollision = nativeCollision;
26429
+ shape1.collider.entity._scripts.forEach(function(element) {
26430
+ collision.shape = shape2;
26431
+ element.onCollisionExit(collision);
26432
+ }, function(element, index) {
26433
+ element._entityScriptsIndex = index;
26434
+ });
26435
+ shape2.collider.entity._scripts.forEach(function(element) {
26436
+ collision.shape = shape1;
26437
+ element.onCollisionExit(collision);
26438
+ }, function(element, index) {
26439
+ element._entityScriptsIndex = index;
26440
+ });
26441
+ };
26442
+ this._onContactStay = function(nativeCollision) {
26443
+ var physicalObjectsMap = Engine._physicalObjectsMap;
26444
+ var shape0Id = nativeCollision.shape0Id, shape1Id = nativeCollision.shape1Id;
26445
+ var shape1 = physicalObjectsMap[shape0Id];
26446
+ var shape2 = physicalObjectsMap[shape1Id];
26447
+ var collision = PhysicsScene._collision;
26448
+ collision._nativeCollision = nativeCollision;
26449
+ shape1.collider.entity._scripts.forEach(function(element) {
26450
+ collision.shape = shape2;
26451
+ element.onCollisionStay(collision);
26452
+ }, function(element, index) {
26453
+ element._entityScriptsIndex = index;
26454
+ });
26455
+ shape2.collider.entity._scripts.forEach(function(element) {
26456
+ collision.shape = shape1;
26457
+ element.onCollisionStay(collision);
26458
+ }, function(element, index) {
26459
+ element._entityScriptsIndex = index;
26460
+ });
26461
+ };
26462
+ this._onTriggerEnter = function(obj1, obj2) {
26463
+ var physicalObjectsMap = Engine._physicalObjectsMap;
26464
+ var shape1 = physicalObjectsMap[obj1];
26465
+ var shape2 = physicalObjectsMap[obj2];
26466
+ shape1.collider.entity._scripts.forEach(function(element) {
26467
+ element.onTriggerEnter(shape2);
26468
+ }, function(element, index) {
26469
+ element._entityScriptsIndex = index;
26470
+ });
26471
+ shape2.collider.entity._scripts.forEach(function(element) {
26472
+ element.onTriggerEnter(shape1);
26473
+ }, function(element, index) {
26474
+ element._entityScriptsIndex = index;
26475
+ });
26476
+ };
26477
+ this._onTriggerExit = function(obj1, obj2) {
26478
+ var physicalObjectsMap = Engine._physicalObjectsMap;
26479
+ var shape1 = physicalObjectsMap[obj1];
26480
+ var shape2 = physicalObjectsMap[obj2];
26481
+ shape1.collider.entity._scripts.forEach(function(element) {
26482
+ element.onTriggerExit(shape2);
26483
+ }, function(element, index) {
26484
+ element._entityScriptsIndex = index;
26485
+ });
26486
+ shape2.collider.entity._scripts.forEach(function(element) {
26487
+ element.onTriggerExit(shape1);
26488
+ }, function(element, index) {
26489
+ element._entityScriptsIndex = index;
26490
+ });
26491
+ };
26492
+ this._onTriggerStay = function(obj1, obj2) {
26493
+ var physicalObjectsMap = Engine._physicalObjectsMap;
26494
+ var shape1 = physicalObjectsMap[obj1];
26495
+ var shape2 = physicalObjectsMap[obj2];
26496
+ shape1.collider.entity._scripts.forEach(function(element) {
26497
+ element.onTriggerStay(shape2);
26498
+ }, function(element, index) {
26499
+ element._entityScriptsIndex = index;
26500
+ });
26501
+ shape2.collider.entity._scripts.forEach(function(element) {
26502
+ element.onTriggerStay(shape1);
26503
+ }, function(element, index) {
26504
+ element._entityScriptsIndex = index;
26505
+ });
26506
+ };
26507
+ this._scene = scene;
26508
+ this._setGravity = this._setGravity.bind(this);
26509
+ //@ts-ignore
26510
+ this._gravity._onValueChanged = this._setGravity;
26511
+ var engine = scene.engine;
26512
+ if (engine._physicsInitialized) {
26513
+ this._nativePhysicsScene = Engine._nativePhysics.createPhysicsScene(engine._nativePhysicsManager, this._onContactEnter, this._onContactExit, this._onContactStay, this._onTriggerEnter, this._onTriggerExit, this._onTriggerStay);
26514
+ }
26515
+ }
26516
+ var _proto = PhysicsScene.prototype;
26517
+ _proto.raycast = function raycast(ray, distanceOrResult, layerMaskOrResult, outHitResult) {
26518
+ var hitResult;
26519
+ var distance = Number.MAX_VALUE;
26520
+ if (typeof distanceOrResult === "number") {
26521
+ distance = distanceOrResult;
26522
+ } else if (distanceOrResult != undefined) {
26523
+ hitResult = distanceOrResult;
26524
+ }
26525
+ var layerMask = Layer.Everything;
26526
+ if (typeof layerMaskOrResult === "number") {
26527
+ layerMask = layerMaskOrResult;
26528
+ } else if (layerMaskOrResult != undefined) {
26529
+ hitResult = layerMaskOrResult;
26530
+ }
26531
+ if (outHitResult) {
26532
+ hitResult = outHitResult;
26533
+ }
26534
+ var onRaycast = function onRaycast(obj) {
26535
+ var shape = Engine._physicalObjectsMap[obj];
26536
+ if (!shape) {
26537
+ return false;
26538
+ }
26539
+ return shape.collider.entity.layer & layerMask && shape.isSceneQuery;
26540
+ };
26541
+ var outIDX;
26542
+ var outDistance;
26543
+ var outPosition;
26544
+ var outNormal;
26545
+ if (hitResult != undefined) {
26546
+ var result = this._nativePhysicsScene.raycast(ray, distance, onRaycast, function(idx, distance, position, normal) {
26547
+ outIDX = idx;
26548
+ outDistance = distance;
26549
+ outPosition = position;
26550
+ outNormal = normal;
26551
+ });
26552
+ if (result) {
26553
+ var hitShape = Engine._physicalObjectsMap[outIDX];
26554
+ hitResult.entity = hitShape._collider.entity;
26555
+ hitResult.shape = hitShape;
26556
+ hitResult.distance = outDistance;
26557
+ hitResult.point.copyFrom(outPosition);
26558
+ hitResult.normal.copyFrom(outNormal);
26559
+ return true;
26560
+ } else {
26561
+ hitResult.entity = null;
26562
+ hitResult.shape = null;
26563
+ hitResult.distance = 0;
26564
+ hitResult.point.set(0, 0, 0);
26565
+ hitResult.normal.set(0, 0, 0);
26566
+ return false;
26567
+ }
26568
+ } else {
26569
+ return this._nativePhysicsScene.raycast(ray, distance, onRaycast);
26570
+ }
26571
+ };
26572
+ /**
26573
+ * Call on every frame to update pose of objects.
26574
+ * @internal
26575
+ */ _proto._update = function _update(deltaTime) {
26576
+ var _this = this, fixedTimeStep = _this._fixedTimeStep, nativePhysicsManager = _this._nativePhysicsScene;
26577
+ var componentsManager = this._scene._componentsManager;
26578
+ var simulateTime = this._restTime + deltaTime;
26579
+ var step = Math.floor(simulateTime / fixedTimeStep);
26580
+ this._restTime = simulateTime - step * fixedTimeStep;
26581
+ for(var i = 0; i < step; i++){
26582
+ componentsManager.callScriptOnPhysicsUpdate();
26583
+ this._callColliderOnUpdate();
26584
+ nativePhysicsManager.update(fixedTimeStep);
26585
+ this._callColliderOnLateUpdate();
26586
+ }
26587
+ };
26588
+ /**
26589
+ * Add collider into the manager.
26590
+ * @param collider - StaticCollider or DynamicCollider.
26591
+ * @internal
26592
+ */ _proto._addCollider = function _addCollider(collider) {
26593
+ if (collider._index === -1) {
26594
+ collider._index = this._colliders.length;
26595
+ this._colliders.add(collider);
26596
+ }
26597
+ this._nativePhysicsScene.addCollider(collider._nativeCollider);
26598
+ };
26599
+ /**
26600
+ * Add character controller into the manager.
26601
+ * @param controller - Character Controller.
26602
+ * @internal
26603
+ */ _proto._addCharacterController = function _addCharacterController(controller) {
26604
+ if (controller._index === -1) {
26605
+ controller._index = this._colliders.length;
26606
+ this._colliders.add(controller);
26607
+ }
26608
+ this._nativePhysicsScene.addCharacterController(controller._nativeCollider);
26609
+ };
26610
+ /**
26611
+ * Remove collider.
26612
+ * @param collider - StaticCollider or DynamicCollider.
26613
+ * @internal
26614
+ */ _proto._removeCollider = function _removeCollider(collider) {
26615
+ var replaced = this._colliders.deleteByIndex(collider._index);
26616
+ replaced && (replaced._index = collider._index);
26617
+ collider._index = -1;
26618
+ this._nativePhysicsScene.removeCollider(collider._nativeCollider);
26619
+ };
26620
+ /**
26621
+ * Remove collider.
26622
+ * @param controller - Character Controller.
26623
+ * @internal
26624
+ */ _proto._removeCharacterController = function _removeCharacterController(controller) {
26625
+ var replaced = this._colliders.deleteByIndex(controller._index);
26626
+ replaced && (replaced._index = controller._index);
26627
+ controller._index = -1;
26628
+ this._nativePhysicsScene.removeCharacterController(controller._nativeCollider);
26629
+ };
26630
+ /**
26631
+ * @internal
26632
+ */ _proto._callColliderOnUpdate = function _callColliderOnUpdate() {
26633
+ var elements = this._colliders._elements;
26634
+ for(var i = this._colliders.length - 1; i >= 0; --i){
26635
+ elements[i]._onUpdate();
26636
+ }
26637
+ };
26638
+ /**
26639
+ * @internal
26640
+ */ _proto._callColliderOnLateUpdate = function _callColliderOnLateUpdate() {
26641
+ var elements = this._colliders._elements;
26642
+ for(var i = this._colliders.length - 1; i >= 0; --i){
26643
+ elements[i]._onLateUpdate();
26644
+ }
26645
+ };
26646
+ /**
26647
+ * @internal
26648
+ */ _proto._gc = function _gc() {
26649
+ this._colliders.garbageCollection();
26650
+ };
26651
+ /**
26652
+ * @internal
26653
+ */ _proto._destroy = function _destroy() {
26654
+ var _this__nativePhysicsScene;
26655
+ (_this__nativePhysicsScene = this._nativePhysicsScene) == null ? void 0 : _this__nativePhysicsScene.destroy();
26656
+ };
26657
+ _proto._setGravity = function _setGravity() {
26658
+ this._nativePhysicsScene.setGravity(this._gravity);
26659
+ };
26660
+ _create_class$2(PhysicsScene, [
26661
+ {
26662
+ key: "gravity",
26663
+ get: /**
26664
+ * The gravity of physics scene.
26665
+ */ function get() {
26666
+ return this._gravity;
26667
+ },
26668
+ set: function set(value) {
26669
+ var gravity = this._gravity;
26670
+ if (gravity !== value) {
26671
+ gravity.copyFrom(value);
26672
+ }
26673
+ }
26674
+ },
26675
+ {
26676
+ key: "fixedTimeStep",
26677
+ get: /**
26678
+ * The fixed time step in seconds at which physics are performed.
26679
+ */ function get() {
26680
+ return this._fixedTimeStep;
26681
+ },
26682
+ set: function set(value) {
26683
+ this._fixedTimeStep = Math.max(value, MathUtil.zeroTolerance);
26684
+ }
26685
+ }
26686
+ ]);
26687
+ return PhysicsScene;
26688
+ }();
26689
+ PhysicsScene._collision = new Collision();
26672
26690
  /**
26673
26691
  * A static collider component that will not move.
26674
26692
  * @remarks Mostly used for object which always stays at the same place and never moves around.
@@ -26678,7 +26696,7 @@
26678
26696
  var _this;
26679
26697
  _this = Collider.call(this, entity) || this;
26680
26698
  var transform = _this.entity.transform;
26681
- _this._nativeCollider = PhysicsScene._nativePhysics.createStaticCollider(transform.worldPosition, transform.worldRotationQuaternion);
26699
+ _this._nativeCollider = Engine._nativePhysics.createStaticCollider(transform.worldPosition, transform.worldRotationQuaternion);
26682
26700
  return _this;
26683
26701
  }
26684
26702
  return StaticCollider;
@@ -27030,7 +27048,7 @@
27030
27048
  _proto._createJoint = function _createJoint() {
27031
27049
  var colliderInfo = this._colliderInfo;
27032
27050
  colliderInfo.collider = this.entity.getComponent(exports.Collider);
27033
- this._nativeJoint = PhysicsScene._nativePhysics.createFixedJoint(colliderInfo.collider._nativeCollider);
27051
+ this._nativeJoint = Engine._nativePhysics.createFixedJoint(colliderInfo.collider._nativeCollider);
27034
27052
  };
27035
27053
  return FixedJoint;
27036
27054
  }(exports.Joint);
@@ -27070,7 +27088,7 @@
27070
27088
  _proto._createJoint = function _createJoint() {
27071
27089
  var colliderInfo = this._colliderInfo;
27072
27090
  colliderInfo.collider = this.entity.getComponent(exports.Collider);
27073
- this._nativeJoint = PhysicsScene._nativePhysics.createHingeJoint(colliderInfo.collider._nativeCollider);
27091
+ this._nativeJoint = Engine._nativePhysics.createHingeJoint(colliderInfo.collider._nativeCollider);
27074
27092
  };
27075
27093
  _proto._syncNative = function _syncNative() {
27076
27094
  Joint.prototype._syncNative.call(this);
@@ -27264,7 +27282,7 @@
27264
27282
  _proto._createJoint = function _createJoint() {
27265
27283
  var colliderInfo = this._colliderInfo;
27266
27284
  colliderInfo.collider = this.entity.getComponent(exports.Collider);
27267
- this._nativeJoint = PhysicsScene._nativePhysics.createSpringJoint(colliderInfo.collider._nativeCollider);
27285
+ this._nativeJoint = Engine._nativePhysics.createSpringJoint(colliderInfo.collider._nativeCollider);
27268
27286
  };
27269
27287
  _proto._syncNative = function _syncNative() {
27270
27288
  Joint.prototype._syncNative.call(this);
@@ -27720,7 +27738,7 @@
27720
27738
  function BoxColliderShape() {
27721
27739
  var _this;
27722
27740
  _this = ColliderShape.call(this) || this, _this._size = new Vector3(1, 1, 1);
27723
- _this._nativeShape = PhysicsScene._nativePhysics.createBoxColliderShape(_this._id, _this._size, _this._material._nativeMaterial);
27741
+ _this._nativeShape = Engine._nativePhysics.createBoxColliderShape(_this._id, _this._size, _this._material._nativeMaterial);
27724
27742
  //@ts-ignore
27725
27743
  _this._size._onValueChanged = _this._setSize.bind(_this);
27726
27744
  return _this;
@@ -27763,7 +27781,7 @@
27763
27781
  function SphereColliderShape() {
27764
27782
  var _this;
27765
27783
  _this = ColliderShape.call(this) || this, _this._radius = 1;
27766
- _this._nativeShape = PhysicsScene._nativePhysics.createSphereColliderShape(_this._id, _this._radius, _this._material._nativeMaterial);
27784
+ _this._nativeShape = Engine._nativePhysics.createSphereColliderShape(_this._id, _this._radius, _this._material._nativeMaterial);
27767
27785
  return _this;
27768
27786
  }
27769
27787
  var _proto = SphereColliderShape.prototype;
@@ -27796,7 +27814,7 @@
27796
27814
  function PlaneColliderShape() {
27797
27815
  var _this;
27798
27816
  _this = ColliderShape.call(this) || this;
27799
- _this._nativeShape = PhysicsScene._nativePhysics.createPlaneColliderShape(_this._id, _this._material._nativeMaterial);
27817
+ _this._nativeShape = Engine._nativePhysics.createPlaneColliderShape(_this._id, _this._material._nativeMaterial);
27800
27818
  return _this;
27801
27819
  }
27802
27820
  var _proto = PlaneColliderShape.prototype;
@@ -27813,7 +27831,7 @@
27813
27831
  function CapsuleColliderShape() {
27814
27832
  var _this;
27815
27833
  _this = ColliderShape.call(this) || this, _this._radius = 1, _this._height = 2, _this._upAxis = ColliderShapeUpAxis.Y;
27816
- _this._nativeShape = PhysicsScene._nativePhysics.createCapsuleColliderShape(_this._id, _this._radius, _this._height, _this._material._nativeMaterial);
27834
+ _this._nativeShape = Engine._nativePhysics.createCapsuleColliderShape(_this._id, _this._radius, _this._height, _this._material._nativeMaterial);
27817
27835
  return _this;
27818
27836
  }
27819
27837
  var _proto = CapsuleColliderShape.prototype;
@@ -28879,7 +28897,7 @@
28879
28897
  }();
28880
28898
  var fragBlurH = "#define GLSLIFY 1\n#include <PostCommon>\n\nvarying vec2 v_uv;\nuniform sampler2D renderer_BlitTexture;\nuniform vec4 renderer_texelSize; // x: 1/width, y: 1/height, z: width, w: height\n\nvoid main(){\n\tvec2 texelSize = renderer_texelSize.xy * 2.0;\n\n // 9-tap gaussian blur on the downsampled source\n mediump vec4 c0 = sampleTexture(renderer_BlitTexture, v_uv - vec2(texelSize.x * 4.0, 0.0));\n mediump vec4 c1 = sampleTexture(renderer_BlitTexture, v_uv - vec2(texelSize.x * 3.0, 0.0));\n mediump vec4 c2 = sampleTexture(renderer_BlitTexture, v_uv - vec2(texelSize.x * 2.0, 0.0));\n mediump vec4 c3 = sampleTexture(renderer_BlitTexture, v_uv - vec2(texelSize.x * 1.0, 0.0));\n mediump vec4 c4 = sampleTexture(renderer_BlitTexture, v_uv);\n mediump vec4 c5 = sampleTexture(renderer_BlitTexture, v_uv + vec2(texelSize.x * 1.0, 0.0));\n mediump vec4 c6 = sampleTexture(renderer_BlitTexture, v_uv + vec2(texelSize.x * 2.0, 0.0));\n mediump vec4 c7 = sampleTexture(renderer_BlitTexture, v_uv + vec2(texelSize.x * 3.0, 0.0));\n mediump vec4 c8 = sampleTexture(renderer_BlitTexture, v_uv + vec2(texelSize.x * 4.0, 0.0));\n\n gl_FragColor = c0 * 0.01621622 + c1 * 0.05405405 + c2 * 0.12162162 + c3 * 0.19459459\n + c4 * 0.22702703\n + c5 * 0.19459459 + c6 * 0.12162162 + c7 * 0.05405405 + c8 * 0.01621622;\n\n #ifndef ENGINE_IS_COLORSPACE_GAMMA\n gl_FragColor = linearToGamma(gl_FragColor);\n #endif\n}"; // eslint-disable-line
28881
28899
  var fragBlurV = "#define GLSLIFY 1\n#include <PostCommon>\n\nvarying vec2 v_uv;\nuniform sampler2D renderer_BlitTexture;\nuniform vec4 renderer_texelSize; // x: 1/width, y: 1/height, z: width, w: height\n\nvoid main(){\n vec2 texelSize = renderer_texelSize.xy;\n\n // Optimized bilinear 5-tap gaussian on the same-sized source (9-tap equivalent)\n mediump vec4 c0 = sampleTexture(renderer_BlitTexture, v_uv - vec2(0.0, texelSize.y * 3.23076923));\n mediump vec4 c1 = sampleTexture(renderer_BlitTexture, v_uv - vec2(0.0, texelSize.y * 1.38461538));\n mediump vec4 c2 = sampleTexture(renderer_BlitTexture, v_uv);\n mediump vec4 c3 = sampleTexture(renderer_BlitTexture, v_uv + vec2(0.0, texelSize.y * 1.38461538));\n mediump vec4 c4 = sampleTexture(renderer_BlitTexture, v_uv + vec2(0.0, texelSize.y * 3.23076923));\n\n gl_FragColor = c0 * 0.07027027 + c1 * 0.31621622\n + c2 * 0.22702703\n + c3 * 0.31621622 + c4 * 0.07027027;\n\n #ifndef ENGINE_IS_COLORSPACE_GAMMA\n gl_FragColor = linearToGamma(gl_FragColor);\n #endif\n}"; // eslint-disable-line
28882
- var fragPrefilter = "#define GLSLIFY 1\n#include <PostCommon>\n\nvarying vec2 v_uv;\nuniform sampler2D renderer_BlitTexture;\nuniform vec4 material_BloomParams; // x: threshold (linear), y: threshold knee, z: scatter\nuniform vec4 renderer_texelSize; // x: 1/width, y: 1/height, z: width, w: height\n\nvoid main(){\n\t#ifdef BLOOM_HQ\n vec2 texelSize = renderer_texelSize.xy;\n mediump vec4 A = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-1.0, -1.0));\n mediump vec4 B = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(0.0, -1.0));\n mediump vec4 C = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(1.0, -1.0));\n mediump vec4 D = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-0.5, -0.5));\n mediump vec4 E = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(0.5, -0.5));\n mediump vec4 F = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-1.0, 0.0));\n mediump vec4 G = sampleTexture(renderer_BlitTexture, v_uv);\n mediump vec4 H = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(1.0, 0.0));\n mediump vec4 I = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-0.5, 0.5));\n mediump vec4 J = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(0.5, 0.5));\n mediump vec4 K = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-1.0, 1.0));\n mediump vec4 L = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(0.0, 1.0));\n mediump vec4 M = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(1.0, 1.0));\n\n mediump vec2 scale = vec2(0.5, 0.125);\n mediump vec2 div = (1.0 / 4.0) * scale;\n\n mediump vec4 samplerColor = (D + E + I + J) * div.x;\n samplerColor += (A + B + G + F) * div.y;\n samplerColor += (B + C + H + G) * div.y;\n samplerColor += (F + G + L + K) * div.y;\n samplerColor += (G + H + M + L) * div.y;\n #else\n mediump vec4 samplerColor = sampleTexture(renderer_BlitTexture, v_uv);\n #endif\n\n mediump vec3 color = samplerColor.rgb;\n\n // User controlled clamp to limit crazy high broken spec\n color = min(color, HALF_MAX);\n\n // Thresholding\n mediump float brightness = max3(color);\n float threshold = material_BloomParams.x;\n float thresholdKnee = material_BloomParams.y;\n mediump float softness = clamp(brightness - threshold + thresholdKnee, 0.0, 2.0 * thresholdKnee);\n softness = (softness * softness) / (4.0 * thresholdKnee + 1e-4);\n mediump float multiplier = max(brightness - threshold, softness) / max(brightness, 1e-4);\n color *= multiplier;\n\n // Clamp colors to positive once in prefilter. Encode can have a sqrt, and sqrt(-x) == NaN. Up/Downsample passes would then spread the NaN.\n color = max(color, 0.0);\n\n gl_FragColor = vec4(color, samplerColor.a);\n \n #ifndef ENGINE_IS_COLORSPACE_GAMMA\n gl_FragColor = linearToGamma(gl_FragColor);\n #endif\n}"; // eslint-disable-line
28900
+ var fragPrefilter = "#define GLSLIFY 1\n#include <PostCommon>\n\nvarying vec2 v_uv;\nuniform sampler2D renderer_BlitTexture;\nuniform vec4 material_BloomParams; // x: threshold (linear), y: threshold knee, z: scatter\nuniform vec4 renderer_texelSize; // x: 1/width, y: 1/height, z: width, w: height\n\nvoid main(){\n\t#ifdef BLOOM_HQ\n vec2 texelSize = renderer_texelSize.xy;\n mediump vec4 A = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-1.0, -1.0));\n mediump vec4 B = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(0.0, -1.0));\n mediump vec4 C = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(1.0, -1.0));\n mediump vec4 D = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-0.5, -0.5));\n mediump vec4 E = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(0.5, -0.5));\n mediump vec4 F = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-1.0, 0.0));\n mediump vec4 G = sampleTexture(renderer_BlitTexture, v_uv);\n mediump vec4 H = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(1.0, 0.0));\n mediump vec4 I = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-0.5, 0.5));\n mediump vec4 J = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(0.5, 0.5));\n mediump vec4 K = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(-1.0, 1.0));\n mediump vec4 L = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(0.0, 1.0));\n mediump vec4 M = sampleTexture(renderer_BlitTexture, v_uv + texelSize * vec2(1.0, 1.0));\n\n mediump vec2 scale = vec2(0.5, 0.125);\n mediump vec2 div = (1.0 / 4.0) * scale;\n\n mediump vec4 samplerColor = (D + E + I + J) * div.x;\n samplerColor += (A + B + G + F) * div.y;\n samplerColor += (B + C + H + G) * div.y;\n samplerColor += (F + G + L + K) * div.y;\n samplerColor += (G + H + M + L) * div.y;\n #else\n mediump vec4 samplerColor = sampleTexture(renderer_BlitTexture, v_uv);\n #endif\n\n mediump vec3 color = samplerColor.rgb;\n\n // User controlled clamp to limit crazy high broken spec\n color = min(color, HALF_MAX);\n\n // Thresholding\n mediump float brightness = max3(color);\n float threshold = material_BloomParams.x;\n float thresholdKnee = material_BloomParams.y;\n mediump float softness = clamp(brightness - threshold + thresholdKnee, 0.0, 2.0 * thresholdKnee);\n softness = (softness * softness) / (4.0 * thresholdKnee + 1e-4);\n mediump float multiplier = max(brightness - threshold, softness) / max(brightness, 1e-4);\n color *= multiplier;\n\n // Clamp colors to positive once in prefilter. Encode can have a sqrt, and sqrt(-x) == NaN. Up/Downsample passes would then spread the NaN.\n color = max(color, 0.0);\n\n // Bloom is addtive blend mode, we should set alpha 0 to avoid browser background color dark when canvas alpha and premultiplyAlpha is true\n gl_FragColor = vec4(color, 0.0);\n \n #ifndef ENGINE_IS_COLORSPACE_GAMMA\n gl_FragColor = linearToGamma(gl_FragColor);\n #endif\n}\n"; // eslint-disable-line
28883
28901
  var fragUpsample = "#define GLSLIFY 1\n#include <PostCommon>\n#include <Filtering>\n\nvarying vec2 v_uv;\nuniform sampler2D renderer_BlitTexture;\nuniform sampler2D material_lowMipTexture;\nuniform vec4 material_BloomParams; // x: threshold (linear), y: threshold knee, z: scatter\nuniform vec4 material_lowMipTexelSize; // x: 1/width, y: 1/height, z: width, w: height\n\nvoid main(){\n mediump vec4 highMip = sampleTexture(renderer_BlitTexture, v_uv);\n\n #ifdef BLOOM_HQ\n mediump vec4 lowMip = sampleTexture2DBicubic(material_lowMipTexture, v_uv, material_lowMipTexelSize);\n #else\n mediump vec4 lowMip = sampleTexture(material_lowMipTexture, v_uv);\n #endif\n \n gl_FragColor = mix(highMip, lowMip, material_BloomParams.z);\n \n #ifndef ENGINE_IS_COLORSPACE_GAMMA\n gl_FragColor = linearToGamma(gl_FragColor);\n #endif\n}"; // eslint-disable-line
28884
28902
  /**
28885
28903
  * This controls the size of the bloom texture.
@@ -29821,7 +29839,10 @@
29821
29839
  var initializePromises = new Array();
29822
29840
  if (physics) {
29823
29841
  initializePromises.push(physics.initialize().then(function() {
29824
- PhysicsScene._nativePhysics = physics;
29842
+ if (Engine._nativePhysics) {
29843
+ console.warn("A physics engine has already been configured. All physics operations will now be handled by the newly specified physics engine.");
29844
+ }
29845
+ Engine._nativePhysics = physics;
29825
29846
  _this._nativePhysicsManager = physics.createPhysicsManager();
29826
29847
  _this._physicsInitialized = true;
29827
29848
  return _this;
@@ -31877,6 +31898,7 @@
31877
31898
  this._maskManager.destroy();
31878
31899
  var allCreatedScenes = sceneManager._allCreatedScenes;
31879
31900
  allCreatedScenes.splice(allCreatedScenes.indexOf(this), 1);
31901
+ this.physics._destroy();
31880
31902
  };
31881
31903
  _proto._computeLinearFogParams = function _computeLinearFogParams(fogStart, fogEnd) {
31882
31904
  var fogRange = fogEnd - fogStart;
@@ -40448,10 +40470,11 @@
40448
40470
  function Polyfill() {}
40449
40471
  Polyfill.registerPolyfill = function registerPolyfill() {
40450
40472
  Polyfill._registerMatchAll();
40473
+ Polyfill._registerAudioContext();
40451
40474
  };
40452
40475
  Polyfill._registerMatchAll = function _registerMatchAll() {
40453
40476
  if (!String.prototype.matchAll) {
40454
- Logger.info("polyfill String.prototype.matchAll");
40477
+ Logger.info("Polyfill String.prototype.matchAll");
40455
40478
  String.prototype.matchAll = function(pattern) {
40456
40479
  var flags = pattern.flags;
40457
40480
  var globalFlagIdx = flags.indexOf("g");
@@ -40505,6 +40528,26 @@
40505
40528
  };
40506
40529
  }
40507
40530
  };
40531
+ Polyfill._registerAudioContext = function _registerAudioContext() {
40532
+ // IOS 12 and the following system do not support AudioContext, need to switch to webkitAudioContext
40533
+ if (!window.AudioContext && window.webkitAudioContext) {
40534
+ Logger.info("Polyfill window.AudioContext");
40535
+ window.AudioContext = window.webkitAudioContext;
40536
+ var originalDecodeAudioData = AudioContext.prototype.decodeAudioData;
40537
+ AudioContext.prototype.decodeAudioData = function(arrayBuffer, successCallback, errorCallback) {
40538
+ var _this = this;
40539
+ return new Promise(function(resolve, reject) {
40540
+ originalDecodeAudioData.call(_this, arrayBuffer, function(buffer) {
40541
+ successCallback == null ? void 0 : successCallback(buffer);
40542
+ resolve(buffer);
40543
+ }, function(error) {
40544
+ errorCallback == null ? void 0 : errorCallback(error);
40545
+ reject(error);
40546
+ });
40547
+ });
40548
+ };
40549
+ }
40550
+ };
40508
40551
  return Polyfill;
40509
40552
  }();
40510
40553
  Polyfill.registerPolyfill();
@@ -43249,11 +43292,215 @@
43249
43292
  ]);
43250
43293
  return FileHeader;
43251
43294
  }();
43295
+ var InterpolableValueType = /*#__PURE__*/ function(InterpolableValueType) {
43296
+ InterpolableValueType[InterpolableValueType["Float"] = 0] = "Float";
43297
+ InterpolableValueType[InterpolableValueType["FloatArray"] = 1] = "FloatArray";
43298
+ InterpolableValueType[InterpolableValueType["Vector2"] = 2] = "Vector2";
43299
+ InterpolableValueType[InterpolableValueType["Vector3"] = 3] = "Vector3";
43300
+ InterpolableValueType[InterpolableValueType["Vector4"] = 4] = "Vector4";
43301
+ InterpolableValueType[InterpolableValueType["Quaternion"] = 5] = "Quaternion";
43302
+ InterpolableValueType[InterpolableValueType["Color"] = 6] = "Color";
43303
+ InterpolableValueType[InterpolableValueType["Array"] = 7] = "Array";
43304
+ InterpolableValueType[InterpolableValueType["Boolean"] = 8] = "Boolean";
43305
+ InterpolableValueType[InterpolableValueType["Rect"] = 9] = "Rect";
43306
+ InterpolableValueType[InterpolableValueType["ReferResource"] = 10] = "ReferResource";
43307
+ return InterpolableValueType;
43308
+ }({});
43309
+ exports.AnimationClipDecoder = /*#__PURE__*/ function() {
43310
+ function AnimationClipDecoder() {}
43311
+ AnimationClipDecoder.decode = function decode(engine, bufferReader) {
43312
+ return new AssetPromise(function(resolve) {
43313
+ var name = bufferReader.nextStr();
43314
+ var clip = new AnimationClip(name);
43315
+ var eventsLen = bufferReader.nextUint16();
43316
+ for(var i = 0; i < eventsLen; ++i){
43317
+ var event = new AnimationEvent();
43318
+ event.time = bufferReader.nextFloat32();
43319
+ event.functionName = bufferReader.nextStr();
43320
+ event.parameter = JSON.parse(bufferReader.nextStr()).val;
43321
+ clip.addEvent(event);
43322
+ }
43323
+ var curveBindingsLen = bufferReader.nextUint16();
43324
+ for(var i1 = 0; i1 < curveBindingsLen; ++i1){
43325
+ var relativePath = bufferReader.nextStr();
43326
+ var componentStr = bufferReader.nextStr();
43327
+ var componentType = Loader.getClass(componentStr);
43328
+ var property = bufferReader.nextStr();
43329
+ var getProperty = bufferReader.nextStr();
43330
+ var curve = void 0;
43331
+ var interpolation = bufferReader.nextUint8();
43332
+ var keysLen = bufferReader.nextUint16();
43333
+ var curveType = bufferReader.nextStr();
43334
+ switch(curveType){
43335
+ case "AnimationFloatCurve":
43336
+ {
43337
+ curve = new exports.AnimationFloatCurve();
43338
+ curve.interpolation = interpolation;
43339
+ for(var j = 0; j < keysLen; ++j){
43340
+ var keyframe = new Keyframe();
43341
+ keyframe.time = bufferReader.nextFloat32();
43342
+ keyframe.value = bufferReader.nextFloat32();
43343
+ keyframe.inTangent = bufferReader.nextFloat32();
43344
+ keyframe.outTangent = bufferReader.nextFloat32();
43345
+ curve.addKey(keyframe);
43346
+ }
43347
+ break;
43348
+ }
43349
+ case "AnimationArrayCurve":
43350
+ {
43351
+ curve = new exports.AnimationArrayCurve();
43352
+ curve.interpolation = interpolation;
43353
+ for(var j1 = 0; j1 < keysLen; ++j1){
43354
+ var keyframe1 = new Keyframe();
43355
+ keyframe1.time = bufferReader.nextFloat32();
43356
+ var len = bufferReader.nextUint16();
43357
+ keyframe1.value = Array.from(bufferReader.nextFloat32Array(len));
43358
+ keyframe1.inTangent = Array.from(bufferReader.nextFloat32Array(len));
43359
+ keyframe1.outTangent = Array.from(bufferReader.nextFloat32Array(len));
43360
+ curve.addKey(keyframe1);
43361
+ }
43362
+ break;
43363
+ }
43364
+ case "AnimationFloatArrayCurve":
43365
+ {
43366
+ curve = new exports.AnimationFloatArrayCurve();
43367
+ curve.interpolation = interpolation;
43368
+ for(var j2 = 0; j2 < keysLen; ++j2){
43369
+ var keyframe2 = new Keyframe();
43370
+ keyframe2.time = bufferReader.nextFloat32();
43371
+ var len1 = bufferReader.nextUint16();
43372
+ keyframe2.value = bufferReader.nextFloat32Array(len1);
43373
+ keyframe2.inTangent = Array.from(bufferReader.nextFloat32Array(len1));
43374
+ keyframe2.outTangent = Array.from(bufferReader.nextFloat32Array(len1));
43375
+ curve.addKey(keyframe2);
43376
+ }
43377
+ break;
43378
+ }
43379
+ case "AnimationVector2Curve":
43380
+ {
43381
+ curve = new exports.AnimationVector2Curve();
43382
+ curve.interpolation = interpolation;
43383
+ for(var j3 = 0; j3 < keysLen; ++j3){
43384
+ var keyframe3 = new Keyframe();
43385
+ keyframe3.time = bufferReader.nextFloat32();
43386
+ keyframe3.value = new Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
43387
+ keyframe3.inTangent = new Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
43388
+ keyframe3.outTangent = new Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
43389
+ curve.addKey(keyframe3);
43390
+ }
43391
+ break;
43392
+ }
43393
+ case "AnimationVector3Curve":
43394
+ {
43395
+ curve = new exports.AnimationVector3Curve();
43396
+ curve.interpolation = interpolation;
43397
+ for(var j4 = 0; j4 < keysLen; ++j4){
43398
+ var keyframe4 = new Keyframe();
43399
+ keyframe4.time = bufferReader.nextFloat32();
43400
+ keyframe4.value = new Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43401
+ keyframe4.inTangent = new Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43402
+ keyframe4.outTangent = new Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43403
+ curve.addKey(keyframe4);
43404
+ }
43405
+ break;
43406
+ }
43407
+ case "AnimationVector4Curve":
43408
+ {
43409
+ curve = new exports.AnimationVector4Curve();
43410
+ curve.interpolation = interpolation;
43411
+ var keyframe5 = new Keyframe();
43412
+ keyframe5.time = bufferReader.nextFloat32();
43413
+ keyframe5.value = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43414
+ keyframe5.inTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43415
+ keyframe5.outTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43416
+ curve.addKey(keyframe5);
43417
+ break;
43418
+ }
43419
+ case "AnimationColorCurve":
43420
+ {
43421
+ curve = new exports.AnimationColorCurve();
43422
+ curve.interpolation = interpolation;
43423
+ for(var j5 = 0; j5 < keysLen; ++j5){
43424
+ var keyframe6 = new Keyframe();
43425
+ keyframe6.time = bufferReader.nextFloat32();
43426
+ keyframe6.value = new Color(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43427
+ keyframe6.inTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43428
+ keyframe6.outTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43429
+ curve.addKey(keyframe6);
43430
+ }
43431
+ break;
43432
+ }
43433
+ case "AnimationQuaternionCurve":
43434
+ {
43435
+ curve = new exports.AnimationQuaternionCurve();
43436
+ curve.interpolation = interpolation;
43437
+ for(var j6 = 0; j6 < keysLen; ++j6){
43438
+ var keyframe7 = new Keyframe();
43439
+ keyframe7.time = bufferReader.nextFloat32();
43440
+ keyframe7.value = new Quaternion(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43441
+ keyframe7.inTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43442
+ keyframe7.outTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43443
+ curve.addKey(keyframe7);
43444
+ }
43445
+ break;
43446
+ }
43447
+ case "AnimationRefCurve":
43448
+ {
43449
+ curve = new exports.AnimationRefCurve();
43450
+ curve.interpolation = interpolation;
43451
+ for(var j7 = 0; j7 < keysLen; ++j7){
43452
+ var keyframe8 = new Keyframe();
43453
+ keyframe8.time = bufferReader.nextFloat32();
43454
+ var str = bufferReader.nextStr();
43455
+ if (str) {
43456
+ keyframe8.value = JSON.parse(str);
43457
+ } else {
43458
+ keyframe8.value = null;
43459
+ }
43460
+ curve.addKey(keyframe8);
43461
+ }
43462
+ break;
43463
+ }
43464
+ case "AnimationBoolCurve":
43465
+ {
43466
+ curve = new exports.AnimationBoolCurve();
43467
+ curve.interpolation = interpolation;
43468
+ for(var j8 = 0; j8 < keysLen; ++j8){
43469
+ var keyframe9 = new Keyframe();
43470
+ keyframe9.time = bufferReader.nextFloat32();
43471
+ keyframe9.value = bufferReader.nextUint8() === 1;
43472
+ curve.addKey(keyframe9);
43473
+ }
43474
+ break;
43475
+ }
43476
+ case "AnimationStringCurve":
43477
+ {
43478
+ curve = new exports.AnimationStringCurve();
43479
+ curve.interpolation = interpolation;
43480
+ for(var j9 = 0; j9 < keysLen; ++j9){
43481
+ var keyframe10 = new Keyframe();
43482
+ keyframe10.time = bufferReader.nextFloat32();
43483
+ keyframe10.value = bufferReader.nextStr();
43484
+ curve.addKey(keyframe10);
43485
+ }
43486
+ break;
43487
+ }
43488
+ }
43489
+ clip.addCurveBinding(relativePath, componentType, property, getProperty, curve);
43490
+ }
43491
+ resolve(clip);
43492
+ });
43493
+ };
43494
+ return AnimationClipDecoder;
43495
+ }();
43496
+ exports.AnimationClipDecoder = __decorate([
43497
+ decoder("AnimationClip")
43498
+ ], exports.AnimationClipDecoder);
43252
43499
  exports.MeshDecoder = /*#__PURE__*/ function() {
43253
43500
  function MeshDecoder() {}
43254
- MeshDecoder.decode = function decode(engine, bufferReader) {
43255
- return new Promise(function(resolve) {
43256
- var modelMesh = new ModelMesh(engine);
43501
+ MeshDecoder.decode = function decode(engine, bufferReader, restoredMesh) {
43502
+ return new AssetPromise(function(resolve) {
43503
+ var modelMesh = restoredMesh || new ModelMesh(engine);
43257
43504
  var jsonDataString = bufferReader.nextStr();
43258
43505
  var encodedMeshData = JSON.parse(jsonDataString);
43259
43506
  // @ts-ignore Vector3 is not compatible with {x: number, y: number, z: number}.
@@ -43382,80 +43629,6 @@
43382
43629
  }
43383
43630
  return array;
43384
43631
  }
43385
- exports.Texture2DDecoder = /*#__PURE__*/ function() {
43386
- function Texture2DDecoder() {}
43387
- Texture2DDecoder.decode = function decode(engine, bufferReader) {
43388
- return new Promise(function(resolve, reject) {
43389
- var objectId = bufferReader.nextStr();
43390
- var mipmap = !!bufferReader.nextUint8();
43391
- var filterMode = bufferReader.nextUint8();
43392
- var anisoLevel = bufferReader.nextUint8();
43393
- var wrapModeU = bufferReader.nextUint8();
43394
- var wrapModeV = bufferReader.nextUint8();
43395
- var format = bufferReader.nextUint8();
43396
- var width = bufferReader.nextUint16();
43397
- var height = bufferReader.nextUint16();
43398
- var isPixelBuffer = bufferReader.nextUint8();
43399
- var mipCount = bufferReader.nextUint8();
43400
- var imagesData = bufferReader.nextImagesData(mipCount);
43401
- var texture2D = new Texture2D(engine, width, height, format, mipmap);
43402
- texture2D.filterMode = filterMode;
43403
- texture2D.anisoLevel = anisoLevel;
43404
- texture2D.wrapModeU = wrapModeU;
43405
- texture2D.wrapModeV = wrapModeV;
43406
- if (isPixelBuffer) {
43407
- var pixelBuffer = imagesData[0];
43408
- texture2D.setPixelBuffer(pixelBuffer);
43409
- if (mipmap) {
43410
- texture2D.generateMipmaps();
43411
- for(var i = 1; i < mipCount; i++){
43412
- var pixelBuffer1 = imagesData[i];
43413
- texture2D.setPixelBuffer(pixelBuffer1, i);
43414
- }
43415
- }
43416
- // @ts-ignore
43417
- engine.resourceManager._objectPool[objectId] = texture2D;
43418
- resolve(texture2D);
43419
- } else {
43420
- var blob = new window.Blob([
43421
- imagesData[0]
43422
- ]);
43423
- var img = new Image();
43424
- img.onload = function() {
43425
- texture2D.setImageSource(img);
43426
- var completedCount = 0;
43427
- var onComplete = function onComplete() {
43428
- completedCount++;
43429
- if (completedCount >= mipCount) {
43430
- resolve(texture2D);
43431
- }
43432
- };
43433
- onComplete();
43434
- if (mipmap) {
43435
- var _loop = function _loop(i) {
43436
- var blob = new window.Blob([
43437
- imagesData[i]
43438
- ]);
43439
- var img = new Image();
43440
- img.onload = function() {
43441
- texture2D.setImageSource(img, i);
43442
- onComplete();
43443
- };
43444
- img.src = URL.createObjectURL(blob);
43445
- };
43446
- texture2D.generateMipmaps();
43447
- for(var i = 1; i < mipCount; i++)_loop(i);
43448
- }
43449
- };
43450
- img.src = URL.createObjectURL(blob);
43451
- }
43452
- });
43453
- };
43454
- return Texture2DDecoder;
43455
- }();
43456
- exports.Texture2DDecoder = __decorate([
43457
- decoder("Texture2D")
43458
- ], exports.Texture2DDecoder);
43459
43632
  function _is_native_reflect_construct() {
43460
43633
  // Since Reflect.construct can't be properly polyfilled, some
43461
43634
  // implementations (e.g. core-js@2) don't set the correct internal slots.
@@ -43734,226 +43907,126 @@
43734
43907
  return ReflectionParser;
43735
43908
  }();
43736
43909
  ReflectionParser.customParseComponentHandles = new Map();
43737
- var InterpolableValueType = /*#__PURE__*/ function(InterpolableValueType) {
43738
- InterpolableValueType[InterpolableValueType["Float"] = 0] = "Float";
43739
- InterpolableValueType[InterpolableValueType["FloatArray"] = 1] = "FloatArray";
43740
- InterpolableValueType[InterpolableValueType["Vector2"] = 2] = "Vector2";
43741
- InterpolableValueType[InterpolableValueType["Vector3"] = 3] = "Vector3";
43742
- InterpolableValueType[InterpolableValueType["Vector4"] = 4] = "Vector4";
43743
- InterpolableValueType[InterpolableValueType["Quaternion"] = 5] = "Quaternion";
43744
- InterpolableValueType[InterpolableValueType["Color"] = 6] = "Color";
43745
- InterpolableValueType[InterpolableValueType["Array"] = 7] = "Array";
43746
- InterpolableValueType[InterpolableValueType["Boolean"] = 8] = "Boolean";
43747
- InterpolableValueType[InterpolableValueType["Rect"] = 9] = "Rect";
43748
- InterpolableValueType[InterpolableValueType["ReferResource"] = 10] = "ReferResource";
43749
- return InterpolableValueType;
43750
- }({});
43751
- exports.AnimationClipDecoder = /*#__PURE__*/ function() {
43752
- function AnimationClipDecoder() {}
43753
- AnimationClipDecoder.decode = function decode(engine, bufferReader) {
43754
- return new Promise(function(resolve) {
43755
- var name = bufferReader.nextStr();
43756
- var clip = new AnimationClip(name);
43757
- var eventsLen = bufferReader.nextUint16();
43758
- for(var i = 0; i < eventsLen; ++i){
43759
- var event = new AnimationEvent();
43760
- event.time = bufferReader.nextFloat32();
43761
- event.functionName = bufferReader.nextStr();
43762
- event.parameter = JSON.parse(bufferReader.nextStr()).val;
43763
- clip.addEvent(event);
43764
- }
43765
- var curveBindingsLen = bufferReader.nextUint16();
43766
- for(var i1 = 0; i1 < curveBindingsLen; ++i1){
43767
- var relativePath = bufferReader.nextStr();
43768
- var componentStr = bufferReader.nextStr();
43769
- var componentType = Loader.getClass(componentStr);
43770
- var property = bufferReader.nextStr();
43771
- var getProperty = bufferReader.nextStr();
43772
- var curve = void 0;
43773
- var interpolation = bufferReader.nextUint8();
43774
- var keysLen = bufferReader.nextUint16();
43775
- var curveType = bufferReader.nextStr();
43776
- switch(curveType){
43777
- case "AnimationFloatCurve":
43778
- {
43779
- curve = new exports.AnimationFloatCurve();
43780
- curve.interpolation = interpolation;
43781
- for(var j = 0; j < keysLen; ++j){
43782
- var keyframe = new Keyframe();
43783
- keyframe.time = bufferReader.nextFloat32();
43784
- keyframe.value = bufferReader.nextFloat32();
43785
- keyframe.inTangent = bufferReader.nextFloat32();
43786
- keyframe.outTangent = bufferReader.nextFloat32();
43787
- curve.addKey(keyframe);
43788
- }
43789
- break;
43790
- }
43791
- case "AnimationArrayCurve":
43792
- {
43793
- curve = new exports.AnimationArrayCurve();
43794
- curve.interpolation = interpolation;
43795
- for(var j1 = 0; j1 < keysLen; ++j1){
43796
- var keyframe1 = new Keyframe();
43797
- keyframe1.time = bufferReader.nextFloat32();
43798
- var len = bufferReader.nextUint16();
43799
- keyframe1.value = Array.from(bufferReader.nextFloat32Array(len));
43800
- keyframe1.inTangent = Array.from(bufferReader.nextFloat32Array(len));
43801
- keyframe1.outTangent = Array.from(bufferReader.nextFloat32Array(len));
43802
- curve.addKey(keyframe1);
43803
- }
43804
- break;
43805
- }
43806
- case "AnimationFloatArrayCurve":
43807
- {
43808
- curve = new exports.AnimationFloatArrayCurve();
43809
- curve.interpolation = interpolation;
43810
- for(var j2 = 0; j2 < keysLen; ++j2){
43811
- var keyframe2 = new Keyframe();
43812
- keyframe2.time = bufferReader.nextFloat32();
43813
- var len1 = bufferReader.nextUint16();
43814
- keyframe2.value = bufferReader.nextFloat32Array(len1);
43815
- keyframe2.inTangent = Array.from(bufferReader.nextFloat32Array(len1));
43816
- keyframe2.outTangent = Array.from(bufferReader.nextFloat32Array(len1));
43817
- curve.addKey(keyframe2);
43818
- }
43819
- break;
43820
- }
43821
- case "AnimationVector2Curve":
43822
- {
43823
- curve = new exports.AnimationVector2Curve();
43824
- curve.interpolation = interpolation;
43825
- for(var j3 = 0; j3 < keysLen; ++j3){
43826
- var keyframe3 = new Keyframe();
43827
- keyframe3.time = bufferReader.nextFloat32();
43828
- keyframe3.value = new Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
43829
- keyframe3.inTangent = new Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
43830
- keyframe3.outTangent = new Vector2(bufferReader.nextFloat32(), bufferReader.nextFloat32());
43831
- curve.addKey(keyframe3);
43832
- }
43833
- break;
43834
- }
43835
- case "AnimationVector3Curve":
43836
- {
43837
- curve = new exports.AnimationVector3Curve();
43838
- curve.interpolation = interpolation;
43839
- for(var j4 = 0; j4 < keysLen; ++j4){
43840
- var keyframe4 = new Keyframe();
43841
- keyframe4.time = bufferReader.nextFloat32();
43842
- keyframe4.value = new Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43843
- keyframe4.inTangent = new Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43844
- keyframe4.outTangent = new Vector3(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43845
- curve.addKey(keyframe4);
43846
- }
43847
- break;
43848
- }
43849
- case "AnimationVector4Curve":
43850
- {
43851
- curve = new exports.AnimationVector4Curve();
43852
- curve.interpolation = interpolation;
43853
- var keyframe5 = new Keyframe();
43854
- keyframe5.time = bufferReader.nextFloat32();
43855
- keyframe5.value = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43856
- keyframe5.inTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43857
- keyframe5.outTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43858
- curve.addKey(keyframe5);
43859
- break;
43860
- }
43861
- case "AnimationColorCurve":
43862
- {
43863
- curve = new exports.AnimationColorCurve();
43864
- curve.interpolation = interpolation;
43865
- for(var j5 = 0; j5 < keysLen; ++j5){
43866
- var keyframe6 = new Keyframe();
43867
- keyframe6.time = bufferReader.nextFloat32();
43868
- keyframe6.value = new Color(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43869
- keyframe6.inTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43870
- keyframe6.outTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43871
- curve.addKey(keyframe6);
43872
- }
43873
- break;
43874
- }
43875
- case "AnimationQuaternionCurve":
43876
- {
43877
- curve = new exports.AnimationQuaternionCurve();
43878
- curve.interpolation = interpolation;
43879
- for(var j6 = 0; j6 < keysLen; ++j6){
43880
- var keyframe7 = new Keyframe();
43881
- keyframe7.time = bufferReader.nextFloat32();
43882
- keyframe7.value = new Quaternion(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43883
- keyframe7.inTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43884
- keyframe7.outTangent = new Vector4(bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32(), bufferReader.nextFloat32());
43885
- curve.addKey(keyframe7);
43886
- }
43887
- break;
43888
- }
43889
- case "AnimationRefCurve":
43890
- {
43891
- curve = new exports.AnimationRefCurve();
43892
- curve.interpolation = interpolation;
43893
- for(var j7 = 0; j7 < keysLen; ++j7){
43894
- var keyframe8 = new Keyframe();
43895
- keyframe8.time = bufferReader.nextFloat32();
43896
- var str = bufferReader.nextStr();
43897
- if (str) {
43898
- keyframe8.value = JSON.parse(str);
43899
- } else {
43900
- keyframe8.value = null;
43901
- }
43902
- curve.addKey(keyframe8);
43903
- }
43904
- break;
43905
- }
43906
- case "AnimationBoolCurve":
43907
- {
43908
- curve = new exports.AnimationBoolCurve();
43909
- curve.interpolation = interpolation;
43910
- for(var j8 = 0; j8 < keysLen; ++j8){
43911
- var keyframe9 = new Keyframe();
43912
- keyframe9.time = bufferReader.nextFloat32();
43913
- keyframe9.value = bufferReader.nextUint8() === 1;
43914
- curve.addKey(keyframe9);
43915
- }
43916
- break;
43917
- }
43918
- case "AnimationStringCurve":
43919
- {
43920
- curve = new exports.AnimationStringCurve();
43921
- curve.interpolation = interpolation;
43922
- for(var j9 = 0; j9 < keysLen; ++j9){
43923
- var keyframe10 = new Keyframe();
43924
- keyframe10.time = bufferReader.nextFloat32();
43925
- keyframe10.value = bufferReader.nextStr();
43926
- curve.addKey(keyframe10);
43927
- }
43928
- break;
43929
- }
43910
+ exports.Texture2DDecoder = /*#__PURE__*/ function() {
43911
+ function Texture2DDecoder() {}
43912
+ Texture2DDecoder.decode = function decode(engine, bufferReader, restoredTexture) {
43913
+ return new AssetPromise(function(resolve, reject) {
43914
+ var objectId = bufferReader.nextStr();
43915
+ var mipmap = !!bufferReader.nextUint8();
43916
+ var filterMode = bufferReader.nextUint8();
43917
+ var anisoLevel = bufferReader.nextUint8();
43918
+ var wrapModeU = bufferReader.nextUint8();
43919
+ var wrapModeV = bufferReader.nextUint8();
43920
+ var format = bufferReader.nextUint8();
43921
+ var width = bufferReader.nextUint16();
43922
+ var height = bufferReader.nextUint16();
43923
+ var isPixelBuffer = bufferReader.nextUint8();
43924
+ var mipCount = bufferReader.nextUint8();
43925
+ var imagesData = bufferReader.nextImagesData(mipCount);
43926
+ var texture2D = restoredTexture || new Texture2D(engine, width, height, format, mipmap);
43927
+ texture2D.filterMode = filterMode;
43928
+ texture2D.anisoLevel = anisoLevel;
43929
+ texture2D.wrapModeU = wrapModeU;
43930
+ texture2D.wrapModeV = wrapModeV;
43931
+ if (isPixelBuffer) {
43932
+ var pixelBuffer = imagesData[0];
43933
+ texture2D.setPixelBuffer(pixelBuffer);
43934
+ if (mipmap) {
43935
+ texture2D.generateMipmaps();
43936
+ for(var i = 1; i < mipCount; i++){
43937
+ var pixelBuffer1 = imagesData[i];
43938
+ texture2D.setPixelBuffer(pixelBuffer1, i);
43939
+ }
43930
43940
  }
43931
- clip.addCurveBinding(relativePath, componentType, property, getProperty, curve);
43941
+ // @ts-ignore
43942
+ engine.resourceManager._objectPool[objectId] = texture2D;
43943
+ resolve(texture2D);
43944
+ } else {
43945
+ var blob = new window.Blob([
43946
+ imagesData[0]
43947
+ ]);
43948
+ var img = new Image();
43949
+ img.onload = function() {
43950
+ texture2D.setImageSource(img);
43951
+ var completedCount = 0;
43952
+ var onComplete = function onComplete() {
43953
+ completedCount++;
43954
+ if (completedCount >= mipCount) {
43955
+ resolve(texture2D);
43956
+ }
43957
+ };
43958
+ onComplete();
43959
+ if (mipmap) {
43960
+ var _loop = function _loop(i) {
43961
+ var blob = new window.Blob([
43962
+ imagesData[i]
43963
+ ]);
43964
+ var img = new Image();
43965
+ img.onload = function() {
43966
+ texture2D.setImageSource(img, i);
43967
+ onComplete();
43968
+ };
43969
+ img.src = URL.createObjectURL(blob);
43970
+ };
43971
+ texture2D.generateMipmaps();
43972
+ for(var i = 1; i < mipCount; i++)_loop(i);
43973
+ }
43974
+ };
43975
+ img.src = URL.createObjectURL(blob);
43932
43976
  }
43933
- resolve(clip);
43934
43977
  });
43935
43978
  };
43936
- return AnimationClipDecoder;
43979
+ return Texture2DDecoder;
43937
43980
  }();
43938
- exports.AnimationClipDecoder = __decorate([
43939
- decoder("AnimationClip")
43940
- ], exports.AnimationClipDecoder);
43941
- var MaterialLoaderType = /*#__PURE__*/ function(MaterialLoaderType) {
43942
- MaterialLoaderType["Vector2"] = "Vector2";
43943
- MaterialLoaderType["Vector3"] = "Vector3";
43944
- MaterialLoaderType["Vector4"] = "Vector4";
43945
- MaterialLoaderType["Color"] = "Color";
43946
- MaterialLoaderType["Float"] = "Float";
43947
- MaterialLoaderType["Texture"] = "Texture";
43948
- MaterialLoaderType["Boolean"] = "Boolean";
43949
- MaterialLoaderType["Integer"] = "Integer";
43950
- return MaterialLoaderType;
43951
- }({});
43952
- var SpecularMode = /*#__PURE__*/ function(SpecularMode) {
43953
- SpecularMode["Sky"] = "Sky";
43954
- SpecularMode["Custom"] = "Custom";
43955
- return SpecularMode;
43956
- }({});
43981
+ exports.Texture2DDecoder = __decorate([
43982
+ decoder("Texture2D")
43983
+ ], exports.Texture2DDecoder);
43984
+ exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
43985
+ _inherits(EditorTextureLoader, Loader);
43986
+ function EditorTextureLoader() {
43987
+ return Loader.apply(this, arguments) || this;
43988
+ }
43989
+ var _proto = EditorTextureLoader.prototype;
43990
+ _proto.load = function load(item, resourceManager) {
43991
+ var requestConfig = _extends({}, item, {
43992
+ type: "arraybuffer"
43993
+ });
43994
+ var url = item.url;
43995
+ return new AssetPromise(function(resolve, reject) {
43996
+ resourceManager // @ts-ignore
43997
+ ._request(url, requestConfig).then(function(data) {
43998
+ decode(data, resourceManager.engine).then(function(texture) {
43999
+ resourceManager.addContentRestorer(new EditorTexture2DContentRestorer(texture, url, requestConfig));
44000
+ resolve(texture);
44001
+ });
44002
+ }).catch(reject);
44003
+ });
44004
+ };
44005
+ return EditorTextureLoader;
44006
+ }(Loader);
44007
+ exports.EditorTextureLoader = __decorate([
44008
+ resourceLoader("EditorTexture2D", [
44009
+ "prefab"
44010
+ ], true)
44011
+ ], exports.EditorTextureLoader);
44012
+ var EditorTexture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
44013
+ _inherits(EditorTexture2DContentRestorer, ContentRestorer);
44014
+ function EditorTexture2DContentRestorer(resource, url, requestConfig) {
44015
+ var _this;
44016
+ _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
44017
+ return _this;
44018
+ }
44019
+ var _proto = EditorTexture2DContentRestorer.prototype;
44020
+ _proto.restoreContent = function restoreContent() {
44021
+ var texture = this.resource;
44022
+ var engine = texture.engine;
44023
+ return engine.resourceManager // @ts-ignore
44024
+ ._request(this.url, this.requestConfig).then(function(data) {
44025
+ return decode(data, engine, texture);
44026
+ });
44027
+ };
44028
+ return EditorTexture2DContentRestorer;
44029
+ }(ContentRestorer);
43957
44030
  function _instanceof1(left, right) {
43958
44031
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
43959
44032
  return !!right[Symbol.hasInstance](left);
@@ -44356,40 +44429,38 @@
44356
44429
  };
44357
44430
  return SceneParser;
44358
44431
  }(HierarchyParser);
44359
- exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
44360
- _inherits(EditorTextureLoader, Loader);
44361
- function EditorTextureLoader() {
44362
- return Loader.apply(this, arguments) || this;
44363
- }
44364
- var _proto = EditorTextureLoader.prototype;
44365
- _proto.load = function load(item, resourceManager) {
44366
- return new AssetPromise(function(resolve, reject) {
44367
- resourceManager // @ts-ignore
44368
- ._request(item.url, _extends({}, item, {
44369
- type: "arraybuffer"
44370
- })).then(function(data) {
44371
- decode(data, resourceManager.engine).then(function(texture) {
44372
- resolve(texture);
44373
- });
44374
- }).catch(reject);
44375
- });
44376
- };
44377
- return EditorTextureLoader;
44378
- }(Loader);
44379
- exports.EditorTextureLoader = __decorate([
44380
- resourceLoader("EditorTexture2D", [
44381
- "prefab"
44382
- ], true)
44383
- ], exports.EditorTextureLoader);
44432
+ var MaterialLoaderType = /*#__PURE__*/ function(MaterialLoaderType) {
44433
+ MaterialLoaderType["Vector2"] = "Vector2";
44434
+ MaterialLoaderType["Vector3"] = "Vector3";
44435
+ MaterialLoaderType["Vector4"] = "Vector4";
44436
+ MaterialLoaderType["Color"] = "Color";
44437
+ MaterialLoaderType["Float"] = "Float";
44438
+ MaterialLoaderType["Texture"] = "Texture";
44439
+ MaterialLoaderType["Boolean"] = "Boolean";
44440
+ MaterialLoaderType["Integer"] = "Integer";
44441
+ return MaterialLoaderType;
44442
+ }({});
44443
+ var SpecularMode = /*#__PURE__*/ function(SpecularMode) {
44444
+ SpecularMode["Sky"] = "Sky";
44445
+ SpecularMode["Custom"] = "Custom";
44446
+ return SpecularMode;
44447
+ }({});
44384
44448
  /**
44385
44449
  * Decode engine binary resource.
44386
44450
  * @param arrayBuffer - array buffer of decode binary file
44387
44451
  * @param engine - engine
44388
44452
  * @returns
44389
44453
  */ function decode(arrayBuffer, engine) {
44454
+ for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
44455
+ args[_key - 2] = arguments[_key];
44456
+ }
44457
+ var _decoderMap_header_type;
44390
44458
  var header = FileHeader.decode(arrayBuffer);
44391
44459
  var bufferReader = new BufferReader(new Uint8Array(arrayBuffer), header.headerLength, header.dataLength);
44392
- return decoderMap[header.type].decode(engine, bufferReader).then(function(object) {
44460
+ return (_decoderMap_header_type = decoderMap[header.type]).decode.apply(_decoderMap_header_type, [].concat([
44461
+ engine,
44462
+ bufferReader
44463
+ ], args)).then(function(object) {
44393
44464
  object.name = header.name;
44394
44465
  return object;
44395
44466
  });
@@ -44601,10 +44672,11 @@
44601
44672
  type: "arraybuffer"
44602
44673
  });
44603
44674
  var engine = resourceManager.engine;
44675
+ var url = item.url;
44604
44676
  resourceManager // @ts-ignore
44605
- ._request(item.url, requestConfig).then(function(arraybuffer) {
44677
+ ._request(url, requestConfig).then(function(arraybuffer) {
44606
44678
  var texture = EnvLoader._setTextureByBuffer(engine, arraybuffer);
44607
- engine.resourceManager.addContentRestorer(new EnvContentRestorer(texture, item.url, requestConfig));
44679
+ engine.resourceManager.addContentRestorer(new EnvContentRestorer(texture, url, requestConfig));
44608
44680
  var ambientLight = new AmbientLight(engine);
44609
44681
  var sh = new SphericalHarmonics3();
44610
44682
  ambientLight.diffuseMode = DiffuseMode.SphericalHarmonics;
@@ -44659,9 +44731,12 @@
44659
44731
  _proto.restoreContent = function restoreContent() {
44660
44732
  var _this = this;
44661
44733
  return new AssetPromise(function(resolve, reject) {
44662
- request(_this.url, _this.requestConfig).then(function(buffer) {
44663
- EnvLoader._setTextureByBuffer(_this.resource.engine, buffer, _this.resource);
44664
- resolve(_this.resource);
44734
+ var resource = _this.resource;
44735
+ var engine = resource.engine;
44736
+ engine.resourceManager // @ts-ignore
44737
+ ._request(_this.url, _this.requestConfig).then(function(buffer) {
44738
+ EnvLoader._setTextureByBuffer(engine, buffer, resource);
44739
+ resolve(resource);
44665
44740
  }).catch(reject);
44666
44741
  });
44667
44742
  };
@@ -44751,6 +44826,202 @@
44751
44826
  "font"
44752
44827
  ], false)
44753
44828
  ], FontLoader);
44829
+ // Source: https://github.com/zeux/meshoptimizer/blob/master/js/meshopt_decoder.js
44830
+ var ready;
44831
+ function getMeshoptDecoder() {
44832
+ if (ready) return ready;
44833
+ 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";
44834
+ 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";
44835
+ var wasmpack = new Uint8Array([
44836
+ 32,
44837
+ 0,
44838
+ 65,
44839
+ 2,
44840
+ 1,
44841
+ 106,
44842
+ 34,
44843
+ 33,
44844
+ 3,
44845
+ 128,
44846
+ 11,
44847
+ 4,
44848
+ 13,
44849
+ 64,
44850
+ 6,
44851
+ 253,
44852
+ 10,
44853
+ 7,
44854
+ 15,
44855
+ 116,
44856
+ 127,
44857
+ 5,
44858
+ 8,
44859
+ 12,
44860
+ 40,
44861
+ 16,
44862
+ 19,
44863
+ 54,
44864
+ 20,
44865
+ 9,
44866
+ 27,
44867
+ 255,
44868
+ 113,
44869
+ 17,
44870
+ 42,
44871
+ 67,
44872
+ 24,
44873
+ 23,
44874
+ 146,
44875
+ 148,
44876
+ 18,
44877
+ 14,
44878
+ 22,
44879
+ 45,
44880
+ 70,
44881
+ 69,
44882
+ 56,
44883
+ 114,
44884
+ 101,
44885
+ 21,
44886
+ 25,
44887
+ 63,
44888
+ 75,
44889
+ 136,
44890
+ 108,
44891
+ 28,
44892
+ 118,
44893
+ 29,
44894
+ 73,
44895
+ 115
44896
+ ]);
44897
+ // @ts-ignore
44898
+ var wasm = SystemInfo._detectSIMDSupported() ? wasm_simd : wasm_base;
44899
+ var instance;
44900
+ ready = WebAssembly.instantiate(unpack(wasm)).then(function(result) {
44901
+ instance = result.instance;
44902
+ instance.exports.__wasm_call_ctors();
44903
+ }).then(function() {
44904
+ return {
44905
+ workerCount: 4,
44906
+ ready: ready,
44907
+ useWorkers: function useWorkers(workerCount) {
44908
+ this.workerCount = workerCount != null ? workerCount : this.workerCount;
44909
+ initWorkers(this.workerCount);
44910
+ },
44911
+ decodeGltfBuffer: function decodeGltfBuffer(count, stride, source, mode, filter) {
44912
+ if (this.workerCount > 0 && workers.length === 0) this.useWorkers();
44913
+ if (workers.length > 0) return decodeWorker(count, stride, source, decoders[mode], filters[filter]);
44914
+ return ready.then(function() {
44915
+ var target = new Uint8Array(count * stride);
44916
+ decode(instance.exports[decoders[mode]], target, count, stride, source, instance.exports[filters[filter]]);
44917
+ return target;
44918
+ });
44919
+ },
44920
+ release: function release() {
44921
+ for(var i = 0; i < workers.length; i++){
44922
+ workers[i].object.terminate();
44923
+ }
44924
+ }
44925
+ };
44926
+ });
44927
+ function unpack(data) {
44928
+ var result = new Uint8Array(data.length);
44929
+ for(var i = 0; i < data.length; ++i){
44930
+ var ch = data.charCodeAt(i);
44931
+ result[i] = ch > 96 ? ch - 97 : ch > 64 ? ch - 39 : ch + 4;
44932
+ }
44933
+ var write = 0;
44934
+ for(var i1 = 0; i1 < data.length; ++i1){
44935
+ result[write++] = result[i1] < 60 ? wasmpack[result[i1]] : (result[i1] - 60) * 64 + result[++i1];
44936
+ }
44937
+ return result.buffer.slice(0, write);
44938
+ }
44939
+ function decode(fun, target, count, size, source, filter) {
44940
+ var sbrk = instance.exports.sbrk;
44941
+ var count4 = count + 3 & ~3;
44942
+ var tp = sbrk(count4 * size);
44943
+ var sp = sbrk(source.length);
44944
+ var heap = new Uint8Array(instance.exports.memory.buffer);
44945
+ heap.set(source, sp);
44946
+ var res = fun(tp, count, size, sp, source.length);
44947
+ if (res == 0 && filter) {
44948
+ filter(tp, count4, size);
44949
+ }
44950
+ target.set(heap.subarray(tp, tp + count * size));
44951
+ sbrk(tp - sbrk(0));
44952
+ if (res != 0) {
44953
+ throw new Error("Malformed buffer data: " + res);
44954
+ }
44955
+ }
44956
+ var filters = {
44957
+ NONE: "",
44958
+ OCTAHEDRAL: "meshopt_decodeFilterOct",
44959
+ QUATERNION: "meshopt_decodeFilterQuat",
44960
+ EXPONENTIAL: "meshopt_decodeFilterExp"
44961
+ };
44962
+ var decoders = {
44963
+ ATTRIBUTES: "meshopt_decodeVertexBuffer",
44964
+ TRIANGLES: "meshopt_decodeIndexBuffer",
44965
+ INDICES: "meshopt_decodeIndexSequence"
44966
+ };
44967
+ var workers = [];
44968
+ var requestId = 0;
44969
+ function createWorker(url) {
44970
+ var worker = {
44971
+ object: new Worker(url),
44972
+ pending: 0,
44973
+ requests: {}
44974
+ };
44975
+ worker.object.onmessage = function(event) {
44976
+ var data = event.data;
44977
+ worker.pending -= data.count;
44978
+ worker.requests[data.id][data.action](data.value);
44979
+ delete worker.requests[data.id];
44980
+ };
44981
+ return worker;
44982
+ }
44983
+ function initWorkers(count) {
44984
+ 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 }';
44985
+ var blob = new Blob([
44986
+ source
44987
+ ], {
44988
+ type: "text/javascript"
44989
+ });
44990
+ var url = URL.createObjectURL(blob);
44991
+ for(var i = 0; i < count; ++i){
44992
+ workers[i] = createWorker(url);
44993
+ }
44994
+ URL.revokeObjectURL(url);
44995
+ }
44996
+ function decodeWorker(count, size, source, mode, filter) {
44997
+ var worker = workers[0];
44998
+ for(var i = 1; i < workers.length; ++i){
44999
+ if (workers[i].pending < worker.pending) {
45000
+ worker = workers[i];
45001
+ }
45002
+ }
45003
+ return new Promise(function(resolve, reject) {
45004
+ var data = new Uint8Array(source);
45005
+ var id = requestId++;
45006
+ worker.pending += count;
45007
+ worker.requests[id] = {
45008
+ resolve: resolve,
45009
+ reject: reject
45010
+ };
45011
+ worker.object.postMessage({
45012
+ id: id,
45013
+ count: count,
45014
+ size: size,
45015
+ source: data,
45016
+ mode: mode,
45017
+ filter: filter
45018
+ }, [
45019
+ data.buffer
45020
+ ]);
45021
+ });
45022
+ }
45023
+ return ready;
45024
+ }
44754
45025
  /**
44755
45026
  * The glTF resource.
44756
45027
  */ var GLTFResource = /*#__PURE__*/ function(ReferResource) {
@@ -44777,14 +45048,15 @@
44777
45048
  materials && this._disassociationSuperResource(materials);
44778
45049
  if (meshes) {
44779
45050
  for(var i = 0, n = meshes.length; i < n; i++){
44780
- this._disassociationSuperResource(meshes[i]);
45051
+ var meshArr = meshes[i];
45052
+ meshArr && this._disassociationSuperResource(meshArr);
44781
45053
  }
44782
45054
  }
44783
45055
  };
44784
45056
  _proto._disassociationSuperResource = function _disassociationSuperResource(resources) {
44785
45057
  for(var i = 0, n = resources.length; i < n; i++){
44786
- // @ts-ignore
44787
- resources[i]._disassociationSuperResource(this);
45058
+ var _resources_i;
45059
+ (_resources_i = resources[i]) == null ? void 0 : _resources_i._disassociationSuperResource(this);
44788
45060
  }
44789
45061
  };
44790
45062
  _create_class(GLTFResource, [
@@ -44982,6 +45254,7 @@
44982
45254
  this.params = params;
44983
45255
  this.accessorBufferCache = {};
44984
45256
  this.needAnimatorController = false;
45257
+ this./** @internal */ _getPromises = [];
44985
45258
  this._resourceCache = new Map();
44986
45259
  this._progress = {
44987
45260
  taskDetail: {},
@@ -45006,7 +45279,7 @@
45006
45279
  var _this = this;
45007
45280
  var parser = GLTFParserContext._parsers[type];
45008
45281
  if (!parser) {
45009
- return Promise.resolve(null);
45282
+ return AssetPromise.resolve(null);
45010
45283
  }
45011
45284
  var cache = this._resourceCache;
45012
45285
  var cacheKey = index === undefined ? "" + type : type + ":" + index;
@@ -45022,7 +45295,7 @@
45022
45295
  if (index === undefined) {
45023
45296
  resource = type === 8 ? glTFItems.map(function(_, index) {
45024
45297
  return _this.get(type, index);
45025
- }) : Promise.all(glTFItems.map(function(_, index) {
45298
+ }) : AssetPromise.all(glTFItems.map(function(_, index) {
45026
45299
  return _this.get(type, index);
45027
45300
  }));
45028
45301
  } else {
@@ -45030,12 +45303,15 @@
45030
45303
  isSubAsset && this._handleSubAsset(resource, type, index);
45031
45304
  }
45032
45305
  } else {
45033
- resource = Promise.resolve(null);
45306
+ resource = AssetPromise.resolve(null);
45034
45307
  }
45035
45308
  } else {
45036
45309
  resource = parser.parse(this, index);
45037
45310
  isSubAsset && this._handleSubAsset(resource, type, index);
45038
45311
  }
45312
+ if (_instanceof1(resource, AssetPromise)) {
45313
+ this._getPromises.push(resource);
45314
+ }
45039
45315
  cache.set(cacheKey, resource);
45040
45316
  return resource;
45041
45317
  };
@@ -45044,7 +45320,7 @@
45044
45320
  var promise = this.get(0).then(function(json) {
45045
45321
  _this.glTF = json;
45046
45322
  _this.needAnimatorController = !!(json.skins || json.animations);
45047
- return Promise.all([
45323
+ return AssetPromise.all([
45048
45324
  _this.get(1),
45049
45325
  _this.get(5),
45050
45326
  _this.get(6),
@@ -45107,6 +45383,8 @@
45107
45383
  _this.resourceManager._onSubAssetSuccess(url, "defaultSceneRoot", item);
45108
45384
  }
45109
45385
  }
45386
+ }).catch(function(e) {
45387
+ Logger.error("GLTFParserContext", "Failed to load " + glTFResourceKey + " " + index + ": " + e);
45110
45388
  });
45111
45389
  }
45112
45390
  };
@@ -45284,13 +45562,15 @@
45284
45562
  bufferInfo.restoreInfo = new BufferDataRestoreInfo(new RestoreDataAccessor(bufferIndex, TypedArray, offset1, count1));
45285
45563
  }
45286
45564
  return bufferInfo;
45565
+ }).catch(function(e) {
45566
+ Logger.error("GLTFUtil getAccessorBuffer error", e);
45287
45567
  });
45288
45568
  } else {
45289
45569
  var count = accessorCount * dataElementSize;
45290
45570
  var data = new TypedArray(count);
45291
45571
  var bufferInfo = new BufferInfo(data, false, elementStride);
45292
45572
  bufferInfo.restoreInfo = new BufferDataRestoreInfo(new RestoreDataAccessor(undefined, TypedArray, undefined, count));
45293
- promise = Promise.resolve(bufferInfo);
45573
+ promise = AssetPromise.resolve(bufferInfo);
45294
45574
  }
45295
45575
  return accessor.sparse ? promise.then(function(bufferInfo) {
45296
45576
  return GLTFUtils.processingSparseData(context, accessor, bufferInfo).then(function() {
@@ -45325,7 +45605,7 @@
45325
45605
  var _accessor_sparse = accessor.sparse, count = _accessor_sparse.count, indices = _accessor_sparse.indices, values = _accessor_sparse.values;
45326
45606
  var indicesBufferView = bufferViews[indices.bufferView];
45327
45607
  var valuesBufferView = bufferViews[values.bufferView];
45328
- return Promise.all([
45608
+ return AssetPromise.all([
45329
45609
  context.get(GLTFParserType.BufferView, indices.bufferView),
45330
45610
  context.get(GLTFParserType.BufferView, values.bufferView)
45331
45611
  ]).then(function(param) {
@@ -45352,6 +45632,8 @@
45352
45632
  }
45353
45633
  }
45354
45634
  bufferInfo.data = data;
45635
+ }).catch(function(e) {
45636
+ Logger.error("GLTFUtil processingSparseData error", e);
45355
45637
  });
45356
45638
  };
45357
45639
  GLTFUtils.getIndexFormat = function getIndexFormat(type) {
@@ -46311,15 +46593,20 @@
46311
46593
  * @internal
46312
46594
  */ _proto.load = function load(item, resourceManager) {
46313
46595
  return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
46314
- resourceManager // @ts-ignore
46315
- ._request(item.url, {
46596
+ var requestConfig = _extends({}, item, {
46316
46597
  type: "arraybuffer"
46317
- }).onProgress(setTaskCompleteProgress, setTaskDetailProgress).then(function(buffer) {
46598
+ });
46599
+ var url = item.url;
46600
+ resourceManager // @ts-ignore
46601
+ ._request(url, requestConfig).onProgress(setTaskCompleteProgress, setTaskDetailProgress).then(function(buffer) {
46318
46602
  return KTX2Loader._parseBuffer(new Uint8Array(buffer), resourceManager.engine, item.params).then(function(param) {
46319
46603
  var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
46320
46604
  return KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params);
46605
+ }).then(function(texture) {
46606
+ resourceManager.addContentRestorer(new KTX2ContentRestorer(texture, url, requestConfig));
46607
+ resolve(texture);
46321
46608
  });
46322
- }).then(resolve).catch(reject);
46609
+ }).catch(reject);
46323
46610
  });
46324
46611
  };
46325
46612
  /**
@@ -46358,7 +46645,7 @@
46358
46645
  };
46359
46646
  });
46360
46647
  };
46361
- /** @internal */ KTX2Loader._createTextureByBuffer = function _createTextureByBuffer(engine, transcodeResult, targetFormat, params) {
46648
+ /** @internal */ KTX2Loader._createTextureByBuffer = function _createTextureByBuffer(engine, transcodeResult, targetFormat, params, restoredTexture) {
46362
46649
  var width = transcodeResult.width, height = transcodeResult.height, faces = transcodeResult.faces;
46363
46650
  var faceCount = faces.length;
46364
46651
  var mipmaps = faces[0];
@@ -46366,13 +46653,13 @@
46366
46653
  var engineFormat = this._getEngineTextureFormat(targetFormat, transcodeResult);
46367
46654
  var texture;
46368
46655
  if (faceCount !== 6) {
46369
- texture = new Texture2D(engine, width, height, engineFormat, mipmap);
46656
+ texture = restoredTexture || new Texture2D(engine, width, height, engineFormat, mipmap);
46370
46657
  for(var mipLevel = 0; mipLevel < mipmaps.length; mipLevel++){
46371
46658
  var data = mipmaps[mipLevel].data;
46372
46659
  texture.setPixelBuffer(data, mipLevel);
46373
46660
  }
46374
46661
  } else {
46375
- texture = new TextureCube(engine, height, engineFormat, mipmap);
46662
+ texture = restoredTexture || new TextureCube(engine, height, engineFormat, mipmap);
46376
46663
  for(var i = 0; i < faces.length; i++){
46377
46664
  var faceData = faces[i];
46378
46665
  for(var mipLevel1 = 0; mipLevel1 < mipmaps.length; mipLevel1++){
@@ -46488,6 +46775,30 @@
46488
46775
  "ktx2"
46489
46776
  ])
46490
46777
  ], exports.KTX2Loader);
46778
+ var KTX2ContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
46779
+ _inherits(KTX2ContentRestorer, ContentRestorer);
46780
+ function KTX2ContentRestorer(resource, url, requestConfig) {
46781
+ var _this;
46782
+ _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
46783
+ return _this;
46784
+ }
46785
+ var _proto = KTX2ContentRestorer.prototype;
46786
+ _proto.restoreContent = function restoreContent() {
46787
+ var _this = this;
46788
+ var _this1 = this, resource = _this1.resource, requestConfig = _this1.requestConfig;
46789
+ var engine = resource.engine;
46790
+ return new AssetPromise(function(resolve, reject) {
46791
+ engine.resourceManager // @ts-ignore
46792
+ ._request(_this.url, requestConfig).then(function(buffer) {
46793
+ return exports.KTX2Loader._parseBuffer(new Uint8Array(buffer), engine, requestConfig.params).then(function(param) {
46794
+ var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
46795
+ return exports.KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params, resource);
46796
+ });
46797
+ }).then(resolve).catch(reject);
46798
+ });
46799
+ };
46800
+ return KTX2ContentRestorer;
46801
+ }(ContentRestorer);
46491
46802
  /** Used for initialize KTX2 transcoder. */ var KTX2Transcoder = /*#__PURE__*/ function(KTX2Transcoder) {
46492
46803
  /** BinomialLLC transcoder. */ KTX2Transcoder[KTX2Transcoder["BinomialLLC"] = 0] = "BinomialLLC";
46493
46804
  /** Khronos transcoder. */ KTX2Transcoder[KTX2Transcoder["Khronos"] = 1] = "Khronos";
@@ -46821,16 +47132,14 @@
46821
47132
  for(var _len = arguments.length, extra = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++){
46822
47133
  extra[_key - 5] = arguments[_key];
46823
47134
  }
47135
+ var _parser;
46824
47136
  var parser = GLTFParser.getExtensionParser(extensionName, GLTFExtensionMode.AdditiveParse);
46825
- if (parser) {
46826
- var _parser;
46827
- (_parser = parser).additiveParse.apply(_parser, [].concat([
46828
- context,
46829
- parseResource,
46830
- extensionSchema,
46831
- ownerSchema
46832
- ], extra));
46833
- }
47137
+ parser == null ? void 0 : (_parser = parser).additiveParse.apply(_parser, [].concat([
47138
+ context,
47139
+ parseResource,
47140
+ extensionSchema,
47141
+ ownerSchema
47142
+ ], extra));
46834
47143
  };
46835
47144
  return GLTFParser;
46836
47145
  }();
@@ -46894,7 +47203,7 @@
46894
47203
  var animationInfo = context.glTF.animations[index];
46895
47204
  var _animationInfo_name = animationInfo.name, name = _animationInfo_name === void 0 ? "AnimationClip" + index : _animationInfo_name;
46896
47205
  var animationClipPromise = GLTFParser.executeExtensionsCreateAndParse(animationInfo.extensions, context, animationInfo) || GLTFAnimationParser._parseStandardProperty(context, new AnimationClip(name), animationInfo);
46897
- return Promise.resolve(animationClipPromise).then(function(animationClip) {
47206
+ return AssetPromise.resolve(animationClipPromise).then(function(animationClip) {
46898
47207
  GLTFParser.executeExtensionsAdditiveAndParse(animationInfo.extensions, context, animationClip, animationInfo);
46899
47208
  return animationClip;
46900
47209
  });
@@ -46906,7 +47215,7 @@
46906
47215
  var glTFSampler = samplers[j];
46907
47216
  var inputAccessor = accessors[glTFSampler.input];
46908
47217
  var outputAccessor = accessors[glTFSampler.output];
46909
- var promise = Promise.all([
47218
+ var promise = AssetPromise.all([
46910
47219
  GLTFUtils.getAccessorBuffer(context, bufferViews, inputAccessor),
46911
47220
  GLTFUtils.getAccessorBuffer(context, bufferViews, outputAccessor)
46912
47221
  ]).then(function(bufferInfos) {
@@ -46957,7 +47266,7 @@
46957
47266
  // parse samplers
46958
47267
  for(var j = 0, m = len; j < m; j++)_loop(j);
46959
47268
  promises.push(context.get(GLTFParserType.Scene));
46960
- return Promise.all(promises).then(function() {
47269
+ return AssetPromise.all(promises).then(function() {
46961
47270
  for(var j = 0, m = channels.length; j < m; j++){
46962
47271
  var glTFChannel = channels[j];
46963
47272
  var target = glTFChannel.target;
@@ -47086,7 +47395,7 @@
47086
47395
  var _proto = GLTFBufferParser.prototype;
47087
47396
  _proto.parse = function parse(context, index) {
47088
47397
  var buffers = context.glTF.buffers;
47089
- return context.buffers ? Promise.resolve(context.buffers[index]) : this._parseSingleBuffer(context, buffers[index]);
47398
+ return context.buffers ? AssetPromise.resolve(context.buffers[index]) : this._parseSingleBuffer(context, buffers[index]);
47090
47399
  };
47091
47400
  _proto._parseSingleBuffer = function _parseSingleBuffer(context, bufferInfo) {
47092
47401
  var glTFResource = context.glTFResource, contentRestorer = context.contentRestorer, resourceManager = context.resourceManager;
@@ -47171,7 +47480,7 @@
47171
47480
  material.name = materialInfo.name;
47172
47481
  GLTFMaterialParser._parseStandardProperty(context, material, materialInfo);
47173
47482
  }
47174
- return Promise.resolve(material).then(function(material) {
47483
+ return AssetPromise.resolve(material).then(function(material) {
47175
47484
  // @ts-ignore
47176
47485
  material || (material = engine._basicResources._getBlinnPhongMaterial());
47177
47486
  GLTFParser.executeExtensionsAdditiveAndParse(materialInfo.extensions, context, material, materialInfo);
@@ -47201,6 +47510,8 @@
47201
47510
  context.get(GLTFParserType.Texture, baseColorTexture.index).then(function(texture) {
47202
47511
  material.baseTexture = texture;
47203
47512
  GLTFParser.executeExtensionsAdditiveAndParse(baseColorTexture.extensions, context, material, baseColorTexture);
47513
+ }).catch(function(e) {
47514
+ Logger.error("GLTFMaterialParser: baseColorTexture error", e);
47204
47515
  });
47205
47516
  }
47206
47517
  if (material.constructor === PBRMaterial) {
@@ -47210,6 +47521,8 @@
47210
47521
  GLTFMaterialParser._checkOtherTextureTransform(metallicRoughnessTexture, "Roughness metallic");
47211
47522
  context.get(GLTFParserType.Texture, metallicRoughnessTexture.index).then(function(texture) {
47212
47523
  material.roughnessMetallicTexture = texture;
47524
+ }).catch(function(e) {
47525
+ Logger.error("GLTFMaterialParser: metallicRoughnessTexture error", e);
47213
47526
  });
47214
47527
  }
47215
47528
  }
@@ -47219,6 +47532,8 @@
47219
47532
  GLTFMaterialParser._checkOtherTextureTransform(emissiveTexture, "Emissive");
47220
47533
  context.get(GLTFParserType.Texture, emissiveTexture.index).then(function(texture) {
47221
47534
  material.emissiveTexture = texture;
47535
+ }).catch(function(e) {
47536
+ Logger.error("GLTFMaterialParser: emissiveTexture error", e);
47222
47537
  });
47223
47538
  }
47224
47539
  if (emissiveFactor) {
@@ -47229,6 +47544,8 @@
47229
47544
  GLTFMaterialParser._checkOtherTextureTransform(normalTexture, "Normal");
47230
47545
  context.get(GLTFParserType.Texture, index).then(function(texture) {
47231
47546
  material.normalTexture = texture;
47547
+ }).catch(function(e) {
47548
+ Logger.error("GLTFMaterialParser: emissiveTexture error", e);
47232
47549
  });
47233
47550
  if (scale !== undefined) {
47234
47551
  material.normalTextureIntensity = scale;
@@ -47239,6 +47556,8 @@
47239
47556
  GLTFMaterialParser._checkOtherTextureTransform(occlusionTexture, "Occlusion");
47240
47557
  context.get(GLTFParserType.Texture, index1).then(function(texture) {
47241
47558
  material.occlusionTexture = texture;
47559
+ }).catch(function(e) {
47560
+ Logger.error("GLTFMaterialParser: occlusionTexture error", e);
47242
47561
  });
47243
47562
  if (strength !== undefined) {
47244
47563
  material.occlusionTextureIntensity = strength;
@@ -47281,7 +47600,7 @@
47281
47600
  _proto.parse = function parse(context, index) {
47282
47601
  var _loop = function _loop(i, length) {
47283
47602
  var gltfPrimitive = meshInfo.primitives[i];
47284
- primitivePromises[i] = new Promise(function(resolve) {
47603
+ primitivePromises[i] = new AssetPromise(function(resolve, reject) {
47285
47604
  var mesh = GLTFParser.executeExtensionsCreateAndParse(gltfPrimitive.extensions, context, gltfPrimitive, meshInfo);
47286
47605
  if (mesh) {
47287
47606
  if (_instanceof1(mesh, ModelMesh)) {
@@ -47302,7 +47621,7 @@
47302
47621
  var meshRestoreInfo = new ModelMeshRestoreInfo();
47303
47622
  meshRestoreInfo.mesh = mesh1;
47304
47623
  context.contentRestorer.meshes.push(meshRestoreInfo);
47305
- GLTFMeshParser._parseMeshFromGLTFPrimitive(context, mesh1, meshRestoreInfo, meshInfo, gltfPrimitive, glTF, context.params.keepMeshData).then(resolve);
47624
+ GLTFMeshParser._parseMeshFromGLTFPrimitive(context, mesh1, meshRestoreInfo, meshInfo, gltfPrimitive, glTF, context.params.keepMeshData).then(resolve, reject);
47306
47625
  }
47307
47626
  });
47308
47627
  };
@@ -47311,7 +47630,7 @@
47311
47630
  var engine = glTFResource.engine;
47312
47631
  var primitivePromises = new Array();
47313
47632
  for(var i = 0, length = meshInfo.primitives.length; i < length; i++)_loop(i);
47314
- return Promise.all(primitivePromises);
47633
+ return AssetPromise.all(primitivePromises);
47315
47634
  };
47316
47635
  /**
47317
47636
  * @internal
@@ -47394,7 +47713,7 @@
47394
47713
  var bufferBindIndex = 0;
47395
47714
  var promises = new Array();
47396
47715
  for(var attribute in attributes)_loop(attribute);
47397
- return Promise.all(promises).then(function() {
47716
+ return AssetPromise.all(promises).then(function() {
47398
47717
  mesh.setVertexElements(vertexElements);
47399
47718
  // Indices
47400
47719
  if (indices !== undefined) {
@@ -47444,7 +47763,7 @@
47444
47763
  var tangentTarget = targets["TANGENT"];
47445
47764
  var hasNormal = normalTarget !== undefined;
47446
47765
  var hasTangent = tangentTarget !== undefined;
47447
- var promise = Promise.all([
47766
+ var promise = AssetPromise.all([
47448
47767
  _this._getBlendShapeData(context, glTF, accessors[targets["POSITION"]]),
47449
47768
  hasNormal ? _this._getBlendShapeData(context, glTF, accessors[normalTarget]) : null,
47450
47769
  hasTangent ? _this._getBlendShapeData(context, glTF, accessors[tangentTarget]) : null
@@ -47464,7 +47783,7 @@
47464
47783
  var blendShapeCount = glTFTargets.length;
47465
47784
  var blendShapeCollection = new Array(blendShapeCount);
47466
47785
  for(var i = 0; i < blendShapeCount; i++)_this = this, _loop(i);
47467
- return Promise.all(promises).then(function() {
47786
+ return AssetPromise.all(promises).then(function() {
47468
47787
  for(var _iterator = _create_for_of_iterator_helper_loose(blendShapeCollection), _step; !(_step = _iterator()).done;){
47469
47788
  var blendShape = _step.value;
47470
47789
  mesh.addBlendShape(blendShape.blendShape);
@@ -47510,7 +47829,7 @@
47510
47829
  for(var i1 = 0; i1 < sceneNodes.length; i1++){
47511
47830
  promises.push(this._parseEntityComponent(context, sceneNodes[i1]));
47512
47831
  }
47513
- return Promise.all(promises).then(function() {
47832
+ return AssetPromise.all(promises).then(function() {
47514
47833
  GLTFParser.executeExtensionsAdditiveAndParse(sceneExtensions, context, sceneRoot, sceneInfo);
47515
47834
  return sceneRoot;
47516
47835
  });
@@ -47528,7 +47847,7 @@
47528
47847
  if (meshID !== undefined) {
47529
47848
  promise = this._createRenderer(context, entityInfo, entity);
47530
47849
  }
47531
- return Promise.resolve(promise).then(function() {
47850
+ return AssetPromise.resolve(promise).then(function() {
47532
47851
  var promises = [];
47533
47852
  var children = entityInfo.children;
47534
47853
  if (children) {
@@ -47536,7 +47855,7 @@
47536
47855
  promises.push(_this._parseEntityComponent(context, children[i]));
47537
47856
  }
47538
47857
  }
47539
- return Promise.all(promises);
47858
+ return AssetPromise.all(promises);
47540
47859
  });
47541
47860
  };
47542
47861
  _proto._createCamera = function _createCamera(resource, cameraSchema, entity) {
@@ -47585,10 +47904,10 @@
47585
47904
  var _glTFMeshPrimitives_i_material;
47586
47905
  materialPromises[i] = context.get(GLTFParserType.Material, (_glTFMeshPrimitives_i_material = glTFMeshPrimitives[i].material) != null ? _glTFMeshPrimitives_i_material : -1);
47587
47906
  }
47588
- return Promise.all([
47907
+ return AssetPromise.all([
47589
47908
  context.get(GLTFParserType.Mesh, meshID),
47590
47909
  skinID !== undefined && context.get(GLTFParserType.Skin, skinID),
47591
- Promise.all(materialPromises)
47910
+ AssetPromise.all(materialPromises)
47592
47911
  ]).then(function(param) {
47593
47912
  var _loop = function _loop(i) {
47594
47913
  var material = materials[i] || basicResources._getBlinnPhongMaterial();
@@ -47623,6 +47942,8 @@
47623
47942
  // @ts-ignore
47624
47943
  var basicResources = context.glTFResource.engine._basicResources;
47625
47944
  for(var i = 0; i < rendererCount; i++)_loop(i);
47945
+ }).catch(function(e) {
47946
+ Logger.error("GLTFSceneParser: create renderer error", e);
47626
47947
  });
47627
47948
  };
47628
47949
  _proto._computeLocalBounds = function _computeLocalBounds(skinnedMeshRenderer, mesh, bones, rootBone, inverseBindMatrices) {
@@ -47706,7 +48027,7 @@
47706
48027
  }
47707
48028
  return skin;
47708
48029
  });
47709
- return Promise.resolve(skinPromise);
48030
+ return AssetPromise.resolve(skinPromise);
47710
48031
  };
47711
48032
  _proto._findSkeletonRootBone = function _findSkeletonRootBone(joints, entities) {
47712
48033
  var paths = {};
@@ -47755,7 +48076,7 @@
47755
48076
  if (!texture) {
47756
48077
  texture = GLTFTextureParser._parseTexture(context, imageIndex, textureIndex, sampler, textureName);
47757
48078
  }
47758
- return Promise.resolve(texture).then(function(texture) {
48079
+ return AssetPromise.resolve(texture).then(function(texture) {
47759
48080
  GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, texture, textureInfo);
47760
48081
  // @ts-ignore
47761
48082
  texture._associationSuperResource(glTFResource);
@@ -47800,6 +48121,8 @@
47800
48121
  context.contentRestorer.bufferTextures.push(bufferTextureRestoreInfo);
47801
48122
  return texture;
47802
48123
  });
48124
+ }).catch(function(e) {
48125
+ Logger.error("GLTFTextureParser: image buffer error", e);
47803
48126
  });
47804
48127
  }
47805
48128
  return texture;
@@ -47841,7 +48164,7 @@
47841
48164
  }
47842
48165
  }
47843
48166
  }
47844
- return Promise.resolve(null);
48167
+ return AssetPromise.resolve(null);
47845
48168
  };
47846
48169
  return GLTFValidator;
47847
48170
  }(GLTFParser);
@@ -47859,6 +48182,8 @@
47859
48182
  var extensions = bufferView.extensions, _bufferView_byteOffset = bufferView.byteOffset, byteOffset = _bufferView_byteOffset === void 0 ? 0 : _bufferView_byteOffset, byteLength = bufferView.byteLength, bufferIndex = bufferView.buffer;
47860
48183
  return extensions ? GLTFParser.executeExtensionsCreateAndParse(extensions, context, bufferView) : context.get(GLTFParserType.Buffer, bufferIndex).then(function(buffer) {
47861
48184
  return new Uint8Array(buffer, byteOffset, byteLength);
48185
+ }).catch(function(e) {
48186
+ Logger.error("GLTFBufferViewParser: buffer error", e);
47862
48187
  });
47863
48188
  };
47864
48189
  return GLTFBufferViewParser;
@@ -47875,11 +48200,13 @@
47875
48200
  _proto.parse = function parse(context) {
47876
48201
  var _this = this;
47877
48202
  if (!context.needAnimatorController) {
47878
- return Promise.resolve(null);
48203
+ return AssetPromise.resolve(null);
47879
48204
  }
47880
48205
  return context.get(GLTFParserType.Animation).then(function(animations) {
47881
48206
  var animatorController = _this._createAnimatorController(context, animations);
47882
- return Promise.resolve(animatorController);
48207
+ return AssetPromise.resolve(animatorController);
48208
+ }).catch(function(e) {
48209
+ Logger.error("GLTFAnimatorControllerParser: animator controller error", e);
47883
48210
  });
47884
48211
  };
47885
48212
  _proto._createAnimatorController = function _createAnimatorController(context, animations) {
@@ -47909,202 +48236,6 @@
47909
48236
  exports.GLTFAnimatorControllerParser = __decorate([
47910
48237
  registerGLTFParser(GLTFParserType.AnimatorController)
47911
48238
  ], exports.GLTFAnimatorControllerParser);
47912
- // Source: https://github.com/zeux/meshoptimizer/blob/master/js/meshopt_decoder.js
47913
- var ready;
47914
- function getMeshoptDecoder() {
47915
- if (ready) return ready;
47916
- 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";
47917
- 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";
47918
- var wasmpack = new Uint8Array([
47919
- 32,
47920
- 0,
47921
- 65,
47922
- 2,
47923
- 1,
47924
- 106,
47925
- 34,
47926
- 33,
47927
- 3,
47928
- 128,
47929
- 11,
47930
- 4,
47931
- 13,
47932
- 64,
47933
- 6,
47934
- 253,
47935
- 10,
47936
- 7,
47937
- 15,
47938
- 116,
47939
- 127,
47940
- 5,
47941
- 8,
47942
- 12,
47943
- 40,
47944
- 16,
47945
- 19,
47946
- 54,
47947
- 20,
47948
- 9,
47949
- 27,
47950
- 255,
47951
- 113,
47952
- 17,
47953
- 42,
47954
- 67,
47955
- 24,
47956
- 23,
47957
- 146,
47958
- 148,
47959
- 18,
47960
- 14,
47961
- 22,
47962
- 45,
47963
- 70,
47964
- 69,
47965
- 56,
47966
- 114,
47967
- 101,
47968
- 21,
47969
- 25,
47970
- 63,
47971
- 75,
47972
- 136,
47973
- 108,
47974
- 28,
47975
- 118,
47976
- 29,
47977
- 73,
47978
- 115
47979
- ]);
47980
- // @ts-ignore
47981
- var wasm = SystemInfo._detectSIMDSupported() ? wasm_simd : wasm_base;
47982
- var instance;
47983
- ready = WebAssembly.instantiate(unpack(wasm)).then(function(result) {
47984
- instance = result.instance;
47985
- instance.exports.__wasm_call_ctors();
47986
- }).then(function() {
47987
- return {
47988
- workerCount: 4,
47989
- ready: ready,
47990
- useWorkers: function useWorkers(workerCount) {
47991
- this.workerCount = workerCount != null ? workerCount : this.workerCount;
47992
- initWorkers(this.workerCount);
47993
- },
47994
- decodeGltfBuffer: function decodeGltfBuffer(count, stride, source, mode, filter) {
47995
- if (this.workerCount > 0 && workers.length === 0) this.useWorkers();
47996
- if (workers.length > 0) return decodeWorker(count, stride, source, decoders[mode], filters[filter]);
47997
- return ready.then(function() {
47998
- var target = new Uint8Array(count * stride);
47999
- decode(instance.exports[decoders[mode]], target, count, stride, source, instance.exports[filters[filter]]);
48000
- return target;
48001
- });
48002
- },
48003
- release: function release() {
48004
- for(var i = 0; i < workers.length; i++){
48005
- workers[i].object.terminate();
48006
- }
48007
- }
48008
- };
48009
- });
48010
- function unpack(data) {
48011
- var result = new Uint8Array(data.length);
48012
- for(var i = 0; i < data.length; ++i){
48013
- var ch = data.charCodeAt(i);
48014
- result[i] = ch > 96 ? ch - 97 : ch > 64 ? ch - 39 : ch + 4;
48015
- }
48016
- var write = 0;
48017
- for(var i1 = 0; i1 < data.length; ++i1){
48018
- result[write++] = result[i1] < 60 ? wasmpack[result[i1]] : (result[i1] - 60) * 64 + result[++i1];
48019
- }
48020
- return result.buffer.slice(0, write);
48021
- }
48022
- function decode(fun, target, count, size, source, filter) {
48023
- var sbrk = instance.exports.sbrk;
48024
- var count4 = count + 3 & ~3;
48025
- var tp = sbrk(count4 * size);
48026
- var sp = sbrk(source.length);
48027
- var heap = new Uint8Array(instance.exports.memory.buffer);
48028
- heap.set(source, sp);
48029
- var res = fun(tp, count, size, sp, source.length);
48030
- if (res == 0 && filter) {
48031
- filter(tp, count4, size);
48032
- }
48033
- target.set(heap.subarray(tp, tp + count * size));
48034
- sbrk(tp - sbrk(0));
48035
- if (res != 0) {
48036
- throw new Error("Malformed buffer data: " + res);
48037
- }
48038
- }
48039
- var filters = {
48040
- NONE: "",
48041
- OCTAHEDRAL: "meshopt_decodeFilterOct",
48042
- QUATERNION: "meshopt_decodeFilterQuat",
48043
- EXPONENTIAL: "meshopt_decodeFilterExp"
48044
- };
48045
- var decoders = {
48046
- ATTRIBUTES: "meshopt_decodeVertexBuffer",
48047
- TRIANGLES: "meshopt_decodeIndexBuffer",
48048
- INDICES: "meshopt_decodeIndexSequence"
48049
- };
48050
- var workers = [];
48051
- var requestId = 0;
48052
- function createWorker(url) {
48053
- var worker = {
48054
- object: new Worker(url),
48055
- pending: 0,
48056
- requests: {}
48057
- };
48058
- worker.object.onmessage = function(event) {
48059
- var data = event.data;
48060
- worker.pending -= data.count;
48061
- worker.requests[data.id][data.action](data.value);
48062
- delete worker.requests[data.id];
48063
- };
48064
- return worker;
48065
- }
48066
- function initWorkers(count) {
48067
- 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 }';
48068
- var blob = new Blob([
48069
- source
48070
- ], {
48071
- type: "text/javascript"
48072
- });
48073
- var url = URL.createObjectURL(blob);
48074
- for(var i = 0; i < count; ++i){
48075
- workers[i] = createWorker(url);
48076
- }
48077
- URL.revokeObjectURL(url);
48078
- }
48079
- function decodeWorker(count, size, source, mode, filter) {
48080
- var worker = workers[0];
48081
- for(var i = 1; i < workers.length; ++i){
48082
- if (workers[i].pending < worker.pending) {
48083
- worker = workers[i];
48084
- }
48085
- }
48086
- return new Promise(function(resolve, reject) {
48087
- var data = new Uint8Array(source);
48088
- var id = requestId++;
48089
- worker.pending += count;
48090
- worker.requests[id] = {
48091
- resolve: resolve,
48092
- reject: reject
48093
- };
48094
- worker.object.postMessage({
48095
- id: id,
48096
- count: count,
48097
- size: size,
48098
- source: data,
48099
- mode: mode,
48100
- filter: filter
48101
- }, [
48102
- data.buffer
48103
- ]);
48104
- });
48105
- }
48106
- return ready;
48107
- }
48108
48239
  exports.GLTFLoader = /*#__PURE__*/ function(Loader) {
48109
48240
  _inherits(GLTFLoader, Loader);
48110
48241
  function GLTFLoader() {
@@ -48128,10 +48259,19 @@
48128
48259
  var context = new GLTFParserContext(glTFResource, resourceManager, _extends({
48129
48260
  keepMeshData: false
48130
48261
  }, params));
48131
- return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
48262
+ return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress, onTaskCancel) {
48132
48263
  context._setTaskCompleteProgress = setTaskCompleteProgress;
48133
48264
  context._setTaskDetailProgress = setTaskDetailProgress;
48134
- context.parse().then(resolve).catch(reject);
48265
+ onTaskCancel(function() {
48266
+ var getPromises = context._getPromises;
48267
+ for(var i = 0, n = getPromises.length; i < n; i++){
48268
+ getPromises[i].cancel();
48269
+ }
48270
+ });
48271
+ context.parse().then(resolve).catch(function(e) {
48272
+ glTFResource.destroy();
48273
+ reject(e);
48274
+ });
48135
48275
  });
48136
48276
  };
48137
48277
  /**
@@ -48216,10 +48356,11 @@
48216
48356
  var requestConfig = _extends({}, item, {
48217
48357
  type: "arraybuffer"
48218
48358
  });
48359
+ var url = item.url;
48219
48360
  resourceManager // @ts-ignore
48220
- ._request(item.url, requestConfig).then(function(buffer) {
48361
+ ._request(url, requestConfig).then(function(buffer) {
48221
48362
  var texture = HDRLoader._setTextureByBuffer(engine, buffer);
48222
- engine.resourceManager.addContentRestorer(new HDRContentRestorer(texture, item.url, requestConfig));
48363
+ engine.resourceManager.addContentRestorer(new HDRContentRestorer(texture, url, requestConfig));
48223
48364
  resolve(texture);
48224
48365
  }).catch(reject);
48225
48366
  });
@@ -48524,9 +48665,12 @@
48524
48665
  _proto.restoreContent = function restoreContent() {
48525
48666
  var _this = this;
48526
48667
  return new AssetPromise(function(resolve, reject) {
48527
- request(_this.url, _this.requestConfig).then(function(buffer) {
48528
- HDRLoader._setTextureByBuffer(_this.resource.engine, buffer, _this.resource);
48529
- resolve(_this.resource);
48668
+ var resource = _this.resource;
48669
+ var engine = resource.engine;
48670
+ engine.resourceManager // @ts-ignore
48671
+ ._request(_this.url, _this.requestConfig).then(function(buffer) {
48672
+ HDRLoader._setTextureByBuffer(engine, buffer, resource);
48673
+ resolve(resource);
48530
48674
  }).catch(reject);
48531
48675
  });
48532
48676
  };
@@ -48776,11 +48920,12 @@
48776
48920
  }
48777
48921
  var _proto = KTXLoader.prototype;
48778
48922
  _proto.load = function load(item, resourceManager) {
48923
+ var requestConfig = _extends({}, item, {
48924
+ type: "arraybuffer"
48925
+ });
48779
48926
  return new AssetPromise(function(resolve, reject) {
48780
48927
  resourceManager // @ts-ignore
48781
- ._request(item.url, _extends({}, item, {
48782
- type: "arraybuffer"
48783
- })).then(function(bin) {
48928
+ ._request(item.url, requestConfig).then(function(bin) {
48784
48929
  var parsedData = parseSingleKTX(bin);
48785
48930
  var width = parsedData.width, height = parsedData.height, mipmaps = parsedData.mipmaps, engineFormat = parsedData.engineFormat;
48786
48931
  var mipmap = mipmaps.length > 1;
@@ -48789,6 +48934,7 @@
48789
48934
  var _mipmaps_miplevel = mipmaps[miplevel], width1 = _mipmaps_miplevel.width, height1 = _mipmaps_miplevel.height, data = _mipmaps_miplevel.data;
48790
48935
  texture.setPixelBuffer(data, miplevel, 0, 0, width1, height1);
48791
48936
  }
48937
+ resourceManager.addContentRestorer(new KTXContentRestorer(texture, item.url, requestConfig));
48792
48938
  resolve(texture);
48793
48939
  }).catch(function(e) {
48794
48940
  reject(e);
@@ -48802,6 +48948,34 @@
48802
48948
  "ktx"
48803
48949
  ])
48804
48950
  ], KTXLoader);
48951
+ var KTXContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
48952
+ _inherits(KTXContentRestorer, ContentRestorer);
48953
+ function KTXContentRestorer(resource, url, requestConfig) {
48954
+ var _this;
48955
+ _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
48956
+ return _this;
48957
+ }
48958
+ var _proto = KTXContentRestorer.prototype;
48959
+ _proto.restoreContent = function restoreContent() {
48960
+ var _this = this;
48961
+ var resource = this.resource;
48962
+ var engine = resource.engine;
48963
+ return new AssetPromise(function(resolve, reject) {
48964
+ engine.resourceManager // @ts-ignore
48965
+ ._request(_this.url, _this.requestConfig).then(function(bin) {
48966
+ var mipmaps = parseSingleKTX(bin).mipmaps;
48967
+ for(var miplevel = 0; miplevel < mipmaps.length; miplevel++){
48968
+ var _mipmaps_miplevel = mipmaps[miplevel], width = _mipmaps_miplevel.width, height = _mipmaps_miplevel.height, data = _mipmaps_miplevel.data;
48969
+ resource.setPixelBuffer(data, miplevel, 0, 0, width, height);
48970
+ }
48971
+ resolve(resource);
48972
+ }).catch(function(e) {
48973
+ reject(e);
48974
+ });
48975
+ });
48976
+ };
48977
+ return KTXContentRestorer;
48978
+ }(ContentRestorer);
48805
48979
  function parseProperty(object, key, value) {
48806
48980
  if ((typeof value === "undefined" ? "undefined" : _type_of1(value)) === "object") {
48807
48981
  for(var subKey in value){
@@ -48903,13 +49077,16 @@
48903
49077
  }
48904
49078
  var _proto = MeshLoader.prototype;
48905
49079
  _proto.load = function load(item, resourceManager) {
49080
+ var requestConfig = _extends({}, item, {
49081
+ type: "arraybuffer"
49082
+ });
49083
+ var url = item.url;
48906
49084
  return new AssetPromise(function(resolve, reject) {
48907
49085
  resourceManager // @ts-ignore
48908
- ._request(item.url, _extends({}, item, {
48909
- type: "arraybuffer"
48910
- })).then(function(data) {
49086
+ ._request(url, requestConfig).then(function(data) {
48911
49087
  return decode(data, resourceManager.engine);
48912
49088
  }).then(function(mesh) {
49089
+ resourceManager.addContentRestorer(new MeshContentRestorer(mesh, url, requestConfig));
48913
49090
  resolve(mesh);
48914
49091
  }).catch(reject);
48915
49092
  });
@@ -48921,6 +49098,29 @@
48921
49098
  "mesh"
48922
49099
  ])
48923
49100
  ], MeshLoader);
49101
+ var MeshContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
49102
+ _inherits(MeshContentRestorer, ContentRestorer);
49103
+ function MeshContentRestorer(resource, url, requestConfig) {
49104
+ var _this;
49105
+ _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
49106
+ return _this;
49107
+ }
49108
+ var _proto = MeshContentRestorer.prototype;
49109
+ _proto.restoreContent = function restoreContent() {
49110
+ var _this = this;
49111
+ var resource = this.resource;
49112
+ var engine = resource.engine;
49113
+ return new AssetPromise(function(resolve, reject) {
49114
+ engine.resourceManager // @ts-ignore
49115
+ ._request(_this.url, _this.requestConfig).then(function(data) {
49116
+ return decode(data, engine, resource);
49117
+ }).then(function(mesh) {
49118
+ resolve(mesh);
49119
+ }).catch(reject);
49120
+ });
49121
+ };
49122
+ return MeshContentRestorer;
49123
+ }(ContentRestorer);
48924
49124
  var PrimitiveMeshLoader = /*#__PURE__*/ function(Loader) {
48925
49125
  _inherits(PrimitiveMeshLoader, Loader);
48926
49126
  function PrimitiveMeshLoader() {
@@ -49649,18 +49849,24 @@
49649
49849
  exports.GLTFMaterialParser._checkOtherTextureTransform(clearcoatTexture, "Clear coat");
49650
49850
  context.get(GLTFParserType.Texture, clearcoatTexture.index).then(function(texture) {
49651
49851
  material.clearCoatTexture = texture;
49852
+ }).catch(function(e) {
49853
+ Logger.error("KHR_materials_clearcoat: clearcoat texture error", e);
49652
49854
  });
49653
49855
  }
49654
49856
  if (clearcoatRoughnessTexture) {
49655
49857
  exports.GLTFMaterialParser._checkOtherTextureTransform(clearcoatRoughnessTexture, "Clear coat roughness");
49656
49858
  context.get(GLTFParserType.Texture, clearcoatRoughnessTexture.index).then(function(texture) {
49657
49859
  material.clearCoatRoughnessTexture = texture;
49860
+ }).catch(function(e) {
49861
+ Logger.error("KHR_materials_clearcoat: clearcoat roughness texture error", e);
49658
49862
  });
49659
49863
  }
49660
49864
  if (clearcoatNormalTexture) {
49661
49865
  exports.GLTFMaterialParser._checkOtherTextureTransform(clearcoatNormalTexture, "Clear coat normal");
49662
49866
  context.get(GLTFParserType.Texture, clearcoatNormalTexture.index).then(function(texture) {
49663
49867
  material.clearCoatNormalTexture = texture;
49868
+ }).catch(function(e) {
49869
+ Logger.error("KHR_materials_clearcoat: clearcoat normal texture error", e);
49664
49870
  });
49665
49871
  }
49666
49872
  };
@@ -49701,6 +49907,8 @@
49701
49907
  context.get(GLTFParserType.Texture, diffuseTexture.index).then(function(texture) {
49702
49908
  material.baseTexture = texture;
49703
49909
  GLTFParser.executeExtensionsAdditiveAndParse(diffuseTexture.extensions, context, material, diffuseTexture);
49910
+ }).catch(function(e) {
49911
+ Logger.error("KHR_materials_pbrSpecularGlossiness: diffuse texture error", e);
49704
49912
  });
49705
49913
  }
49706
49914
  if (specularFactor) {
@@ -49713,6 +49921,8 @@
49713
49921
  exports.GLTFMaterialParser._checkOtherTextureTransform(specularGlossinessTexture, "Specular glossiness");
49714
49922
  context.get(GLTFParserType.Texture, specularGlossinessTexture.index).then(function(texture) {
49715
49923
  material.specularGlossinessTexture = texture;
49924
+ }).catch(function(e) {
49925
+ Logger.error("KHR_materials_pbrSpecularGlossiness: specular glossiness texture error", e);
49716
49926
  });
49717
49927
  }
49718
49928
  material.name = ownerSchema.name;
@@ -49740,12 +49950,16 @@
49740
49950
  exports.GLTFMaterialParser._checkOtherTextureTransform(sheenColorTexture, "Sheen texture");
49741
49951
  context.get(GLTFParserType.Texture, sheenColorTexture.index).then(function(texture) {
49742
49952
  material.sheenColorTexture = texture;
49953
+ }).catch(function(e) {
49954
+ Logger.error("KHR_materials_sheen: sheenColorTexture error", e);
49743
49955
  });
49744
49956
  }
49745
49957
  if (sheenRoughnessTexture) {
49746
49958
  exports.GLTFMaterialParser._checkOtherTextureTransform(sheenRoughnessTexture, "SheenRoughness texture");
49747
49959
  context.get(GLTFParserType.Texture, sheenRoughnessTexture.index).then(function(texture) {
49748
49960
  material.sheenRoughnessTexture = texture;
49961
+ }).catch(function(e) {
49962
+ Logger.error("KHR_materials_sheen: sheenRoughnessTexture error", e);
49749
49963
  });
49750
49964
  }
49751
49965
  };
@@ -49767,6 +49981,8 @@
49767
49981
  exports.GLTFMaterialParser._checkOtherTextureTransform(transmissionTexture, "Transmission texture");
49768
49982
  context.get(GLTFParserType.Texture, transmissionTexture.index).then(function(texture) {
49769
49983
  material.transmissionTexture = texture;
49984
+ }).catch(function(e) {
49985
+ Logger.error("KHR_materials_transmission: transmission texture error", e);
49770
49986
  });
49771
49987
  }
49772
49988
  };
@@ -49810,6 +50026,8 @@
49810
50026
  return variantNames[index].name;
49811
50027
  })
49812
50028
  });
50029
+ }).catch(function(e) {
50030
+ Logger.error("KHR_materials_variants: material error", e);
49813
50031
  });
49814
50032
  };
49815
50033
  var _glTFResource;
@@ -49842,6 +50060,8 @@
49842
50060
  exports.GLTFMaterialParser._checkOtherTextureTransform(thicknessTexture, "Thickness texture");
49843
50061
  context.get(GLTFParserType.Texture, thicknessTexture.index).then(function(texture) {
49844
50062
  material.thicknessTexture = texture;
50063
+ }).catch(function(e) {
50064
+ Logger.error("KHR_materials_volume: thickness texture error", e);
49845
50065
  });
49846
50066
  }
49847
50067
  };
@@ -49867,57 +50087,48 @@
49867
50087
  }
49868
50088
  var _proto = KHR_texture_basisu.prototype;
49869
50089
  _proto.createAndParse = function createAndParse(context, schema, textureInfo) {
49870
- return _async_to_generator(function() {
49871
- var glTF, glTFResource, engine, url, sampler, textureName, source, _glTF_images_source, uri, bufferViewIndex, mimeType, imageName, samplerInfo, index, promise, bufferView;
49872
- return __generator(this, function(_state) {
49873
- glTF = context.glTF, glTFResource = context.glTFResource;
49874
- engine = glTFResource.engine, url = glTFResource.url;
49875
- sampler = textureInfo.sampler, textureName = textureInfo.name;
49876
- source = schema.source;
49877
- _glTF_images_source = glTF.images[source], uri = _glTF_images_source.uri, bufferViewIndex = _glTF_images_source.bufferView, mimeType = _glTF_images_source.mimeType, imageName = _glTF_images_source.name;
49878
- samplerInfo = sampler !== undefined && GLTFUtils.getSamplerInfo(glTF.samplers[sampler]);
49879
- if (uri) {
49880
- index = uri.lastIndexOf(".");
49881
- promise = engine.resourceManager.load({
49882
- url: Utils.resolveAbsoluteUrl(url, uri),
49883
- type: AssetType.KTX2
49884
- }).onProgress(undefined, context._onTaskDetail).then(function(texture) {
49885
- if (!texture.name) {
49886
- texture.name = textureName || imageName || "texture_" + index;
49887
- }
49888
- if (sampler !== undefined) {
49889
- GLTFUtils.parseSampler(texture, samplerInfo);
49890
- }
49891
- return texture;
49892
- });
49893
- context._addTaskCompletePromise(promise);
49894
- return [
49895
- 2,
49896
- promise
49897
- ];
49898
- } else {
49899
- bufferView = glTF.bufferViews[bufferViewIndex];
49900
- return [
49901
- 2,
49902
- context.get(GLTFParserType.Buffer, bufferView.buffer).then(function(buffer) {
49903
- var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
49904
- return exports.KTX2Loader._parseBuffer(imageBuffer, engine).then(function(param) {
49905
- var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
49906
- return exports.KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params);
49907
- }).then(function(texture) {
49908
- texture.name = textureName || imageName || "texture_" + bufferViewIndex;
49909
- if (sampler !== undefined) {
49910
- GLTFUtils.parseSampler(texture, samplerInfo);
49911
- }
49912
- var bufferTextureRestoreInfo = new BufferTextureRestoreInfo(texture, bufferView, mimeType);
49913
- context.contentRestorer.bufferTextures.push(bufferTextureRestoreInfo);
49914
- return texture;
49915
- });
49916
- })
49917
- ];
50090
+ var glTF = context.glTF, glTFResource = context.glTFResource;
50091
+ var engine = glTFResource.engine, url = glTFResource.url;
50092
+ var sampler = textureInfo.sampler, textureName = textureInfo.name;
50093
+ var source = schema.source;
50094
+ var _glTF_images_source = glTF.images[source], uri = _glTF_images_source.uri, bufferViewIndex = _glTF_images_source.bufferView, mimeType = _glTF_images_source.mimeType, imageName = _glTF_images_source.name;
50095
+ var samplerInfo = sampler !== undefined && GLTFUtils.getSamplerInfo(glTF.samplers[sampler]);
50096
+ if (uri) {
50097
+ var index = uri.lastIndexOf(".");
50098
+ var promise = engine.resourceManager.load({
50099
+ url: Utils.resolveAbsoluteUrl(url, uri),
50100
+ type: AssetType.KTX2
50101
+ }).onProgress(undefined, context._onTaskDetail).then(function(texture) {
50102
+ if (!texture.name) {
50103
+ texture.name = textureName || imageName || "texture_" + index;
50104
+ }
50105
+ if (sampler !== undefined) {
50106
+ GLTFUtils.parseSampler(texture, samplerInfo);
49918
50107
  }
50108
+ return texture;
49919
50109
  });
49920
- })();
50110
+ context._addTaskCompletePromise(promise);
50111
+ return promise;
50112
+ } else {
50113
+ var bufferView = glTF.bufferViews[bufferViewIndex];
50114
+ return context.get(GLTFParserType.Buffer, bufferView.buffer).then(function(buffer) {
50115
+ var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
50116
+ return exports.KTX2Loader._parseBuffer(imageBuffer, engine).then(function(param) {
50117
+ var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
50118
+ return exports.KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params);
50119
+ }).then(function(texture) {
50120
+ texture.name = textureName || imageName || "texture_" + bufferViewIndex;
50121
+ if (sampler !== undefined) {
50122
+ GLTFUtils.parseSampler(texture, samplerInfo);
50123
+ }
50124
+ var bufferTextureRestoreInfo = new BufferTextureRestoreInfo(texture, bufferView, mimeType);
50125
+ context.contentRestorer.bufferTextures.push(bufferTextureRestoreInfo);
50126
+ return texture;
50127
+ });
50128
+ }).catch(function(e) {
50129
+ Logger.error("KHR_texture_basisu: buffer error", e);
50130
+ });
50131
+ }
49921
50132
  };
49922
50133
  return KHR_texture_basisu;
49923
50134
  }(GLTFExtensionParser);
@@ -50003,6 +50214,8 @@
50003
50214
  return getMeshoptDecoder().then(function(decoder) {
50004
50215
  return decoder.decodeGltfBuffer(schema.count, schema.byteStride, new Uint8Array(arrayBuffer, schema.byteOffset, schema.byteLength), schema.mode, schema.filter);
50005
50216
  });
50217
+ }).catch(function(e) {
50218
+ Logger.error("EXT_meshopt_compression: buffer error", e);
50006
50219
  });
50007
50220
  };
50008
50221
  return EXT_meshopt_compression;
@@ -50024,6 +50237,8 @@
50024
50237
  exports.GLTFMaterialParser._checkOtherTextureTransform(anisotropyTexture, "Anisotropy texture");
50025
50238
  context.get(GLTFParserType.Texture, anisotropyTexture.index).then(function(texture) {
50026
50239
  material.anisotropyTexture = texture;
50240
+ }).catch(function(e) {
50241
+ Logger.error("KHR_materials_anisotropy: anisotropy texture error", e);
50027
50242
  });
50028
50243
  }
50029
50244
  };
@@ -50047,12 +50262,16 @@
50047
50262
  exports.GLTFMaterialParser._checkOtherTextureTransform(iridescenceTexture, "Iridescence texture");
50048
50263
  context.get(GLTFParserType.Texture, iridescenceTexture.index).then(function(texture) {
50049
50264
  material.iridescenceTexture = texture;
50265
+ }).catch(function(e) {
50266
+ Logger.error("KHR_materials_iridescence: iridescence texture error", e);
50050
50267
  });
50051
50268
  }
50052
50269
  if (iridescenceThicknessTexture) {
50053
50270
  exports.GLTFMaterialParser._checkOtherTextureTransform(iridescenceThicknessTexture, "IridescenceThickness texture");
50054
50271
  context.get(GLTFParserType.Texture, iridescenceThicknessTexture.index).then(function(texture) {
50055
50272
  material.iridescenceThicknessTexture = texture;
50273
+ }).catch(function(e) {
50274
+ Logger.error("KHR_materials_iridescence: iridescence thickness error", e);
50056
50275
  });
50057
50276
  }
50058
50277
  };
@@ -50078,19 +50297,10 @@
50078
50297
  }
50079
50298
  var _proto = EXT_texture_webp.prototype;
50080
50299
  _proto.createAndParse = function createAndParse(context, schema, textureInfo, textureIndex) {
50081
- var _this = this;
50082
- return _async_to_generator(function() {
50083
- var webPIndex, sampler, tmp, fallbackIndex, textureName, texture;
50084
- return __generator(this, function(_state) {
50085
- webPIndex = schema.source;
50086
- sampler = textureInfo.sampler, tmp = textureInfo.source, fallbackIndex = tmp === void 0 ? 0 : tmp, textureName = textureInfo.name;
50087
- texture = exports.GLTFTextureParser._parseTexture(context, _this._supportWebP ? webPIndex : fallbackIndex, textureIndex, sampler, textureName);
50088
- return [
50089
- 2,
50090
- texture
50091
- ];
50092
- });
50093
- })();
50300
+ var webPIndex = schema.source;
50301
+ var sampler = textureInfo.sampler, tmp = textureInfo.source, fallbackIndex = tmp === void 0 ? 0 : tmp, textureName = textureInfo.name;
50302
+ var texture = exports.GLTFTextureParser._parseTexture(context, this._supportWebP ? webPIndex : fallbackIndex, textureIndex, sampler, textureName);
50303
+ return texture;
50094
50304
  };
50095
50305
  return EXT_texture_webp;
50096
50306
  }(GLTFExtensionParser);
@@ -50099,7 +50309,7 @@
50099
50309
  ], EXT_texture_webp);
50100
50310
 
50101
50311
  //@ts-ignore
50102
- var version = "1.4.14";
50312
+ var version = "1.4.16";
50103
50313
  console.log("Galacean Engine Version: " + version);
50104
50314
  for(var key in CoreObjects){
50105
50315
  Loader.registerClass(key, CoreObjects[key]);