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