@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/main.js CHANGED
@@ -7,54 +7,37 @@ var engineMath = require('@galacean/engine-math');
7
7
  var engineDraco = require('@galacean/engine-draco');
8
8
  var engineRhiWebgl = require('@galacean/engine-rhi-webgl');
9
9
 
10
- function extends_() {
11
- extends_ = Object.assign || function (target) {
12
- for (var i = 1; i < arguments.length; i++) {
13
- var source = arguments[i];
14
-
15
- for (var key in source) {
16
- if (Object.prototype.hasOwnProperty.call(source, key)) {
17
- target[key] = source[key];
10
+ function _extends() {
11
+ _extends = Object.assign || function assign(target) {
12
+ for (var i = 1; i < arguments.length; i++) {
13
+ var source = arguments[i];
14
+ for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
18
15
  }
19
- }
20
- }
21
16
 
22
- return target;
23
- };
24
-
25
- return extends_.apply(this, arguments);
26
- }
17
+ return target;
18
+ };
27
19
 
28
- function _extends() {
29
- return extends_.apply(this, arguments);
20
+ return _extends.apply(this, arguments);
30
21
  }
31
22
 
32
- function setPrototypeOf(o, p) {
33
- setPrototypeOf = Object.setPrototypeOf || function setPrototypeOf(o, p) {
34
- o.__proto__ = p;
35
- return o;
36
- };
23
+ function _set_prototype_of(o, p) {
24
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
25
+ o.__proto__ = p;
37
26
 
38
- return setPrototypeOf(o, p);
39
- }
27
+ return o;
28
+ };
40
29
 
41
- function _setPrototypeOf(o, p) {
42
- return setPrototypeOf(o, p);
30
+ return _set_prototype_of(o, p);
43
31
  }
44
32
 
45
33
  function _inherits(subClass, superClass) {
46
- if (typeof superClass !== "function" && superClass !== null) {
47
- throw new TypeError("Super expression must either be null or a function");
48
- }
49
-
50
- subClass.prototype = Object.create(superClass && superClass.prototype, {
51
- constructor: {
52
- value: subClass,
53
- writable: true,
54
- configurable: true
34
+ if (typeof superClass !== "function" && superClass !== null) {
35
+ throw new TypeError("Super expression must either be null or a function");
55
36
  }
56
- });
57
- if (superClass) _setPrototypeOf(subClass, superClass);
37
+
38
+ subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
39
+
40
+ if (superClass) _set_prototype_of(subClass, superClass);
58
41
  }
59
42
 
60
43
  /******************************************************************************
@@ -270,39 +253,34 @@ EnvLoader = __decorate([
270
253
  ], EnvLoader);
271
254
 
272
255
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
273
- try {
274
- var info = gen[key](arg);
275
- var value = info.value;
276
- } catch (error) {
277
- reject(error);
278
- return;
279
- }
280
-
281
- if (info.done) {
282
- resolve(value);
283
- } else {
284
- Promise.resolve(value).then(_next, _throw);
285
- }
256
+ try {
257
+ var info = gen[key](arg);
258
+ var value = info.value;
259
+ } catch (error) {
260
+ reject(error);
261
+ return;
262
+ }
263
+ if (info.done) resolve(value);
264
+ else Promise.resolve(value).then(_next, _throw);
286
265
  }
266
+ function _async_to_generator(fn) {
267
+ return function() {
268
+ var self = this, args = arguments;
287
269
 
288
- function _asyncToGenerator(fn) {
289
- return function () {
290
- var self = this,
291
- args = arguments;
292
- return new Promise(function (resolve, reject) {
293
- var gen = fn.apply(self, args);
270
+ return new Promise(function(resolve, reject) {
271
+ var gen = fn.apply(self, args);
294
272
 
295
- function _next(value) {
296
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
297
- }
273
+ function _next(value) {
274
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
275
+ }
298
276
 
299
- function _throw(err) {
300
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
301
- }
277
+ function _throw(err) {
278
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
279
+ }
302
280
 
303
- _next(undefined);
304
- });
305
- };
281
+ _next(undefined);
282
+ });
283
+ };
306
284
  }
307
285
 
308
286
  var FontLoader = /*#__PURE__*/ function(Loader) {
@@ -335,7 +313,7 @@ var FontLoader = /*#__PURE__*/ function(Loader) {
335
313
  });
336
314
  };
337
315
  _proto._registerFont = function _registerFont(fontName, fontUrl) {
338
- return _asyncToGenerator(function() {
316
+ return _async_to_generator(function() {
339
317
  var fontFace;
340
318
  return __generator(this, function(_state) {
341
319
  switch(_state.label){
@@ -948,36 +926,41 @@ var TextureWrapMode;
948
926
  return GLTFUtil;
949
927
  }();
950
928
 
951
- function _arrayLikeToArray(arr, len) {
952
- if (len == null || len > arr.length) len = arr.length;
953
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
954
- return arr2;
929
+ function _array_like_to_array(arr, len) {
930
+ if (len == null || len > arr.length) len = arr.length;
931
+
932
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
933
+
934
+ return arr2;
955
935
  }
956
936
 
957
- function _arrayWithoutHoles(arr) {
958
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
937
+ function _array_without_holes(arr) {
938
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
959
939
  }
960
940
 
961
- function _iterableToArray(iter) {
962
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
941
+ function _iterable_to_array(iter) {
942
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
943
+ return Array.from(iter);
944
+ }
963
945
  }
964
946
 
965
- function _nonIterableSpread() {
966
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
947
+ function _non_iterable_spread() {
948
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
967
949
  }
968
950
 
969
- function _unsupportedIterableToArray(o, minLen) {
970
- if (!o) return;
971
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
972
- var n = Object.prototype.toString.call(o).slice(8, -1);
973
- if (n === "Object" && o.constructor) n = o.constructor.name;
974
- if (n === "Map" || n === "Set") return Array.from(n);
975
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
976
- return _arrayLikeToArray(o, minLen);
951
+ function _unsupported_iterable_to_array(o, minLen) {
952
+ if (!o) return;
953
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
954
+
955
+ var n = Object.prototype.toString.call(o).slice(8, -1);
956
+
957
+ if (n === "Object" && o.constructor) n = o.constructor.name;
958
+ if (n === "Map" || n === "Set") return Array.from(n);
959
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
977
960
  }
978
961
 
979
- function _toConsumableArray(arr) {
980
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
962
+ function _to_consumable_array(arr) {
963
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
981
964
  }
982
965
 
983
966
  var Parser = /*#__PURE__*/ function() {
@@ -994,7 +977,7 @@ var Parser = /*#__PURE__*/ function() {
994
977
  extensionSchema,
995
978
  parseResource,
996
979
  context
997
- ].concat(_toConsumableArray(extra)));
980
+ ].concat(_to_consumable_array(extra)));
998
981
  }
999
982
  }
1000
983
  };
@@ -1008,7 +991,7 @@ var Parser = /*#__PURE__*/ function() {
1008
991
  return (_parsers_ = parsers[0]).createEngineResource.apply(_parsers_, [
1009
992
  extensionSchema,
1010
993
  context
1011
- ].concat(_toConsumableArray(extra)));
994
+ ].concat(_to_consumable_array(extra)));
1012
995
  }
1013
996
  };
1014
997
  Parser.hasExtensionParser = function hasExtensionParser(extensionName) {
@@ -1033,7 +1016,9 @@ var Parser = /*#__PURE__*/ function() {
1033
1016
  };
1034
1017
  return Parser;
1035
1018
  }();
1036
- Parser._extensionParsers = {};
1019
+ (function() {
1020
+ Parser._extensionParsers = {};
1021
+ })();
1037
1022
  /**
1038
1023
  * Declare ExtensionParser's decorator.
1039
1024
  * @param extensionName - Extension name
@@ -1108,11 +1093,9 @@ KHR_draco_mesh_compression = __decorate([
1108
1093
  ], KHR_draco_mesh_compression);
1109
1094
 
1110
1095
  function _instanceof(left, right) {
1111
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1112
- return !!right[Symbol.hasInstance](left);
1113
- } else {
1114
- return left instanceof right;
1115
- }
1096
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1097
+ return !!right[Symbol.hasInstance](left);
1098
+ } else return left instanceof right;
1116
1099
  }
1117
1100
 
1118
1101
  var KHR_lights_punctual = /*#__PURE__*/ function(ExtensionParser) {
@@ -1435,23 +1418,24 @@ GalaceanMaterialsRemap = __decorate([
1435
1418
  registerExtension("OASIS_materials_remap")
1436
1419
  ], GalaceanMaterialsRemap);
1437
1420
 
1438
- function _createForOfIteratorHelperLoose(o, allowArrayLike) {
1421
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1439
1422
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
1423
+
1440
1424
  if (it) return (it = it.call(o)).next.bind(it);
1441
1425
  // Fallback for engines without symbol support
1442
- if (
1443
- Array.isArray(o) ||
1444
- (it = _unsupportedIterableToArray(o)) ||
1445
- (allowArrayLike && o && typeof o.length === "number")
1446
- ) {
1426
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
1447
1427
  if (it) o = it;
1428
+
1448
1429
  var i = 0;
1449
- return function () {
1430
+
1431
+ return function() {
1450
1432
  if (i >= o.length) return { done: true };
1433
+
1451
1434
  return { done: false, value: o[i++] };
1452
- }
1435
+ };
1453
1436
  }
1454
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1437
+
1438
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1455
1439
  }
1456
1440
 
1457
1441
  var AnimationParser = /*#__PURE__*/ function(Parser) {
@@ -1744,7 +1728,9 @@ var EntityParser = /*#__PURE__*/ function(Parser) {
1744
1728
  };
1745
1729
  return EntityParser;
1746
1730
  }(Parser);
1747
- /** @internal */ EntityParser._defaultName = "_GLTF_ENTITY_";
1731
+ (function() {
1732
+ /** @internal */ EntityParser._defaultName = "_GLTF_ENTITY_";
1733
+ })();
1748
1734
 
1749
1735
  var MeshParser = /*#__PURE__*/ function(Parser1) {
1750
1736
  _inherits(MeshParser, Parser1);
@@ -1820,6 +1806,8 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
1820
1806
  var vertexElements = new Array();
1821
1807
  var vertexCount;
1822
1808
  var bufferBindIndex = 0;
1809
+ var positions;
1810
+ keepMeshData && (positions = new Array(vertexCount));
1823
1811
  for(var attribute in attributes){
1824
1812
  var accessor = accessors[attributes[attribute]];
1825
1813
  var accessorBuffer = GLTFUtil.getAccessorBuffer(context, gltf, accessor);
@@ -1861,16 +1849,24 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
1861
1849
  if (accessor.min && accessor.max) {
1862
1850
  min.copyFromArray(accessor.min);
1863
1851
  max.copyFromArray(accessor.max);
1852
+ if (keepMeshData) {
1853
+ var stride1 = vertices.length / attributeCount;
1854
+ for(var j = 0; j < attributeCount; j++){
1855
+ var offset = j * stride1;
1856
+ positions[j] = new engineMath.Vector3(vertices[offset], vertices[offset + 1], vertices[offset + 2]);
1857
+ }
1858
+ }
1864
1859
  } else {
1865
1860
  var position = MeshParser._tempVector3;
1866
1861
  min.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
1867
1862
  max.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
1868
- var stride1 = vertices.length / attributeCount;
1869
- for(var j = 0; j < attributeCount; j++){
1870
- var offset = j * stride1;
1871
- position.copyFromArray(vertices, offset);
1863
+ var stride2 = vertices.length / attributeCount;
1864
+ for(var j1 = 0; j1 < attributeCount; j1++){
1865
+ var offset1 = j1 * stride2;
1866
+ position.copyFromArray(vertices, offset1);
1872
1867
  engineMath.Vector3.min(min, position, min);
1873
1868
  engineMath.Vector3.max(max, position, max);
1869
+ keepMeshData && (positions[j1] = position.clone());
1874
1870
  }
1875
1871
  }
1876
1872
  if (accessor.normalized) {
@@ -1893,6 +1889,8 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
1893
1889
  // BlendShapes
1894
1890
  targets && this._createBlendShape(mesh, gltfMesh, targets, getBlendShapeData);
1895
1891
  mesh.uploadData(!keepMeshData);
1892
+ //@ts-ignore
1893
+ mesh._positions = positions;
1896
1894
  return Promise.resolve(mesh);
1897
1895
  };
1898
1896
  _proto._createBlendShape = function _createBlendShape(mesh, glTFMesh, glTFTargets, getBlendShapeData) {
@@ -2014,7 +2012,9 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
2014
2012
  };
2015
2013
  return MeshParser;
2016
2014
  }(Parser);
2017
- MeshParser._tempVector3 = new engineMath.Vector3();
2015
+ (function() {
2016
+ MeshParser._tempVector3 = new engineMath.Vector3();
2017
+ })();
2018
2018
 
2019
2019
  var SceneParser$1 = /*#__PURE__*/ function(Parser1) {
2020
2020
  _inherits(SceneParser, Parser1);
@@ -2223,7 +2223,7 @@ var SkinParser = /*#__PURE__*/ function(Parser) {
2223
2223
  };
2224
2224
  _proto._findSkeletonRootBone = function _findSkeletonRootBone(joints, entities) {
2225
2225
  var paths = {};
2226
- for(var _iterator = _createForOfIteratorHelperLoose(joints), _step; !(_step = _iterator()).done;){
2226
+ for(var _iterator = _create_for_of_iterator_helper_loose(joints), _step; !(_step = _iterator()).done;){
2227
2227
  var index = _step.value;
2228
2228
  var path = new Array();
2229
2229
  var entity = entities[index];
@@ -2325,8 +2325,10 @@ var TextureParser = /*#__PURE__*/ function(Parser) {
2325
2325
  };
2326
2326
  return TextureParser;
2327
2327
  }(Parser);
2328
- var _obj;
2329
- TextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = engineCore.TextureWrapMode.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = engineCore.TextureWrapMode.Mirror, _obj[TextureWrapMode.REPEAT] = engineCore.TextureWrapMode.Repeat, _obj);
2328
+ (function() {
2329
+ var _obj;
2330
+ TextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = engineCore.TextureWrapMode.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = engineCore.TextureWrapMode.Mirror, _obj[TextureWrapMode.REPEAT] = engineCore.TextureWrapMode.Repeat, _obj);
2331
+ })();
2330
2332
 
2331
2333
  var Validator = /*#__PURE__*/ function(Parser1) {
2332
2334
  _inherits(Validator, Parser1);
@@ -2398,17 +2400,19 @@ var GLTFParser = /*#__PURE__*/ function() {
2398
2400
  };
2399
2401
  return GLTFParser;
2400
2402
  }();
2401
- GLTFParser.defaultPipeline = new GLTFParser([
2402
- BufferParser,
2403
- Validator,
2404
- TextureParser,
2405
- MaterialParser,
2406
- MeshParser,
2407
- EntityParser,
2408
- SkinParser,
2409
- AnimationParser,
2410
- SceneParser$1
2411
- ]);
2403
+ (function() {
2404
+ GLTFParser.defaultPipeline = new GLTFParser([
2405
+ BufferParser,
2406
+ Validator,
2407
+ TextureParser,
2408
+ MaterialParser,
2409
+ MeshParser,
2410
+ EntityParser,
2411
+ SkinParser,
2412
+ AnimationParser,
2413
+ SceneParser$1
2414
+ ]);
2415
+ })();
2412
2416
 
2413
2417
  /**
2414
2418
  * Product after GLTF parser, usually, `defaultSceneRoot` is only needed to use.
@@ -2460,7 +2464,7 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
2460
2464
  context.keepMeshData = (_item_params_keepMeshData = (_item_params = item.params) == null ? void 0 : _item_params.keepMeshData) != null ? _item_params_keepMeshData : false;
2461
2465
  masterPromiseInfo.onCancel(function() {
2462
2466
  var chainPromises = context.chainPromises;
2463
- for(var _iterator = _createForOfIteratorHelperLoose(chainPromises), _step; !(_step = _iterator()).done;){
2467
+ for(var _iterator = _create_for_of_iterator_helper_loose(chainPromises), _step; !(_step = _iterator()).done;){
2464
2468
  var promise = _step.value;
2465
2469
  promise.cancel();
2466
2470
  }
@@ -2721,37 +2725,75 @@ var HDRLoader = (_HDRLoader = /*#__PURE__*/ function(Loader) {
2721
2725
  color.a *= M;
2722
2726
  };
2723
2727
  return HDRLoader1;
2724
- }(engineCore.Loader), _HDRLoader._rightBottomBack = new engineMath.Vector3(1.0, -1.0, -1.0), _HDRLoader._rightBottomFront = new engineMath.Vector3(1.0, -1.0, 1.0), _HDRLoader._rightUpBack = new engineMath.Vector3(1.0, 1.0, -1.0), _HDRLoader._rightUpFront = new engineMath.Vector3(1.0, 1.0, 1.0), _HDRLoader._leftBottomBack = new engineMath.Vector3(-1.0, -1.0, -1.0), _HDRLoader._leftBottomFront = new engineMath.Vector3(-1.0, -1.0, 1.0), _HDRLoader._leftUpBack = new engineMath.Vector3(-1.0, 1.0, -1.0), _HDRLoader._leftUpFront = new engineMath.Vector3(-1.0, 1.0, 1.0), _HDRLoader._faceRight = [
2725
- _HDRLoader._rightBottomBack,
2726
- _HDRLoader._rightBottomFront,
2727
- _HDRLoader._rightUpBack,
2728
- _HDRLoader._rightUpFront
2729
- ], _HDRLoader._faceLeft = [
2730
- _HDRLoader._leftBottomFront,
2731
- _HDRLoader._leftBottomBack,
2732
- _HDRLoader._leftUpFront,
2733
- _HDRLoader._leftUpBack
2734
- ], _HDRLoader._faceUp = [
2735
- _HDRLoader._leftBottomFront,
2736
- _HDRLoader._rightBottomFront,
2737
- _HDRLoader._leftBottomBack,
2738
- _HDRLoader._rightBottomBack
2739
- ], _HDRLoader._faceBottom = [
2740
- _HDRLoader._leftUpBack,
2741
- _HDRLoader._rightUpBack,
2742
- _HDRLoader._leftUpFront,
2743
- _HDRLoader._rightUpFront
2744
- ], _HDRLoader._faceFront = [
2745
- _HDRLoader._leftBottomBack,
2746
- _HDRLoader._rightBottomBack,
2747
- _HDRLoader._leftUpBack,
2748
- _HDRLoader._rightUpBack
2749
- ], _HDRLoader._faceBack = [
2750
- _HDRLoader._rightBottomFront,
2751
- _HDRLoader._leftBottomFront,
2752
- _HDRLoader._rightUpFront,
2753
- _HDRLoader._leftUpFront
2754
- ], _HDRLoader._tempVector3 = new engineMath.Vector3(), _HDRLoader._temp2Vector3 = new engineMath.Vector3(), _HDRLoader._temp3Vector3 = new engineMath.Vector3(), _HDRLoader._temp4Vector3 = new engineMath.Vector3(), _HDRLoader._temp5Vector3 = new engineMath.Vector3(), _HDRLoader);
2728
+ }(engineCore.Loader), function() {
2729
+ _HDRLoader._rightBottomBack = new engineMath.Vector3(1.0, -1.0, -1.0);
2730
+ }(), function() {
2731
+ _HDRLoader._rightBottomFront = new engineMath.Vector3(1.0, -1.0, 1.0);
2732
+ }(), function() {
2733
+ _HDRLoader._rightUpBack = new engineMath.Vector3(1.0, 1.0, -1.0);
2734
+ }(), function() {
2735
+ _HDRLoader._rightUpFront = new engineMath.Vector3(1.0, 1.0, 1.0);
2736
+ }(), function() {
2737
+ _HDRLoader._leftBottomBack = new engineMath.Vector3(-1.0, -1.0, -1.0);
2738
+ }(), function() {
2739
+ _HDRLoader._leftBottomFront = new engineMath.Vector3(-1.0, -1.0, 1.0);
2740
+ }(), function() {
2741
+ _HDRLoader._leftUpBack = new engineMath.Vector3(-1.0, 1.0, -1.0);
2742
+ }(), function() {
2743
+ _HDRLoader._leftUpFront = new engineMath.Vector3(-1.0, 1.0, 1.0);
2744
+ }(), function() {
2745
+ _HDRLoader._faceRight = [
2746
+ _HDRLoader._rightBottomBack,
2747
+ _HDRLoader._rightBottomFront,
2748
+ _HDRLoader._rightUpBack,
2749
+ _HDRLoader._rightUpFront
2750
+ ];
2751
+ }(), function() {
2752
+ _HDRLoader._faceLeft = [
2753
+ _HDRLoader._leftBottomFront,
2754
+ _HDRLoader._leftBottomBack,
2755
+ _HDRLoader._leftUpFront,
2756
+ _HDRLoader._leftUpBack
2757
+ ];
2758
+ }(), function() {
2759
+ _HDRLoader._faceUp = [
2760
+ _HDRLoader._leftBottomFront,
2761
+ _HDRLoader._rightBottomFront,
2762
+ _HDRLoader._leftBottomBack,
2763
+ _HDRLoader._rightBottomBack
2764
+ ];
2765
+ }(), function() {
2766
+ _HDRLoader._faceBottom = [
2767
+ _HDRLoader._leftUpBack,
2768
+ _HDRLoader._rightUpBack,
2769
+ _HDRLoader._leftUpFront,
2770
+ _HDRLoader._rightUpFront
2771
+ ];
2772
+ }(), function() {
2773
+ _HDRLoader._faceFront = [
2774
+ _HDRLoader._leftBottomBack,
2775
+ _HDRLoader._rightBottomBack,
2776
+ _HDRLoader._leftUpBack,
2777
+ _HDRLoader._rightUpBack
2778
+ ];
2779
+ }(), function() {
2780
+ _HDRLoader._faceBack = [
2781
+ _HDRLoader._rightBottomFront,
2782
+ _HDRLoader._leftBottomFront,
2783
+ _HDRLoader._rightUpFront,
2784
+ _HDRLoader._leftUpFront
2785
+ ];
2786
+ }(), function() {
2787
+ _HDRLoader._tempVector3 = new engineMath.Vector3();
2788
+ }(), function() {
2789
+ _HDRLoader._temp2Vector3 = new engineMath.Vector3();
2790
+ }(), function() {
2791
+ _HDRLoader._temp3Vector3 = new engineMath.Vector3();
2792
+ }(), function() {
2793
+ _HDRLoader._temp4Vector3 = new engineMath.Vector3();
2794
+ }(), function() {
2795
+ _HDRLoader._temp5Vector3 = new engineMath.Vector3();
2796
+ }(), _HDRLoader);
2755
2797
  HDRLoader = __decorate([
2756
2798
  engineCore.resourceLoader(engineCore.AssetType.HDR, [
2757
2799
  "hdr"
@@ -3121,19 +3163,21 @@ MaterialLoader = __decorate([
3121
3163
  ], MaterialLoader);
3122
3164
 
3123
3165
  function _defineProperties(target, props) {
3124
- for (var i = 0; i < props.length; i++) {
3125
- var descriptor = props[i];
3126
- descriptor.enumerable = descriptor.enumerable || false;
3127
- descriptor.configurable = true;
3128
- if ("value" in descriptor) descriptor.writable = true;
3129
- Object.defineProperty(target, descriptor.key, descriptor);
3130
- }
3166
+ for (var i = 0; i < props.length; i++) {
3167
+ var descriptor = props[i];
3168
+ descriptor.enumerable = descriptor.enumerable || false;
3169
+ descriptor.configurable = true;
3170
+
3171
+ if ("value" in descriptor) descriptor.writable = true;
3172
+
3173
+ Object.defineProperty(target, descriptor.key, descriptor);
3174
+ }
3131
3175
  }
3176
+ function _create_class(Constructor, protoProps, staticProps) {
3177
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
3178
+ if (staticProps) _defineProperties(Constructor, staticProps);
3132
3179
 
3133
- function _createClass(Constructor, protoProps, staticProps) {
3134
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
3135
- if (staticProps) _defineProperties(Constructor, staticProps);
3136
- return Constructor;
3180
+ return Constructor;
3137
3181
  }
3138
3182
 
3139
3183
  var BufferReader = /*#__PURE__*/ function() {
@@ -3242,7 +3286,7 @@ var BufferReader = /*#__PURE__*/ function() {
3242
3286
  if (byteLength < maxByteLength) this._offset++;
3243
3287
  return new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + byteOffset, byteLength);
3244
3288
  };
3245
- _createClass(BufferReader, [
3289
+ _create_class(BufferReader, [
3246
3290
  {
3247
3291
  key: "offset",
3248
3292
  get: function get() {
@@ -3252,12 +3296,14 @@ var BufferReader = /*#__PURE__*/ function() {
3252
3296
  ]);
3253
3297
  return BufferReader;
3254
3298
  }();
3255
- BufferReader.imageMapping = {
3256
- 0: "image/png",
3257
- 1: "image/jpg",
3258
- 2: "image/webp",
3259
- 3: "ktx"
3260
- };
3299
+ (function() {
3300
+ BufferReader.imageMapping = {
3301
+ 0: "image/png",
3302
+ 1: "image/jpg",
3303
+ 2: "image/webp",
3304
+ 3: "ktx"
3305
+ };
3306
+ })();
3261
3307
 
3262
3308
  var decoderMap = {};
3263
3309
  /**
@@ -3296,7 +3342,7 @@ var FileHeader = /*#__PURE__*/ function() {
3296
3342
  header.headerLength = nameUint8Array.byteLength + typeUint8Array.byteLength + 9;
3297
3343
  return header;
3298
3344
  };
3299
- _createClass(FileHeader, [
3345
+ _create_class(FileHeader, [
3300
3346
  {
3301
3347
  key: "dataLength",
3302
3348
  get: function get() {
@@ -3515,38 +3561,36 @@ exports.Texture2DDecoder = __decorate([
3515
3561
  decoder("Texture2D")
3516
3562
  ], exports.Texture2DDecoder);
3517
3563
 
3518
- function isNativeReflectConstruct() {
3519
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3520
- if (Reflect.construct.sham) return false;
3521
- if (typeof Proxy === "function") return true;
3522
-
3523
- try {
3524
- Date.prototype.toString.call(Reflect.construct(Date, [], function () { }));
3525
- return true;
3526
- } catch (e) {
3527
- return false;
3528
- }
3529
- }
3564
+ function _is_native_reflect_construct() {
3565
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3566
+ if (Reflect.construct.sham) return false;
3567
+ if (typeof Proxy === "function") return true;
3530
3568
 
3531
- function construct(Parent, args, Class) {
3532
- if (isNativeReflectConstruct()) {
3533
- construct = Reflect.construct;
3534
- } else {
3535
- construct = function construct(Parent, args, Class) {
3536
- var a = [null];
3537
- a.push.apply(a, args);
3538
- var Constructor = Function.bind.apply(Parent, a);
3539
- var instance = new Constructor();
3540
- if (Class) _setPrototypeOf(instance, Class.prototype);
3541
- return instance;
3542
- };
3543
- }
3569
+ try {
3570
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3544
3571
 
3545
- return construct.apply(null, arguments);
3572
+ return true;
3573
+ } catch (e) {
3574
+ return false;
3575
+ }
3546
3576
  }
3547
3577
 
3548
3578
  function _construct(Parent, args, Class) {
3549
- return construct.apply(null, arguments);
3579
+ if (_is_native_reflect_construct()) _construct = Reflect.construct;
3580
+ else {
3581
+ _construct = function construct(Parent, args, Class) {
3582
+ var a = [null];
3583
+ a.push.apply(a, args);
3584
+ var Constructor = Function.bind.apply(Parent, a);
3585
+ var instance = new Constructor();
3586
+
3587
+ if (Class) _set_prototype_of(instance, Class.prototype);
3588
+
3589
+ return instance;
3590
+ };
3591
+ }
3592
+
3593
+ return _construct.apply(null, arguments);
3550
3594
  }
3551
3595
 
3552
3596
  var ReflectionParser = /*#__PURE__*/ function() {
@@ -3661,7 +3705,9 @@ var ReflectionParser = /*#__PURE__*/ function() {
3661
3705
  };
3662
3706
  return ReflectionParser;
3663
3707
  }();
3664
- ReflectionParser.customParseComponentHandles = new Map();
3708
+ (function() {
3709
+ ReflectionParser.customParseComponentHandles = new Map();
3710
+ })();
3665
3711
 
3666
3712
  var PrefabParser = /*#__PURE__*/ function() {
3667
3713
  function PrefabParser() {}
@@ -3915,7 +3961,7 @@ var SceneParserContext = /*#__PURE__*/ function() {
3915
3961
  };
3916
3962
  _proto._organizeEntities = function _organizeEntities() {
3917
3963
  var _this_context = this.context, entityConfigMap = _this_context.entityConfigMap, entityMap = _this_context.entityMap, scene = _this_context.scene, rootIds = _this_context.rootIds;
3918
- for(var _iterator = _createForOfIteratorHelperLoose(rootIds), _step; !(_step = _iterator()).done;){
3964
+ for(var _iterator = _create_for_of_iterator_helper_loose(rootIds), _step; !(_step = _iterator()).done;){
3919
3965
  var rootId = _step.value;
3920
3966
  PrefabParser.parseChildren(entityConfigMap, entityMap, rootId);
3921
3967
  }
@@ -4079,7 +4125,7 @@ var SourceFontLoader = /*#__PURE__*/ function(Loader) {
4079
4125
  });
4080
4126
  };
4081
4127
  _proto._registerFont = function _registerFont(fontName, fontUrl) {
4082
- return _asyncToGenerator(function() {
4128
+ return _async_to_generator(function() {
4083
4129
  var fontFace;
4084
4130
  return __generator(this, function(_state) {
4085
4131
  switch(_state.label){
@@ -4400,7 +4446,7 @@ SceneLoader = __decorate([
4400
4446
  "prefab"
4401
4447
  ], true)
4402
4448
  ], SceneLoader);
4403
- ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _asyncToGenerator(function(instance, item, engine) {
4449
+ ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item, engine) {
4404
4450
  var props;
4405
4451
  return __generator(this, function(_state) {
4406
4452
  props = item.props;