@loaders.gl/tile-converter 3.2.5 → 3.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/3d-tiles-attributes-worker.js +3 -3
- package/dist/3d-tiles-attributes-worker.js.map +1 -1
- package/dist/converter-cli.js +30 -7
- package/dist/converter.min.js +1 -1
- package/dist/dist.min.js +819 -516
- package/dist/es5/3d-tiles-attributes-worker.js +1 -1
- package/dist/es5/3d-tiles-attributes-worker.js.map +1 -1
- package/dist/es5/converter-cli.js +42 -12
- package/dist/es5/converter-cli.js.map +1 -1
- package/dist/es5/i3s-attributes-worker.js +1 -1
- package/dist/es5/i3s-attributes-worker.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +135 -0
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +16 -10
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js +15 -1
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +19 -15
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/lib/utils/write-queue.js +3 -5
- package/dist/es5/lib/utils/write-queue.js.map +1 -1
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/es5/pgm-loader.js.map +1 -1
- package/dist/esm/3d-tiles-attributes-worker.js +1 -1
- package/dist/esm/3d-tiles-attributes-worker.js.map +1 -1
- package/dist/esm/converter-cli.js +37 -7
- package/dist/esm/converter-cli.js.map +1 -1
- package/dist/esm/i3s-attributes-worker.js +1 -1
- package/dist/esm/i3s-attributes-worker.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +117 -0
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +13 -8
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js +15 -1
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +5 -1
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/lib/utils/write-queue.js +3 -5
- package/dist/esm/lib/utils/write-queue.js.map +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/esm/pgm-loader.js.map +1 -1
- package/dist/i3s-attributes-worker.js +3 -3
- package/dist/i3s-attributes-worker.js.map +3 -3
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +12 -0
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/batch-ids-extensions.js +127 -0
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.js +16 -11
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/gltf-attributes.js +13 -0
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +4 -1
- package/dist/i3s-converter/types.d.ts +48 -0
- package/dist/i3s-converter/types.d.ts.map +1 -1
- package/dist/lib/utils/write-queue.d.ts.map +1 -1
- package/dist/lib/utils/write-queue.js +3 -4
- package/package.json +15 -15
- package/src/converter-cli.ts +33 -7
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +182 -0
- package/src/i3s-converter/helpers/geometry-converter.ts +26 -11
- package/src/i3s-converter/helpers/gltf-attributes.ts +15 -0
- package/src/i3s-converter/i3s-converter.ts +13 -6
- package/src/i3s-converter/types.ts +51 -0
- package/src/lib/utils/write-queue.ts +7 -5
package/dist/dist.min.js
CHANGED
|
@@ -10,8 +10,8 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
10
10
|
};
|
|
11
11
|
var __export = (target, all) => {
|
|
12
12
|
__markAsModule(target);
|
|
13
|
-
for (var
|
|
14
|
-
__defProp(target,
|
|
13
|
+
for (var name9 in all)
|
|
14
|
+
__defProp(target, name9, { get: all[name9], enumerable: true });
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, module2, desc) => {
|
|
17
17
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
@@ -130,7 +130,7 @@ var require_stat = __commonJS({
|
|
|
130
130
|
var _defineProperty2 = _interopRequireDefault(require_defineProperty());
|
|
131
131
|
var _hiResTimestamp = _interopRequireDefault(require_hi_res_timestamp());
|
|
132
132
|
var Stat = function() {
|
|
133
|
-
function Stat2(
|
|
133
|
+
function Stat2(name9, type) {
|
|
134
134
|
(0, _classCallCheck2.default)(this, Stat2);
|
|
135
135
|
(0, _defineProperty2.default)(this, "name", void 0);
|
|
136
136
|
(0, _defineProperty2.default)(this, "type", void 0);
|
|
@@ -146,7 +146,7 @@ var require_stat = __commonJS({
|
|
|
146
146
|
(0, _defineProperty2.default)(this, "_samples", 0);
|
|
147
147
|
(0, _defineProperty2.default)(this, "_startTime", 0);
|
|
148
148
|
(0, _defineProperty2.default)(this, "_timerPending", false);
|
|
149
|
-
this.name =
|
|
149
|
+
this.name = name9;
|
|
150
150
|
this.type = type;
|
|
151
151
|
this.reset();
|
|
152
152
|
}
|
|
@@ -303,10 +303,10 @@ var require_stats = __commonJS({
|
|
|
303
303
|
}
|
|
304
304
|
(0, _createClass2.default)(Stats4, [{
|
|
305
305
|
key: "get",
|
|
306
|
-
value: function get(
|
|
306
|
+
value: function get(name9) {
|
|
307
307
|
var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
|
|
308
308
|
return this._getOrCreate({
|
|
309
|
-
name:
|
|
309
|
+
name: name9,
|
|
310
310
|
type
|
|
311
311
|
});
|
|
312
312
|
}
|
|
@@ -359,15 +359,15 @@ var require_stats = __commonJS({
|
|
|
359
359
|
if (!stat2 || !stat2.name) {
|
|
360
360
|
return null;
|
|
361
361
|
}
|
|
362
|
-
var
|
|
363
|
-
if (!this.stats[
|
|
362
|
+
var name9 = stat2.name, type = stat2.type;
|
|
363
|
+
if (!this.stats[name9]) {
|
|
364
364
|
if (stat2 instanceof _stat.default) {
|
|
365
|
-
this.stats[
|
|
365
|
+
this.stats[name9] = stat2;
|
|
366
366
|
} else {
|
|
367
|
-
this.stats[
|
|
367
|
+
this.stats[name9] = new _stat.default(name9, type);
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
return this.stats[
|
|
370
|
+
return this.stats[name9];
|
|
371
371
|
}
|
|
372
372
|
}]);
|
|
373
373
|
return Stats4;
|
|
@@ -935,8 +935,8 @@ var require_autobind = __commonJS({
|
|
|
935
935
|
var _loop = function _loop2() {
|
|
936
936
|
var key = _step.value;
|
|
937
937
|
if (typeof obj[key] === "function") {
|
|
938
|
-
if (!predefined.find(function(
|
|
939
|
-
return key ===
|
|
938
|
+
if (!predefined.find(function(name9) {
|
|
939
|
+
return key === name9;
|
|
940
940
|
})) {
|
|
941
941
|
obj[key] = obj[key].bind(obj);
|
|
942
942
|
}
|
|
@@ -1498,9 +1498,9 @@ var require_stat2 = __commonJS({
|
|
|
1498
1498
|
var _createClass2 = _interopRequireDefault(require_createClass());
|
|
1499
1499
|
var _hiResTimestamp = _interopRequireDefault(require_hi_res_timestamp3());
|
|
1500
1500
|
var Stat = function() {
|
|
1501
|
-
function Stat2(
|
|
1501
|
+
function Stat2(name9, type) {
|
|
1502
1502
|
(0, _classCallCheck2.default)(this, Stat2);
|
|
1503
|
-
this.name =
|
|
1503
|
+
this.name = name9;
|
|
1504
1504
|
this.type = type;
|
|
1505
1505
|
this.sampleSize = 1;
|
|
1506
1506
|
this.reset();
|
|
@@ -1656,10 +1656,10 @@ var require_stats2 = __commonJS({
|
|
|
1656
1656
|
}
|
|
1657
1657
|
(0, _createClass2.default)(Stats4, [{
|
|
1658
1658
|
key: "get",
|
|
1659
|
-
value: function get(
|
|
1659
|
+
value: function get(name9) {
|
|
1660
1660
|
var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
|
|
1661
1661
|
return this._getOrCreate({
|
|
1662
|
-
name:
|
|
1662
|
+
name: name9,
|
|
1663
1663
|
type
|
|
1664
1664
|
});
|
|
1665
1665
|
}
|
|
@@ -1712,15 +1712,15 @@ var require_stats2 = __commonJS({
|
|
|
1712
1712
|
if (!stat2 || !stat2.name) {
|
|
1713
1713
|
return null;
|
|
1714
1714
|
}
|
|
1715
|
-
var
|
|
1716
|
-
if (!this.stats[
|
|
1715
|
+
var name9 = stat2.name, type = stat2.type;
|
|
1716
|
+
if (!this.stats[name9]) {
|
|
1717
1717
|
if (stat2 instanceof _stat.default) {
|
|
1718
|
-
this.stats[
|
|
1718
|
+
this.stats[name9] = stat2;
|
|
1719
1719
|
} else {
|
|
1720
|
-
this.stats[
|
|
1720
|
+
this.stats[name9] = new _stat.default(name9, type);
|
|
1721
1721
|
}
|
|
1722
1722
|
}
|
|
1723
|
-
return this.stats[
|
|
1723
|
+
return this.stats[name9];
|
|
1724
1724
|
}
|
|
1725
1725
|
}]);
|
|
1726
1726
|
return Stats4;
|
|
@@ -2587,8 +2587,8 @@ var require_autobind2 = __commonJS({
|
|
|
2587
2587
|
var _loop = function _loop2() {
|
|
2588
2588
|
var key = _step.value;
|
|
2589
2589
|
if (typeof obj[key] === "function") {
|
|
2590
|
-
if (!predefined.find(function(
|
|
2591
|
-
return key ===
|
|
2590
|
+
if (!predefined.find(function(name9) {
|
|
2591
|
+
return key === name9;
|
|
2592
2592
|
})) {
|
|
2593
2593
|
obj[key] = obj[key].bind(obj);
|
|
2594
2594
|
}
|
|
@@ -5259,15 +5259,15 @@ var require_vector3 = __commonJS({
|
|
|
5259
5259
|
}
|
|
5260
5260
|
var ORIGIN = [0, 0, 0];
|
|
5261
5261
|
var constants = {};
|
|
5262
|
-
var
|
|
5263
|
-
(0, _inherits2.default)(
|
|
5264
|
-
var _super = _createSuper(
|
|
5265
|
-
function
|
|
5262
|
+
var Vector321 = function(_Vector) {
|
|
5263
|
+
(0, _inherits2.default)(Vector322, _Vector);
|
|
5264
|
+
var _super = _createSuper(Vector322);
|
|
5265
|
+
function Vector322() {
|
|
5266
5266
|
var _this;
|
|
5267
5267
|
var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
5268
5268
|
var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
5269
5269
|
var z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
|
|
5270
|
-
(0, _classCallCheck2.default)(this,
|
|
5270
|
+
(0, _classCallCheck2.default)(this, Vector322);
|
|
5271
5271
|
_this = _super.call(this, -0, -0, -0);
|
|
5272
5272
|
if (arguments.length === 1 && (0, _common.isArray)(x)) {
|
|
5273
5273
|
_this.copy(x);
|
|
@@ -5283,7 +5283,7 @@ var require_vector3 = __commonJS({
|
|
|
5283
5283
|
}
|
|
5284
5284
|
return _this;
|
|
5285
5285
|
}
|
|
5286
|
-
(0, _createClass2.default)(
|
|
5286
|
+
(0, _createClass2.default)(Vector322, [{
|
|
5287
5287
|
key: "set",
|
|
5288
5288
|
value: function set(x, y, z) {
|
|
5289
5289
|
this[0] = x;
|
|
@@ -5403,12 +5403,12 @@ var require_vector3 = __commonJS({
|
|
|
5403
5403
|
}], [{
|
|
5404
5404
|
key: "ZERO",
|
|
5405
5405
|
get: function get() {
|
|
5406
|
-
return constants.ZERO = constants.ZERO || Object.freeze(new
|
|
5406
|
+
return constants.ZERO = constants.ZERO || Object.freeze(new Vector322(0, 0, 0, 0));
|
|
5407
5407
|
}
|
|
5408
5408
|
}]);
|
|
5409
|
-
return
|
|
5409
|
+
return Vector322;
|
|
5410
5410
|
}(_vector.default);
|
|
5411
|
-
exports.default =
|
|
5411
|
+
exports.default = Vector321;
|
|
5412
5412
|
}
|
|
5413
5413
|
});
|
|
5414
5414
|
|
|
@@ -6349,12 +6349,12 @@ var require_matrix3 = __commonJS({
|
|
|
6349
6349
|
COL2ROW2: 8
|
|
6350
6350
|
});
|
|
6351
6351
|
var constants = {};
|
|
6352
|
-
var
|
|
6353
|
-
(0, _inherits2.default)(
|
|
6354
|
-
var _super = _createSuper(
|
|
6355
|
-
function
|
|
6352
|
+
var Matrix35 = function(_Matrix) {
|
|
6353
|
+
(0, _inherits2.default)(Matrix36, _Matrix);
|
|
6354
|
+
var _super = _createSuper(Matrix36);
|
|
6355
|
+
function Matrix36(array) {
|
|
6356
6356
|
var _this;
|
|
6357
|
-
(0, _classCallCheck2.default)(this,
|
|
6357
|
+
(0, _classCallCheck2.default)(this, Matrix36);
|
|
6358
6358
|
_this = _super.call(this, -0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
6359
6359
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
6360
6360
|
_this.copy(array);
|
|
@@ -6363,7 +6363,7 @@ var require_matrix3 = __commonJS({
|
|
|
6363
6363
|
}
|
|
6364
6364
|
return _this;
|
|
6365
6365
|
}
|
|
6366
|
-
(0, _createClass2.default)(
|
|
6366
|
+
(0, _createClass2.default)(Matrix36, [{
|
|
6367
6367
|
key: "ELEMENTS",
|
|
6368
6368
|
get: function get() {
|
|
6369
6369
|
return 9;
|
|
@@ -6522,19 +6522,19 @@ var require_matrix3 = __commonJS({
|
|
|
6522
6522
|
}], [{
|
|
6523
6523
|
key: "IDENTITY",
|
|
6524
6524
|
get: function get() {
|
|
6525
|
-
constants.IDENTITY = constants.IDENTITY || Object.freeze(new
|
|
6525
|
+
constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix36(IDENTITY));
|
|
6526
6526
|
return constants.IDENTITY;
|
|
6527
6527
|
}
|
|
6528
6528
|
}, {
|
|
6529
6529
|
key: "ZERO",
|
|
6530
6530
|
get: function get() {
|
|
6531
|
-
constants.ZERO = constants.ZERO || Object.freeze(new
|
|
6531
|
+
constants.ZERO = constants.ZERO || Object.freeze(new Matrix36(ZERO));
|
|
6532
6532
|
return constants.ZERO;
|
|
6533
6533
|
}
|
|
6534
6534
|
}]);
|
|
6535
|
-
return
|
|
6535
|
+
return Matrix36;
|
|
6536
6536
|
}(_matrix.default);
|
|
6537
|
-
exports.default =
|
|
6537
|
+
exports.default = Matrix35;
|
|
6538
6538
|
}
|
|
6539
6539
|
});
|
|
6540
6540
|
|
|
@@ -10788,7 +10788,7 @@ var require_type_utils = __commonJS({
|
|
|
10788
10788
|
var noop = function noop2(x) {
|
|
10789
10789
|
return x;
|
|
10790
10790
|
};
|
|
10791
|
-
var
|
|
10791
|
+
var scratchVector8 = new _core.Vector3();
|
|
10792
10792
|
function fromCartographic(cartographic, result) {
|
|
10793
10793
|
var map = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : noop;
|
|
10794
10794
|
if ((0, _core.isArray)(cartographic)) {
|
|
@@ -10807,11 +10807,11 @@ var require_type_utils = __commonJS({
|
|
|
10807
10807
|
return result;
|
|
10808
10808
|
}
|
|
10809
10809
|
function fromCartographicToRadians(cartographic) {
|
|
10810
|
-
var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
10810
|
+
var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector8;
|
|
10811
10811
|
return fromCartographic(cartographic, vector, _core.config._cartographicRadians ? noop : _core.toRadians);
|
|
10812
10812
|
}
|
|
10813
10813
|
function fromCartographicToDegrees(cartographic) {
|
|
10814
|
-
var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
10814
|
+
var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector8;
|
|
10815
10815
|
return fromCartographic(cartographic, vector, _core.config._cartographicRadians ? _core.toDegrees : noop);
|
|
10816
10816
|
}
|
|
10817
10817
|
function toCartographic(vector, cartographic) {
|
|
@@ -10841,7 +10841,7 @@ var require_type_utils = __commonJS({
|
|
|
10841
10841
|
if (!vector) {
|
|
10842
10842
|
return false;
|
|
10843
10843
|
}
|
|
10844
|
-
|
|
10844
|
+
scratchVector8.from(vector);
|
|
10845
10845
|
var oneOverRadiiSquared = _constants.WGS84_CONSTANTS.oneOverRadiiSquared, centerToleranceSquared = _constants.WGS84_CONSTANTS.centerToleranceSquared;
|
|
10846
10846
|
var x2 = vector[0] * vector[0] * oneOverRadiiSquared[0];
|
|
10847
10847
|
var y2 = vector[1] * vector[1] * oneOverRadiiSquared[1];
|
|
@@ -10900,13 +10900,13 @@ var require_scale_to_geodetic_surface = __commonJS({
|
|
|
10900
10900
|
}
|
|
10901
10901
|
return newObj;
|
|
10902
10902
|
}
|
|
10903
|
-
var
|
|
10903
|
+
var scratchVector8 = new _core.Vector3();
|
|
10904
10904
|
var scaleToGeodeticSurfaceIntersection = new _core.Vector3();
|
|
10905
10905
|
var scaleToGeodeticSurfaceGradient = new _core.Vector3();
|
|
10906
10906
|
function scaleToGeodeticSurface(cartesian, ellipsoid) {
|
|
10907
10907
|
var result = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : new _core.Vector3();
|
|
10908
10908
|
var oneOverRadii = ellipsoid.oneOverRadii, oneOverRadiiSquared = ellipsoid.oneOverRadiiSquared, centerToleranceSquared = ellipsoid.centerToleranceSquared;
|
|
10909
|
-
|
|
10909
|
+
scratchVector8.from(cartesian);
|
|
10910
10910
|
var positionX = cartesian.x;
|
|
10911
10911
|
var positionY = cartesian.y;
|
|
10912
10912
|
var positionZ = cartesian.z;
|
|
@@ -10953,7 +10953,7 @@ var require_scale_to_geodetic_surface = __commonJS({
|
|
|
10953
10953
|
var derivative = -2 * denominator;
|
|
10954
10954
|
correction = func / derivative;
|
|
10955
10955
|
} while (Math.abs(func) > _core._MathUtils.EPSILON12);
|
|
10956
|
-
return
|
|
10956
|
+
return scratchVector8.scale([xMultiplier, yMultiplier, zMultiplier]).to(result);
|
|
10957
10957
|
}
|
|
10958
10958
|
}
|
|
10959
10959
|
});
|
|
@@ -11139,7 +11139,7 @@ var require_ellipsoid = __commonJS({
|
|
|
11139
11139
|
}
|
|
11140
11140
|
return newObj;
|
|
11141
11141
|
}
|
|
11142
|
-
var
|
|
11142
|
+
var scratchVector8 = new _core.Vector3();
|
|
11143
11143
|
var scratchNormal2 = new _core.Vector3();
|
|
11144
11144
|
var scratchK = new _core.Vector3();
|
|
11145
11145
|
var scratchPosition3 = new _core.Vector3();
|
|
@@ -11226,7 +11226,7 @@ var require_ellipsoid = __commonJS({
|
|
|
11226
11226
|
key: "geocentricSurfaceNormal",
|
|
11227
11227
|
value: function geocentricSurfaceNormal(cartesian) {
|
|
11228
11228
|
var result = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0, 0];
|
|
11229
|
-
return
|
|
11229
|
+
return scratchVector8.from(cartesian).normalize().to(result);
|
|
11230
11230
|
}
|
|
11231
11231
|
}, {
|
|
11232
11232
|
key: "geodeticSurfaceNormalCartographic",
|
|
@@ -11236,14 +11236,14 @@ var require_ellipsoid = __commonJS({
|
|
|
11236
11236
|
var longitude = cartographicVectorRadians[0];
|
|
11237
11237
|
var latitude = cartographicVectorRadians[1];
|
|
11238
11238
|
var cosLatitude = Math.cos(latitude);
|
|
11239
|
-
|
|
11240
|
-
return
|
|
11239
|
+
scratchVector8.set(cosLatitude * Math.cos(longitude), cosLatitude * Math.sin(longitude), Math.sin(latitude)).normalize();
|
|
11240
|
+
return scratchVector8.to(result);
|
|
11241
11241
|
}
|
|
11242
11242
|
}, {
|
|
11243
11243
|
key: "geodeticSurfaceNormal",
|
|
11244
11244
|
value: function geodeticSurfaceNormal(cartesian) {
|
|
11245
11245
|
var result = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0, 0];
|
|
11246
|
-
return
|
|
11246
|
+
return scratchVector8.from(cartesian).scale(this.oneOverRadiiSquared).normalize().to(result);
|
|
11247
11247
|
}
|
|
11248
11248
|
}, {
|
|
11249
11249
|
key: "scaleToGeodeticSurface",
|
|
@@ -11356,7 +11356,7 @@ var require_axis_aligned_bounding_box = __commonJS({
|
|
|
11356
11356
|
var _createClass2 = _interopRequireDefault(require_createClass());
|
|
11357
11357
|
var _core = require_es56();
|
|
11358
11358
|
var _constants = require_constants2();
|
|
11359
|
-
var
|
|
11359
|
+
var scratchVector8 = new _core.Vector3();
|
|
11360
11360
|
var scratchNormal2 = new _core.Vector3();
|
|
11361
11361
|
var AxisAlignedBoundingBox = function() {
|
|
11362
11362
|
function AxisAlignedBoundingBox2() {
|
|
@@ -11364,7 +11364,7 @@ var require_axis_aligned_bounding_box = __commonJS({
|
|
|
11364
11364
|
var maximum = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0, 0];
|
|
11365
11365
|
var center = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
11366
11366
|
(0, _classCallCheck2.default)(this, AxisAlignedBoundingBox2);
|
|
11367
|
-
center = center ||
|
|
11367
|
+
center = center || scratchVector8.copy(minimum).add(maximum).scale(0.5);
|
|
11368
11368
|
this.center = new _core.Vector3(center);
|
|
11369
11369
|
this.halfDiagonal = new _core.Vector3(maximum).subtract(this.center);
|
|
11370
11370
|
this.minimum = new _core.Vector3(minimum);
|
|
@@ -11412,7 +11412,7 @@ var require_axis_aligned_bounding_box = __commonJS({
|
|
|
11412
11412
|
}, {
|
|
11413
11413
|
key: "distanceSquaredTo",
|
|
11414
11414
|
value: function distanceSquaredTo(point) {
|
|
11415
|
-
var offset =
|
|
11415
|
+
var offset = scratchVector8.from(point).subtract(this.center);
|
|
11416
11416
|
var halfDiagonal = this.halfDiagonal;
|
|
11417
11417
|
var distanceSquared = 0;
|
|
11418
11418
|
var d;
|
|
@@ -11490,7 +11490,7 @@ var require_bounding_sphere = __commonJS({
|
|
|
11490
11490
|
}
|
|
11491
11491
|
return newObj;
|
|
11492
11492
|
}
|
|
11493
|
-
var
|
|
11493
|
+
var scratchVector8 = new _core.Vector3();
|
|
11494
11494
|
var scratchVector23 = new _core.Vector3();
|
|
11495
11495
|
var BoundingSphere5 = function() {
|
|
11496
11496
|
function BoundingSphere6() {
|
|
@@ -11511,7 +11511,7 @@ var require_bounding_sphere = __commonJS({
|
|
|
11511
11511
|
}, {
|
|
11512
11512
|
key: "fromCornerPoints",
|
|
11513
11513
|
value: function fromCornerPoints(corner, oppositeCorner) {
|
|
11514
|
-
oppositeCorner =
|
|
11514
|
+
oppositeCorner = scratchVector8.from(oppositeCorner);
|
|
11515
11515
|
this.center = new _core.Vector3().from(corner).add(oppositeCorner).scale(0.5);
|
|
11516
11516
|
this.radius = this.center.distance(oppositeCorner);
|
|
11517
11517
|
return this;
|
|
@@ -11533,7 +11533,7 @@ var require_bounding_sphere = __commonJS({
|
|
|
11533
11533
|
var leftRadius = this.radius;
|
|
11534
11534
|
var rightCenter = boundingSphere.center;
|
|
11535
11535
|
var rightRadius = boundingSphere.radius;
|
|
11536
|
-
var toRightCenter =
|
|
11536
|
+
var toRightCenter = scratchVector8.copy(rightCenter).subtract(leftCenter);
|
|
11537
11537
|
var centerSeparation = toRightCenter.magnitude();
|
|
11538
11538
|
if (leftRadius >= centerSeparation + rightRadius) {
|
|
11539
11539
|
return this.clone();
|
|
@@ -11550,7 +11550,7 @@ var require_bounding_sphere = __commonJS({
|
|
|
11550
11550
|
}, {
|
|
11551
11551
|
key: "expand",
|
|
11552
11552
|
value: function expand(point) {
|
|
11553
|
-
point =
|
|
11553
|
+
point = scratchVector8.from(point);
|
|
11554
11554
|
var radius = point.subtract(this.center).magnitude();
|
|
11555
11555
|
if (radius > this.radius) {
|
|
11556
11556
|
this.radius = radius;
|
|
@@ -11561,14 +11561,14 @@ var require_bounding_sphere = __commonJS({
|
|
|
11561
11561
|
key: "transform",
|
|
11562
11562
|
value: function transform9(_transform) {
|
|
11563
11563
|
this.center.transform(_transform);
|
|
11564
|
-
var scale = mat4.getScaling(
|
|
11564
|
+
var scale = mat4.getScaling(scratchVector8, _transform);
|
|
11565
11565
|
this.radius = Math.max(scale[0], Math.max(scale[1], scale[2])) * this.radius;
|
|
11566
11566
|
return this;
|
|
11567
11567
|
}
|
|
11568
11568
|
}, {
|
|
11569
11569
|
key: "distanceSquaredTo",
|
|
11570
11570
|
value: function distanceSquaredTo(point) {
|
|
11571
|
-
point =
|
|
11571
|
+
point = scratchVector8.from(point);
|
|
11572
11572
|
var delta = point.subtract(this.center);
|
|
11573
11573
|
return delta.lengthSquared() - this.radius * this.radius;
|
|
11574
11574
|
}
|
|
@@ -13480,7 +13480,7 @@ var require_v35 = __commonJS({
|
|
|
13480
13480
|
exports.DNS = DNS;
|
|
13481
13481
|
var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
13482
13482
|
exports.URL = URL2;
|
|
13483
|
-
function _default(
|
|
13483
|
+
function _default(name9, version2, hashfunc) {
|
|
13484
13484
|
function generateUUID(value, namespace, buf, offset) {
|
|
13485
13485
|
if (typeof value === "string") {
|
|
13486
13486
|
value = stringToBytes(value);
|
|
@@ -13507,7 +13507,7 @@ var require_v35 = __commonJS({
|
|
|
13507
13507
|
return (0, _stringify.default)(bytes);
|
|
13508
13508
|
}
|
|
13509
13509
|
try {
|
|
13510
|
-
generateUUID.name =
|
|
13510
|
+
generateUUID.name = name9;
|
|
13511
13511
|
} catch (err) {
|
|
13512
13512
|
}
|
|
13513
13513
|
generateUUID.DNS = DNS;
|
|
@@ -14930,12 +14930,12 @@ var require_readdir_glob = __commonJS({
|
|
|
14930
14930
|
async function* exploreWalkAsync(dir, path2, followSyslinks, useStat, shouldSkip, strict) {
|
|
14931
14931
|
let files = await readdir2(path2 + dir, strict);
|
|
14932
14932
|
for (const file of files) {
|
|
14933
|
-
let
|
|
14934
|
-
if (
|
|
14935
|
-
|
|
14933
|
+
let name9 = file.name;
|
|
14934
|
+
if (name9 === void 0) {
|
|
14935
|
+
name9 = file;
|
|
14936
14936
|
useStat = true;
|
|
14937
14937
|
}
|
|
14938
|
-
const filename2 = dir + "/" +
|
|
14938
|
+
const filename2 = dir + "/" + name9;
|
|
14939
14939
|
const relative = filename2.slice(1);
|
|
14940
14940
|
const absolute = path2 + "/" + relative;
|
|
14941
14941
|
let stats = null;
|
|
@@ -15617,7 +15617,7 @@ var require_async = __commonJS({
|
|
|
15617
15617
|
newTasks[key] = params.concat(newTask);
|
|
15618
15618
|
}
|
|
15619
15619
|
function newTask(results, taskCb) {
|
|
15620
|
-
var newArgs = params.map((
|
|
15620
|
+
var newArgs = params.map((name9) => results[name9]);
|
|
15621
15621
|
newArgs.push(taskCb);
|
|
15622
15622
|
wrapAsync(taskFn)(...newArgs);
|
|
15623
15623
|
}
|
|
@@ -15816,18 +15816,18 @@ var require_async = __commonJS({
|
|
|
15816
15816
|
}
|
|
15817
15817
|
return false;
|
|
15818
15818
|
}
|
|
15819
|
-
const eventMethod = (
|
|
15819
|
+
const eventMethod = (name9) => (handler) => {
|
|
15820
15820
|
if (!handler) {
|
|
15821
15821
|
return new Promise((resolve, reject2) => {
|
|
15822
|
-
once2(
|
|
15822
|
+
once2(name9, (err, data) => {
|
|
15823
15823
|
if (err)
|
|
15824
15824
|
return reject2(err);
|
|
15825
15825
|
resolve(data);
|
|
15826
15826
|
});
|
|
15827
15827
|
});
|
|
15828
15828
|
}
|
|
15829
|
-
off(
|
|
15830
|
-
on(
|
|
15829
|
+
off(name9);
|
|
15830
|
+
on(name9, handler);
|
|
15831
15831
|
};
|
|
15832
15832
|
var isProcessing = false;
|
|
15833
15833
|
var q = {
|
|
@@ -16064,15 +16064,15 @@ var require_async = __commonJS({
|
|
|
16064
16064
|
return _createTester((bool) => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback);
|
|
16065
16065
|
}
|
|
16066
16066
|
var detectSeries$1 = awaitify(detectSeries, 3);
|
|
16067
|
-
function consoleFunc(
|
|
16067
|
+
function consoleFunc(name9) {
|
|
16068
16068
|
return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => {
|
|
16069
16069
|
if (typeof console === "object") {
|
|
16070
16070
|
if (err) {
|
|
16071
16071
|
if (console.error) {
|
|
16072
16072
|
console.error(err);
|
|
16073
16073
|
}
|
|
16074
|
-
} else if (console[
|
|
16075
|
-
resultArgs.forEach((x) => console[
|
|
16074
|
+
} else if (console[name9]) {
|
|
16075
|
+
resultArgs.forEach((x) => console[name9](x));
|
|
16076
16076
|
}
|
|
16077
16077
|
}
|
|
16078
16078
|
});
|
|
@@ -16628,8 +16628,8 @@ var require_async = __commonJS({
|
|
|
16628
16628
|
var timedOut = false;
|
|
16629
16629
|
var timer;
|
|
16630
16630
|
function timeoutCallback() {
|
|
16631
|
-
var
|
|
16632
|
-
var error = new Error('Callback function "' +
|
|
16631
|
+
var name9 = asyncFn.name || "anonymous";
|
|
16632
|
+
var error = new Error('Callback function "' + name9 + '" timed out.');
|
|
16633
16633
|
error.code = "ETIMEDOUT";
|
|
16634
16634
|
if (info) {
|
|
16635
16635
|
error.info = info;
|
|
@@ -21900,8 +21900,8 @@ var require_once = __commonJS({
|
|
|
21900
21900
|
f.called = true;
|
|
21901
21901
|
return f.value = fn.apply(this, arguments);
|
|
21902
21902
|
};
|
|
21903
|
-
var
|
|
21904
|
-
f.onceError =
|
|
21903
|
+
var name9 = fn.name || "Function wrapped with `once`";
|
|
21904
|
+
f.onceError = name9 + " shouldn't be called more than once";
|
|
21905
21905
|
f.called = false;
|
|
21906
21906
|
return f;
|
|
21907
21907
|
}
|
|
@@ -23219,10 +23219,10 @@ var require_errors = __commonJS({
|
|
|
23219
23219
|
return str.indexOf(search, start) !== -1;
|
|
23220
23220
|
}
|
|
23221
23221
|
}
|
|
23222
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
23223
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
23222
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
|
|
23223
|
+
return 'The value "' + value + '" is invalid for option "' + name9 + '"';
|
|
23224
23224
|
}, TypeError);
|
|
23225
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
23225
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
|
|
23226
23226
|
let determiner;
|
|
23227
23227
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
23228
23228
|
determiner = "must not be";
|
|
@@ -23231,22 +23231,22 @@ var require_errors = __commonJS({
|
|
|
23231
23231
|
determiner = "must be";
|
|
23232
23232
|
}
|
|
23233
23233
|
let msg;
|
|
23234
|
-
if (endsWith(
|
|
23235
|
-
msg = `The ${
|
|
23234
|
+
if (endsWith(name9, " argument")) {
|
|
23235
|
+
msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
|
|
23236
23236
|
} else {
|
|
23237
|
-
const type = includes(
|
|
23238
|
-
msg = `The "${
|
|
23237
|
+
const type = includes(name9, ".") ? "property" : "argument";
|
|
23238
|
+
msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
23239
23239
|
}
|
|
23240
23240
|
msg += `. Received type ${typeof actual}`;
|
|
23241
23241
|
return msg;
|
|
23242
23242
|
}, TypeError);
|
|
23243
23243
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
23244
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
23245
|
-
return "The " +
|
|
23244
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
|
|
23245
|
+
return "The " + name9 + " method is not implemented";
|
|
23246
23246
|
});
|
|
23247
23247
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
23248
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
23249
|
-
return "Cannot call " +
|
|
23248
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name9) {
|
|
23249
|
+
return "Cannot call " + name9 + " after a stream was destroyed";
|
|
23250
23250
|
});
|
|
23251
23251
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
23252
23252
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -23272,8 +23272,8 @@ var require_state = __commonJS({
|
|
|
23272
23272
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
23273
23273
|
if (hwm != null) {
|
|
23274
23274
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
23275
|
-
var
|
|
23276
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
23275
|
+
var name9 = isDuplex ? duplexKey : "highWaterMark";
|
|
23276
|
+
throw new ERR_INVALID_OPT_VALUE(name9, hwm);
|
|
23277
23277
|
}
|
|
23278
23278
|
return Math.floor(hwm);
|
|
23279
23279
|
}
|
|
@@ -26360,9 +26360,9 @@ var require_zip_archive_entry = __commonJS({
|
|
|
26360
26360
|
var UnixStat = require_unix_stat();
|
|
26361
26361
|
var constants = require_constants3();
|
|
26362
26362
|
var zipUtil = require_util2();
|
|
26363
|
-
var ZipArchiveEntry = module2.exports = function(
|
|
26363
|
+
var ZipArchiveEntry = module2.exports = function(name9) {
|
|
26364
26364
|
if (!(this instanceof ZipArchiveEntry)) {
|
|
26365
|
-
return new ZipArchiveEntry(
|
|
26365
|
+
return new ZipArchiveEntry(name9);
|
|
26366
26366
|
}
|
|
26367
26367
|
ArchiveEntry.call(this);
|
|
26368
26368
|
this.platform = constants.PLATFORM_FAT;
|
|
@@ -26379,8 +26379,8 @@ var require_zip_archive_entry = __commonJS({
|
|
|
26379
26379
|
this.exattr = 0;
|
|
26380
26380
|
this.inattr = 0;
|
|
26381
26381
|
this.comment = null;
|
|
26382
|
-
if (
|
|
26383
|
-
this.setName(
|
|
26382
|
+
if (name9) {
|
|
26383
|
+
this.setName(name9);
|
|
26384
26384
|
}
|
|
26385
26385
|
};
|
|
26386
26386
|
inherits(ZipArchiveEntry, ArchiveEntry);
|
|
@@ -26477,15 +26477,15 @@ var require_zip_archive_entry = __commonJS({
|
|
|
26477
26477
|
}
|
|
26478
26478
|
this.method = method;
|
|
26479
26479
|
};
|
|
26480
|
-
ZipArchiveEntry.prototype.setName = function(
|
|
26481
|
-
|
|
26480
|
+
ZipArchiveEntry.prototype.setName = function(name9, prependSlash = false) {
|
|
26481
|
+
name9 = normalizePath(name9, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
|
|
26482
26482
|
if (prependSlash) {
|
|
26483
|
-
|
|
26483
|
+
name9 = `/${name9}`;
|
|
26484
26484
|
}
|
|
26485
|
-
if (Buffer.byteLength(
|
|
26485
|
+
if (Buffer.byteLength(name9) !== name9.length) {
|
|
26486
26486
|
this.getGeneralPurposeBit().useUTF8ForNames(true);
|
|
26487
26487
|
}
|
|
26488
|
-
this.name =
|
|
26488
|
+
this.name = name9;
|
|
26489
26489
|
};
|
|
26490
26490
|
ZipArchiveEntry.prototype.setPlatform = function(platform) {
|
|
26491
26491
|
this.platform = platform;
|
|
@@ -26931,10 +26931,10 @@ var require_errors2 = __commonJS({
|
|
|
26931
26931
|
return str.indexOf(search, start) !== -1;
|
|
26932
26932
|
}
|
|
26933
26933
|
}
|
|
26934
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
26935
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
26934
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
|
|
26935
|
+
return 'The value "' + value + '" is invalid for option "' + name9 + '"';
|
|
26936
26936
|
}, TypeError);
|
|
26937
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
26937
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
|
|
26938
26938
|
let determiner;
|
|
26939
26939
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
26940
26940
|
determiner = "must not be";
|
|
@@ -26943,22 +26943,22 @@ var require_errors2 = __commonJS({
|
|
|
26943
26943
|
determiner = "must be";
|
|
26944
26944
|
}
|
|
26945
26945
|
let msg;
|
|
26946
|
-
if (endsWith(
|
|
26947
|
-
msg = `The ${
|
|
26946
|
+
if (endsWith(name9, " argument")) {
|
|
26947
|
+
msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
|
|
26948
26948
|
} else {
|
|
26949
|
-
const type = includes(
|
|
26950
|
-
msg = `The "${
|
|
26949
|
+
const type = includes(name9, ".") ? "property" : "argument";
|
|
26950
|
+
msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
26951
26951
|
}
|
|
26952
26952
|
msg += `. Received type ${typeof actual}`;
|
|
26953
26953
|
return msg;
|
|
26954
26954
|
}, TypeError);
|
|
26955
26955
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
26956
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
26957
|
-
return "The " +
|
|
26956
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
|
|
26957
|
+
return "The " + name9 + " method is not implemented";
|
|
26958
26958
|
});
|
|
26959
26959
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
26960
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
26961
|
-
return "Cannot call " +
|
|
26960
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name9) {
|
|
26961
|
+
return "Cannot call " + name9 + " after a stream was destroyed";
|
|
26962
26962
|
});
|
|
26963
26963
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
26964
26964
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -26984,8 +26984,8 @@ var require_state2 = __commonJS({
|
|
|
26984
26984
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
26985
26985
|
if (hwm != null) {
|
|
26986
26986
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
26987
|
-
var
|
|
26988
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
26987
|
+
var name9 = isDuplex ? duplexKey : "highWaterMark";
|
|
26988
|
+
throw new ERR_INVALID_OPT_VALUE(name9, hwm);
|
|
26989
26989
|
}
|
|
26990
26990
|
return Math.floor(hwm);
|
|
26991
26991
|
}
|
|
@@ -30073,10 +30073,10 @@ var require_errors3 = __commonJS({
|
|
|
30073
30073
|
return str.indexOf(search, start) !== -1;
|
|
30074
30074
|
}
|
|
30075
30075
|
}
|
|
30076
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
30077
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
30076
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
|
|
30077
|
+
return 'The value "' + value + '" is invalid for option "' + name9 + '"';
|
|
30078
30078
|
}, TypeError);
|
|
30079
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
30079
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
|
|
30080
30080
|
let determiner;
|
|
30081
30081
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
30082
30082
|
determiner = "must not be";
|
|
@@ -30085,22 +30085,22 @@ var require_errors3 = __commonJS({
|
|
|
30085
30085
|
determiner = "must be";
|
|
30086
30086
|
}
|
|
30087
30087
|
let msg;
|
|
30088
|
-
if (endsWith(
|
|
30089
|
-
msg = `The ${
|
|
30088
|
+
if (endsWith(name9, " argument")) {
|
|
30089
|
+
msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
|
|
30090
30090
|
} else {
|
|
30091
|
-
const type = includes(
|
|
30092
|
-
msg = `The "${
|
|
30091
|
+
const type = includes(name9, ".") ? "property" : "argument";
|
|
30092
|
+
msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
30093
30093
|
}
|
|
30094
30094
|
msg += `. Received type ${typeof actual}`;
|
|
30095
30095
|
return msg;
|
|
30096
30096
|
}, TypeError);
|
|
30097
30097
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
30098
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
30099
|
-
return "The " +
|
|
30098
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
|
|
30099
|
+
return "The " + name9 + " method is not implemented";
|
|
30100
30100
|
});
|
|
30101
30101
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
30102
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
30103
|
-
return "Cannot call " +
|
|
30102
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name9) {
|
|
30103
|
+
return "Cannot call " + name9 + " after a stream was destroyed";
|
|
30104
30104
|
});
|
|
30105
30105
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
30106
30106
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -30126,8 +30126,8 @@ var require_state3 = __commonJS({
|
|
|
30126
30126
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
30127
30127
|
if (hwm != null) {
|
|
30128
30128
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
30129
|
-
var
|
|
30130
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
30129
|
+
var name9 = isDuplex ? duplexKey : "highWaterMark";
|
|
30130
|
+
throw new ERR_INVALID_OPT_VALUE(name9, hwm);
|
|
30131
30131
|
}
|
|
30132
30132
|
return Math.floor(hwm);
|
|
30133
30133
|
}
|
|
@@ -32805,14 +32805,14 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
32805
32805
|
this.write(zipUtil.getLongBytes(ae.getCrc()));
|
|
32806
32806
|
this.write(zipUtil.getLongBytes(compressedSize));
|
|
32807
32807
|
this.write(zipUtil.getLongBytes(size));
|
|
32808
|
-
var
|
|
32808
|
+
var name9 = ae.getName();
|
|
32809
32809
|
var comment = ae.getComment();
|
|
32810
32810
|
var extra = ae.getCentralDirectoryExtra();
|
|
32811
32811
|
if (gpb.usesUTF8ForNames()) {
|
|
32812
|
-
|
|
32812
|
+
name9 = Buffer.from(name9);
|
|
32813
32813
|
comment = Buffer.from(comment);
|
|
32814
32814
|
}
|
|
32815
|
-
this.write(zipUtil.getShortBytes(
|
|
32815
|
+
this.write(zipUtil.getShortBytes(name9.length));
|
|
32816
32816
|
this.write(zipUtil.getShortBytes(extra.length));
|
|
32817
32817
|
this.write(zipUtil.getShortBytes(comment.length));
|
|
32818
32818
|
this.write(constants.SHORT_ZERO);
|
|
@@ -32823,7 +32823,7 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
32823
32823
|
} else {
|
|
32824
32824
|
this.write(zipUtil.getLongBytes(offsets.file));
|
|
32825
32825
|
}
|
|
32826
|
-
this.write(
|
|
32826
|
+
this.write(name9);
|
|
32827
32827
|
this.write(extra);
|
|
32828
32828
|
this.write(comment);
|
|
32829
32829
|
};
|
|
@@ -32841,14 +32841,14 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
32841
32841
|
ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) {
|
|
32842
32842
|
var gpb = ae.getGeneralPurposeBit();
|
|
32843
32843
|
var method = ae.getMethod();
|
|
32844
|
-
var
|
|
32844
|
+
var name9 = ae.getName();
|
|
32845
32845
|
var extra = ae.getLocalFileDataExtra();
|
|
32846
32846
|
if (ae.isZip64()) {
|
|
32847
32847
|
gpb.useDataDescriptor(true);
|
|
32848
32848
|
ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64);
|
|
32849
32849
|
}
|
|
32850
32850
|
if (gpb.usesUTF8ForNames()) {
|
|
32851
|
-
|
|
32851
|
+
name9 = Buffer.from(name9);
|
|
32852
32852
|
}
|
|
32853
32853
|
ae._offsets.file = this.offset;
|
|
32854
32854
|
this.write(zipUtil.getLongBytes(constants.SIG_LFH));
|
|
@@ -32866,9 +32866,9 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
32866
32866
|
this.write(zipUtil.getLongBytes(ae.getCompressedSize()));
|
|
32867
32867
|
this.write(zipUtil.getLongBytes(ae.getSize()));
|
|
32868
32868
|
}
|
|
32869
|
-
this.write(zipUtil.getShortBytes(
|
|
32869
|
+
this.write(zipUtil.getShortBytes(name9.length));
|
|
32870
32870
|
this.write(zipUtil.getShortBytes(extra.length));
|
|
32871
|
-
this.write(
|
|
32871
|
+
this.write(name9);
|
|
32872
32872
|
this.write(extra);
|
|
32873
32873
|
ae._offsets.contents = this.offset;
|
|
32874
32874
|
};
|
|
@@ -33445,10 +33445,10 @@ var require_errors4 = __commonJS({
|
|
|
33445
33445
|
return str.indexOf(search, start) !== -1;
|
|
33446
33446
|
}
|
|
33447
33447
|
}
|
|
33448
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
33449
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
33448
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
|
|
33449
|
+
return 'The value "' + value + '" is invalid for option "' + name9 + '"';
|
|
33450
33450
|
}, TypeError);
|
|
33451
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
33451
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
|
|
33452
33452
|
let determiner;
|
|
33453
33453
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
33454
33454
|
determiner = "must not be";
|
|
@@ -33457,22 +33457,22 @@ var require_errors4 = __commonJS({
|
|
|
33457
33457
|
determiner = "must be";
|
|
33458
33458
|
}
|
|
33459
33459
|
let msg;
|
|
33460
|
-
if (endsWith(
|
|
33461
|
-
msg = `The ${
|
|
33460
|
+
if (endsWith(name9, " argument")) {
|
|
33461
|
+
msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
|
|
33462
33462
|
} else {
|
|
33463
|
-
const type = includes(
|
|
33464
|
-
msg = `The "${
|
|
33463
|
+
const type = includes(name9, ".") ? "property" : "argument";
|
|
33464
|
+
msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
33465
33465
|
}
|
|
33466
33466
|
msg += `. Received type ${typeof actual}`;
|
|
33467
33467
|
return msg;
|
|
33468
33468
|
}, TypeError);
|
|
33469
33469
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
33470
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
33471
|
-
return "The " +
|
|
33470
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
|
|
33471
|
+
return "The " + name9 + " method is not implemented";
|
|
33472
33472
|
});
|
|
33473
33473
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
33474
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
33475
|
-
return "Cannot call " +
|
|
33474
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name9) {
|
|
33475
|
+
return "Cannot call " + name9 + " after a stream was destroyed";
|
|
33476
33476
|
});
|
|
33477
33477
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
33478
33478
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -33498,8 +33498,8 @@ var require_state4 = __commonJS({
|
|
|
33498
33498
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
33499
33499
|
if (hwm != null) {
|
|
33500
33500
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
33501
|
-
var
|
|
33502
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
33501
|
+
var name9 = isDuplex ? duplexKey : "highWaterMark";
|
|
33502
|
+
throw new ERR_INVALID_OPT_VALUE(name9, hwm);
|
|
33503
33503
|
}
|
|
33504
33504
|
return Math.floor(hwm);
|
|
33505
33505
|
}
|
|
@@ -36326,24 +36326,24 @@ var require_headers = __commonJS({
|
|
|
36326
36326
|
};
|
|
36327
36327
|
exports.encode = function(opts) {
|
|
36328
36328
|
var buf = alloc(512);
|
|
36329
|
-
var
|
|
36329
|
+
var name9 = opts.name;
|
|
36330
36330
|
var prefix = "";
|
|
36331
|
-
if (opts.typeflag === 5 &&
|
|
36332
|
-
|
|
36333
|
-
if (Buffer.byteLength(
|
|
36331
|
+
if (opts.typeflag === 5 && name9[name9.length - 1] !== "/")
|
|
36332
|
+
name9 += "/";
|
|
36333
|
+
if (Buffer.byteLength(name9) !== name9.length)
|
|
36334
36334
|
return null;
|
|
36335
|
-
while (Buffer.byteLength(
|
|
36336
|
-
var i =
|
|
36335
|
+
while (Buffer.byteLength(name9) > 100) {
|
|
36336
|
+
var i = name9.indexOf("/");
|
|
36337
36337
|
if (i === -1)
|
|
36338
36338
|
return null;
|
|
36339
|
-
prefix += prefix ? "/" +
|
|
36340
|
-
|
|
36339
|
+
prefix += prefix ? "/" + name9.slice(0, i) : name9.slice(0, i);
|
|
36340
|
+
name9 = name9.slice(i + 1);
|
|
36341
36341
|
}
|
|
36342
|
-
if (Buffer.byteLength(
|
|
36342
|
+
if (Buffer.byteLength(name9) > 100 || Buffer.byteLength(prefix) > 155)
|
|
36343
36343
|
return null;
|
|
36344
36344
|
if (opts.linkname && Buffer.byteLength(opts.linkname) > 100)
|
|
36345
36345
|
return null;
|
|
36346
|
-
buf.write(
|
|
36346
|
+
buf.write(name9);
|
|
36347
36347
|
buf.write(encodeOct(opts.mode & MASK, 6), 100);
|
|
36348
36348
|
buf.write(encodeOct(opts.uid, 6), 108);
|
|
36349
36349
|
buf.write(encodeOct(opts.gid, 6), 116);
|
|
@@ -36367,7 +36367,7 @@ var require_headers = __commonJS({
|
|
|
36367
36367
|
};
|
|
36368
36368
|
exports.decode = function(buf, filenameEncoding, allowUnknownFormat) {
|
|
36369
36369
|
var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET;
|
|
36370
|
-
var
|
|
36370
|
+
var name9 = decodeStr(buf, 0, 100, filenameEncoding);
|
|
36371
36371
|
var mode = decodeOct(buf, 100, 8);
|
|
36372
36372
|
var uid = decodeOct(buf, 108, 8);
|
|
36373
36373
|
var gid = decodeOct(buf, 116, 8);
|
|
@@ -36386,17 +36386,17 @@ var require_headers = __commonJS({
|
|
|
36386
36386
|
throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");
|
|
36387
36387
|
if (USTAR_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0) {
|
|
36388
36388
|
if (buf[345])
|
|
36389
|
-
|
|
36389
|
+
name9 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name9;
|
|
36390
36390
|
} else if (GNU_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0 && GNU_VER.compare(buf, VERSION_OFFSET, VERSION_OFFSET + 2) === 0) {
|
|
36391
36391
|
} else {
|
|
36392
36392
|
if (!allowUnknownFormat) {
|
|
36393
36393
|
throw new Error("Invalid tar header: unknown format.");
|
|
36394
36394
|
}
|
|
36395
36395
|
}
|
|
36396
|
-
if (typeflag === 0 &&
|
|
36396
|
+
if (typeflag === 0 && name9 && name9[name9.length - 1] === "/")
|
|
36397
36397
|
typeflag = 5;
|
|
36398
36398
|
return {
|
|
36399
|
-
name:
|
|
36399
|
+
name: name9,
|
|
36400
36400
|
mode,
|
|
36401
36401
|
uid,
|
|
36402
36402
|
gid,
|
|
@@ -36819,10 +36819,10 @@ var require_errors5 = __commonJS({
|
|
|
36819
36819
|
return str.indexOf(search, start) !== -1;
|
|
36820
36820
|
}
|
|
36821
36821
|
}
|
|
36822
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
36823
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
36822
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name9, value) {
|
|
36823
|
+
return 'The value "' + value + '" is invalid for option "' + name9 + '"';
|
|
36824
36824
|
}, TypeError);
|
|
36825
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
36825
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name9, expected, actual) {
|
|
36826
36826
|
let determiner;
|
|
36827
36827
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
36828
36828
|
determiner = "must not be";
|
|
@@ -36831,22 +36831,22 @@ var require_errors5 = __commonJS({
|
|
|
36831
36831
|
determiner = "must be";
|
|
36832
36832
|
}
|
|
36833
36833
|
let msg;
|
|
36834
|
-
if (endsWith(
|
|
36835
|
-
msg = `The ${
|
|
36834
|
+
if (endsWith(name9, " argument")) {
|
|
36835
|
+
msg = `The ${name9} ${determiner} ${oneOf(expected, "type")}`;
|
|
36836
36836
|
} else {
|
|
36837
|
-
const type = includes(
|
|
36838
|
-
msg = `The "${
|
|
36837
|
+
const type = includes(name9, ".") ? "property" : "argument";
|
|
36838
|
+
msg = `The "${name9}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
36839
36839
|
}
|
|
36840
36840
|
msg += `. Received type ${typeof actual}`;
|
|
36841
36841
|
return msg;
|
|
36842
36842
|
}, TypeError);
|
|
36843
36843
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
36844
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
36845
|
-
return "The " +
|
|
36844
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name9) {
|
|
36845
|
+
return "The " + name9 + " method is not implemented";
|
|
36846
36846
|
});
|
|
36847
36847
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
36848
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
36849
|
-
return "Cannot call " +
|
|
36848
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name9) {
|
|
36849
|
+
return "Cannot call " + name9 + " after a stream was destroyed";
|
|
36850
36850
|
});
|
|
36851
36851
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
36852
36852
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -36872,8 +36872,8 @@ var require_state5 = __commonJS({
|
|
|
36872
36872
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
36873
36873
|
if (hwm != null) {
|
|
36874
36874
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
36875
|
-
var
|
|
36876
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
36875
|
+
var name9 = isDuplex ? duplexKey : "highWaterMark";
|
|
36876
|
+
throw new ERR_INVALID_OPT_VALUE(name9, hwm);
|
|
36877
36877
|
}
|
|
36878
36878
|
return Math.floor(hwm);
|
|
36879
36879
|
}
|
|
@@ -40670,7 +40670,7 @@ var require_utils = __commonJS({
|
|
|
40670
40670
|
}
|
|
40671
40671
|
return result;
|
|
40672
40672
|
};
|
|
40673
|
-
exports.prepareContent = function(
|
|
40673
|
+
exports.prepareContent = function(name9, inputData, isBinary, isOptimizedBinaryString, isBase64) {
|
|
40674
40674
|
var promise = external.Promise.resolve(inputData).then(function(data) {
|
|
40675
40675
|
var isBlob2 = support.blob && (data instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data)) !== -1);
|
|
40676
40676
|
if (isBlob2 && typeof FileReader !== "undefined") {
|
|
@@ -40691,7 +40691,7 @@ var require_utils = __commonJS({
|
|
|
40691
40691
|
return promise.then(function(data) {
|
|
40692
40692
|
var dataType = exports.getTypeOf(data);
|
|
40693
40693
|
if (!dataType) {
|
|
40694
|
-
return external.Promise.reject(new Error("Can't read the data of '" +
|
|
40694
|
+
return external.Promise.reject(new Error("Can't read the data of '" + name9 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
|
|
40695
40695
|
}
|
|
40696
40696
|
if (dataType === "arraybuffer") {
|
|
40697
40697
|
data = exports.transformTo("uint8array", data);
|
|
@@ -40714,8 +40714,8 @@ var require_utils = __commonJS({
|
|
|
40714
40714
|
var require_GenericWorker = __commonJS({
|
|
40715
40715
|
"../../node_modules/jszip/lib/stream/GenericWorker.js"(exports, module2) {
|
|
40716
40716
|
"use strict";
|
|
40717
|
-
function GenericWorker(
|
|
40718
|
-
this.name =
|
|
40717
|
+
function GenericWorker(name9) {
|
|
40718
|
+
this.name = name9 || "default";
|
|
40719
40719
|
this.streamInfo = {};
|
|
40720
40720
|
this.generatedError = null;
|
|
40721
40721
|
this.extraStreamInfo = {};
|
|
@@ -40763,18 +40763,18 @@ var require_GenericWorker = __commonJS({
|
|
|
40763
40763
|
}
|
|
40764
40764
|
return true;
|
|
40765
40765
|
},
|
|
40766
|
-
on: function(
|
|
40767
|
-
this._listeners[
|
|
40766
|
+
on: function(name9, listener) {
|
|
40767
|
+
this._listeners[name9].push(listener);
|
|
40768
40768
|
return this;
|
|
40769
40769
|
},
|
|
40770
40770
|
cleanUp: function() {
|
|
40771
40771
|
this.streamInfo = this.generatedError = this.extraStreamInfo = null;
|
|
40772
40772
|
this._listeners = [];
|
|
40773
40773
|
},
|
|
40774
|
-
emit: function(
|
|
40775
|
-
if (this._listeners[
|
|
40776
|
-
for (var i = 0; i < this._listeners[
|
|
40777
|
-
this._listeners[
|
|
40774
|
+
emit: function(name9, arg) {
|
|
40775
|
+
if (this._listeners[name9]) {
|
|
40776
|
+
for (var i = 0; i < this._listeners[name9].length; i++) {
|
|
40777
|
+
this._listeners[name9][i].call(this, arg);
|
|
40778
40778
|
}
|
|
40779
40779
|
}
|
|
40780
40780
|
},
|
|
@@ -41483,8 +41483,8 @@ var require_zipObject = __commonJS({
|
|
|
41483
41483
|
var utf8 = require_utf8();
|
|
41484
41484
|
var CompressedObject = require_compressedObject();
|
|
41485
41485
|
var GenericWorker = require_GenericWorker();
|
|
41486
|
-
var ZipObject = function(
|
|
41487
|
-
this.name =
|
|
41486
|
+
var ZipObject = function(name9, data, options) {
|
|
41487
|
+
this.name = name9;
|
|
41488
41488
|
this.dir = options.dir;
|
|
41489
41489
|
this.date = options.date;
|
|
41490
41490
|
this.comment = options.comment;
|
|
@@ -46116,7 +46116,7 @@ var require_object = __commonJS({
|
|
|
46116
46116
|
var generate = require_generate();
|
|
46117
46117
|
var nodejsUtils = require_nodejsUtils();
|
|
46118
46118
|
var NodejsStreamInputAdapter = require_NodejsStreamInputAdapter();
|
|
46119
|
-
var fileAdd = function(
|
|
46119
|
+
var fileAdd = function(name9, data, originalOptions) {
|
|
46120
46120
|
var dataType = utils.getTypeOf(data), parent;
|
|
46121
46121
|
var o = utils.extend(originalOptions || {}, defaults);
|
|
46122
46122
|
o.date = o.date || new Date();
|
|
@@ -46133,9 +46133,9 @@ var require_object = __commonJS({
|
|
|
46133
46133
|
o.dir = true;
|
|
46134
46134
|
}
|
|
46135
46135
|
if (o.dir) {
|
|
46136
|
-
|
|
46136
|
+
name9 = forceTrailingSlash(name9);
|
|
46137
46137
|
}
|
|
46138
|
-
if (o.createFolders && (parent = parentFolder(
|
|
46138
|
+
if (o.createFolders && (parent = parentFolder(name9))) {
|
|
46139
46139
|
folderAdd.call(this, parent, true);
|
|
46140
46140
|
}
|
|
46141
46141
|
var isUnicodeString = dataType === "string" && o.binary === false && o.base64 === false;
|
|
@@ -46154,12 +46154,12 @@ var require_object = __commonJS({
|
|
|
46154
46154
|
if (data instanceof CompressedObject || data instanceof GenericWorker) {
|
|
46155
46155
|
zipObjectContent = data;
|
|
46156
46156
|
} else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {
|
|
46157
|
-
zipObjectContent = new NodejsStreamInputAdapter(
|
|
46157
|
+
zipObjectContent = new NodejsStreamInputAdapter(name9, data);
|
|
46158
46158
|
} else {
|
|
46159
|
-
zipObjectContent = utils.prepareContent(
|
|
46159
|
+
zipObjectContent = utils.prepareContent(name9, data, o.binary, o.optimizedBinaryString, o.base64);
|
|
46160
46160
|
}
|
|
46161
|
-
var object = new ZipObject(
|
|
46162
|
-
this.files[
|
|
46161
|
+
var object = new ZipObject(name9, zipObjectContent, o);
|
|
46162
|
+
this.files[name9] = object;
|
|
46163
46163
|
};
|
|
46164
46164
|
var parentFolder = function(path2) {
|
|
46165
46165
|
if (path2.slice(-1) === "/") {
|
|
@@ -46174,16 +46174,16 @@ var require_object = __commonJS({
|
|
|
46174
46174
|
}
|
|
46175
46175
|
return path2;
|
|
46176
46176
|
};
|
|
46177
|
-
var folderAdd = function(
|
|
46177
|
+
var folderAdd = function(name9, createFolders) {
|
|
46178
46178
|
createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
|
|
46179
|
-
|
|
46180
|
-
if (!this.files[
|
|
46181
|
-
fileAdd.call(this,
|
|
46179
|
+
name9 = forceTrailingSlash(name9);
|
|
46180
|
+
if (!this.files[name9]) {
|
|
46181
|
+
fileAdd.call(this, name9, null, {
|
|
46182
46182
|
dir: true,
|
|
46183
46183
|
createFolders
|
|
46184
46184
|
});
|
|
46185
46185
|
}
|
|
46186
|
-
return this.files[
|
|
46186
|
+
return this.files[name9];
|
|
46187
46187
|
};
|
|
46188
46188
|
function isRegExp(object) {
|
|
46189
46189
|
return Object.prototype.toString.call(object) === "[object RegExp]";
|
|
@@ -46211,15 +46211,15 @@ var require_object = __commonJS({
|
|
|
46211
46211
|
});
|
|
46212
46212
|
return result;
|
|
46213
46213
|
},
|
|
46214
|
-
file: function(
|
|
46214
|
+
file: function(name9, data, o) {
|
|
46215
46215
|
if (arguments.length === 1) {
|
|
46216
|
-
if (isRegExp(
|
|
46217
|
-
var regexp =
|
|
46216
|
+
if (isRegExp(name9)) {
|
|
46217
|
+
var regexp = name9;
|
|
46218
46218
|
return this.filter(function(relativePath, file) {
|
|
46219
46219
|
return !file.dir && regexp.test(relativePath);
|
|
46220
46220
|
});
|
|
46221
46221
|
} else {
|
|
46222
|
-
var obj = this.files[this.root +
|
|
46222
|
+
var obj = this.files[this.root + name9];
|
|
46223
46223
|
if (obj && !obj.dir) {
|
|
46224
46224
|
return obj;
|
|
46225
46225
|
} else {
|
|
@@ -46227,8 +46227,8 @@ var require_object = __commonJS({
|
|
|
46227
46227
|
}
|
|
46228
46228
|
}
|
|
46229
46229
|
} else {
|
|
46230
|
-
|
|
46231
|
-
fileAdd.call(this,
|
|
46230
|
+
name9 = this.root + name9;
|
|
46231
|
+
fileAdd.call(this, name9, data, o);
|
|
46232
46232
|
}
|
|
46233
46233
|
return this;
|
|
46234
46234
|
},
|
|
@@ -46241,26 +46241,26 @@ var require_object = __commonJS({
|
|
|
46241
46241
|
return file.dir && arg.test(relativePath);
|
|
46242
46242
|
});
|
|
46243
46243
|
}
|
|
46244
|
-
var
|
|
46245
|
-
var newFolder = folderAdd.call(this,
|
|
46244
|
+
var name9 = this.root + arg;
|
|
46245
|
+
var newFolder = folderAdd.call(this, name9);
|
|
46246
46246
|
var ret = this.clone();
|
|
46247
46247
|
ret.root = newFolder.name;
|
|
46248
46248
|
return ret;
|
|
46249
46249
|
},
|
|
46250
|
-
remove: function(
|
|
46251
|
-
|
|
46252
|
-
var file = this.files[
|
|
46250
|
+
remove: function(name9) {
|
|
46251
|
+
name9 = this.root + name9;
|
|
46252
|
+
var file = this.files[name9];
|
|
46253
46253
|
if (!file) {
|
|
46254
|
-
if (
|
|
46255
|
-
|
|
46254
|
+
if (name9.slice(-1) !== "/") {
|
|
46255
|
+
name9 += "/";
|
|
46256
46256
|
}
|
|
46257
|
-
file = this.files[
|
|
46257
|
+
file = this.files[name9];
|
|
46258
46258
|
}
|
|
46259
46259
|
if (file && !file.dir) {
|
|
46260
|
-
delete this.files[
|
|
46260
|
+
delete this.files[name9];
|
|
46261
46261
|
} else {
|
|
46262
46262
|
var kids = this.filter(function(relativePath, file2) {
|
|
46263
|
-
return file2.name.slice(0,
|
|
46263
|
+
return file2.name.slice(0, name9.length) === name9;
|
|
46264
46264
|
});
|
|
46265
46265
|
for (var i = 0; i < kids.length; i++) {
|
|
46266
46266
|
delete this.files[kids[i].name];
|
|
@@ -47303,9 +47303,9 @@ var require_runtime = __commonJS({
|
|
|
47303
47303
|
this.arg = undefined2;
|
|
47304
47304
|
this.tryEntries.forEach(resetTryEntry);
|
|
47305
47305
|
if (!skipTempReset) {
|
|
47306
|
-
for (var
|
|
47307
|
-
if (
|
|
47308
|
-
this[
|
|
47306
|
+
for (var name9 in this) {
|
|
47307
|
+
if (name9.charAt(0) === "t" && hasOwn.call(this, name9) && !isNaN(+name9.slice(1))) {
|
|
47308
|
+
this[name9] = undefined2;
|
|
47309
47309
|
}
|
|
47310
47310
|
}
|
|
47311
47311
|
}
|
|
@@ -48375,12 +48375,12 @@ var require_polyfill_vertex_array_object = __commonJS({
|
|
|
48375
48375
|
return list;
|
|
48376
48376
|
};
|
|
48377
48377
|
var original_getExtension = gl.getExtension;
|
|
48378
|
-
gl.getExtension = function getExtension(
|
|
48379
|
-
var ext = original_getExtension.call(this,
|
|
48378
|
+
gl.getExtension = function getExtension(name9) {
|
|
48379
|
+
var ext = original_getExtension.call(this, name9);
|
|
48380
48380
|
if (ext) {
|
|
48381
48381
|
return ext;
|
|
48382
48382
|
}
|
|
48383
|
-
if (
|
|
48383
|
+
if (name9 !== "OES_vertex_array_object") {
|
|
48384
48384
|
return null;
|
|
48385
48385
|
}
|
|
48386
48386
|
if (!gl.__OESVertexArrayObject) {
|
|
@@ -49841,13 +49841,13 @@ var require_init3 = __commonJS({
|
|
|
49841
49841
|
}
|
|
49842
49842
|
(0, _createClass2.default)(StatsManager2, [{
|
|
49843
49843
|
key: "get",
|
|
49844
|
-
value: function get(
|
|
49845
|
-
if (!this.stats.has(
|
|
49846
|
-
this.stats.set(
|
|
49847
|
-
id:
|
|
49844
|
+
value: function get(name9) {
|
|
49845
|
+
if (!this.stats.has(name9)) {
|
|
49846
|
+
this.stats.set(name9, new _probe.Stats({
|
|
49847
|
+
id: name9
|
|
49848
49848
|
}));
|
|
49849
49849
|
}
|
|
49850
|
-
return this.stats.get(
|
|
49850
|
+
return this.stats.get(name9);
|
|
49851
49851
|
}
|
|
49852
49852
|
}]);
|
|
49853
49853
|
return StatsManager2;
|
|
@@ -50239,17 +50239,17 @@ var require_constants_to_keys = __commonJS({
|
|
|
50239
50239
|
exports.getKey = getKey;
|
|
50240
50240
|
exports.getKeyType = getKeyType;
|
|
50241
50241
|
var _utils = require_utils4();
|
|
50242
|
-
function getKeyValue(gl,
|
|
50243
|
-
if (typeof
|
|
50244
|
-
return
|
|
50242
|
+
function getKeyValue(gl, name9) {
|
|
50243
|
+
if (typeof name9 !== "string") {
|
|
50244
|
+
return name9;
|
|
50245
50245
|
}
|
|
50246
|
-
var number = Number(
|
|
50246
|
+
var number = Number(name9);
|
|
50247
50247
|
if (!isNaN(number)) {
|
|
50248
50248
|
return number;
|
|
50249
50249
|
}
|
|
50250
|
-
|
|
50251
|
-
var value = gl[
|
|
50252
|
-
(0, _utils.assert)(value !== void 0, "Accessing undefined constant GL.".concat(
|
|
50250
|
+
name9 = name9.replace(/^.*\./, "");
|
|
50251
|
+
var value = gl[name9];
|
|
50252
|
+
(0, _utils.assert)(value !== void 0, "Accessing undefined constant GL.".concat(name9));
|
|
50253
50253
|
return value;
|
|
50254
50254
|
}
|
|
50255
50255
|
function getKey(gl, value) {
|
|
@@ -50614,35 +50614,35 @@ var require_resource = __commonJS({
|
|
|
50614
50614
|
}, {
|
|
50615
50615
|
key: "_addStats",
|
|
50616
50616
|
value: function _addStats() {
|
|
50617
|
-
var
|
|
50617
|
+
var name9 = this.constructor.name;
|
|
50618
50618
|
var stats = _init.lumaStats.get("Resource Counts");
|
|
50619
50619
|
stats.get("Resources Created").incrementCount();
|
|
50620
|
-
stats.get("".concat(
|
|
50621
|
-
stats.get("".concat(
|
|
50620
|
+
stats.get("".concat(name9, "s Created")).incrementCount();
|
|
50621
|
+
stats.get("".concat(name9, "s Active")).incrementCount();
|
|
50622
50622
|
}
|
|
50623
50623
|
}, {
|
|
50624
50624
|
key: "_removeStats",
|
|
50625
50625
|
value: function _removeStats() {
|
|
50626
|
-
var
|
|
50626
|
+
var name9 = this.constructor.name;
|
|
50627
50627
|
var stats = _init.lumaStats.get("Resource Counts");
|
|
50628
|
-
stats.get("".concat(
|
|
50628
|
+
stats.get("".concat(name9, "s Active")).decrementCount();
|
|
50629
50629
|
}
|
|
50630
50630
|
}, {
|
|
50631
50631
|
key: "_trackAllocatedMemory",
|
|
50632
50632
|
value: function _trackAllocatedMemory(bytes) {
|
|
50633
|
-
var
|
|
50633
|
+
var name9 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.constructor.name;
|
|
50634
50634
|
var stats = _init.lumaStats.get("Memory Usage");
|
|
50635
50635
|
stats.get("GPU Memory").addCount(bytes);
|
|
50636
|
-
stats.get("".concat(
|
|
50636
|
+
stats.get("".concat(name9, " Memory")).addCount(bytes);
|
|
50637
50637
|
this.byteLength = bytes;
|
|
50638
50638
|
}
|
|
50639
50639
|
}, {
|
|
50640
50640
|
key: "_trackDeallocatedMemory",
|
|
50641
50641
|
value: function _trackDeallocatedMemory() {
|
|
50642
|
-
var
|
|
50642
|
+
var name9 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.constructor.name;
|
|
50643
50643
|
var stats = _init.lumaStats.get("Memory Usage");
|
|
50644
50644
|
stats.get("GPU Memory").subtractCount(this.byteLength);
|
|
50645
|
-
stats.get("".concat(
|
|
50645
|
+
stats.get("".concat(name9, " Memory")).subtractCount(this.byteLength);
|
|
50646
50646
|
this.byteLength = 0;
|
|
50647
50647
|
}
|
|
50648
50648
|
}, {
|
|
@@ -54395,8 +54395,8 @@ var require_format_glsl_error = __commonJS({
|
|
|
54395
54395
|
var errorStrings = errLog.split(/\r?\n/);
|
|
54396
54396
|
var errors = {};
|
|
54397
54397
|
var warnings = {};
|
|
54398
|
-
var
|
|
54399
|
-
var shaderDescription = "".concat((0, _getShaderTypeName.default)(shaderType), " shader ").concat(
|
|
54398
|
+
var name9 = shaderName || (0, _getShaderName.default)(src) || "(unnamed)";
|
|
54399
|
+
var shaderDescription = "".concat((0, _getShaderTypeName.default)(shaderType), " shader ").concat(name9);
|
|
54400
54400
|
for (var i = 0; i < errorStrings.length; i++) {
|
|
54401
54401
|
var errorString = errorStrings[i];
|
|
54402
54402
|
if (errorString.length <= 1) {
|
|
@@ -54794,18 +54794,18 @@ var require_uniforms = __commonJS({
|
|
|
54794
54794
|
}
|
|
54795
54795
|
return setter().bind(null, gl, location);
|
|
54796
54796
|
}
|
|
54797
|
-
function parseUniformName(
|
|
54798
|
-
if (
|
|
54797
|
+
function parseUniformName(name9) {
|
|
54798
|
+
if (name9[name9.length - 1] !== "]") {
|
|
54799
54799
|
return {
|
|
54800
|
-
name:
|
|
54800
|
+
name: name9,
|
|
54801
54801
|
length: 1,
|
|
54802
54802
|
isArray: false
|
|
54803
54803
|
};
|
|
54804
54804
|
}
|
|
54805
54805
|
var UNIFORM_NAME_REGEXP = /([^[]*)(\[[0-9]+\])?/;
|
|
54806
|
-
var matches3 =
|
|
54806
|
+
var matches3 = name9.match(UNIFORM_NAME_REGEXP);
|
|
54807
54807
|
if (!matches3 || matches3.length < 2) {
|
|
54808
|
-
throw new Error("Failed to parse GLSL uniform name ".concat(
|
|
54808
|
+
throw new Error("Failed to parse GLSL uniform name ".concat(name9));
|
|
54809
54809
|
}
|
|
54810
54810
|
return {
|
|
54811
54811
|
name: matches3[1],
|
|
@@ -55050,11 +55050,11 @@ var require_attribute_utils = __commonJS({
|
|
|
55050
55050
|
default:
|
|
55051
55051
|
}
|
|
55052
55052
|
for (var glType in COMPOSITE_GL_TYPES) {
|
|
55053
|
-
var _COMPOSITE_GL_TYPES$g = (0, _slicedToArray2.default)(COMPOSITE_GL_TYPES[glType], 3), compType = _COMPOSITE_GL_TYPES$g[0], compComponents = _COMPOSITE_GL_TYPES$g[1],
|
|
55053
|
+
var _COMPOSITE_GL_TYPES$g = (0, _slicedToArray2.default)(COMPOSITE_GL_TYPES[glType], 3), compType = _COMPOSITE_GL_TYPES$g[0], compComponents = _COMPOSITE_GL_TYPES$g[1], name9 = _COMPOSITE_GL_TYPES$g[2];
|
|
55054
55054
|
if (compType === type && compComponents === components) {
|
|
55055
55055
|
return {
|
|
55056
55056
|
glType,
|
|
55057
|
-
name:
|
|
55057
|
+
name: name9
|
|
55058
55058
|
};
|
|
55059
55059
|
}
|
|
55060
55060
|
}
|
|
@@ -55138,10 +55138,10 @@ var require_program_configuration = __commonJS({
|
|
|
55138
55138
|
var gl = program.gl;
|
|
55139
55139
|
var count = gl.getProgramParameter(program.handle, 35721);
|
|
55140
55140
|
for (var index = 0; index < count; index++) {
|
|
55141
|
-
var _gl$getActiveAttrib = gl.getActiveAttrib(program.handle, index),
|
|
55142
|
-
var location = gl.getAttribLocation(program.handle,
|
|
55141
|
+
var _gl$getActiveAttrib = gl.getActiveAttrib(program.handle, index), name9 = _gl$getActiveAttrib.name, type = _gl$getActiveAttrib.type, size = _gl$getActiveAttrib.size;
|
|
55142
|
+
var location = gl.getAttribLocation(program.handle, name9);
|
|
55143
55143
|
if (location >= 0) {
|
|
55144
|
-
this._addAttribute(location,
|
|
55144
|
+
this._addAttribute(location, name9, type, size);
|
|
55145
55145
|
}
|
|
55146
55146
|
}
|
|
55147
55147
|
this.attributeInfos.sort(function(a, b) {
|
|
@@ -55157,8 +55157,8 @@ var require_program_configuration = __commonJS({
|
|
|
55157
55157
|
}
|
|
55158
55158
|
var count = gl.getProgramParameter(program.handle, 35971);
|
|
55159
55159
|
for (var location = 0; location < count; location++) {
|
|
55160
|
-
var _gl$getTransformFeedb = gl.getTransformFeedbackVarying(program.handle, location),
|
|
55161
|
-
this._addVarying(location,
|
|
55160
|
+
var _gl$getTransformFeedb = gl.getTransformFeedbackVarying(program.handle, location), name9 = _gl$getTransformFeedb.name, type = _gl$getTransformFeedb.type, size = _gl$getTransformFeedb.size;
|
|
55161
|
+
this._addVarying(location, name9, type, size);
|
|
55162
55162
|
}
|
|
55163
55163
|
this.varyingInfos.sort(function(a, b) {
|
|
55164
55164
|
return a.location - b.location;
|
|
@@ -55166,16 +55166,16 @@ var require_program_configuration = __commonJS({
|
|
|
55166
55166
|
}
|
|
55167
55167
|
}, {
|
|
55168
55168
|
key: "_addAttribute",
|
|
55169
|
-
value: function _addAttribute(location,
|
|
55169
|
+
value: function _addAttribute(location, name9, compositeType, size) {
|
|
55170
55170
|
var _decomposeCompositeGL = (0, _attributeUtils.decomposeCompositeGLType)(compositeType), type = _decomposeCompositeGL.type, components = _decomposeCompositeGL.components;
|
|
55171
55171
|
var accessor = {
|
|
55172
55172
|
type,
|
|
55173
55173
|
size: size * components
|
|
55174
55174
|
};
|
|
55175
|
-
this._inferProperties(location,
|
|
55175
|
+
this._inferProperties(location, name9, accessor);
|
|
55176
55176
|
var attributeInfo = {
|
|
55177
55177
|
location,
|
|
55178
|
-
name:
|
|
55178
|
+
name: name9,
|
|
55179
55179
|
accessor: new _accessor.default(accessor)
|
|
55180
55180
|
};
|
|
55181
55181
|
this.attributeInfos.push(attributeInfo);
|
|
@@ -55184,14 +55184,14 @@ var require_program_configuration = __commonJS({
|
|
|
55184
55184
|
}
|
|
55185
55185
|
}, {
|
|
55186
55186
|
key: "_inferProperties",
|
|
55187
|
-
value: function _inferProperties(location,
|
|
55188
|
-
if (/instance/i.test(
|
|
55187
|
+
value: function _inferProperties(location, name9, accessor) {
|
|
55188
|
+
if (/instance/i.test(name9)) {
|
|
55189
55189
|
accessor.divisor = 1;
|
|
55190
55190
|
}
|
|
55191
55191
|
}
|
|
55192
55192
|
}, {
|
|
55193
55193
|
key: "_addVarying",
|
|
55194
|
-
value: function _addVarying(location,
|
|
55194
|
+
value: function _addVarying(location, name9, compositeType, size) {
|
|
55195
55195
|
var _decomposeCompositeGL2 = (0, _attributeUtils.decomposeCompositeGLType)(compositeType), type = _decomposeCompositeGL2.type, components = _decomposeCompositeGL2.components;
|
|
55196
55196
|
var accessor = new _accessor.default({
|
|
55197
55197
|
type,
|
|
@@ -55199,7 +55199,7 @@ var require_program_configuration = __commonJS({
|
|
|
55199
55199
|
});
|
|
55200
55200
|
var varying = {
|
|
55201
55201
|
location,
|
|
55202
|
-
name:
|
|
55202
|
+
name: name9,
|
|
55203
55203
|
accessor
|
|
55204
55204
|
};
|
|
55205
55205
|
this.varyingInfos.push(varying);
|
|
@@ -55589,13 +55589,13 @@ var require_program = __commonJS({
|
|
|
55589
55589
|
this._uniformCount = this._getParameter(35718);
|
|
55590
55590
|
for (var i = 0; i < this._uniformCount; i++) {
|
|
55591
55591
|
var info = this.gl.getActiveUniform(this.handle, i);
|
|
55592
|
-
var _parseUniformName = (0, _uniforms.parseUniformName)(info.name),
|
|
55593
|
-
var location = gl.getUniformLocation(this.handle,
|
|
55594
|
-
this._uniformSetters[
|
|
55592
|
+
var _parseUniformName = (0, _uniforms.parseUniformName)(info.name), name9 = _parseUniformName.name;
|
|
55593
|
+
var location = gl.getUniformLocation(this.handle, name9);
|
|
55594
|
+
this._uniformSetters[name9] = (0, _uniforms.getUniformSetter)(gl, location, info);
|
|
55595
55595
|
if (info.size > 1) {
|
|
55596
55596
|
for (var l = 0; l < info.size; l++) {
|
|
55597
|
-
location = gl.getUniformLocation(this.handle, "".concat(
|
|
55598
|
-
this._uniformSetters["".concat(
|
|
55597
|
+
location = gl.getUniformLocation(this.handle, "".concat(name9, "[").concat(l, "]"));
|
|
55598
|
+
this._uniformSetters["".concat(name9, "[").concat(l, "]")] = (0, _uniforms.getUniformSetter)(gl, location, info);
|
|
55599
55599
|
}
|
|
55600
55600
|
}
|
|
55601
55601
|
}
|
|
@@ -56727,7 +56727,7 @@ var require_vertex_array = __commonJS({
|
|
|
56727
56727
|
location: -1,
|
|
56728
56728
|
accessor: null
|
|
56729
56729
|
};
|
|
56730
|
-
var _this$_getAttributeIn = this._getAttributeIndex(locationOrName), location = _this$_getAttributeIn.location,
|
|
56730
|
+
var _this$_getAttributeIn = this._getAttributeIndex(locationOrName), location = _this$_getAttributeIn.location, name9 = _this$_getAttributeIn.name;
|
|
56731
56731
|
if (!Number.isFinite(location) || location < 0) {
|
|
56732
56732
|
this.unused[locationOrName] = value;
|
|
56733
56733
|
_gltools.log.once(3, function() {
|
|
@@ -56735,7 +56735,7 @@ var require_vertex_array = __commonJS({
|
|
|
56735
56735
|
})();
|
|
56736
56736
|
return INVALID_RESULT;
|
|
56737
56737
|
}
|
|
56738
|
-
var accessInfo = this._getAttributeInfo(
|
|
56738
|
+
var accessInfo = this._getAttributeInfo(name9 || location);
|
|
56739
56739
|
if (!accessInfo) {
|
|
56740
56740
|
return INVALID_RESULT;
|
|
56741
56741
|
}
|
|
@@ -56763,12 +56763,12 @@ var require_vertex_array = __commonJS({
|
|
|
56763
56763
|
};
|
|
56764
56764
|
}
|
|
56765
56765
|
var multiLocation = MULTI_LOCATION_ATTRIBUTE_REGEXP.exec(locationOrName);
|
|
56766
|
-
var
|
|
56766
|
+
var name9 = multiLocation ? multiLocation[1] : locationOrName;
|
|
56767
56767
|
var locationOffset = multiLocation ? Number(multiLocation[2]) : 0;
|
|
56768
56768
|
if (this.configuration) {
|
|
56769
56769
|
return {
|
|
56770
|
-
location: this.configuration.getAttributeLocation(
|
|
56771
|
-
name:
|
|
56770
|
+
location: this.configuration.getAttributeLocation(name9) + locationOffset,
|
|
56771
|
+
name: name9
|
|
56772
56772
|
};
|
|
56773
56773
|
}
|
|
56774
56774
|
return {
|
|
@@ -57274,10 +57274,10 @@ var require_debug_vertex_array = __commonJS({
|
|
|
57274
57274
|
isInteger
|
|
57275
57275
|
}), " (constant)")), (0, _defineProperty2.default)(_ref4, "Format ", "".concat(size, "x").concat(type, " (constant)")), _ref4;
|
|
57276
57276
|
}
|
|
57277
|
-
function getGLSLDeclaration(
|
|
57277
|
+
function getGLSLDeclaration(name9, accessor) {
|
|
57278
57278
|
var type = accessor.type, size = accessor.size;
|
|
57279
57279
|
var typeAndName = (0, _attributeUtils.getCompositeGLType)(type, size);
|
|
57280
|
-
return typeAndName ? "".concat(
|
|
57280
|
+
return typeAndName ? "".concat(name9, " (").concat(typeAndName.name, ")") : name9;
|
|
57281
57281
|
}
|
|
57282
57282
|
}
|
|
57283
57283
|
});
|
|
@@ -58406,10 +58406,10 @@ var require_shader_module = __commonJS({
|
|
|
58406
58406
|
var FRAGMENT_SHADER = "fs";
|
|
58407
58407
|
var ShaderModule = function() {
|
|
58408
58408
|
function ShaderModule2(_ref) {
|
|
58409
|
-
var
|
|
58409
|
+
var name9 = _ref.name, vs = _ref.vs, fs5 = _ref.fs, _ref$dependencies = _ref.dependencies, dependencies = _ref$dependencies === void 0 ? [] : _ref$dependencies, uniforms = _ref.uniforms, getUniforms = _ref.getUniforms, _ref$deprecations = _ref.deprecations, deprecations = _ref$deprecations === void 0 ? [] : _ref$deprecations, _ref$defines = _ref.defines, defines = _ref$defines === void 0 ? {} : _ref$defines, _ref$inject = _ref.inject, inject = _ref$inject === void 0 ? {} : _ref$inject, vertexShader = _ref.vertexShader, fragmentShader = _ref.fragmentShader;
|
|
58410
58410
|
(0, _classCallCheck2.default)(this, ShaderModule2);
|
|
58411
|
-
(0, _utils.assert)(typeof
|
|
58412
|
-
this.name =
|
|
58411
|
+
(0, _utils.assert)(typeof name9 === "string");
|
|
58412
|
+
this.name = name9;
|
|
58413
58413
|
this.vs = vs || vertexShader;
|
|
58414
58414
|
this.fs = fs5 || fragmentShader;
|
|
58415
58415
|
this.getModuleUniforms = getUniforms;
|
|
@@ -58620,8 +58620,8 @@ var require_resolve_modules = __commonJS({
|
|
|
58620
58620
|
});
|
|
58621
58621
|
return Object.keys(moduleDepth).sort(function(a, b) {
|
|
58622
58622
|
return moduleDepth[b] - moduleDepth[a];
|
|
58623
|
-
}).map(function(
|
|
58624
|
-
return moduleMap[
|
|
58623
|
+
}).map(function(name9) {
|
|
58624
|
+
return moduleMap[name9];
|
|
58625
58625
|
});
|
|
58626
58626
|
}
|
|
58627
58627
|
function getDependencyGraph(_ref) {
|
|
@@ -59235,9 +59235,9 @@ var require_assemble_shaders = __commonJS({
|
|
|
59235
59235
|
var match = key.match(/^(v|f)s:(#)?([\w-]+)$/);
|
|
59236
59236
|
if (match) {
|
|
59237
59237
|
var hash = match[2];
|
|
59238
|
-
var
|
|
59238
|
+
var name9 = match[3];
|
|
59239
59239
|
if (hash) {
|
|
59240
|
-
if (
|
|
59240
|
+
if (name9 === "decl") {
|
|
59241
59241
|
declInjections[key] = [injection];
|
|
59242
59242
|
} else {
|
|
59243
59243
|
mainInjections[key] = [injection];
|
|
@@ -59378,8 +59378,8 @@ var require_assemble_shaders = __commonJS({
|
|
|
59378
59378
|
}
|
|
59379
59379
|
hook = hook.trim();
|
|
59380
59380
|
var _hook$split = hook.split(":"), _hook$split2 = (0, _slicedToArray2.default)(_hook$split, 2), stage = _hook$split2[0], signature = _hook$split2[1];
|
|
59381
|
-
var
|
|
59382
|
-
result[stage][
|
|
59381
|
+
var name9 = hook.replace(/\(.+/, "");
|
|
59382
|
+
result[stage][name9] = Object.assign(opts, {
|
|
59383
59383
|
signature
|
|
59384
59384
|
});
|
|
59385
59385
|
});
|
|
@@ -59413,11 +59413,11 @@ var require_shader_utils = __commonJS({
|
|
|
59413
59413
|
if (!qualifiers.includes(qualifier) || !type || !definition) {
|
|
59414
59414
|
return null;
|
|
59415
59415
|
}
|
|
59416
|
-
var
|
|
59416
|
+
var name9 = definition.split(";")[0];
|
|
59417
59417
|
return {
|
|
59418
59418
|
qualifier,
|
|
59419
59419
|
type,
|
|
59420
|
-
name:
|
|
59420
|
+
name: name9
|
|
59421
59421
|
};
|
|
59422
59422
|
}
|
|
59423
59423
|
function getPassthroughFS() {
|
|
@@ -60808,15 +60808,15 @@ var require_vector32 = __commonJS({
|
|
|
60808
60808
|
}
|
|
60809
60809
|
var ORIGIN = [0, 0, 0];
|
|
60810
60810
|
var constants = {};
|
|
60811
|
-
var
|
|
60812
|
-
(0, _inherits2.default)(
|
|
60813
|
-
var _super = _createSuper(
|
|
60814
|
-
function
|
|
60811
|
+
var Vector321 = function(_Vector) {
|
|
60812
|
+
(0, _inherits2.default)(Vector322, _Vector);
|
|
60813
|
+
var _super = _createSuper(Vector322);
|
|
60814
|
+
function Vector322() {
|
|
60815
60815
|
var _this;
|
|
60816
60816
|
var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
60817
60817
|
var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
60818
60818
|
var z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
|
|
60819
|
-
(0, _classCallCheck2.default)(this,
|
|
60819
|
+
(0, _classCallCheck2.default)(this, Vector322);
|
|
60820
60820
|
_this = _super.call(this, -0, -0, -0);
|
|
60821
60821
|
if (arguments.length === 1 && (0, _common.isArray)(x)) {
|
|
60822
60822
|
_this.copy(x);
|
|
@@ -60832,7 +60832,7 @@ var require_vector32 = __commonJS({
|
|
|
60832
60832
|
}
|
|
60833
60833
|
return _this;
|
|
60834
60834
|
}
|
|
60835
|
-
(0, _createClass2.default)(
|
|
60835
|
+
(0, _createClass2.default)(Vector322, [{
|
|
60836
60836
|
key: "set",
|
|
60837
60837
|
value: function set(x, y, z) {
|
|
60838
60838
|
this[0] = x;
|
|
@@ -60952,12 +60952,12 @@ var require_vector32 = __commonJS({
|
|
|
60952
60952
|
}], [{
|
|
60953
60953
|
key: "ZERO",
|
|
60954
60954
|
get: function get() {
|
|
60955
|
-
return constants.ZERO = constants.ZERO || Object.freeze(new
|
|
60955
|
+
return constants.ZERO = constants.ZERO || Object.freeze(new Vector322(0, 0, 0, 0));
|
|
60956
60956
|
}
|
|
60957
60957
|
}]);
|
|
60958
|
-
return
|
|
60958
|
+
return Vector322;
|
|
60959
60959
|
}(_vector.default);
|
|
60960
|
-
exports.default =
|
|
60960
|
+
exports.default = Vector321;
|
|
60961
60961
|
}
|
|
60962
60962
|
});
|
|
60963
60963
|
|
|
@@ -61408,12 +61408,12 @@ var require_matrix32 = __commonJS({
|
|
|
61408
61408
|
COL2ROW2: 8
|
|
61409
61409
|
});
|
|
61410
61410
|
var constants = {};
|
|
61411
|
-
var
|
|
61412
|
-
(0, _inherits2.default)(
|
|
61413
|
-
var _super = _createSuper(
|
|
61414
|
-
function
|
|
61411
|
+
var Matrix35 = function(_Matrix) {
|
|
61412
|
+
(0, _inherits2.default)(Matrix36, _Matrix);
|
|
61413
|
+
var _super = _createSuper(Matrix36);
|
|
61414
|
+
function Matrix36(array) {
|
|
61415
61415
|
var _this;
|
|
61416
|
-
(0, _classCallCheck2.default)(this,
|
|
61416
|
+
(0, _classCallCheck2.default)(this, Matrix36);
|
|
61417
61417
|
_this = _super.call(this, -0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
61418
61418
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
61419
61419
|
_this.copy(array);
|
|
@@ -61422,7 +61422,7 @@ var require_matrix32 = __commonJS({
|
|
|
61422
61422
|
}
|
|
61423
61423
|
return _this;
|
|
61424
61424
|
}
|
|
61425
|
-
(0, _createClass2.default)(
|
|
61425
|
+
(0, _createClass2.default)(Matrix36, [{
|
|
61426
61426
|
key: "ELEMENTS",
|
|
61427
61427
|
get: function get() {
|
|
61428
61428
|
return 9;
|
|
@@ -61581,19 +61581,19 @@ var require_matrix32 = __commonJS({
|
|
|
61581
61581
|
}], [{
|
|
61582
61582
|
key: "IDENTITY",
|
|
61583
61583
|
get: function get() {
|
|
61584
|
-
constants.IDENTITY = constants.IDENTITY || Object.freeze(new
|
|
61584
|
+
constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix36(IDENTITY));
|
|
61585
61585
|
return constants.IDENTITY;
|
|
61586
61586
|
}
|
|
61587
61587
|
}, {
|
|
61588
61588
|
key: "ZERO",
|
|
61589
61589
|
get: function get() {
|
|
61590
|
-
constants.ZERO = constants.ZERO || Object.freeze(new
|
|
61590
|
+
constants.ZERO = constants.ZERO || Object.freeze(new Matrix36(ZERO));
|
|
61591
61591
|
return constants.ZERO;
|
|
61592
61592
|
}
|
|
61593
61593
|
}]);
|
|
61594
|
-
return
|
|
61594
|
+
return Matrix36;
|
|
61595
61595
|
}(_matrix.default);
|
|
61596
|
-
exports.default =
|
|
61596
|
+
exports.default = Matrix35;
|
|
61597
61597
|
}
|
|
61598
61598
|
});
|
|
61599
61599
|
|
|
@@ -65332,9 +65332,9 @@ var require_program_manager = __commonJS({
|
|
|
65332
65332
|
var count = 0;
|
|
65333
65333
|
for (var i = 0, len = this._defaultModules.length; i < len; ++i) {
|
|
65334
65334
|
var module3 = this._defaultModules[i];
|
|
65335
|
-
var
|
|
65335
|
+
var name9 = module3.name;
|
|
65336
65336
|
modules[count++] = module3;
|
|
65337
|
-
seen[
|
|
65337
|
+
seen[name9] = true;
|
|
65338
65338
|
}
|
|
65339
65339
|
for (var _i = 0, _len = appModules.length; _i < _len; ++_i) {
|
|
65340
65340
|
var _module = appModules[_i];
|
|
@@ -65406,10 +65406,10 @@ var require_model_utils = __commonJS({
|
|
|
65406
65406
|
function getBuffersFromGeometry(gl, geometry, options) {
|
|
65407
65407
|
var buffers = {};
|
|
65408
65408
|
var indices = geometry.indices;
|
|
65409
|
-
for (var
|
|
65410
|
-
var attribute = geometry.attributes[
|
|
65411
|
-
var remappedName = mapAttributeName(
|
|
65412
|
-
if (
|
|
65409
|
+
for (var name9 in geometry.attributes) {
|
|
65410
|
+
var attribute = geometry.attributes[name9];
|
|
65411
|
+
var remappedName = mapAttributeName(name9, options);
|
|
65412
|
+
if (name9 === "indices") {
|
|
65413
65413
|
indices = attribute;
|
|
65414
65414
|
} else if (attribute.constant) {
|
|
65415
65415
|
buffers[remappedName] = attribute.value;
|
|
@@ -65418,7 +65418,7 @@ var require_model_utils = __commonJS({
|
|
|
65418
65418
|
var accessor = _objectSpread({}, attribute);
|
|
65419
65419
|
delete accessor.value;
|
|
65420
65420
|
buffers[remappedName] = [new _webgl.Buffer(gl, typedArray), accessor];
|
|
65421
|
-
inferAttributeAccessor(
|
|
65421
|
+
inferAttributeAccessor(name9, accessor);
|
|
65422
65422
|
}
|
|
65423
65423
|
}
|
|
65424
65424
|
if (indices) {
|
|
@@ -65435,9 +65435,9 @@ var require_model_utils = __commonJS({
|
|
|
65435
65435
|
}
|
|
65436
65436
|
return buffers;
|
|
65437
65437
|
}
|
|
65438
|
-
function mapAttributeName(
|
|
65438
|
+
function mapAttributeName(name9, options) {
|
|
65439
65439
|
var _ref = options || {}, _ref$attributeMap = _ref.attributeMap, attributeMap = _ref$attributeMap === void 0 ? GLTF_TO_LUMA_ATTRIBUTE_MAP : _ref$attributeMap;
|
|
65440
|
-
return attributeMap && attributeMap[
|
|
65440
|
+
return attributeMap && attributeMap[name9] || name9;
|
|
65441
65441
|
}
|
|
65442
65442
|
function inferAttributeAccessor(attributeName, attribute) {
|
|
65443
65443
|
var category;
|
|
@@ -65648,9 +65648,9 @@ var require_model = __commonJS({
|
|
|
65648
65648
|
return this;
|
|
65649
65649
|
}
|
|
65650
65650
|
var normalizedAttributes = {};
|
|
65651
|
-
for (var
|
|
65652
|
-
var attribute = attributes[
|
|
65653
|
-
normalizedAttributes[
|
|
65651
|
+
for (var name9 in attributes) {
|
|
65652
|
+
var attribute = attributes[name9];
|
|
65653
|
+
normalizedAttributes[name9] = attribute.getValue ? attribute.getValue() : attribute;
|
|
65654
65654
|
}
|
|
65655
65655
|
this.vertexArray.setAttributes(normalizedAttributes);
|
|
65656
65656
|
return this;
|
|
@@ -65832,8 +65832,8 @@ var require_model = __commonJS({
|
|
|
65832
65832
|
}, {
|
|
65833
65833
|
key: "_deleteGeometryBuffers",
|
|
65834
65834
|
value: function _deleteGeometryBuffers() {
|
|
65835
|
-
for (var
|
|
65836
|
-
var buffer = this.geometryBuffers[
|
|
65835
|
+
for (var name9 in this.geometryBuffers) {
|
|
65836
|
+
var buffer = this.geometryBuffers[name9][0] || this.geometryBuffers[name9];
|
|
65837
65837
|
if (buffer instanceof _webgl.Buffer) {
|
|
65838
65838
|
buffer.delete();
|
|
65839
65839
|
}
|
|
@@ -66084,8 +66084,8 @@ var require_buffer_transform = __commonJS({
|
|
|
66084
66084
|
}, {
|
|
66085
66085
|
key: "delete",
|
|
66086
66086
|
value: function _delete() {
|
|
66087
|
-
for (var
|
|
66088
|
-
this.resources[
|
|
66087
|
+
for (var name9 in this.resources) {
|
|
66088
|
+
this.resources[name9].delete();
|
|
66089
66089
|
}
|
|
66090
66090
|
}
|
|
66091
66091
|
}, {
|
|
@@ -66201,12 +66201,12 @@ var require_buffer_transform = __commonJS({
|
|
|
66201
66201
|
}
|
|
66202
66202
|
}, {
|
|
66203
66203
|
key: "_createNewBuffer",
|
|
66204
|
-
value: function _createNewBuffer(
|
|
66204
|
+
value: function _createNewBuffer(name9, opts) {
|
|
66205
66205
|
var buffer = new _webgl.Buffer(this.gl, opts);
|
|
66206
|
-
if (this.resources[
|
|
66207
|
-
this.resources[
|
|
66206
|
+
if (this.resources[name9]) {
|
|
66207
|
+
this.resources[name9].delete();
|
|
66208
66208
|
}
|
|
66209
|
-
this.resources[
|
|
66209
|
+
this.resources[name9] = buffer;
|
|
66210
66210
|
return buffer;
|
|
66211
66211
|
}
|
|
66212
66212
|
}, {
|
|
@@ -66327,13 +66327,13 @@ var require_transform_shader_utils = __commonJS({
|
|
|
66327
66327
|
if (!attributeData) {
|
|
66328
66328
|
return null;
|
|
66329
66329
|
}
|
|
66330
|
-
var type = attributeData.type,
|
|
66331
|
-
if (
|
|
66330
|
+
var type = attributeData.type, name9 = attributeData.name;
|
|
66331
|
+
if (name9 && textureMap[name9]) {
|
|
66332
66332
|
var updatedLine = "// ".concat(line, " => Replaced by Transform with a sampler");
|
|
66333
|
-
var _getSamplerDecleratio = getSamplerDeclerations(
|
|
66333
|
+
var _getSamplerDecleratio = getSamplerDeclerations(name9), samplerName = _getSamplerDecleratio.samplerName, sizeName = _getSamplerDecleratio.sizeName, uniformDeclerations = _getSamplerDecleratio.uniformDeclerations;
|
|
66334
66334
|
var channels = (0, _shadertools.typeToChannelSuffix)(type);
|
|
66335
|
-
var sampleInstruction = " ".concat(type, " ").concat(
|
|
66336
|
-
samplerTextureMap[samplerName] =
|
|
66335
|
+
var sampleInstruction = " ".concat(type, " ").concat(name9, " = transform_getInput(").concat(samplerName, ", ").concat(sizeName, ").").concat(channels, ";\n");
|
|
66336
|
+
samplerTextureMap[samplerName] = name9;
|
|
66337
66337
|
var inject = {
|
|
66338
66338
|
"vs:#decl": uniformDeclerations,
|
|
66339
66339
|
"vs:#main-start": sampleInstruction
|
|
@@ -66603,8 +66603,8 @@ var require_texture_transform = __commonJS({
|
|
|
66603
66603
|
value: function _setSourceTextureParameters() {
|
|
66604
66604
|
var index = this.currentIndex;
|
|
66605
66605
|
var sourceTextures = this.bindings[index].sourceTextures;
|
|
66606
|
-
for (var
|
|
66607
|
-
sourceTextures[
|
|
66606
|
+
for (var name9 in sourceTextures) {
|
|
66607
|
+
sourceTextures[name9].setParameters(SRC_TEX_PARAMETER_OVERRIDES);
|
|
66608
66608
|
}
|
|
66609
66609
|
}
|
|
66610
66610
|
}, {
|
|
@@ -68750,15 +68750,15 @@ var require_vector33 = __commonJS({
|
|
|
68750
68750
|
}
|
|
68751
68751
|
var ORIGIN = [0, 0, 0];
|
|
68752
68752
|
var constants = {};
|
|
68753
|
-
var
|
|
68754
|
-
(0, _inherits2.default)(
|
|
68755
|
-
var _super = _createSuper(
|
|
68756
|
-
function
|
|
68753
|
+
var Vector321 = function(_Vector) {
|
|
68754
|
+
(0, _inherits2.default)(Vector322, _Vector);
|
|
68755
|
+
var _super = _createSuper(Vector322);
|
|
68756
|
+
function Vector322() {
|
|
68757
68757
|
var _this;
|
|
68758
68758
|
var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
68759
68759
|
var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
68760
68760
|
var z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
|
|
68761
|
-
(0, _classCallCheck2.default)(this,
|
|
68761
|
+
(0, _classCallCheck2.default)(this, Vector322);
|
|
68762
68762
|
_this = _super.call(this, -0, -0, -0);
|
|
68763
68763
|
if (arguments.length === 1 && (0, _common.isArray)(x)) {
|
|
68764
68764
|
_this.copy(x);
|
|
@@ -68774,7 +68774,7 @@ var require_vector33 = __commonJS({
|
|
|
68774
68774
|
}
|
|
68775
68775
|
return _this;
|
|
68776
68776
|
}
|
|
68777
|
-
(0, _createClass2.default)(
|
|
68777
|
+
(0, _createClass2.default)(Vector322, [{
|
|
68778
68778
|
key: "set",
|
|
68779
68779
|
value: function set(x, y, z) {
|
|
68780
68780
|
this[0] = x;
|
|
@@ -68894,12 +68894,12 @@ var require_vector33 = __commonJS({
|
|
|
68894
68894
|
}], [{
|
|
68895
68895
|
key: "ZERO",
|
|
68896
68896
|
get: function get() {
|
|
68897
|
-
return constants.ZERO = constants.ZERO || Object.freeze(new
|
|
68897
|
+
return constants.ZERO = constants.ZERO || Object.freeze(new Vector322(0, 0, 0, 0));
|
|
68898
68898
|
}
|
|
68899
68899
|
}]);
|
|
68900
|
-
return
|
|
68900
|
+
return Vector322;
|
|
68901
68901
|
}(_vector.default);
|
|
68902
|
-
exports.default =
|
|
68902
|
+
exports.default = Vector321;
|
|
68903
68903
|
}
|
|
68904
68904
|
});
|
|
68905
68905
|
|
|
@@ -69350,12 +69350,12 @@ var require_matrix33 = __commonJS({
|
|
|
69350
69350
|
COL2ROW2: 8
|
|
69351
69351
|
});
|
|
69352
69352
|
var constants = {};
|
|
69353
|
-
var
|
|
69354
|
-
(0, _inherits2.default)(
|
|
69355
|
-
var _super = _createSuper(
|
|
69356
|
-
function
|
|
69353
|
+
var Matrix35 = function(_Matrix) {
|
|
69354
|
+
(0, _inherits2.default)(Matrix36, _Matrix);
|
|
69355
|
+
var _super = _createSuper(Matrix36);
|
|
69356
|
+
function Matrix36(array) {
|
|
69357
69357
|
var _this;
|
|
69358
|
-
(0, _classCallCheck2.default)(this,
|
|
69358
|
+
(0, _classCallCheck2.default)(this, Matrix36);
|
|
69359
69359
|
_this = _super.call(this, -0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
69360
69360
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
69361
69361
|
_this.copy(array);
|
|
@@ -69364,7 +69364,7 @@ var require_matrix33 = __commonJS({
|
|
|
69364
69364
|
}
|
|
69365
69365
|
return _this;
|
|
69366
69366
|
}
|
|
69367
|
-
(0, _createClass2.default)(
|
|
69367
|
+
(0, _createClass2.default)(Matrix36, [{
|
|
69368
69368
|
key: "ELEMENTS",
|
|
69369
69369
|
get: function get() {
|
|
69370
69370
|
return 9;
|
|
@@ -69523,19 +69523,19 @@ var require_matrix33 = __commonJS({
|
|
|
69523
69523
|
}], [{
|
|
69524
69524
|
key: "IDENTITY",
|
|
69525
69525
|
get: function get() {
|
|
69526
|
-
constants.IDENTITY = constants.IDENTITY || Object.freeze(new
|
|
69526
|
+
constants.IDENTITY = constants.IDENTITY || Object.freeze(new Matrix36(IDENTITY));
|
|
69527
69527
|
return constants.IDENTITY;
|
|
69528
69528
|
}
|
|
69529
69529
|
}, {
|
|
69530
69530
|
key: "ZERO",
|
|
69531
69531
|
get: function get() {
|
|
69532
|
-
constants.ZERO = constants.ZERO || Object.freeze(new
|
|
69532
|
+
constants.ZERO = constants.ZERO || Object.freeze(new Matrix36(ZERO));
|
|
69533
69533
|
return constants.ZERO;
|
|
69534
69534
|
}
|
|
69535
69535
|
}]);
|
|
69536
|
-
return
|
|
69536
|
+
return Matrix36;
|
|
69537
69537
|
}(_matrix.default);
|
|
69538
|
-
exports.default =
|
|
69538
|
+
exports.default = Matrix35;
|
|
69539
69539
|
}
|
|
69540
69540
|
});
|
|
69541
69541
|
|
|
@@ -73431,7 +73431,7 @@ var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.e
|
|
|
73431
73431
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
73432
73432
|
|
|
73433
73433
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
73434
|
-
var DEFAULT_VERSION = "
|
|
73434
|
+
var DEFAULT_VERSION = "beta";
|
|
73435
73435
|
var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
|
|
73436
73436
|
if (typeof __VERSION__ === "undefined") {
|
|
73437
73437
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
@@ -73580,9 +73580,9 @@ var WorkerThread = class {
|
|
|
73580
73580
|
constructor(props) {
|
|
73581
73581
|
this.terminated = false;
|
|
73582
73582
|
this._loadableURL = "";
|
|
73583
|
-
const { name:
|
|
73583
|
+
const { name: name9, source, url } = props;
|
|
73584
73584
|
assert3(source || url);
|
|
73585
|
-
this.name =
|
|
73585
|
+
this.name = name9;
|
|
73586
73586
|
this.source = source;
|
|
73587
73587
|
this.url = url;
|
|
73588
73588
|
this.onMessage = NOOP;
|
|
@@ -73699,9 +73699,9 @@ var WorkerPool = class {
|
|
|
73699
73699
|
this.onDebug = props.onDebug;
|
|
73700
73700
|
}
|
|
73701
73701
|
}
|
|
73702
|
-
async startJob(
|
|
73702
|
+
async startJob(name9, onMessage3 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
|
|
73703
73703
|
const startPromise = new Promise((onStart) => {
|
|
73704
|
-
this.jobQueue.push({ name:
|
|
73704
|
+
this.jobQueue.push({ name: name9, onMessage: onMessage3, onError, onStart });
|
|
73705
73705
|
return this;
|
|
73706
73706
|
});
|
|
73707
73707
|
this._startQueuedJob();
|
|
@@ -73752,8 +73752,8 @@ var WorkerPool = class {
|
|
|
73752
73752
|
}
|
|
73753
73753
|
if (this.count < this._getMaxConcurrency()) {
|
|
73754
73754
|
this.count++;
|
|
73755
|
-
const
|
|
73756
|
-
return new WorkerThread({ name:
|
|
73755
|
+
const name9 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
|
|
73756
|
+
return new WorkerThread({ name: name9, source: this.source, url: this.url });
|
|
73757
73757
|
}
|
|
73758
73758
|
return null;
|
|
73759
73759
|
}
|
|
@@ -73798,16 +73798,16 @@ var WorkerFarm = class {
|
|
|
73798
73798
|
}
|
|
73799
73799
|
}
|
|
73800
73800
|
getWorkerPool(options) {
|
|
73801
|
-
const { name:
|
|
73802
|
-
let workerPool = this.workerPools.get(
|
|
73801
|
+
const { name: name9, source, url } = options;
|
|
73802
|
+
let workerPool = this.workerPools.get(name9);
|
|
73803
73803
|
if (!workerPool) {
|
|
73804
73804
|
workerPool = new WorkerPool({
|
|
73805
|
-
name:
|
|
73805
|
+
name: name9,
|
|
73806
73806
|
source,
|
|
73807
73807
|
url
|
|
73808
73808
|
});
|
|
73809
73809
|
workerPool.setProps(this._getWorkerPoolProps());
|
|
73810
|
-
this.workerPools.set(
|
|
73810
|
+
this.workerPools.set(name9, workerPool);
|
|
73811
73811
|
}
|
|
73812
73812
|
return workerPool;
|
|
73813
73813
|
}
|
|
@@ -73843,7 +73843,7 @@ function stringifyJSON(v) {
|
|
|
73843
73843
|
}
|
|
73844
73844
|
|
|
73845
73845
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
73846
|
-
var NPM_TAG = "
|
|
73846
|
+
var NPM_TAG = "beta";
|
|
73847
73847
|
var VERSION2 = typeof VERSION !== "undefined" ? VERSION : NPM_TAG;
|
|
73848
73848
|
function getWorkerName(worker) {
|
|
73849
73849
|
const warning = worker.version !== VERSION2 ? ` (worker-utils@${VERSION2})` : "";
|
|
@@ -73873,10 +73873,10 @@ function getWorkerURL(worker, options = {}) {
|
|
|
73873
73873
|
|
|
73874
73874
|
// ../worker-utils/src/lib/worker-api/process-on-worker.ts
|
|
73875
73875
|
async function processOnWorker(worker, data, options = {}, context = {}) {
|
|
73876
|
-
const
|
|
73876
|
+
const name9 = getWorkerName(worker);
|
|
73877
73877
|
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
73878
73878
|
const { source } = options;
|
|
73879
|
-
const workerPoolProps = { name:
|
|
73879
|
+
const workerPoolProps = { name: name9, source };
|
|
73880
73880
|
if (!source) {
|
|
73881
73881
|
workerPoolProps.url = getWorkerURL(worker, options);
|
|
73882
73882
|
}
|
|
@@ -73965,7 +73965,7 @@ function requireFromString(code, filename2 = "", options) {
|
|
|
73965
73965
|
}
|
|
73966
73966
|
|
|
73967
73967
|
// ../worker-utils/src/lib/library-utils/library-utils.ts
|
|
73968
|
-
var LATEST = "
|
|
73968
|
+
var LATEST = "beta";
|
|
73969
73969
|
var VERSION3 = typeof VERSION !== "undefined" ? VERSION : LATEST;
|
|
73970
73970
|
var loadLibraryPromises = {};
|
|
73971
73971
|
async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
|
|
@@ -74164,10 +74164,10 @@ function canParseWithWorker(loader, options) {
|
|
|
74164
74164
|
return loader.worker && options?.worker;
|
|
74165
74165
|
}
|
|
74166
74166
|
async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
|
|
74167
|
-
const
|
|
74167
|
+
const name9 = loader.id;
|
|
74168
74168
|
const url = getWorkerURL(loader, options);
|
|
74169
74169
|
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
74170
|
-
const workerPool = workerFarm.getWorkerPool({ name:
|
|
74170
|
+
const workerPool = workerFarm.getWorkerPool({ name: name9, url });
|
|
74171
74171
|
options = JSON.parse(JSON.stringify(options));
|
|
74172
74172
|
context = JSON.parse(JSON.stringify(context || {}));
|
|
74173
74173
|
const job = await workerPool.startJob("process-on-worker", onMessage2.bind(null, parseOnMainThread));
|
|
@@ -76452,6 +76452,12 @@ var TileHeader = class {
|
|
|
76452
76452
|
get contentFailed() {
|
|
76453
76453
|
return this.contentState === TILE_CONTENT_STATE.FAILED;
|
|
76454
76454
|
}
|
|
76455
|
+
get distanceToCamera() {
|
|
76456
|
+
return this._distanceToCamera;
|
|
76457
|
+
}
|
|
76458
|
+
get screenSpaceError() {
|
|
76459
|
+
return this._screenSpaceError;
|
|
76460
|
+
}
|
|
76455
76461
|
getScreenSpaceError(frameState, useParentLodMetric) {
|
|
76456
76462
|
switch (this.tileset.type) {
|
|
76457
76463
|
case TILESET_TYPE.I3S:
|
|
@@ -77183,7 +77189,11 @@ var Tileset3D = class {
|
|
|
77183
77189
|
this.zoom = 1;
|
|
77184
77190
|
return;
|
|
77185
77191
|
}
|
|
77186
|
-
|
|
77192
|
+
if (center[0] !== 0 || center[1] !== 0 || center[2] !== 0) {
|
|
77193
|
+
this.cartographicCenter = import_geospatial6.Ellipsoid.WGS84.cartesianToCartographic(center, new import_core10.Vector3());
|
|
77194
|
+
} else {
|
|
77195
|
+
this.cartographicCenter = new import_core10.Vector3(0, 0, -import_geospatial6.Ellipsoid.WGS84.radii[0]);
|
|
77196
|
+
}
|
|
77187
77197
|
this.cartesianCenter = center;
|
|
77188
77198
|
this.zoom = getZoomFromBoundingVolume(root.boundingVolume, this.cartographicCenter);
|
|
77189
77199
|
}
|
|
@@ -77495,8 +77505,8 @@ var Schema = class {
|
|
|
77495
77505
|
}
|
|
77496
77506
|
select(...columnNames) {
|
|
77497
77507
|
const nameMap = Object.create(null);
|
|
77498
|
-
for (const
|
|
77499
|
-
nameMap[
|
|
77508
|
+
for (const name9 of columnNames) {
|
|
77509
|
+
nameMap[name9] = true;
|
|
77500
77510
|
}
|
|
77501
77511
|
const selectedFields = this.fields.filter((field) => nameMap[field.name]);
|
|
77502
77512
|
return new Schema(selectedFields, this.metadata);
|
|
@@ -77541,8 +77551,8 @@ function mergeMaps(m1, m2) {
|
|
|
77541
77551
|
|
|
77542
77552
|
// ../schema/src/lib/schema/impl/field.ts
|
|
77543
77553
|
var Field = class {
|
|
77544
|
-
constructor(
|
|
77545
|
-
this.name =
|
|
77554
|
+
constructor(name9, type, nullable = false, metadata = new Map()) {
|
|
77555
|
+
this.name = name9;
|
|
77546
77556
|
this.type = type;
|
|
77547
77557
|
this.nullable = nullable;
|
|
77548
77558
|
this.metadata = metadata;
|
|
@@ -78464,8 +78474,8 @@ var GLType = class {
|
|
|
78464
78474
|
}
|
|
78465
78475
|
throw new Error(ERR_TYPE_CONVERSION);
|
|
78466
78476
|
}
|
|
78467
|
-
static fromName(
|
|
78468
|
-
const glType = NAME_TO_GL_TYPE[
|
|
78477
|
+
static fromName(name9) {
|
|
78478
|
+
const glType = NAME_TO_GL_TYPE[name9];
|
|
78469
78479
|
if (!glType) {
|
|
78470
78480
|
throw new Error(ERR_TYPE_CONVERSION);
|
|
78471
78481
|
}
|
|
@@ -78977,10 +78987,10 @@ var Tile3DBatchTableParser = class {
|
|
|
78977
78987
|
}
|
|
78978
78988
|
return void 0;
|
|
78979
78989
|
}
|
|
78980
|
-
hasProperty(batchId,
|
|
78990
|
+
hasProperty(batchId, name9) {
|
|
78981
78991
|
this._checkBatchId(batchId);
|
|
78982
|
-
assert2(typeof
|
|
78983
|
-
return defined5(this._properties[
|
|
78992
|
+
assert2(typeof name9 === "string", name9);
|
|
78993
|
+
return defined5(this._properties[name9]) || this._hasPropertyInHierarchy(batchId, name9);
|
|
78984
78994
|
}
|
|
78985
78995
|
getPropertyNames(batchId, results) {
|
|
78986
78996
|
this._checkBatchId(batchId);
|
|
@@ -78993,47 +79003,47 @@ var Tile3DBatchTableParser = class {
|
|
|
78993
79003
|
}
|
|
78994
79004
|
return results;
|
|
78995
79005
|
}
|
|
78996
|
-
getProperty(batchId,
|
|
79006
|
+
getProperty(batchId, name9) {
|
|
78997
79007
|
this._checkBatchId(batchId);
|
|
78998
|
-
assert2(typeof
|
|
79008
|
+
assert2(typeof name9 === "string", name9);
|
|
78999
79009
|
if (this._binaryProperties) {
|
|
79000
|
-
const binaryProperty = this._binaryProperties[
|
|
79010
|
+
const binaryProperty = this._binaryProperties[name9];
|
|
79001
79011
|
if (defined5(binaryProperty)) {
|
|
79002
79012
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
79003
79013
|
}
|
|
79004
79014
|
}
|
|
79005
|
-
const propertyValues = this._properties[
|
|
79015
|
+
const propertyValues = this._properties[name9];
|
|
79006
79016
|
if (defined5(propertyValues)) {
|
|
79007
79017
|
return clone(propertyValues[batchId], true);
|
|
79008
79018
|
}
|
|
79009
79019
|
if (this._hierarchy) {
|
|
79010
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
79020
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name9);
|
|
79011
79021
|
if (defined5(hierarchyProperty)) {
|
|
79012
79022
|
return hierarchyProperty;
|
|
79013
79023
|
}
|
|
79014
79024
|
}
|
|
79015
79025
|
return void 0;
|
|
79016
79026
|
}
|
|
79017
|
-
setProperty(batchId,
|
|
79027
|
+
setProperty(batchId, name9, value) {
|
|
79018
79028
|
const featureCount = this.featureCount;
|
|
79019
79029
|
this._checkBatchId(batchId);
|
|
79020
|
-
assert2(typeof
|
|
79030
|
+
assert2(typeof name9 === "string", name9);
|
|
79021
79031
|
if (this._binaryProperties) {
|
|
79022
|
-
const binaryProperty = this._binaryProperties[
|
|
79032
|
+
const binaryProperty = this._binaryProperties[name9];
|
|
79023
79033
|
if (binaryProperty) {
|
|
79024
79034
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
79025
79035
|
return;
|
|
79026
79036
|
}
|
|
79027
79037
|
}
|
|
79028
79038
|
if (this._hierarchy) {
|
|
79029
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
79039
|
+
if (this._setHierarchyProperty(this, batchId, name9, value)) {
|
|
79030
79040
|
return;
|
|
79031
79041
|
}
|
|
79032
79042
|
}
|
|
79033
|
-
let propertyValues = this._properties[
|
|
79043
|
+
let propertyValues = this._properties[name9];
|
|
79034
79044
|
if (!defined5(propertyValues)) {
|
|
79035
|
-
this._properties[
|
|
79036
|
-
propertyValues = this._properties[
|
|
79045
|
+
this._properties[name9] = new Array(featureCount);
|
|
79046
|
+
propertyValues = this._properties[name9];
|
|
79037
79047
|
}
|
|
79038
79048
|
propertyValues[batchId] = clone(value, true);
|
|
79039
79049
|
}
|
|
@@ -79051,21 +79061,21 @@ var Tile3DBatchTableParser = class {
|
|
|
79051
79061
|
}
|
|
79052
79062
|
_initializeBinaryProperties() {
|
|
79053
79063
|
let binaryProperties = null;
|
|
79054
|
-
for (const
|
|
79055
|
-
const property = this._properties[
|
|
79056
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
79064
|
+
for (const name9 in this._properties) {
|
|
79065
|
+
const property = this._properties[name9];
|
|
79066
|
+
const binaryProperty = this._initializeBinaryProperty(name9, property);
|
|
79057
79067
|
if (binaryProperty) {
|
|
79058
79068
|
binaryProperties = binaryProperties || {};
|
|
79059
|
-
binaryProperties[
|
|
79069
|
+
binaryProperties[name9] = binaryProperty;
|
|
79060
79070
|
}
|
|
79061
79071
|
}
|
|
79062
79072
|
return binaryProperties;
|
|
79063
79073
|
}
|
|
79064
|
-
_initializeBinaryProperty(
|
|
79074
|
+
_initializeBinaryProperty(name9, property) {
|
|
79065
79075
|
if ("byteOffset" in property) {
|
|
79066
79076
|
const tile3DAccessor = property;
|
|
79067
|
-
assert2(this.binary, `Property ${
|
|
79068
|
-
assert2(tile3DAccessor.type, `Property ${
|
|
79077
|
+
assert2(this.binary, `Property ${name9} requires a batch table binary.`);
|
|
79078
|
+
assert2(tile3DAccessor.type, `Property ${name9} requires a type.`);
|
|
79069
79079
|
const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
|
|
79070
79080
|
return {
|
|
79071
79081
|
typedArray: accessor.values,
|
|
@@ -79076,14 +79086,14 @@ var Tile3DBatchTableParser = class {
|
|
|
79076
79086
|
}
|
|
79077
79087
|
return null;
|
|
79078
79088
|
}
|
|
79079
|
-
_hasPropertyInHierarchy(batchId,
|
|
79089
|
+
_hasPropertyInHierarchy(batchId, name9) {
|
|
79080
79090
|
if (!this._hierarchy) {
|
|
79081
79091
|
return false;
|
|
79082
79092
|
}
|
|
79083
79093
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
79084
79094
|
const classId = hierarchy.classIds[instanceIndex];
|
|
79085
79095
|
const instances = hierarchy.classes[classId].instances;
|
|
79086
|
-
return defined5(instances[
|
|
79096
|
+
return defined5(instances[name9]);
|
|
79087
79097
|
});
|
|
79088
79098
|
return defined5(result);
|
|
79089
79099
|
}
|
|
@@ -79091,21 +79101,21 @@ var Tile3DBatchTableParser = class {
|
|
|
79091
79101
|
traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
79092
79102
|
const classId = hierarchy.classIds[instanceIndex];
|
|
79093
79103
|
const instances = hierarchy.classes[classId].instances;
|
|
79094
|
-
for (const
|
|
79095
|
-
if (instances.hasOwnProperty(
|
|
79096
|
-
if (results.indexOf(
|
|
79097
|
-
results.push(
|
|
79104
|
+
for (const name9 in instances) {
|
|
79105
|
+
if (instances.hasOwnProperty(name9)) {
|
|
79106
|
+
if (results.indexOf(name9) === -1) {
|
|
79107
|
+
results.push(name9);
|
|
79098
79108
|
}
|
|
79099
79109
|
}
|
|
79100
79110
|
}
|
|
79101
79111
|
});
|
|
79102
79112
|
}
|
|
79103
|
-
_getHierarchyProperty(batchId,
|
|
79113
|
+
_getHierarchyProperty(batchId, name9) {
|
|
79104
79114
|
return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
79105
79115
|
const classId = hierarchy.classIds[instanceIndex];
|
|
79106
79116
|
const instanceClass = hierarchy.classes[classId];
|
|
79107
79117
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
79108
|
-
const propertyValues = instanceClass.instances[
|
|
79118
|
+
const propertyValues = instanceClass.instances[name9];
|
|
79109
79119
|
if (defined5(propertyValues)) {
|
|
79110
79120
|
if (defined5(propertyValues.typedArray)) {
|
|
79111
79121
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -79115,14 +79125,14 @@ var Tile3DBatchTableParser = class {
|
|
|
79115
79125
|
return null;
|
|
79116
79126
|
});
|
|
79117
79127
|
}
|
|
79118
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
79128
|
+
_setHierarchyProperty(batchTable, batchId, name9, value) {
|
|
79119
79129
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
79120
79130
|
const classId = hierarchy.classIds[instanceIndex];
|
|
79121
79131
|
const instanceClass = hierarchy.classes[classId];
|
|
79122
79132
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
79123
|
-
const propertyValues = instanceClass.instances[
|
|
79133
|
+
const propertyValues = instanceClass.instances[name9];
|
|
79124
79134
|
if (defined5(propertyValues)) {
|
|
79125
|
-
assert2(instanceIndex === batchId, `Inherited property "${
|
|
79135
|
+
assert2(instanceIndex === batchId, `Inherited property "${name9}" is read-only.`);
|
|
79126
79136
|
if (defined5(propertyValues.typedArray)) {
|
|
79127
79137
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
79128
79138
|
} else {
|
|
@@ -79523,7 +79533,7 @@ async function loadDraco(tile, dracoData, options, context) {
|
|
|
79523
79533
|
var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
79524
79534
|
|
|
79525
79535
|
// ../textures/src/lib/utils/version.ts
|
|
79526
|
-
var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "
|
|
79536
|
+
var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
79527
79537
|
|
|
79528
79538
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
79529
79539
|
var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
@@ -80971,12 +80981,12 @@ var GLTFScenegraph = class {
|
|
|
80971
80981
|
return extras[key];
|
|
80972
80982
|
}
|
|
80973
80983
|
getExtension(extensionName) {
|
|
80974
|
-
const isExtension = this.getUsedExtensions().find((
|
|
80984
|
+
const isExtension = this.getUsedExtensions().find((name9) => name9 === extensionName);
|
|
80975
80985
|
const extensions = this.json.extensions || {};
|
|
80976
80986
|
return isExtension ? extensions[extensionName] || true : null;
|
|
80977
80987
|
}
|
|
80978
80988
|
getRequiredExtension(extensionName) {
|
|
80979
|
-
const isRequired = this.getRequiredExtensions().find((
|
|
80989
|
+
const isRequired = this.getRequiredExtensions().find((name9) => name9 === extensionName);
|
|
80980
80990
|
return isRequired ? this.getExtension(extensionName) : null;
|
|
80981
80991
|
}
|
|
80982
80992
|
getRequiredExtensions() {
|
|
@@ -81608,11 +81618,11 @@ __export(KHR_draco_mesh_compression_exports, {
|
|
|
81608
81618
|
// ../gltf/src/lib/gltf-utils/gltf-attribute-utils.ts
|
|
81609
81619
|
function getGLTFAccessors(attributes) {
|
|
81610
81620
|
const accessors = {};
|
|
81611
|
-
for (const
|
|
81612
|
-
const attribute = attributes[
|
|
81613
|
-
if (
|
|
81621
|
+
for (const name9 in attributes) {
|
|
81622
|
+
const attribute = attributes[name9];
|
|
81623
|
+
if (name9 !== "indices") {
|
|
81614
81624
|
const glTFAccessor = getGLTFAccessor(attribute);
|
|
81615
|
-
accessors[
|
|
81625
|
+
accessors[name9] = glTFAccessor;
|
|
81616
81626
|
}
|
|
81617
81627
|
}
|
|
81618
81628
|
return accessors;
|
|
@@ -81754,16 +81764,192 @@ function* makeMeshPrimitiveIterator(scenegraph) {
|
|
|
81754
81764
|
}
|
|
81755
81765
|
}
|
|
81756
81766
|
|
|
81767
|
+
// ../gltf/src/lib/extensions/KHR_texture_transform.ts
|
|
81768
|
+
var KHR_texture_transform_exports = {};
|
|
81769
|
+
__export(KHR_texture_transform_exports, {
|
|
81770
|
+
decode: () => decode4,
|
|
81771
|
+
name: () => name5
|
|
81772
|
+
});
|
|
81773
|
+
var import_core15 = __toModule(require_es56());
|
|
81774
|
+
|
|
81775
|
+
// ../gltf/src/lib/gltf-utils/gltf-constants.ts
|
|
81776
|
+
var COMPONENTS = {
|
|
81777
|
+
SCALAR: 1,
|
|
81778
|
+
VEC2: 2,
|
|
81779
|
+
VEC3: 3,
|
|
81780
|
+
VEC4: 4,
|
|
81781
|
+
MAT2: 4,
|
|
81782
|
+
MAT3: 9,
|
|
81783
|
+
MAT4: 16
|
|
81784
|
+
};
|
|
81785
|
+
var BYTES = {
|
|
81786
|
+
5120: 1,
|
|
81787
|
+
5121: 1,
|
|
81788
|
+
5122: 2,
|
|
81789
|
+
5123: 2,
|
|
81790
|
+
5125: 4,
|
|
81791
|
+
5126: 4
|
|
81792
|
+
};
|
|
81793
|
+
|
|
81794
|
+
// ../gltf/src/lib/extensions/KHR_texture_transform.ts
|
|
81795
|
+
var EXT_MESHOPT_TRANSFORM = "KHR_texture_transform";
|
|
81796
|
+
var name5 = EXT_MESHOPT_TRANSFORM;
|
|
81797
|
+
var scratchVector4 = new import_core15.Vector3();
|
|
81798
|
+
var scratchRotationMatrix = new import_core15.Matrix3();
|
|
81799
|
+
var scratchScaleMatrix = new import_core15.Matrix3();
|
|
81800
|
+
async function decode4(gltfData, options) {
|
|
81801
|
+
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
81802
|
+
const extension = gltfScenegraph.getExtension(EXT_MESHOPT_TRANSFORM);
|
|
81803
|
+
if (!extension) {
|
|
81804
|
+
return;
|
|
81805
|
+
}
|
|
81806
|
+
const materials = gltfData.json.materials || [];
|
|
81807
|
+
for (let i = 0; i < materials.length; i++) {
|
|
81808
|
+
transformTexCoords(i, gltfData);
|
|
81809
|
+
}
|
|
81810
|
+
}
|
|
81811
|
+
function transformTexCoords(materialIndex, gltfData) {
|
|
81812
|
+
const processedTexCoords = [];
|
|
81813
|
+
const material = gltfData.json.materials?.[materialIndex];
|
|
81814
|
+
const baseColorTexture = material?.pbrMetallicRoughness?.baseColorTexture;
|
|
81815
|
+
if (baseColorTexture) {
|
|
81816
|
+
transformPrimitives(gltfData, materialIndex, baseColorTexture, processedTexCoords);
|
|
81817
|
+
}
|
|
81818
|
+
const emisiveTexture = material?.emissiveTexture;
|
|
81819
|
+
if (emisiveTexture) {
|
|
81820
|
+
transformPrimitives(gltfData, materialIndex, emisiveTexture, processedTexCoords);
|
|
81821
|
+
}
|
|
81822
|
+
const normalTexture = material?.normalTexture;
|
|
81823
|
+
if (normalTexture) {
|
|
81824
|
+
transformPrimitives(gltfData, materialIndex, normalTexture, processedTexCoords);
|
|
81825
|
+
}
|
|
81826
|
+
const occlusionTexture = material?.occlusionTexture;
|
|
81827
|
+
if (occlusionTexture) {
|
|
81828
|
+
transformPrimitives(gltfData, materialIndex, occlusionTexture, processedTexCoords);
|
|
81829
|
+
}
|
|
81830
|
+
const metallicRoughnessTexture = material?.pbrMetallicRoughness?.metallicRoughnessTexture;
|
|
81831
|
+
if (metallicRoughnessTexture) {
|
|
81832
|
+
transformPrimitives(gltfData, materialIndex, metallicRoughnessTexture, processedTexCoords);
|
|
81833
|
+
}
|
|
81834
|
+
}
|
|
81835
|
+
function transformPrimitives(gltfData, materialIndex, texture, processedTexCoords) {
|
|
81836
|
+
const transformParameters = getTransformParameters(texture, processedTexCoords);
|
|
81837
|
+
if (!transformParameters) {
|
|
81838
|
+
return;
|
|
81839
|
+
}
|
|
81840
|
+
const meshes = gltfData.json.meshes || [];
|
|
81841
|
+
for (const mesh of meshes) {
|
|
81842
|
+
for (const primitive of mesh.primitives) {
|
|
81843
|
+
const material = primitive.material;
|
|
81844
|
+
if (Number.isFinite(material) && materialIndex === material) {
|
|
81845
|
+
transformPrimitive(gltfData, primitive, transformParameters);
|
|
81846
|
+
}
|
|
81847
|
+
}
|
|
81848
|
+
}
|
|
81849
|
+
}
|
|
81850
|
+
function getTransformParameters(texture, processedTexCoords) {
|
|
81851
|
+
const textureInfo = texture.extensions?.[EXT_MESHOPT_TRANSFORM];
|
|
81852
|
+
const { texCoord: originalTexCoord = 0 } = texture;
|
|
81853
|
+
const { texCoord = originalTexCoord } = textureInfo;
|
|
81854
|
+
const isProcessed = processedTexCoords.findIndex(([original, newTexCoord]) => original === originalTexCoord && newTexCoord === texCoord) !== -1;
|
|
81855
|
+
if (!isProcessed) {
|
|
81856
|
+
const matrix = makeTransformationMatrix(textureInfo);
|
|
81857
|
+
if (originalTexCoord !== texCoord) {
|
|
81858
|
+
texture.texCoord = texCoord;
|
|
81859
|
+
}
|
|
81860
|
+
processedTexCoords.push([originalTexCoord, texCoord]);
|
|
81861
|
+
return { originalTexCoord, texCoord, matrix };
|
|
81862
|
+
}
|
|
81863
|
+
return null;
|
|
81864
|
+
}
|
|
81865
|
+
function transformPrimitive(gltfData, primitive, transformParameters) {
|
|
81866
|
+
const { originalTexCoord, texCoord, matrix } = transformParameters;
|
|
81867
|
+
const texCoordAccessor = primitive.attributes[`TEXCOORD_${originalTexCoord}`];
|
|
81868
|
+
if (Number.isFinite(texCoordAccessor)) {
|
|
81869
|
+
const accessor = gltfData.json.accessors?.[texCoordAccessor];
|
|
81870
|
+
if (accessor && accessor.bufferView) {
|
|
81871
|
+
const bufferView = gltfData.json.bufferViews?.[accessor.bufferView];
|
|
81872
|
+
if (bufferView) {
|
|
81873
|
+
const { arrayBuffer, byteOffset: bufferByteOffset } = gltfData.buffers[bufferView.buffer];
|
|
81874
|
+
const byteOffset = (bufferByteOffset || 0) + (accessor.byteOffset || 0) + (bufferView.byteOffset || 0);
|
|
81875
|
+
const { ArrayType, length } = getAccessorArrayTypeAndLength(accessor, bufferView);
|
|
81876
|
+
const bytes = BYTES[accessor.componentType];
|
|
81877
|
+
const components = COMPONENTS[accessor.type];
|
|
81878
|
+
const elementAddressScale = bufferView.byteStride || bytes * components;
|
|
81879
|
+
const result = new Float32Array(length);
|
|
81880
|
+
for (let i = 0; i < accessor.count; i++) {
|
|
81881
|
+
const uv = new ArrayType(arrayBuffer, byteOffset + i * elementAddressScale, 2);
|
|
81882
|
+
scratchVector4.set(uv[0], uv[1], 1);
|
|
81883
|
+
scratchVector4.transformByMatrix3(matrix);
|
|
81884
|
+
result.set([scratchVector4[0], scratchVector4[1]], i * components);
|
|
81885
|
+
}
|
|
81886
|
+
if (originalTexCoord === texCoord) {
|
|
81887
|
+
updateGltf(accessor, bufferView, gltfData.buffers, result);
|
|
81888
|
+
} else {
|
|
81889
|
+
createAttribute(texCoord, accessor, primitive, gltfData, result);
|
|
81890
|
+
}
|
|
81891
|
+
}
|
|
81892
|
+
}
|
|
81893
|
+
}
|
|
81894
|
+
}
|
|
81895
|
+
function updateGltf(accessor, bufferView, buffers, newTexCoordArray) {
|
|
81896
|
+
accessor.componentType = 5126;
|
|
81897
|
+
buffers.push({
|
|
81898
|
+
arrayBuffer: newTexCoordArray.buffer,
|
|
81899
|
+
byteOffset: 0,
|
|
81900
|
+
byteLength: newTexCoordArray.buffer.byteLength
|
|
81901
|
+
});
|
|
81902
|
+
bufferView.buffer = buffers.length - 1;
|
|
81903
|
+
bufferView.byteLength = newTexCoordArray.buffer.byteLength;
|
|
81904
|
+
bufferView.byteOffset = 0;
|
|
81905
|
+
delete bufferView.byteStride;
|
|
81906
|
+
}
|
|
81907
|
+
function createAttribute(newTexCoord, originalAccessor, primitive, gltfData, newTexCoordArray) {
|
|
81908
|
+
gltfData.buffers.push({
|
|
81909
|
+
arrayBuffer: newTexCoordArray.buffer,
|
|
81910
|
+
byteOffset: 0,
|
|
81911
|
+
byteLength: newTexCoordArray.buffer.byteLength
|
|
81912
|
+
});
|
|
81913
|
+
const bufferViews = gltfData.json.bufferViews;
|
|
81914
|
+
if (!bufferViews) {
|
|
81915
|
+
return;
|
|
81916
|
+
}
|
|
81917
|
+
bufferViews.push({
|
|
81918
|
+
buffer: gltfData.buffers.length - 1,
|
|
81919
|
+
byteLength: newTexCoordArray.buffer.byteLength,
|
|
81920
|
+
byteOffset: 0
|
|
81921
|
+
});
|
|
81922
|
+
const accessors = gltfData.json.accessors;
|
|
81923
|
+
if (!accessors) {
|
|
81924
|
+
return;
|
|
81925
|
+
}
|
|
81926
|
+
accessors.push({
|
|
81927
|
+
bufferView: bufferViews?.length - 1,
|
|
81928
|
+
byteOffset: 0,
|
|
81929
|
+
componentType: 5126,
|
|
81930
|
+
count: originalAccessor.count,
|
|
81931
|
+
type: "VEC2"
|
|
81932
|
+
});
|
|
81933
|
+
primitive.attributes[`TEXCOORD_${newTexCoord}`] = accessors.length - 1;
|
|
81934
|
+
}
|
|
81935
|
+
function makeTransformationMatrix(extensionData) {
|
|
81936
|
+
const { offset = [0, 0], rotation = 0, scale = [1, 1] } = extensionData;
|
|
81937
|
+
const translationMatirx = new import_core15.Matrix3().set(1, 0, 0, 0, 1, 0, offset[0], offset[1], 1);
|
|
81938
|
+
const rotationMatirx = scratchRotationMatrix.set(Math.cos(rotation), Math.sin(rotation), 0, -Math.sin(rotation), Math.cos(rotation), 0, 0, 0, 1);
|
|
81939
|
+
const scaleMatrix = scratchScaleMatrix.set(scale[0], 0, 0, 0, scale[1], 0, 0, 0, 1);
|
|
81940
|
+
return translationMatirx.multiplyRight(rotationMatirx).multiplyRight(scaleMatrix);
|
|
81941
|
+
}
|
|
81942
|
+
|
|
81757
81943
|
// ../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts
|
|
81758
81944
|
var KHR_lights_punctual_exports = {};
|
|
81759
81945
|
__export(KHR_lights_punctual_exports, {
|
|
81760
|
-
decode: () =>
|
|
81946
|
+
decode: () => decode5,
|
|
81761
81947
|
encode: () => encode3,
|
|
81762
|
-
name: () =>
|
|
81948
|
+
name: () => name6
|
|
81763
81949
|
});
|
|
81764
81950
|
var KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
|
|
81765
|
-
var
|
|
81766
|
-
async function
|
|
81951
|
+
var name6 = KHR_LIGHTS_PUNCTUAL;
|
|
81952
|
+
async function decode5(gltfData) {
|
|
81767
81953
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
81768
81954
|
const { json } = gltfScenegraph;
|
|
81769
81955
|
const extension = gltfScenegraph.getExtension(KHR_LIGHTS_PUNCTUAL);
|
|
@@ -81800,13 +81986,13 @@ async function encode3(gltfData) {
|
|
|
81800
81986
|
// ../gltf/src/lib/extensions/deprecated/KHR_materials_unlit.ts
|
|
81801
81987
|
var KHR_materials_unlit_exports = {};
|
|
81802
81988
|
__export(KHR_materials_unlit_exports, {
|
|
81803
|
-
decode: () =>
|
|
81989
|
+
decode: () => decode6,
|
|
81804
81990
|
encode: () => encode4,
|
|
81805
|
-
name: () =>
|
|
81991
|
+
name: () => name7
|
|
81806
81992
|
});
|
|
81807
81993
|
var KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
|
|
81808
|
-
var
|
|
81809
|
-
async function
|
|
81994
|
+
var name7 = KHR_MATERIALS_UNLIT;
|
|
81995
|
+
async function decode6(gltfData) {
|
|
81810
81996
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
81811
81997
|
const { json } = gltfScenegraph;
|
|
81812
81998
|
gltfScenegraph.removeExtension(KHR_MATERIALS_UNLIT);
|
|
@@ -81835,13 +82021,13 @@ function encode4(gltfData) {
|
|
|
81835
82021
|
// ../gltf/src/lib/extensions/deprecated/KHR_techniques_webgl.ts
|
|
81836
82022
|
var KHR_techniques_webgl_exports = {};
|
|
81837
82023
|
__export(KHR_techniques_webgl_exports, {
|
|
81838
|
-
decode: () =>
|
|
82024
|
+
decode: () => decode7,
|
|
81839
82025
|
encode: () => encode5,
|
|
81840
|
-
name: () =>
|
|
82026
|
+
name: () => name8
|
|
81841
82027
|
});
|
|
81842
82028
|
var KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
|
|
81843
|
-
var
|
|
81844
|
-
async function
|
|
82029
|
+
var name8 = KHR_TECHNIQUES_WEBGL;
|
|
82030
|
+
async function decode7(gltfData) {
|
|
81845
82031
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
81846
82032
|
const { json } = gltfScenegraph;
|
|
81847
82033
|
const extension = gltfScenegraph.getExtension(KHR_TECHNIQUES_WEBGL);
|
|
@@ -81902,7 +82088,8 @@ var EXTENSIONS2 = [
|
|
|
81902
82088
|
KHR_draco_mesh_compression_exports,
|
|
81903
82089
|
KHR_lights_punctual_exports,
|
|
81904
82090
|
KHR_materials_unlit_exports,
|
|
81905
|
-
KHR_techniques_webgl_exports
|
|
82091
|
+
KHR_techniques_webgl_exports,
|
|
82092
|
+
KHR_texture_transform_exports
|
|
81906
82093
|
];
|
|
81907
82094
|
function preprocessExtensions(gltf, options = {}, context) {
|
|
81908
82095
|
const extensions = EXTENSIONS2.filter((extension) => useExtension(extension.name, options));
|
|
@@ -82135,7 +82322,7 @@ function normalizeGLTFV1(gltf, options = {}) {
|
|
|
82135
82322
|
}
|
|
82136
82323
|
|
|
82137
82324
|
// ../gltf/src/lib/api/post-process-gltf.ts
|
|
82138
|
-
var
|
|
82325
|
+
var COMPONENTS2 = {
|
|
82139
82326
|
SCALAR: 1,
|
|
82140
82327
|
VEC2: 2,
|
|
82141
82328
|
VEC3: 3,
|
|
@@ -82144,7 +82331,7 @@ var COMPONENTS = {
|
|
|
82144
82331
|
MAT3: 9,
|
|
82145
82332
|
MAT4: 16
|
|
82146
82333
|
};
|
|
82147
|
-
var
|
|
82334
|
+
var BYTES2 = {
|
|
82148
82335
|
5120: 1,
|
|
82149
82336
|
5121: 1,
|
|
82150
82337
|
5122: 2,
|
|
@@ -82174,10 +82361,10 @@ var DEFAULT_SAMPLER = {
|
|
|
82174
82361
|
[GL_SAMPLER.TEXTURE_WRAP_T]: GL_SAMPLER.REPEAT
|
|
82175
82362
|
};
|
|
82176
82363
|
function getBytesFromComponentType(componentType) {
|
|
82177
|
-
return
|
|
82364
|
+
return BYTES2[componentType];
|
|
82178
82365
|
}
|
|
82179
82366
|
function getSizeFromAccessorType(type) {
|
|
82180
|
-
return
|
|
82367
|
+
return COMPONENTS2[type];
|
|
82181
82368
|
}
|
|
82182
82369
|
var GLTFPostProcessor = class {
|
|
82183
82370
|
constructor() {
|
|
@@ -82875,7 +83062,7 @@ function parseBatchedModel(tile, arrayBuffer, byteOffset, options, context) {
|
|
|
82875
83062
|
}
|
|
82876
83063
|
|
|
82877
83064
|
// ../3d-tiles/src/lib/parsers/parse-3d-tile-instanced-model.ts
|
|
82878
|
-
var
|
|
83065
|
+
var import_core16 = __toModule(require_es56());
|
|
82879
83066
|
var import_geospatial7 = __toModule(require_es57());
|
|
82880
83067
|
async function parseInstancedModel3DTile(tile, arrayBuffer, byteOffset, options, context) {
|
|
82881
83068
|
byteOffset = parseInstancedModel(tile, arrayBuffer, byteOffset, options, context);
|
|
@@ -82920,19 +83107,19 @@ function extractInstancedAttributes(tile, featureTable, batchTable, instancesLen
|
|
|
82920
83107
|
forwardAxis: [1, 0, 0]
|
|
82921
83108
|
};
|
|
82922
83109
|
const instances = collectionOptions.instances;
|
|
82923
|
-
const instancePosition = new
|
|
82924
|
-
const instanceNormalRight = new
|
|
82925
|
-
const instanceNormalUp = new
|
|
82926
|
-
const instanceNormalForward = new
|
|
82927
|
-
const instanceRotation = new
|
|
82928
|
-
const instanceQuaternion = new
|
|
82929
|
-
const instanceScale = new
|
|
83110
|
+
const instancePosition = new import_core16.Vector3();
|
|
83111
|
+
const instanceNormalRight = new import_core16.Vector3();
|
|
83112
|
+
const instanceNormalUp = new import_core16.Vector3();
|
|
83113
|
+
const instanceNormalForward = new import_core16.Vector3();
|
|
83114
|
+
const instanceRotation = new import_core16.Matrix3();
|
|
83115
|
+
const instanceQuaternion = new import_core16.Quaternion();
|
|
83116
|
+
const instanceScale = new import_core16.Vector3();
|
|
82930
83117
|
const instanceTranslationRotationScale = {};
|
|
82931
|
-
const instanceTransform = new
|
|
83118
|
+
const instanceTransform = new import_core16.Matrix4();
|
|
82932
83119
|
const scratch1 = [];
|
|
82933
83120
|
const scratch2 = [];
|
|
82934
|
-
const scratchVector1 = new
|
|
82935
|
-
const scratchVector23 = new
|
|
83121
|
+
const scratchVector1 = new import_core16.Vector3();
|
|
83122
|
+
const scratchVector23 = new import_core16.Vector3();
|
|
82936
83123
|
for (let i = 0; i < instancesLength; i++) {
|
|
82937
83124
|
let position;
|
|
82938
83125
|
if (featureTable.hasProperty("POSITION")) {
|
|
@@ -83002,7 +83189,7 @@ function extractInstancedAttributes(tile, featureTable, batchTable, instancesLen
|
|
|
83002
83189
|
if (batchId === void 0) {
|
|
83003
83190
|
batchId = i;
|
|
83004
83191
|
}
|
|
83005
|
-
const rotationMatrix = new
|
|
83192
|
+
const rotationMatrix = new import_core16.Matrix4().fromQuaternion(instanceTranslationRotationScale.rotation);
|
|
83006
83193
|
instanceTransform.identity();
|
|
83007
83194
|
instanceTransform.translate(instanceTranslationRotationScale.translation);
|
|
83008
83195
|
instanceTransform.multiplyRight(rotationMatrix);
|
|
@@ -83092,8 +83279,8 @@ async function parse3DTilesSubtree(data) {
|
|
|
83092
83279
|
}
|
|
83093
83280
|
return subtree;
|
|
83094
83281
|
}
|
|
83095
|
-
async function getExplicitBitstream(subtree,
|
|
83096
|
-
const bufferViewIndex = subtree[
|
|
83282
|
+
async function getExplicitBitstream(subtree, name9, internalBinaryBuffer) {
|
|
83283
|
+
const bufferViewIndex = subtree[name9].bufferView;
|
|
83097
83284
|
const bufferView = subtree.bufferViews[bufferViewIndex];
|
|
83098
83285
|
const buffer = subtree.buffers[bufferView.buffer];
|
|
83099
83286
|
if (buffer.uri) {
|
|
@@ -83328,13 +83515,23 @@ function getRefine(refine) {
|
|
|
83328
83515
|
return refine;
|
|
83329
83516
|
}
|
|
83330
83517
|
}
|
|
83518
|
+
function resolveUri(uri, basePath) {
|
|
83519
|
+
const urlSchemeRegex = /^[a-z][0-9a-z+.-]*:/i;
|
|
83520
|
+
if (urlSchemeRegex.test(basePath)) {
|
|
83521
|
+
const url = new URL(uri, `${basePath}/`);
|
|
83522
|
+
return decodeURI(url.toString());
|
|
83523
|
+
} else if (uri.startsWith("/")) {
|
|
83524
|
+
return uri;
|
|
83525
|
+
}
|
|
83526
|
+
return `${basePath}/${uri}`;
|
|
83527
|
+
}
|
|
83331
83528
|
function normalizeTileData(tile, options) {
|
|
83332
83529
|
if (!tile) {
|
|
83333
83530
|
return null;
|
|
83334
83531
|
}
|
|
83335
83532
|
if (tile.content) {
|
|
83336
83533
|
const contentUri = tile.content.uri || tile.content.url;
|
|
83337
|
-
tile.contentUrl =
|
|
83534
|
+
tile.contentUrl = resolveUri(contentUri, options.basePath);
|
|
83338
83535
|
}
|
|
83339
83536
|
tile.id = tile.contentUrl;
|
|
83340
83537
|
tile.lodMetricType = LOD_METRIC_TYPE.GEOMETRIC_ERROR;
|
|
@@ -83372,9 +83569,9 @@ async function normalizeImplicitTileHeaders(tileset) {
|
|
|
83372
83569
|
subtrees: { uri: subtreesUriTemplate }
|
|
83373
83570
|
} = implicitTilingExtension;
|
|
83374
83571
|
const subtreeUrl = replaceContentUrlTemplate(subtreesUriTemplate, 0, 0, 0, 0);
|
|
83375
|
-
const rootSubtreeUrl =
|
|
83572
|
+
const rootSubtreeUrl = resolveUri(subtreeUrl, basePath);
|
|
83376
83573
|
const rootSubtree = await load(rootSubtreeUrl, Tile3DSubtreeLoader);
|
|
83377
|
-
const contentUrlTemplate =
|
|
83574
|
+
const contentUrlTemplate = resolveUri(tileset.root.content.uri, basePath);
|
|
83378
83575
|
const refine = tileset.root.refine;
|
|
83379
83576
|
const rootLodMetricValue = tileset.root.geometricError;
|
|
83380
83577
|
const rootBoundingVolume = tileset.root.boundingVolume;
|
|
@@ -84042,7 +84239,7 @@ async function getTotalFilesSize(dirPath) {
|
|
|
84042
84239
|
}
|
|
84043
84240
|
|
|
84044
84241
|
// src/i3s-converter/helpers/geometry-converter.ts
|
|
84045
|
-
var
|
|
84242
|
+
var import_core22 = __toModule(require_es56());
|
|
84046
84243
|
var import_geospatial9 = __toModule(require_es57());
|
|
84047
84244
|
var import_md5 = __toModule(require_md52());
|
|
84048
84245
|
|
|
@@ -84195,7 +84392,7 @@ function groupAttributesAndRangesByFeatureId(unifiedObjects, featureCount) {
|
|
|
84195
84392
|
}
|
|
84196
84393
|
|
|
84197
84394
|
// src/i3s-converter/helpers/coordinate-converter.ts
|
|
84198
|
-
var
|
|
84395
|
+
var import_core21 = __toModule(require_es56());
|
|
84199
84396
|
var import_geospatial8 = __toModule(require_es57());
|
|
84200
84397
|
var import_culling5 = __toModule(require_es58());
|
|
84201
84398
|
function createBoundingVolumes(tile, geoidHeightModel) {
|
|
@@ -84203,16 +84400,16 @@ function createBoundingVolumes(tile, geoidHeightModel) {
|
|
|
84203
84400
|
let halfSize;
|
|
84204
84401
|
let quaternion;
|
|
84205
84402
|
const boundingVolume = tile.boundingVolume;
|
|
84206
|
-
const cartographicCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(boundingVolume.center, new
|
|
84403
|
+
const cartographicCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(boundingVolume.center, new import_core21.Vector3());
|
|
84207
84404
|
cartographicCenter[2] = cartographicCenter[2] - geoidHeightModel.getHeight(cartographicCenter[1], cartographicCenter[0]);
|
|
84208
84405
|
if (boundingVolume instanceof import_culling5.OrientedBoundingBox) {
|
|
84209
84406
|
halfSize = boundingVolume.halfSize;
|
|
84210
|
-
radius = new
|
|
84407
|
+
radius = new import_core21.Vector3(halfSize[0], halfSize[1], halfSize[2]).len();
|
|
84211
84408
|
quaternion = boundingVolume.quaternion;
|
|
84212
84409
|
} else {
|
|
84213
84410
|
radius = tile.boundingVolume.radius;
|
|
84214
84411
|
halfSize = [radius, radius, radius];
|
|
84215
|
-
quaternion = new
|
|
84412
|
+
quaternion = new import_core21.Quaternion().fromMatrix3(new import_core21.Matrix3([halfSize[0], 0, 0, 0, halfSize[1], 0, 0, 0, halfSize[2]])).normalize();
|
|
84216
84413
|
}
|
|
84217
84414
|
return {
|
|
84218
84415
|
mbs: [cartographicCenter[0], cartographicCenter[1], cartographicCenter[2], radius],
|
|
@@ -84227,8 +84424,8 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
|
|
|
84227
84424
|
const positionVectors = convertPositionsToVectors(cartesianPositions);
|
|
84228
84425
|
const geometryObb = (0, import_culling5.makeOrientedBoundingBoxFromPoints)(positionVectors);
|
|
84229
84426
|
const geometryMbs = (0, import_culling5.makeBoundingSphereFromPoints)(positionVectors);
|
|
84230
|
-
let mbsCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new
|
|
84231
|
-
let obbCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new
|
|
84427
|
+
let mbsCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new import_core21.Vector3());
|
|
84428
|
+
let obbCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new import_core21.Vector3());
|
|
84232
84429
|
mbsCenter[2] = mbsCenter[2] - geoidHeightModel.getHeight(mbsCenter[1], mbsCenter[0]);
|
|
84233
84430
|
obbCenter[2] = obbCenter[2] - geoidHeightModel.getHeight(obbCenter[1], obbCenter[0]);
|
|
84234
84431
|
return {
|
|
@@ -84243,7 +84440,7 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
|
|
|
84243
84440
|
function convertPositionsToVectors(positions) {
|
|
84244
84441
|
const result = [];
|
|
84245
84442
|
for (let i = 0; i < positions.length; i += 3) {
|
|
84246
|
-
const positionVector = new
|
|
84443
|
+
const positionVector = new import_core21.Vector3([positions[i], positions[i + 1], positions[i + 2]]);
|
|
84247
84444
|
result.push(positionVector);
|
|
84248
84445
|
}
|
|
84249
84446
|
return result;
|
|
@@ -84257,8 +84454,8 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
|
|
|
84257
84454
|
}
|
|
84258
84455
|
const center = sphere.center;
|
|
84259
84456
|
const radius = sphere.radius;
|
|
84260
|
-
const vertexMax = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new
|
|
84261
|
-
const vertexMin = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new
|
|
84457
|
+
const vertexMax = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core21.Vector3(center[0] + radius, center[1] + radius, center[2] + radius), new import_core21.Vector3());
|
|
84458
|
+
const vertexMin = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core21.Vector3(center[0] - radius, center[1] - radius, center[2] - radius), new import_core21.Vector3());
|
|
84262
84459
|
return {
|
|
84263
84460
|
xmin: vertexMin[0],
|
|
84264
84461
|
xmax: vertexMax[0],
|
|
@@ -84270,8 +84467,8 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
|
|
|
84270
84467
|
}
|
|
84271
84468
|
function createObbFromMbs(mbs) {
|
|
84272
84469
|
const radius = mbs[3];
|
|
84273
|
-
const center = new
|
|
84274
|
-
const halfAxex = new
|
|
84470
|
+
const center = new import_core21.Vector3(mbs[0], mbs[1], mbs[2]);
|
|
84471
|
+
const halfAxex = new import_core21.Matrix3([radius, 0, 0, 0, radius, 0, 0, 0, radius]);
|
|
84275
84472
|
return new import_culling5.OrientedBoundingBox(center, halfAxex);
|
|
84276
84473
|
}
|
|
84277
84474
|
|
|
@@ -84288,12 +84485,24 @@ function getB3DMAttributesWithoutBufferView(attributes) {
|
|
|
84288
84485
|
function prepareDataForAttributesConversion(tileContent) {
|
|
84289
84486
|
const gltfMaterials = tileContent.gltf?.materials?.map((material) => ({ id: material.id }));
|
|
84290
84487
|
let nodes = tileContent.gltf?.scene?.nodes || tileContent.gltf?.scenes?.[0]?.nodes || tileContent.gltf?.nodes || [];
|
|
84488
|
+
const images = tileContent.gltf?.images?.map((imageObject) => {
|
|
84489
|
+
const data = imageObject?.image?.compressed ? null : imageObject?.image?.data.subarray();
|
|
84490
|
+
return {
|
|
84491
|
+
data,
|
|
84492
|
+
compressed: Boolean(imageObject?.image?.compressed),
|
|
84493
|
+
height: imageObject.image.height,
|
|
84494
|
+
width: imageObject.image.width,
|
|
84495
|
+
components: imageObject.image.components,
|
|
84496
|
+
mimeType: imageObject.mimeType
|
|
84497
|
+
};
|
|
84498
|
+
}) || [];
|
|
84291
84499
|
const prepearedNodes = nodes.map((node2) => {
|
|
84292
84500
|
if (!node2.mesh) {
|
|
84293
84501
|
return node2;
|
|
84294
84502
|
}
|
|
84295
84503
|
return {
|
|
84296
84504
|
...node2,
|
|
84505
|
+
images,
|
|
84297
84506
|
mesh: {
|
|
84298
84507
|
...node2.mesh,
|
|
84299
84508
|
primitives: node2.mesh?.primitives.map((primitive) => ({
|
|
@@ -84317,6 +84526,96 @@ function prepareDataForAttributesConversion(tileContent) {
|
|
|
84317
84526
|
};
|
|
84318
84527
|
}
|
|
84319
84528
|
|
|
84529
|
+
// src/i3s-converter/helpers/batch-ids-extensions.ts
|
|
84530
|
+
var EXT_MESH_FEATURES = "EXT_mesh_features";
|
|
84531
|
+
var EXT_FEATURE_METADATA = "EXT_feature_metadata";
|
|
84532
|
+
function handleBatchIdsExtensions(attributes, primitive, images) {
|
|
84533
|
+
const extensions = primitive?.extensions;
|
|
84534
|
+
if (!extensions) {
|
|
84535
|
+
return [];
|
|
84536
|
+
}
|
|
84537
|
+
for (const [extensionName, extensionData] of Object.entries(extensions || {})) {
|
|
84538
|
+
switch (extensionName) {
|
|
84539
|
+
case EXT_FEATURE_METADATA:
|
|
84540
|
+
return handleExtFeatureMetadataExtension(attributes, extensionData, images);
|
|
84541
|
+
case EXT_MESH_FEATURES:
|
|
84542
|
+
console.warn("EXT_mesh_features extension is not supported yet");
|
|
84543
|
+
return [];
|
|
84544
|
+
default:
|
|
84545
|
+
return [];
|
|
84546
|
+
}
|
|
84547
|
+
}
|
|
84548
|
+
return [];
|
|
84549
|
+
}
|
|
84550
|
+
function handleExtFeatureMetadataExtension(attributes, extFeatureMetadata, images) {
|
|
84551
|
+
const featureIdAttribute = extFeatureMetadata?.featureIdAttributes?.[0];
|
|
84552
|
+
if (featureIdAttribute?.featureIds?.attribute) {
|
|
84553
|
+
const batchIdsAttribute = attributes[featureIdAttribute.featureIds.attribute];
|
|
84554
|
+
return batchIdsAttribute.value;
|
|
84555
|
+
}
|
|
84556
|
+
if (featureIdAttribute?.featureIds?.hasOwnProperty("constant") && featureIdAttribute?.featureIds?.hasOwnProperty("divisor")) {
|
|
84557
|
+
const featuresCount = attributes?.POSITIONS?.value.length / 3 || 0;
|
|
84558
|
+
return generateImplicitFeatureIds(featuresCount, featureIdAttribute.featureIds.constant, featureIdAttribute.featureIds.divisor);
|
|
84559
|
+
}
|
|
84560
|
+
const featureIdTexture = extFeatureMetadata?.featureIdTextures && extFeatureMetadata?.featureIdTextures[0];
|
|
84561
|
+
if (featureIdTexture) {
|
|
84562
|
+
const textureCoordinates = attributes.TEXCOORD_0.value;
|
|
84563
|
+
return generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, images);
|
|
84564
|
+
}
|
|
84565
|
+
return [];
|
|
84566
|
+
}
|
|
84567
|
+
function generateImplicitFeatureIds(featuresCount, constant = 0, divisor = 0) {
|
|
84568
|
+
let featureIds = [];
|
|
84569
|
+
if (divisor > 0) {
|
|
84570
|
+
let currentValue = constant;
|
|
84571
|
+
let devisorCounter = divisor;
|
|
84572
|
+
for (let index = 0; index < featuresCount; index++) {
|
|
84573
|
+
featureIds.push(currentValue);
|
|
84574
|
+
devisorCounter -= 1;
|
|
84575
|
+
if (devisorCounter === 0) {
|
|
84576
|
+
currentValue++;
|
|
84577
|
+
devisorCounter = divisor;
|
|
84578
|
+
}
|
|
84579
|
+
}
|
|
84580
|
+
} else {
|
|
84581
|
+
featureIds = Array(featuresCount).fill(constant, 0, featuresCount);
|
|
84582
|
+
}
|
|
84583
|
+
return featureIds;
|
|
84584
|
+
}
|
|
84585
|
+
function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, images) {
|
|
84586
|
+
const CHANNELS_MAP = {
|
|
84587
|
+
r: 0,
|
|
84588
|
+
g: 1,
|
|
84589
|
+
b: 2,
|
|
84590
|
+
a: 3
|
|
84591
|
+
};
|
|
84592
|
+
const textureIndex = featureIdTexture?.featureIds?.texture?.index;
|
|
84593
|
+
const featureChannel = featureIdTexture?.featureIds?.channels;
|
|
84594
|
+
if (!featureChannel || textureIndex === void 0) {
|
|
84595
|
+
return [];
|
|
84596
|
+
}
|
|
84597
|
+
const image = images[textureIndex];
|
|
84598
|
+
const batchIds = [];
|
|
84599
|
+
const channels = CHANNELS_MAP[featureChannel];
|
|
84600
|
+
if (!image.compressed) {
|
|
84601
|
+
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
84602
|
+
const u = textureCoordinates[index];
|
|
84603
|
+
const v = textureCoordinates[index + 1];
|
|
84604
|
+
const tx = Math.min(emod(u) * image.width | 0, image.width - 1);
|
|
84605
|
+
const ty = Math.min(emod(v) * image.height | 0, image.height - 1);
|
|
84606
|
+
const offset = (ty * image.width + tx) * image.components + channels;
|
|
84607
|
+
const batchId = new Uint8Array(image.data)[offset];
|
|
84608
|
+
batchIds.push(batchId);
|
|
84609
|
+
}
|
|
84610
|
+
} else {
|
|
84611
|
+
console.warn(`Can't get batch Ids from ${image.mimeType} compressed texture`);
|
|
84612
|
+
}
|
|
84613
|
+
return batchIds;
|
|
84614
|
+
}
|
|
84615
|
+
function emod(n) {
|
|
84616
|
+
return (n % 1 + 1) % 1;
|
|
84617
|
+
}
|
|
84618
|
+
|
|
84320
84619
|
// src/i3s-converter/helpers/geometry-converter.ts
|
|
84321
84620
|
var DEFAULT_ROUGHNESS_FACTOR = 1;
|
|
84322
84621
|
var DEFAULT_METALLIC_FACTOR = 1;
|
|
@@ -84328,7 +84627,7 @@ var SHORT_INT_TYPE = "Int32";
|
|
|
84328
84627
|
var DOUBLE_TYPE = "Float64";
|
|
84329
84628
|
var OBJECT_ID_TYPE = "Oid32";
|
|
84330
84629
|
var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ["CUSTOM_ATTRIBUTE_2", "_BATCHID", "BATCHID"];
|
|
84331
|
-
var
|
|
84630
|
+
var scratchVector5 = new import_core22.Vector3();
|
|
84332
84631
|
async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, geoidHeightModel, workerSource) {
|
|
84333
84632
|
const useCartesianPositions = generateBoundingVolumes;
|
|
84334
84633
|
const materialAndTextureList = convertMaterials(tileContent.gltf?.materials);
|
|
@@ -84383,10 +84682,10 @@ function _generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeigh
|
|
|
84383
84682
|
const cartographicOrigin = boundingVolumes.obb.center;
|
|
84384
84683
|
for (let index = 0; index < attributes.positions.length; index += VALUES_PER_VERTEX2) {
|
|
84385
84684
|
const vertex = attributes.positions.subarray(index, index + VALUES_PER_VERTEX2);
|
|
84386
|
-
import_geospatial9.Ellipsoid.WGS84.cartesianToCartographic(Array.from(vertex),
|
|
84387
|
-
|
|
84388
|
-
|
|
84389
|
-
attributes.positions.set(
|
|
84685
|
+
import_geospatial9.Ellipsoid.WGS84.cartesianToCartographic(Array.from(vertex), scratchVector5);
|
|
84686
|
+
scratchVector5[2] = scratchVector5[2] - geoidHeightModel.getHeight(scratchVector5[1], scratchVector5[0]);
|
|
84687
|
+
scratchVector5 = scratchVector5.subtract(cartographicOrigin);
|
|
84688
|
+
attributes.positions.set(scratchVector5, index);
|
|
84390
84689
|
}
|
|
84391
84690
|
}
|
|
84392
84691
|
}
|
|
@@ -84463,7 +84762,7 @@ async function convertAttributes(attributesData, useCartesianPositions) {
|
|
|
84463
84762
|
}
|
|
84464
84763
|
return attributesMap;
|
|
84465
84764
|
}
|
|
84466
|
-
function convertNodes(nodes, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new
|
|
84765
|
+
function convertNodes(nodes, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core22.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
|
|
84467
84766
|
if (nodes) {
|
|
84468
84767
|
for (const node2 of nodes) {
|
|
84469
84768
|
convertNode(node2, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix);
|
|
@@ -84487,15 +84786,16 @@ function getCompositeTransformationMatrix(node2, matrix) {
|
|
|
84487
84786
|
}
|
|
84488
84787
|
return transformationMatrix;
|
|
84489
84788
|
}
|
|
84490
|
-
function convertNode(node2, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new
|
|
84789
|
+
function convertNode(node2, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core22.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
|
|
84491
84790
|
const transformationMatrix = getCompositeTransformationMatrix(node2, matrix);
|
|
84492
84791
|
const mesh = node2.mesh;
|
|
84792
|
+
const images = node2.images;
|
|
84493
84793
|
if (mesh) {
|
|
84494
|
-
convertMesh(mesh, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
|
|
84794
|
+
convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
|
|
84495
84795
|
}
|
|
84496
84796
|
convertNodes(node2.children || [], cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
|
|
84497
84797
|
}
|
|
84498
|
-
function convertMesh(mesh, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions = false, matrix = new
|
|
84798
|
+
function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions = false, matrix = new import_core22.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
|
|
84499
84799
|
for (const primitive of mesh.primitives) {
|
|
84500
84800
|
let outputAttributes = null;
|
|
84501
84801
|
if (primitive.material) {
|
|
@@ -84529,7 +84829,7 @@ function convertMesh(mesh, cartographicOrigin, cartesianModelMatrix, attributesM
|
|
|
84529
84829
|
outputAttributes.texCoords = concatenateTypedArrays(outputAttributes.texCoords, flattenTexCoords(attributes.TEXCOORD_0 && attributes.TEXCOORD_0.value, primitive.indices?.value));
|
|
84530
84830
|
outputAttributes.colors = concatenateTypedArrays(outputAttributes.colors, flattenColors(attributes.COLOR_0, primitive.indices?.value));
|
|
84531
84831
|
outputAttributes.featureIndicesGroups = outputAttributes.featureIndicesGroups || [];
|
|
84532
|
-
outputAttributes.featureIndicesGroups.push(flattenBatchIds(
|
|
84832
|
+
outputAttributes.featureIndicesGroups.push(flattenBatchIds(getBatchIds(attributes, primitive, images), primitive.indices?.value));
|
|
84533
84833
|
}
|
|
84534
84834
|
}
|
|
84535
84835
|
function transformVertexArray(args) {
|
|
@@ -84541,7 +84841,7 @@ function transformVertexArray(args) {
|
|
|
84541
84841
|
for (let i = 0; i < indices.length; i++) {
|
|
84542
84842
|
const coordIndex = indices[i] * VALUES_PER_VERTEX2;
|
|
84543
84843
|
const vertex = vertices.subarray(coordIndex, coordIndex + VALUES_PER_VERTEX2);
|
|
84544
|
-
let vertexVector = new
|
|
84844
|
+
let vertexVector = new import_core22.Vector3(Array.from(vertex));
|
|
84545
84845
|
vertexVector = attributeSpecificTransformation(vertexVector, args);
|
|
84546
84846
|
newVertices[i * VALUES_PER_VERTEX2] = vertexVector.x;
|
|
84547
84847
|
newVertices[i * VALUES_PER_VERTEX2 + 1] = vertexVector.y;
|
|
@@ -84614,16 +84914,18 @@ function flattenBatchIds(batchedIds, indices) {
|
|
|
84614
84914
|
}
|
|
84615
84915
|
return newBatchIds;
|
|
84616
84916
|
}
|
|
84617
|
-
function
|
|
84618
|
-
|
|
84917
|
+
function getBatchIds(attributes, primitive, images) {
|
|
84918
|
+
const batchIds = handleBatchIdsExtensions(attributes, primitive, images);
|
|
84919
|
+
if (batchIds.length) {
|
|
84920
|
+
return batchIds;
|
|
84921
|
+
}
|
|
84619
84922
|
for (let index = 0; index < BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES.length; index++) {
|
|
84620
84923
|
const possibleBatchIdAttributeName = BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES[index];
|
|
84621
84924
|
if (attributes[possibleBatchIdAttributeName] && attributes[possibleBatchIdAttributeName].value) {
|
|
84622
|
-
|
|
84623
|
-
break;
|
|
84925
|
+
return attributes[possibleBatchIdAttributeName].value;
|
|
84624
84926
|
}
|
|
84625
84927
|
}
|
|
84626
|
-
return
|
|
84928
|
+
return [];
|
|
84627
84929
|
}
|
|
84628
84930
|
function convertMaterials(sourceMaterials = []) {
|
|
84629
84931
|
const result = [];
|
|
@@ -84716,10 +85018,10 @@ function convertGLTFMaterialToI3sSharedResources(gltfMaterial, nodeId) {
|
|
|
84716
85018
|
}
|
|
84717
85019
|
function extractSharedResourcesMaterialInfo(baseColorFactor, metallicFactor = 1) {
|
|
84718
85020
|
const matDielectricColorComponent = 0.04 / 255;
|
|
84719
|
-
const black = new
|
|
84720
|
-
const unitVector = new
|
|
84721
|
-
const dielectricSpecular = new
|
|
84722
|
-
const baseColorVector = new
|
|
85021
|
+
const black = new import_core22.Vector4(0, 0, 0, 1);
|
|
85022
|
+
const unitVector = new import_core22.Vector4(1, 1, 1, 1);
|
|
85023
|
+
const dielectricSpecular = new import_core22.Vector4(matDielectricColorComponent, matDielectricColorComponent, matDielectricColorComponent, 0);
|
|
85024
|
+
const baseColorVector = new import_core22.Vector4(baseColorFactor);
|
|
84723
85025
|
const firstOperand = unitVector.subtract(dielectricSpecular).multiply(baseColorVector);
|
|
84724
85026
|
const diffuse = firstOperand.lerp(firstOperand, black, metallicFactor);
|
|
84725
85027
|
dielectricSpecular[3] = 1;
|
|
@@ -85536,7 +85838,7 @@ function transfromTextureDefinitions(textureDefinitionInfos, thisObject, origina
|
|
|
85536
85838
|
// src/i3s-converter/helpers/node-debug.ts
|
|
85537
85839
|
var import_culling6 = __toModule(require_es58());
|
|
85538
85840
|
var import_engine = __toModule(require_es515());
|
|
85539
|
-
var
|
|
85841
|
+
var import_core24 = __toModule(require_es56());
|
|
85540
85842
|
var import_geospatial10 = __toModule(require_es57());
|
|
85541
85843
|
function validateNodeBoundingVolumes(node2) {
|
|
85542
85844
|
if (!node2?.parentNode?.obb || !node2?.parentNode?.mbs) {
|
|
@@ -85581,7 +85883,7 @@ function getTileObbVertices(node2) {
|
|
|
85581
85883
|
const obbCenterCartesian = import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(node2.obb.center);
|
|
85582
85884
|
let vertices = [];
|
|
85583
85885
|
for (let i = 0; i < positions.length; i += 3) {
|
|
85584
|
-
const positionsVector = new
|
|
85886
|
+
const positionsVector = new import_core24.Vector3(positions[i] *= halfSize[0], positions[i + 1] *= halfSize[1], positions[i + 2] *= halfSize[2]);
|
|
85585
85887
|
const rotatedPositions = positionsVector.transformByQuaternion(node2.obb.quaternion).add(obbCenterCartesian);
|
|
85586
85888
|
vertices = vertices.concat(rotatedPositions);
|
|
85587
85889
|
}
|
|
@@ -85661,7 +85963,7 @@ var WriteQueue = class extends Queue {
|
|
|
85661
85963
|
archiveKeys.push(archiveKey);
|
|
85662
85964
|
promises.push(writePromise);
|
|
85663
85965
|
}
|
|
85664
|
-
const writeResults = await Promise.
|
|
85966
|
+
const writeResults = await Promise.allSettled(promises);
|
|
85665
85967
|
this.updateFileMap(archiveKeys, writeResults);
|
|
85666
85968
|
}
|
|
85667
85969
|
this.writePromise = null;
|
|
@@ -85669,10 +85971,9 @@ var WriteQueue = class extends Queue {
|
|
|
85669
85971
|
updateFileMap(archiveKeys, writeResults) {
|
|
85670
85972
|
for (let i = 0; i < archiveKeys.length; i++) {
|
|
85671
85973
|
const archiveKey = archiveKeys[i];
|
|
85672
|
-
if (
|
|
85673
|
-
|
|
85974
|
+
if (archiveKey && "value" in writeResults[i]) {
|
|
85975
|
+
this.fileMap[archiveKey] = writeResults[i].value;
|
|
85674
85976
|
}
|
|
85675
|
-
this.fileMap[archiveKey] = writeResults[i];
|
|
85676
85977
|
}
|
|
85677
85978
|
}
|
|
85678
85979
|
};
|
|
@@ -86195,7 +86496,9 @@ var I3SConverter = class {
|
|
|
86195
86496
|
await this.writeTextureFile(textureData, "0", format, childPath, slpkChildPath);
|
|
86196
86497
|
if (this.generateTextures) {
|
|
86197
86498
|
formats2.push({ name: "1", format: "ktx2" });
|
|
86198
|
-
const
|
|
86499
|
+
const copyArrayBuffer2 = texture.image.data.subarray();
|
|
86500
|
+
const arrayToEncode = new Uint8Array(copyArrayBuffer2);
|
|
86501
|
+
const ktx2TextureData = encode({ ...texture.image, data: arrayToEncode }, KTX2BasisWriterWorker, {
|
|
86199
86502
|
...KTX2BasisWriterWorker.options,
|
|
86200
86503
|
source: this.workerSource.ktx2,
|
|
86201
86504
|
reuseWorkers: true,
|
|
@@ -86220,16 +86523,16 @@ var I3SConverter = class {
|
|
|
86220
86523
|
}
|
|
86221
86524
|
}
|
|
86222
86525
|
}
|
|
86223
|
-
async writeTextureFile(textureData,
|
|
86526
|
+
async writeTextureFile(textureData, name9, format, childPath, slpkChildPath) {
|
|
86224
86527
|
if (this.options.slpk) {
|
|
86225
86528
|
const slpkTexturePath = (0, import_path7.join)(childPath, "textures");
|
|
86226
86529
|
const compress = false;
|
|
86227
86530
|
this.writeQueue.enqueue({
|
|
86228
|
-
archiveKey: `${slpkChildPath}/textures/${
|
|
86229
|
-
writePromise: writeFileForSlpk(slpkTexturePath, textureData, `${
|
|
86531
|
+
archiveKey: `${slpkChildPath}/textures/${name9}.${format}`,
|
|
86532
|
+
writePromise: writeFileForSlpk(slpkTexturePath, textureData, `${name9}.${format}`, compress)
|
|
86230
86533
|
});
|
|
86231
86534
|
} else {
|
|
86232
|
-
const texturePath = (0, import_path7.join)(childPath, `textures/${
|
|
86535
|
+
const texturePath = (0, import_path7.join)(childPath, `textures/${name9}/`);
|
|
86233
86536
|
this.writeQueue.enqueue({
|
|
86234
86537
|
writePromise: writeFile3(texturePath, textureData, `index.${format}`)
|
|
86235
86538
|
});
|
|
@@ -86484,7 +86787,7 @@ var import_process2 = __toModule(require("process"));
|
|
|
86484
86787
|
var import_json_map_transform8 = __toModule(require_json_map_transform());
|
|
86485
86788
|
|
|
86486
86789
|
// ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
|
|
86487
|
-
var
|
|
86790
|
+
var import_core27 = __toModule(require_es56());
|
|
86488
86791
|
var import_geospatial11 = __toModule(require_es57());
|
|
86489
86792
|
|
|
86490
86793
|
// ../i3s/src/types.ts
|
|
@@ -86587,7 +86890,7 @@ var COORDINATE_SYSTEM;
|
|
|
86587
86890
|
})(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
|
|
86588
86891
|
|
|
86589
86892
|
// ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
|
|
86590
|
-
var
|
|
86893
|
+
var scratchVector6 = new import_core27.Vector3([0, 0, 0]);
|
|
86591
86894
|
function getLoaderForTextureFormat(textureFormat) {
|
|
86592
86895
|
switch (textureFormat) {
|
|
86593
86896
|
case "ktx-etc2":
|
|
@@ -86829,9 +87132,9 @@ function parsePositions2(attribute, tile) {
|
|
|
86829
87132
|
const mbs = tile.mbs;
|
|
86830
87133
|
const value = attribute.value;
|
|
86831
87134
|
const metadata = attribute.metadata;
|
|
86832
|
-
const enuMatrix = new
|
|
86833
|
-
const cartographicOrigin = new
|
|
86834
|
-
const cartesianOrigin = new
|
|
87135
|
+
const enuMatrix = new import_core27.Matrix4();
|
|
87136
|
+
const cartographicOrigin = new import_core27.Vector3(mbs[0], mbs[1], mbs[2]);
|
|
87137
|
+
const cartesianOrigin = new import_core27.Vector3();
|
|
86835
87138
|
import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(cartographicOrigin, cartesianOrigin);
|
|
86836
87139
|
import_geospatial11.Ellipsoid.WGS84.eastNorthUpToFixedFrame(cartesianOrigin, enuMatrix);
|
|
86837
87140
|
attribute.value = offsetsToCartesians(value, metadata, cartographicOrigin);
|
|
@@ -86847,10 +87150,10 @@ function offsetsToCartesians(vertices, metadata = {}, cartographicOrigin) {
|
|
|
86847
87150
|
positions[i + 2] = vertices[i + 2] + cartographicOrigin.z;
|
|
86848
87151
|
}
|
|
86849
87152
|
for (let i = 0; i < positions.length; i += 3) {
|
|
86850
|
-
import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3),
|
|
86851
|
-
positions[i] =
|
|
86852
|
-
positions[i + 1] =
|
|
86853
|
-
positions[i + 2] =
|
|
87153
|
+
import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3), scratchVector6);
|
|
87154
|
+
positions[i] = scratchVector6.x;
|
|
87155
|
+
positions[i + 1] = scratchVector6.y;
|
|
87156
|
+
positions[i + 2] = scratchVector6.z;
|
|
86854
87157
|
}
|
|
86855
87158
|
return positions;
|
|
86856
87159
|
}
|
|
@@ -86858,7 +87161,7 @@ function getModelMatrix(positions) {
|
|
|
86858
87161
|
const metadata = positions.metadata;
|
|
86859
87162
|
const scaleX = metadata?.["i3s-scale_x"]?.double || 1;
|
|
86860
87163
|
const scaleY = metadata?.["i3s-scale_y"]?.double || 1;
|
|
86861
|
-
const modelMatrix = new
|
|
87164
|
+
const modelMatrix = new import_core27.Matrix4();
|
|
86862
87165
|
modelMatrix[0] = scaleX;
|
|
86863
87166
|
modelMatrix[5] = scaleY;
|
|
86864
87167
|
return modelMatrix;
|
|
@@ -86958,7 +87261,7 @@ function getFeatureIdsFromFeatureIndexMetadata(featureIndex) {
|
|
|
86958
87261
|
}
|
|
86959
87262
|
|
|
86960
87263
|
// ../i3s/src/i3s-content-loader.ts
|
|
86961
|
-
var VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "
|
|
87264
|
+
var VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
86962
87265
|
var I3SContentLoader = {
|
|
86963
87266
|
name: "I3S Content (Indexed Scene Layers)",
|
|
86964
87267
|
id: "i3s-content",
|
|
@@ -87402,7 +87705,7 @@ async function parse8(data, options) {
|
|
|
87402
87705
|
}
|
|
87403
87706
|
|
|
87404
87707
|
// src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.ts
|
|
87405
|
-
var
|
|
87708
|
+
var import_core31 = __toModule(require_es56());
|
|
87406
87709
|
var import_geospatial13 = __toModule(require_es57());
|
|
87407
87710
|
var import_culling8 = __toModule(require_es58());
|
|
87408
87711
|
function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
|
|
@@ -87411,7 +87714,7 @@ function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
|
|
|
87411
87714
|
i3SObb.center[1],
|
|
87412
87715
|
i3SObb.center[2] + geoidHeightModel.getHeight(i3SObb.center[1], i3SObb.center[0])
|
|
87413
87716
|
];
|
|
87414
|
-
const cartesianCenter = import_geospatial13.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new
|
|
87717
|
+
const cartesianCenter = import_geospatial13.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new import_core31.Vector3());
|
|
87415
87718
|
const tiles3DObb = new import_culling8.OrientedBoundingBox().fromCenterHalfSizeQuaternion(cartesianCenter, i3SObb.halfSize, i3SObb.quaternion);
|
|
87416
87719
|
return [...tiles3DObb.center, ...tiles3DObb.halfAxes.toArray()];
|
|
87417
87720
|
}
|
|
@@ -87455,7 +87758,7 @@ var TILESET = () => ({
|
|
|
87455
87758
|
});
|
|
87456
87759
|
|
|
87457
87760
|
// src/3d-tiles-converter/helpers/b3dm-converter.ts
|
|
87458
|
-
var
|
|
87761
|
+
var import_core33 = __toModule(require_es56());
|
|
87459
87762
|
var import_geospatial14 = __toModule(require_es57());
|
|
87460
87763
|
|
|
87461
87764
|
// src/3d-tiles-converter/helpers/texture-atlas.ts
|
|
@@ -87490,8 +87793,8 @@ function normalizeRegions(regions) {
|
|
|
87490
87793
|
}
|
|
87491
87794
|
|
|
87492
87795
|
// src/3d-tiles-converter/helpers/b3dm-converter.ts
|
|
87493
|
-
var Z_UP_TO_Y_UP_MATRIX = new
|
|
87494
|
-
var
|
|
87796
|
+
var Z_UP_TO_Y_UP_MATRIX = new import_core33.Matrix4([1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
|
|
87797
|
+
var scratchVector7 = new import_core33.Vector3();
|
|
87495
87798
|
var B3dmConverter = class {
|
|
87496
87799
|
async convert(i3sAttributesData, featureAttributes = null) {
|
|
87497
87800
|
const gltf = await this.buildGltf(i3sAttributesData);
|
|
@@ -87560,16 +87863,16 @@ var B3dmConverter = class {
|
|
|
87560
87863
|
const newPositionsValue = new Float32Array(positionsValue.length);
|
|
87561
87864
|
for (let index = 0; index < positionsValue.length; index += 3) {
|
|
87562
87865
|
const vertex = positionsValue.subarray(index, index + 3);
|
|
87563
|
-
const cartesianOriginVector = new
|
|
87564
|
-
let vertexVector = new
|
|
87565
|
-
import_geospatial14.Ellipsoid.WGS84.cartographicToCartesian(vertexVector,
|
|
87566
|
-
vertexVector =
|
|
87866
|
+
const cartesianOriginVector = new import_core33.Vector3(cartesianOrigin);
|
|
87867
|
+
let vertexVector = new import_core33.Vector3(Array.from(vertex)).transform(modelMatrix).add(cartographicOrigin);
|
|
87868
|
+
import_geospatial14.Ellipsoid.WGS84.cartographicToCartesian(vertexVector, scratchVector7);
|
|
87869
|
+
vertexVector = scratchVector7.subtract(cartesianOriginVector);
|
|
87567
87870
|
newPositionsValue.set(vertexVector, index);
|
|
87568
87871
|
}
|
|
87569
87872
|
return newPositionsValue;
|
|
87570
87873
|
}
|
|
87571
87874
|
_generateTransformMatrix(cartesianOrigin) {
|
|
87572
|
-
const translateOriginMatrix = new
|
|
87875
|
+
const translateOriginMatrix = new import_core33.Matrix4().translate(cartesianOrigin);
|
|
87573
87876
|
const result = translateOriginMatrix.multiplyLeft(Z_UP_TO_Y_UP_MATRIX);
|
|
87574
87877
|
return result;
|
|
87575
87878
|
}
|