@galacean/engine-loader 0.9.0-beta.81 → 0.9.0

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/module.js CHANGED
@@ -3,54 +3,37 @@ import { SphericalHarmonics3, Vector2, Vector3, Vector4, Color, Quaternion, Matr
3
3
  import { DRACODecoder } from '@galacean/engine-draco';
4
4
  import { GLCompressedTextureInternalFormat } from '@galacean/engine-rhi-webgl';
5
5
 
6
- function extends_() {
7
- extends_ = Object.assign || function (target) {
8
- for (var i = 1; i < arguments.length; i++) {
9
- var source = arguments[i];
10
-
11
- for (var key in source) {
12
- if (Object.prototype.hasOwnProperty.call(source, key)) {
13
- target[key] = source[key];
6
+ function _extends() {
7
+ _extends = Object.assign || function assign(target) {
8
+ for (var i = 1; i < arguments.length; i++) {
9
+ var source = arguments[i];
10
+ for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
14
11
  }
15
- }
16
- }
17
12
 
18
- return target;
19
- };
20
-
21
- return extends_.apply(this, arguments);
22
- }
13
+ return target;
14
+ };
23
15
 
24
- function _extends() {
25
- return extends_.apply(this, arguments);
16
+ return _extends.apply(this, arguments);
26
17
  }
27
18
 
28
- function setPrototypeOf(o, p) {
29
- setPrototypeOf = Object.setPrototypeOf || function setPrototypeOf(o, p) {
30
- o.__proto__ = p;
31
- return o;
32
- };
19
+ function _set_prototype_of(o, p) {
20
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
21
+ o.__proto__ = p;
33
22
 
34
- return setPrototypeOf(o, p);
35
- }
23
+ return o;
24
+ };
36
25
 
37
- function _setPrototypeOf(o, p) {
38
- return setPrototypeOf(o, p);
26
+ return _set_prototype_of(o, p);
39
27
  }
40
28
 
41
29
  function _inherits(subClass, superClass) {
42
- if (typeof superClass !== "function" && superClass !== null) {
43
- throw new TypeError("Super expression must either be null or a function");
44
- }
45
-
46
- subClass.prototype = Object.create(superClass && superClass.prototype, {
47
- constructor: {
48
- value: subClass,
49
- writable: true,
50
- configurable: true
30
+ if (typeof superClass !== "function" && superClass !== null) {
31
+ throw new TypeError("Super expression must either be null or a function");
51
32
  }
52
- });
53
- if (superClass) _setPrototypeOf(subClass, superClass);
33
+
34
+ subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
35
+
36
+ if (superClass) _set_prototype_of(subClass, superClass);
54
37
  }
55
38
 
56
39
  /******************************************************************************
@@ -266,39 +249,34 @@ EnvLoader = __decorate([
266
249
  ], EnvLoader);
267
250
 
268
251
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
269
- try {
270
- var info = gen[key](arg);
271
- var value = info.value;
272
- } catch (error) {
273
- reject(error);
274
- return;
275
- }
276
-
277
- if (info.done) {
278
- resolve(value);
279
- } else {
280
- Promise.resolve(value).then(_next, _throw);
281
- }
252
+ try {
253
+ var info = gen[key](arg);
254
+ var value = info.value;
255
+ } catch (error) {
256
+ reject(error);
257
+ return;
258
+ }
259
+ if (info.done) resolve(value);
260
+ else Promise.resolve(value).then(_next, _throw);
282
261
  }
262
+ function _async_to_generator(fn) {
263
+ return function() {
264
+ var self = this, args = arguments;
283
265
 
284
- function _asyncToGenerator(fn) {
285
- return function () {
286
- var self = this,
287
- args = arguments;
288
- return new Promise(function (resolve, reject) {
289
- var gen = fn.apply(self, args);
266
+ return new Promise(function(resolve, reject) {
267
+ var gen = fn.apply(self, args);
290
268
 
291
- function _next(value) {
292
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
293
- }
269
+ function _next(value) {
270
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
271
+ }
294
272
 
295
- function _throw(err) {
296
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
297
- }
273
+ function _throw(err) {
274
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
275
+ }
298
276
 
299
- _next(undefined);
300
- });
301
- };
277
+ _next(undefined);
278
+ });
279
+ };
302
280
  }
303
281
 
304
282
  var FontLoader = /*#__PURE__*/ function(Loader) {
@@ -331,7 +309,7 @@ var FontLoader = /*#__PURE__*/ function(Loader) {
331
309
  });
332
310
  };
333
311
  _proto._registerFont = function _registerFont(fontName, fontUrl) {
334
- return _asyncToGenerator(function() {
312
+ return _async_to_generator(function() {
335
313
  var fontFace;
336
314
  return __generator(this, function(_state) {
337
315
  switch(_state.label){
@@ -944,36 +922,41 @@ var TextureWrapMode;
944
922
  return GLTFUtil;
945
923
  }();
946
924
 
947
- function _arrayLikeToArray(arr, len) {
948
- if (len == null || len > arr.length) len = arr.length;
949
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
950
- return arr2;
925
+ function _array_like_to_array(arr, len) {
926
+ if (len == null || len > arr.length) len = arr.length;
927
+
928
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
929
+
930
+ return arr2;
951
931
  }
952
932
 
953
- function _arrayWithoutHoles(arr) {
954
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
933
+ function _array_without_holes(arr) {
934
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
955
935
  }
956
936
 
957
- function _iterableToArray(iter) {
958
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
937
+ function _iterable_to_array(iter) {
938
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
939
+ return Array.from(iter);
940
+ }
959
941
  }
960
942
 
961
- function _nonIterableSpread() {
962
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
943
+ function _non_iterable_spread() {
944
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
963
945
  }
964
946
 
965
- function _unsupportedIterableToArray(o, minLen) {
966
- if (!o) return;
967
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
968
- var n = Object.prototype.toString.call(o).slice(8, -1);
969
- if (n === "Object" && o.constructor) n = o.constructor.name;
970
- if (n === "Map" || n === "Set") return Array.from(n);
971
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
972
- return _arrayLikeToArray(o, minLen);
947
+ function _unsupported_iterable_to_array(o, minLen) {
948
+ if (!o) return;
949
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
950
+
951
+ var n = Object.prototype.toString.call(o).slice(8, -1);
952
+
953
+ if (n === "Object" && o.constructor) n = o.constructor.name;
954
+ if (n === "Map" || n === "Set") return Array.from(n);
955
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
973
956
  }
974
957
 
975
- function _toConsumableArray(arr) {
976
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
958
+ function _to_consumable_array(arr) {
959
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
977
960
  }
978
961
 
979
962
  var Parser = /*#__PURE__*/ function() {
@@ -990,7 +973,7 @@ var Parser = /*#__PURE__*/ function() {
990
973
  extensionSchema,
991
974
  parseResource,
992
975
  context
993
- ].concat(_toConsumableArray(extra)));
976
+ ].concat(_to_consumable_array(extra)));
994
977
  }
995
978
  }
996
979
  };
@@ -1004,7 +987,7 @@ var Parser = /*#__PURE__*/ function() {
1004
987
  return (_parsers_ = parsers[0]).createEngineResource.apply(_parsers_, [
1005
988
  extensionSchema,
1006
989
  context
1007
- ].concat(_toConsumableArray(extra)));
990
+ ].concat(_to_consumable_array(extra)));
1008
991
  }
1009
992
  };
1010
993
  Parser.hasExtensionParser = function hasExtensionParser(extensionName) {
@@ -1029,7 +1012,9 @@ var Parser = /*#__PURE__*/ function() {
1029
1012
  };
1030
1013
  return Parser;
1031
1014
  }();
1032
- Parser._extensionParsers = {};
1015
+ (function() {
1016
+ Parser._extensionParsers = {};
1017
+ })();
1033
1018
  /**
1034
1019
  * Declare ExtensionParser's decorator.
1035
1020
  * @param extensionName - Extension name
@@ -1104,11 +1089,9 @@ KHR_draco_mesh_compression = __decorate([
1104
1089
  ], KHR_draco_mesh_compression);
1105
1090
 
1106
1091
  function _instanceof(left, right) {
1107
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1108
- return !!right[Symbol.hasInstance](left);
1109
- } else {
1110
- return left instanceof right;
1111
- }
1092
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1093
+ return !!right[Symbol.hasInstance](left);
1094
+ } else return left instanceof right;
1112
1095
  }
1113
1096
 
1114
1097
  var KHR_lights_punctual = /*#__PURE__*/ function(ExtensionParser) {
@@ -1431,23 +1414,24 @@ GalaceanMaterialsRemap = __decorate([
1431
1414
  registerExtension("OASIS_materials_remap")
1432
1415
  ], GalaceanMaterialsRemap);
1433
1416
 
1434
- function _createForOfIteratorHelperLoose(o, allowArrayLike) {
1417
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1435
1418
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
1419
+
1436
1420
  if (it) return (it = it.call(o)).next.bind(it);
1437
1421
  // Fallback for engines without symbol support
1438
- if (
1439
- Array.isArray(o) ||
1440
- (it = _unsupportedIterableToArray(o)) ||
1441
- (allowArrayLike && o && typeof o.length === "number")
1442
- ) {
1422
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
1443
1423
  if (it) o = it;
1424
+
1444
1425
  var i = 0;
1445
- return function () {
1426
+
1427
+ return function() {
1446
1428
  if (i >= o.length) return { done: true };
1429
+
1447
1430
  return { done: false, value: o[i++] };
1448
- }
1431
+ };
1449
1432
  }
1450
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1433
+
1434
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1451
1435
  }
1452
1436
 
1453
1437
  var AnimationParser = /*#__PURE__*/ function(Parser) {
@@ -1740,7 +1724,9 @@ var EntityParser = /*#__PURE__*/ function(Parser) {
1740
1724
  };
1741
1725
  return EntityParser;
1742
1726
  }(Parser);
1743
- /** @internal */ EntityParser._defaultName = "_GLTF_ENTITY_";
1727
+ (function() {
1728
+ /** @internal */ EntityParser._defaultName = "_GLTF_ENTITY_";
1729
+ })();
1744
1730
 
1745
1731
  var MeshParser = /*#__PURE__*/ function(Parser1) {
1746
1732
  _inherits(MeshParser, Parser1);
@@ -1816,6 +1802,8 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
1816
1802
  var vertexElements = new Array();
1817
1803
  var vertexCount;
1818
1804
  var bufferBindIndex = 0;
1805
+ var positions;
1806
+ keepMeshData && (positions = new Array(vertexCount));
1819
1807
  for(var attribute in attributes){
1820
1808
  var accessor = accessors[attributes[attribute]];
1821
1809
  var accessorBuffer = GLTFUtil.getAccessorBuffer(context, gltf, accessor);
@@ -1857,16 +1845,24 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
1857
1845
  if (accessor.min && accessor.max) {
1858
1846
  min.copyFromArray(accessor.min);
1859
1847
  max.copyFromArray(accessor.max);
1848
+ if (keepMeshData) {
1849
+ var stride1 = vertices.length / attributeCount;
1850
+ for(var j = 0; j < attributeCount; j++){
1851
+ var offset = j * stride1;
1852
+ positions[j] = new Vector3(vertices[offset], vertices[offset + 1], vertices[offset + 2]);
1853
+ }
1854
+ }
1860
1855
  } else {
1861
1856
  var position = MeshParser._tempVector3;
1862
1857
  min.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
1863
1858
  max.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
1864
- var stride1 = vertices.length / attributeCount;
1865
- for(var j = 0; j < attributeCount; j++){
1866
- var offset = j * stride1;
1867
- position.copyFromArray(vertices, offset);
1859
+ var stride2 = vertices.length / attributeCount;
1860
+ for(var j1 = 0; j1 < attributeCount; j1++){
1861
+ var offset1 = j1 * stride2;
1862
+ position.copyFromArray(vertices, offset1);
1868
1863
  Vector3.min(min, position, min);
1869
1864
  Vector3.max(max, position, max);
1865
+ keepMeshData && (positions[j1] = position.clone());
1870
1866
  }
1871
1867
  }
1872
1868
  if (accessor.normalized) {
@@ -1889,6 +1885,8 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
1889
1885
  // BlendShapes
1890
1886
  targets && this._createBlendShape(mesh, gltfMesh, targets, getBlendShapeData);
1891
1887
  mesh.uploadData(!keepMeshData);
1888
+ //@ts-ignore
1889
+ mesh._positions = positions;
1892
1890
  return Promise.resolve(mesh);
1893
1891
  };
1894
1892
  _proto._createBlendShape = function _createBlendShape(mesh, glTFMesh, glTFTargets, getBlendShapeData) {
@@ -2010,7 +2008,9 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
2010
2008
  };
2011
2009
  return MeshParser;
2012
2010
  }(Parser);
2013
- MeshParser._tempVector3 = new Vector3();
2011
+ (function() {
2012
+ MeshParser._tempVector3 = new Vector3();
2013
+ })();
2014
2014
 
2015
2015
  var SceneParser$1 = /*#__PURE__*/ function(Parser1) {
2016
2016
  _inherits(SceneParser, Parser1);
@@ -2219,7 +2219,7 @@ var SkinParser = /*#__PURE__*/ function(Parser) {
2219
2219
  };
2220
2220
  _proto._findSkeletonRootBone = function _findSkeletonRootBone(joints, entities) {
2221
2221
  var paths = {};
2222
- for(var _iterator = _createForOfIteratorHelperLoose(joints), _step; !(_step = _iterator()).done;){
2222
+ for(var _iterator = _create_for_of_iterator_helper_loose(joints), _step; !(_step = _iterator()).done;){
2223
2223
  var index = _step.value;
2224
2224
  var path = new Array();
2225
2225
  var entity = entities[index];
@@ -2321,8 +2321,10 @@ var TextureParser = /*#__PURE__*/ function(Parser) {
2321
2321
  };
2322
2322
  return TextureParser;
2323
2323
  }(Parser);
2324
- var _obj;
2325
- TextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = TextureWrapMode$1.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = TextureWrapMode$1.Mirror, _obj[TextureWrapMode.REPEAT] = TextureWrapMode$1.Repeat, _obj);
2324
+ (function() {
2325
+ var _obj;
2326
+ TextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = TextureWrapMode$1.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = TextureWrapMode$1.Mirror, _obj[TextureWrapMode.REPEAT] = TextureWrapMode$1.Repeat, _obj);
2327
+ })();
2326
2328
 
2327
2329
  var Validator = /*#__PURE__*/ function(Parser1) {
2328
2330
  _inherits(Validator, Parser1);
@@ -2394,17 +2396,19 @@ var GLTFParser = /*#__PURE__*/ function() {
2394
2396
  };
2395
2397
  return GLTFParser;
2396
2398
  }();
2397
- GLTFParser.defaultPipeline = new GLTFParser([
2398
- BufferParser,
2399
- Validator,
2400
- TextureParser,
2401
- MaterialParser,
2402
- MeshParser,
2403
- EntityParser,
2404
- SkinParser,
2405
- AnimationParser,
2406
- SceneParser$1
2407
- ]);
2399
+ (function() {
2400
+ GLTFParser.defaultPipeline = new GLTFParser([
2401
+ BufferParser,
2402
+ Validator,
2403
+ TextureParser,
2404
+ MaterialParser,
2405
+ MeshParser,
2406
+ EntityParser,
2407
+ SkinParser,
2408
+ AnimationParser,
2409
+ SceneParser$1
2410
+ ]);
2411
+ })();
2408
2412
 
2409
2413
  /**
2410
2414
  * Product after GLTF parser, usually, `defaultSceneRoot` is only needed to use.
@@ -2456,7 +2460,7 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
2456
2460
  context.keepMeshData = (_item_params_keepMeshData = (_item_params = item.params) == null ? void 0 : _item_params.keepMeshData) != null ? _item_params_keepMeshData : false;
2457
2461
  masterPromiseInfo.onCancel(function() {
2458
2462
  var chainPromises = context.chainPromises;
2459
- for(var _iterator = _createForOfIteratorHelperLoose(chainPromises), _step; !(_step = _iterator()).done;){
2463
+ for(var _iterator = _create_for_of_iterator_helper_loose(chainPromises), _step; !(_step = _iterator()).done;){
2460
2464
  var promise = _step.value;
2461
2465
  promise.cancel();
2462
2466
  }
@@ -2717,37 +2721,75 @@ var HDRLoader = (_HDRLoader = /*#__PURE__*/ function(Loader) {
2717
2721
  color.a *= M;
2718
2722
  };
2719
2723
  return HDRLoader1;
2720
- }(Loader), _HDRLoader._rightBottomBack = new Vector3(1.0, -1.0, -1.0), _HDRLoader._rightBottomFront = new Vector3(1.0, -1.0, 1.0), _HDRLoader._rightUpBack = new Vector3(1.0, 1.0, -1.0), _HDRLoader._rightUpFront = new Vector3(1.0, 1.0, 1.0), _HDRLoader._leftBottomBack = new Vector3(-1.0, -1.0, -1.0), _HDRLoader._leftBottomFront = new Vector3(-1.0, -1.0, 1.0), _HDRLoader._leftUpBack = new Vector3(-1.0, 1.0, -1.0), _HDRLoader._leftUpFront = new Vector3(-1.0, 1.0, 1.0), _HDRLoader._faceRight = [
2721
- _HDRLoader._rightBottomBack,
2722
- _HDRLoader._rightBottomFront,
2723
- _HDRLoader._rightUpBack,
2724
- _HDRLoader._rightUpFront
2725
- ], _HDRLoader._faceLeft = [
2726
- _HDRLoader._leftBottomFront,
2727
- _HDRLoader._leftBottomBack,
2728
- _HDRLoader._leftUpFront,
2729
- _HDRLoader._leftUpBack
2730
- ], _HDRLoader._faceUp = [
2731
- _HDRLoader._leftBottomFront,
2732
- _HDRLoader._rightBottomFront,
2733
- _HDRLoader._leftBottomBack,
2734
- _HDRLoader._rightBottomBack
2735
- ], _HDRLoader._faceBottom = [
2736
- _HDRLoader._leftUpBack,
2737
- _HDRLoader._rightUpBack,
2738
- _HDRLoader._leftUpFront,
2739
- _HDRLoader._rightUpFront
2740
- ], _HDRLoader._faceFront = [
2741
- _HDRLoader._leftBottomBack,
2742
- _HDRLoader._rightBottomBack,
2743
- _HDRLoader._leftUpBack,
2744
- _HDRLoader._rightUpBack
2745
- ], _HDRLoader._faceBack = [
2746
- _HDRLoader._rightBottomFront,
2747
- _HDRLoader._leftBottomFront,
2748
- _HDRLoader._rightUpFront,
2749
- _HDRLoader._leftUpFront
2750
- ], _HDRLoader._tempVector3 = new Vector3(), _HDRLoader._temp2Vector3 = new Vector3(), _HDRLoader._temp3Vector3 = new Vector3(), _HDRLoader._temp4Vector3 = new Vector3(), _HDRLoader._temp5Vector3 = new Vector3(), _HDRLoader);
2724
+ }(Loader), function() {
2725
+ _HDRLoader._rightBottomBack = new Vector3(1.0, -1.0, -1.0);
2726
+ }(), function() {
2727
+ _HDRLoader._rightBottomFront = new Vector3(1.0, -1.0, 1.0);
2728
+ }(), function() {
2729
+ _HDRLoader._rightUpBack = new Vector3(1.0, 1.0, -1.0);
2730
+ }(), function() {
2731
+ _HDRLoader._rightUpFront = new Vector3(1.0, 1.0, 1.0);
2732
+ }(), function() {
2733
+ _HDRLoader._leftBottomBack = new Vector3(-1.0, -1.0, -1.0);
2734
+ }(), function() {
2735
+ _HDRLoader._leftBottomFront = new Vector3(-1.0, -1.0, 1.0);
2736
+ }(), function() {
2737
+ _HDRLoader._leftUpBack = new Vector3(-1.0, 1.0, -1.0);
2738
+ }(), function() {
2739
+ _HDRLoader._leftUpFront = new Vector3(-1.0, 1.0, 1.0);
2740
+ }(), function() {
2741
+ _HDRLoader._faceRight = [
2742
+ _HDRLoader._rightBottomBack,
2743
+ _HDRLoader._rightBottomFront,
2744
+ _HDRLoader._rightUpBack,
2745
+ _HDRLoader._rightUpFront
2746
+ ];
2747
+ }(), function() {
2748
+ _HDRLoader._faceLeft = [
2749
+ _HDRLoader._leftBottomFront,
2750
+ _HDRLoader._leftBottomBack,
2751
+ _HDRLoader._leftUpFront,
2752
+ _HDRLoader._leftUpBack
2753
+ ];
2754
+ }(), function() {
2755
+ _HDRLoader._faceUp = [
2756
+ _HDRLoader._leftBottomFront,
2757
+ _HDRLoader._rightBottomFront,
2758
+ _HDRLoader._leftBottomBack,
2759
+ _HDRLoader._rightBottomBack
2760
+ ];
2761
+ }(), function() {
2762
+ _HDRLoader._faceBottom = [
2763
+ _HDRLoader._leftUpBack,
2764
+ _HDRLoader._rightUpBack,
2765
+ _HDRLoader._leftUpFront,
2766
+ _HDRLoader._rightUpFront
2767
+ ];
2768
+ }(), function() {
2769
+ _HDRLoader._faceFront = [
2770
+ _HDRLoader._leftBottomBack,
2771
+ _HDRLoader._rightBottomBack,
2772
+ _HDRLoader._leftUpBack,
2773
+ _HDRLoader._rightUpBack
2774
+ ];
2775
+ }(), function() {
2776
+ _HDRLoader._faceBack = [
2777
+ _HDRLoader._rightBottomFront,
2778
+ _HDRLoader._leftBottomFront,
2779
+ _HDRLoader._rightUpFront,
2780
+ _HDRLoader._leftUpFront
2781
+ ];
2782
+ }(), function() {
2783
+ _HDRLoader._tempVector3 = new Vector3();
2784
+ }(), function() {
2785
+ _HDRLoader._temp2Vector3 = new Vector3();
2786
+ }(), function() {
2787
+ _HDRLoader._temp3Vector3 = new Vector3();
2788
+ }(), function() {
2789
+ _HDRLoader._temp4Vector3 = new Vector3();
2790
+ }(), function() {
2791
+ _HDRLoader._temp5Vector3 = new Vector3();
2792
+ }(), _HDRLoader);
2751
2793
  HDRLoader = __decorate([
2752
2794
  resourceLoader(AssetType.HDR, [
2753
2795
  "hdr"
@@ -3117,19 +3159,21 @@ MaterialLoader = __decorate([
3117
3159
  ], MaterialLoader);
3118
3160
 
3119
3161
  function _defineProperties(target, props) {
3120
- for (var i = 0; i < props.length; i++) {
3121
- var descriptor = props[i];
3122
- descriptor.enumerable = descriptor.enumerable || false;
3123
- descriptor.configurable = true;
3124
- if ("value" in descriptor) descriptor.writable = true;
3125
- Object.defineProperty(target, descriptor.key, descriptor);
3126
- }
3162
+ for (var i = 0; i < props.length; i++) {
3163
+ var descriptor = props[i];
3164
+ descriptor.enumerable = descriptor.enumerable || false;
3165
+ descriptor.configurable = true;
3166
+
3167
+ if ("value" in descriptor) descriptor.writable = true;
3168
+
3169
+ Object.defineProperty(target, descriptor.key, descriptor);
3170
+ }
3127
3171
  }
3172
+ function _create_class(Constructor, protoProps, staticProps) {
3173
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
3174
+ if (staticProps) _defineProperties(Constructor, staticProps);
3128
3175
 
3129
- function _createClass(Constructor, protoProps, staticProps) {
3130
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
3131
- if (staticProps) _defineProperties(Constructor, staticProps);
3132
- return Constructor;
3176
+ return Constructor;
3133
3177
  }
3134
3178
 
3135
3179
  var BufferReader = /*#__PURE__*/ function() {
@@ -3238,7 +3282,7 @@ var BufferReader = /*#__PURE__*/ function() {
3238
3282
  if (byteLength < maxByteLength) this._offset++;
3239
3283
  return new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + byteOffset, byteLength);
3240
3284
  };
3241
- _createClass(BufferReader, [
3285
+ _create_class(BufferReader, [
3242
3286
  {
3243
3287
  key: "offset",
3244
3288
  get: function get() {
@@ -3248,12 +3292,14 @@ var BufferReader = /*#__PURE__*/ function() {
3248
3292
  ]);
3249
3293
  return BufferReader;
3250
3294
  }();
3251
- BufferReader.imageMapping = {
3252
- 0: "image/png",
3253
- 1: "image/jpg",
3254
- 2: "image/webp",
3255
- 3: "ktx"
3256
- };
3295
+ (function() {
3296
+ BufferReader.imageMapping = {
3297
+ 0: "image/png",
3298
+ 1: "image/jpg",
3299
+ 2: "image/webp",
3300
+ 3: "ktx"
3301
+ };
3302
+ })();
3257
3303
 
3258
3304
  var decoderMap = {};
3259
3305
  /**
@@ -3292,7 +3338,7 @@ var FileHeader = /*#__PURE__*/ function() {
3292
3338
  header.headerLength = nameUint8Array.byteLength + typeUint8Array.byteLength + 9;
3293
3339
  return header;
3294
3340
  };
3295
- _createClass(FileHeader, [
3341
+ _create_class(FileHeader, [
3296
3342
  {
3297
3343
  key: "dataLength",
3298
3344
  get: function get() {
@@ -3511,38 +3557,36 @@ Texture2DDecoder = __decorate([
3511
3557
  decoder("Texture2D")
3512
3558
  ], Texture2DDecoder);
3513
3559
 
3514
- function isNativeReflectConstruct() {
3515
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3516
- if (Reflect.construct.sham) return false;
3517
- if (typeof Proxy === "function") return true;
3518
-
3519
- try {
3520
- Date.prototype.toString.call(Reflect.construct(Date, [], function () { }));
3521
- return true;
3522
- } catch (e) {
3523
- return false;
3524
- }
3525
- }
3560
+ function _is_native_reflect_construct() {
3561
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3562
+ if (Reflect.construct.sham) return false;
3563
+ if (typeof Proxy === "function") return true;
3526
3564
 
3527
- function construct(Parent, args, Class) {
3528
- if (isNativeReflectConstruct()) {
3529
- construct = Reflect.construct;
3530
- } else {
3531
- construct = function construct(Parent, args, Class) {
3532
- var a = [null];
3533
- a.push.apply(a, args);
3534
- var Constructor = Function.bind.apply(Parent, a);
3535
- var instance = new Constructor();
3536
- if (Class) _setPrototypeOf(instance, Class.prototype);
3537
- return instance;
3538
- };
3539
- }
3565
+ try {
3566
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3540
3567
 
3541
- return construct.apply(null, arguments);
3568
+ return true;
3569
+ } catch (e) {
3570
+ return false;
3571
+ }
3542
3572
  }
3543
3573
 
3544
3574
  function _construct(Parent, args, Class) {
3545
- return construct.apply(null, arguments);
3575
+ if (_is_native_reflect_construct()) _construct = Reflect.construct;
3576
+ else {
3577
+ _construct = function construct(Parent, args, Class) {
3578
+ var a = [null];
3579
+ a.push.apply(a, args);
3580
+ var Constructor = Function.bind.apply(Parent, a);
3581
+ var instance = new Constructor();
3582
+
3583
+ if (Class) _set_prototype_of(instance, Class.prototype);
3584
+
3585
+ return instance;
3586
+ };
3587
+ }
3588
+
3589
+ return _construct.apply(null, arguments);
3546
3590
  }
3547
3591
 
3548
3592
  var ReflectionParser = /*#__PURE__*/ function() {
@@ -3657,7 +3701,9 @@ var ReflectionParser = /*#__PURE__*/ function() {
3657
3701
  };
3658
3702
  return ReflectionParser;
3659
3703
  }();
3660
- ReflectionParser.customParseComponentHandles = new Map();
3704
+ (function() {
3705
+ ReflectionParser.customParseComponentHandles = new Map();
3706
+ })();
3661
3707
 
3662
3708
  var PrefabParser = /*#__PURE__*/ function() {
3663
3709
  function PrefabParser() {}
@@ -3911,7 +3957,7 @@ var SceneParserContext = /*#__PURE__*/ function() {
3911
3957
  };
3912
3958
  _proto._organizeEntities = function _organizeEntities() {
3913
3959
  var _this_context = this.context, entityConfigMap = _this_context.entityConfigMap, entityMap = _this_context.entityMap, scene = _this_context.scene, rootIds = _this_context.rootIds;
3914
- for(var _iterator = _createForOfIteratorHelperLoose(rootIds), _step; !(_step = _iterator()).done;){
3960
+ for(var _iterator = _create_for_of_iterator_helper_loose(rootIds), _step; !(_step = _iterator()).done;){
3915
3961
  var rootId = _step.value;
3916
3962
  PrefabParser.parseChildren(entityConfigMap, entityMap, rootId);
3917
3963
  }
@@ -4075,7 +4121,7 @@ var SourceFontLoader = /*#__PURE__*/ function(Loader) {
4075
4121
  });
4076
4122
  };
4077
4123
  _proto._registerFont = function _registerFont(fontName, fontUrl) {
4078
- return _asyncToGenerator(function() {
4124
+ return _async_to_generator(function() {
4079
4125
  var fontFace;
4080
4126
  return __generator(this, function(_state) {
4081
4127
  switch(_state.label){
@@ -4396,7 +4442,7 @@ SceneLoader = __decorate([
4396
4442
  "prefab"
4397
4443
  ], true)
4398
4444
  ], SceneLoader);
4399
- ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _asyncToGenerator(function(instance, item, engine) {
4445
+ ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item, engine) {
4400
4446
  var props;
4401
4447
  return __generator(this, function(_state) {
4402
4448
  props = item.props;