@loaders.gl/tile-converter 3.2.6 → 3.3.0-alpha.2
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 +1123 -624
- 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 +146 -0
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
- package/dist/es5/i3s-converter/helpers/feature-attributes.js +60 -0
- package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -0
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js +39 -7
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +177 -59
- 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 +50 -51
- 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 +128 -0
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
- package/dist/esm/i3s-converter/helpers/feature-attributes.js +34 -0
- package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -0
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js +23 -7
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +145 -38
- 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 +21 -27
- 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 +138 -0
- package/dist/i3s-converter/helpers/feature-attributes.d.ts +24 -0
- package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/feature-attributes.js +55 -0
- package/dist/i3s-converter/helpers/geometry-attributes.js +26 -7
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +9 -2
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.js +140 -44
- 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 +7 -14
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +44 -35
- 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 +199 -0
- package/src/i3s-converter/helpers/feature-attributes.ts +65 -0
- package/src/i3s-converter/helpers/geometry-attributes.ts +30 -7
- package/src/i3s-converter/helpers/geometry-converter.ts +187 -48
- package/src/i3s-converter/helpers/gltf-attributes.ts +15 -0
- package/src/i3s-converter/i3s-converter.ts +38 -41
- 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 name10 in all)
|
|
14
|
+
__defProp(target, name10, { get: all[name10], 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(name10, 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 = name10;
|
|
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(name10) {
|
|
307
307
|
var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
|
|
308
308
|
return this._getOrCreate({
|
|
309
|
-
name:
|
|
309
|
+
name: name10,
|
|
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 name10 = stat2.name, type = stat2.type;
|
|
363
|
+
if (!this.stats[name10]) {
|
|
364
364
|
if (stat2 instanceof _stat.default) {
|
|
365
|
-
this.stats[
|
|
365
|
+
this.stats[name10] = stat2;
|
|
366
366
|
} else {
|
|
367
|
-
this.stats[
|
|
367
|
+
this.stats[name10] = new _stat.default(name10, type);
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
return this.stats[
|
|
370
|
+
return this.stats[name10];
|
|
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(name10) {
|
|
939
|
+
return key === name10;
|
|
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(name10, type) {
|
|
1502
1502
|
(0, _classCallCheck2.default)(this, Stat2);
|
|
1503
|
-
this.name =
|
|
1503
|
+
this.name = name10;
|
|
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(name10) {
|
|
1660
1660
|
var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "count";
|
|
1661
1661
|
return this._getOrCreate({
|
|
1662
|
-
name:
|
|
1662
|
+
name: name10,
|
|
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 name10 = stat2.name, type = stat2.type;
|
|
1716
|
+
if (!this.stats[name10]) {
|
|
1717
1717
|
if (stat2 instanceof _stat.default) {
|
|
1718
|
-
this.stats[
|
|
1718
|
+
this.stats[name10] = stat2;
|
|
1719
1719
|
} else {
|
|
1720
|
-
this.stats[
|
|
1720
|
+
this.stats[name10] = new _stat.default(name10, type);
|
|
1721
1721
|
}
|
|
1722
1722
|
}
|
|
1723
|
-
return this.stats[
|
|
1723
|
+
return this.stats[name10];
|
|
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(name10) {
|
|
2591
|
+
return key === name10;
|
|
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(name10, 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 = name10;
|
|
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 name10 = file.name;
|
|
14934
|
+
if (name10 === void 0) {
|
|
14935
|
+
name10 = file;
|
|
14936
14936
|
useStat = true;
|
|
14937
14937
|
}
|
|
14938
|
-
const filename2 = dir + "/" +
|
|
14938
|
+
const filename2 = dir + "/" + name10;
|
|
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((name10) => results[name10]);
|
|
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 = (name10) => (handler) => {
|
|
15820
15820
|
if (!handler) {
|
|
15821
15821
|
return new Promise((resolve, reject2) => {
|
|
15822
|
-
once2(
|
|
15822
|
+
once2(name10, (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(name10);
|
|
15830
|
+
on(name10, 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(name10) {
|
|
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[name10]) {
|
|
16075
|
+
resultArgs.forEach((x) => console[name10](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 name10 = asyncFn.name || "anonymous";
|
|
16632
|
+
var error = new Error('Callback function "' + name10 + '" 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 name10 = fn.name || "Function wrapped with `once`";
|
|
21904
|
+
f.onceError = name10 + " 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(name10, value) {
|
|
23223
|
+
return 'The value "' + value + '" is invalid for option "' + name10 + '"';
|
|
23224
23224
|
}, TypeError);
|
|
23225
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
23225
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name10, 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(name10, " argument")) {
|
|
23235
|
+
msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
|
|
23236
23236
|
} else {
|
|
23237
|
-
const type = includes(
|
|
23238
|
-
msg = `The "${
|
|
23237
|
+
const type = includes(name10, ".") ? "property" : "argument";
|
|
23238
|
+
msg = `The "${name10}" ${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(name10) {
|
|
23245
|
+
return "The " + name10 + " 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(name10) {
|
|
23249
|
+
return "Cannot call " + name10 + " 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 name10 = isDuplex ? duplexKey : "highWaterMark";
|
|
23276
|
+
throw new ERR_INVALID_OPT_VALUE(name10, 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(name10) {
|
|
26364
26364
|
if (!(this instanceof ZipArchiveEntry)) {
|
|
26365
|
-
return new ZipArchiveEntry(
|
|
26365
|
+
return new ZipArchiveEntry(name10);
|
|
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 (name10) {
|
|
26383
|
+
this.setName(name10);
|
|
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(name10, prependSlash = false) {
|
|
26481
|
+
name10 = normalizePath(name10, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
|
|
26482
26482
|
if (prependSlash) {
|
|
26483
|
-
|
|
26483
|
+
name10 = `/${name10}`;
|
|
26484
26484
|
}
|
|
26485
|
-
if (Buffer.byteLength(
|
|
26485
|
+
if (Buffer.byteLength(name10) !== name10.length) {
|
|
26486
26486
|
this.getGeneralPurposeBit().useUTF8ForNames(true);
|
|
26487
26487
|
}
|
|
26488
|
-
this.name =
|
|
26488
|
+
this.name = name10;
|
|
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(name10, value) {
|
|
26935
|
+
return 'The value "' + value + '" is invalid for option "' + name10 + '"';
|
|
26936
26936
|
}, TypeError);
|
|
26937
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
26937
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name10, 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(name10, " argument")) {
|
|
26947
|
+
msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
|
|
26948
26948
|
} else {
|
|
26949
|
-
const type = includes(
|
|
26950
|
-
msg = `The "${
|
|
26949
|
+
const type = includes(name10, ".") ? "property" : "argument";
|
|
26950
|
+
msg = `The "${name10}" ${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(name10) {
|
|
26957
|
+
return "The " + name10 + " 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(name10) {
|
|
26961
|
+
return "Cannot call " + name10 + " 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 name10 = isDuplex ? duplexKey : "highWaterMark";
|
|
26988
|
+
throw new ERR_INVALID_OPT_VALUE(name10, 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(name10, value) {
|
|
30077
|
+
return 'The value "' + value + '" is invalid for option "' + name10 + '"';
|
|
30078
30078
|
}, TypeError);
|
|
30079
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
30079
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name10, 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(name10, " argument")) {
|
|
30089
|
+
msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
|
|
30090
30090
|
} else {
|
|
30091
|
-
const type = includes(
|
|
30092
|
-
msg = `The "${
|
|
30091
|
+
const type = includes(name10, ".") ? "property" : "argument";
|
|
30092
|
+
msg = `The "${name10}" ${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(name10) {
|
|
30099
|
+
return "The " + name10 + " 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(name10) {
|
|
30103
|
+
return "Cannot call " + name10 + " 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 name10 = isDuplex ? duplexKey : "highWaterMark";
|
|
30130
|
+
throw new ERR_INVALID_OPT_VALUE(name10, 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 name10 = ae.getName();
|
|
32809
32809
|
var comment = ae.getComment();
|
|
32810
32810
|
var extra = ae.getCentralDirectoryExtra();
|
|
32811
32811
|
if (gpb.usesUTF8ForNames()) {
|
|
32812
|
-
|
|
32812
|
+
name10 = Buffer.from(name10);
|
|
32813
32813
|
comment = Buffer.from(comment);
|
|
32814
32814
|
}
|
|
32815
|
-
this.write(zipUtil.getShortBytes(
|
|
32815
|
+
this.write(zipUtil.getShortBytes(name10.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(name10);
|
|
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 name10 = 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
|
+
name10 = Buffer.from(name10);
|
|
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(name10.length));
|
|
32870
32870
|
this.write(zipUtil.getShortBytes(extra.length));
|
|
32871
|
-
this.write(
|
|
32871
|
+
this.write(name10);
|
|
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(name10, value) {
|
|
33449
|
+
return 'The value "' + value + '" is invalid for option "' + name10 + '"';
|
|
33450
33450
|
}, TypeError);
|
|
33451
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
33451
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name10, 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(name10, " argument")) {
|
|
33461
|
+
msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
|
|
33462
33462
|
} else {
|
|
33463
|
-
const type = includes(
|
|
33464
|
-
msg = `The "${
|
|
33463
|
+
const type = includes(name10, ".") ? "property" : "argument";
|
|
33464
|
+
msg = `The "${name10}" ${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(name10) {
|
|
33471
|
+
return "The " + name10 + " 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(name10) {
|
|
33475
|
+
return "Cannot call " + name10 + " 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 name10 = isDuplex ? duplexKey : "highWaterMark";
|
|
33502
|
+
throw new ERR_INVALID_OPT_VALUE(name10, 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 name10 = opts.name;
|
|
36330
36330
|
var prefix = "";
|
|
36331
|
-
if (opts.typeflag === 5 &&
|
|
36332
|
-
|
|
36333
|
-
if (Buffer.byteLength(
|
|
36331
|
+
if (opts.typeflag === 5 && name10[name10.length - 1] !== "/")
|
|
36332
|
+
name10 += "/";
|
|
36333
|
+
if (Buffer.byteLength(name10) !== name10.length)
|
|
36334
36334
|
return null;
|
|
36335
|
-
while (Buffer.byteLength(
|
|
36336
|
-
var i =
|
|
36335
|
+
while (Buffer.byteLength(name10) > 100) {
|
|
36336
|
+
var i = name10.indexOf("/");
|
|
36337
36337
|
if (i === -1)
|
|
36338
36338
|
return null;
|
|
36339
|
-
prefix += prefix ? "/" +
|
|
36340
|
-
|
|
36339
|
+
prefix += prefix ? "/" + name10.slice(0, i) : name10.slice(0, i);
|
|
36340
|
+
name10 = name10.slice(i + 1);
|
|
36341
36341
|
}
|
|
36342
|
-
if (Buffer.byteLength(
|
|
36342
|
+
if (Buffer.byteLength(name10) > 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(name10);
|
|
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 name10 = 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
|
+
name10 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name10;
|
|
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 && name10 && name10[name10.length - 1] === "/")
|
|
36397
36397
|
typeflag = 5;
|
|
36398
36398
|
return {
|
|
36399
|
-
name:
|
|
36399
|
+
name: name10,
|
|
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(name10, value) {
|
|
36823
|
+
return 'The value "' + value + '" is invalid for option "' + name10 + '"';
|
|
36824
36824
|
}, TypeError);
|
|
36825
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
36825
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name10, 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(name10, " argument")) {
|
|
36835
|
+
msg = `The ${name10} ${determiner} ${oneOf(expected, "type")}`;
|
|
36836
36836
|
} else {
|
|
36837
|
-
const type = includes(
|
|
36838
|
-
msg = `The "${
|
|
36837
|
+
const type = includes(name10, ".") ? "property" : "argument";
|
|
36838
|
+
msg = `The "${name10}" ${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(name10) {
|
|
36845
|
+
return "The " + name10 + " 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(name10) {
|
|
36849
|
+
return "Cannot call " + name10 + " 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 name10 = isDuplex ? duplexKey : "highWaterMark";
|
|
36876
|
+
throw new ERR_INVALID_OPT_VALUE(name10, 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(name10, 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 '" + name10 + "'. 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(name10) {
|
|
40718
|
+
this.name = name10 || "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(name10, listener) {
|
|
40767
|
+
this._listeners[name10].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(name10, arg) {
|
|
40775
|
+
if (this._listeners[name10]) {
|
|
40776
|
+
for (var i = 0; i < this._listeners[name10].length; i++) {
|
|
40777
|
+
this._listeners[name10][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(name10, data, options) {
|
|
41487
|
+
this.name = name10;
|
|
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(name10, 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
|
+
name10 = forceTrailingSlash(name10);
|
|
46137
46137
|
}
|
|
46138
|
-
if (o.createFolders && (parent = parentFolder(
|
|
46138
|
+
if (o.createFolders && (parent = parentFolder(name10))) {
|
|
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(name10, data);
|
|
46158
46158
|
} else {
|
|
46159
|
-
zipObjectContent = utils.prepareContent(
|
|
46159
|
+
zipObjectContent = utils.prepareContent(name10, data, o.binary, o.optimizedBinaryString, o.base64);
|
|
46160
46160
|
}
|
|
46161
|
-
var object = new ZipObject(
|
|
46162
|
-
this.files[
|
|
46161
|
+
var object = new ZipObject(name10, zipObjectContent, o);
|
|
46162
|
+
this.files[name10] = 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(name10, createFolders) {
|
|
46178
46178
|
createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
|
|
46179
|
-
|
|
46180
|
-
if (!this.files[
|
|
46181
|
-
fileAdd.call(this,
|
|
46179
|
+
name10 = forceTrailingSlash(name10);
|
|
46180
|
+
if (!this.files[name10]) {
|
|
46181
|
+
fileAdd.call(this, name10, null, {
|
|
46182
46182
|
dir: true,
|
|
46183
46183
|
createFolders
|
|
46184
46184
|
});
|
|
46185
46185
|
}
|
|
46186
|
-
return this.files[
|
|
46186
|
+
return this.files[name10];
|
|
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(name10, data, o) {
|
|
46215
46215
|
if (arguments.length === 1) {
|
|
46216
|
-
if (isRegExp(
|
|
46217
|
-
var regexp =
|
|
46216
|
+
if (isRegExp(name10)) {
|
|
46217
|
+
var regexp = name10;
|
|
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 + name10];
|
|
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
|
+
name10 = this.root + name10;
|
|
46231
|
+
fileAdd.call(this, name10, 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 name10 = this.root + arg;
|
|
46245
|
+
var newFolder = folderAdd.call(this, name10);
|
|
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(name10) {
|
|
46251
|
+
name10 = this.root + name10;
|
|
46252
|
+
var file = this.files[name10];
|
|
46253
46253
|
if (!file) {
|
|
46254
|
-
if (
|
|
46255
|
-
|
|
46254
|
+
if (name10.slice(-1) !== "/") {
|
|
46255
|
+
name10 += "/";
|
|
46256
46256
|
}
|
|
46257
|
-
file = this.files[
|
|
46257
|
+
file = this.files[name10];
|
|
46258
46258
|
}
|
|
46259
46259
|
if (file && !file.dir) {
|
|
46260
|
-
delete this.files[
|
|
46260
|
+
delete this.files[name10];
|
|
46261
46261
|
} else {
|
|
46262
46262
|
var kids = this.filter(function(relativePath, file2) {
|
|
46263
|
-
return file2.name.slice(0,
|
|
46263
|
+
return file2.name.slice(0, name10.length) === name10;
|
|
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 name10 in this) {
|
|
47307
|
+
if (name10.charAt(0) === "t" && hasOwn.call(this, name10) && !isNaN(+name10.slice(1))) {
|
|
47308
|
+
this[name10] = 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(name10) {
|
|
48379
|
+
var ext = original_getExtension.call(this, name10);
|
|
48380
48380
|
if (ext) {
|
|
48381
48381
|
return ext;
|
|
48382
48382
|
}
|
|
48383
|
-
if (
|
|
48383
|
+
if (name10 !== "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(name10) {
|
|
49845
|
+
if (!this.stats.has(name10)) {
|
|
49846
|
+
this.stats.set(name10, new _probe.Stats({
|
|
49847
|
+
id: name10
|
|
49848
49848
|
}));
|
|
49849
49849
|
}
|
|
49850
|
-
return this.stats.get(
|
|
49850
|
+
return this.stats.get(name10);
|
|
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, name10) {
|
|
50243
|
+
if (typeof name10 !== "string") {
|
|
50244
|
+
return name10;
|
|
50245
50245
|
}
|
|
50246
|
-
var number = Number(
|
|
50246
|
+
var number = Number(name10);
|
|
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
|
+
name10 = name10.replace(/^.*\./, "");
|
|
50251
|
+
var value = gl[name10];
|
|
50252
|
+
(0, _utils.assert)(value !== void 0, "Accessing undefined constant GL.".concat(name10));
|
|
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 name10 = 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(name10, "s Created")).incrementCount();
|
|
50621
|
+
stats.get("".concat(name10, "s Active")).incrementCount();
|
|
50622
50622
|
}
|
|
50623
50623
|
}, {
|
|
50624
50624
|
key: "_removeStats",
|
|
50625
50625
|
value: function _removeStats() {
|
|
50626
|
-
var
|
|
50626
|
+
var name10 = this.constructor.name;
|
|
50627
50627
|
var stats = _init.lumaStats.get("Resource Counts");
|
|
50628
|
-
stats.get("".concat(
|
|
50628
|
+
stats.get("".concat(name10, "s Active")).decrementCount();
|
|
50629
50629
|
}
|
|
50630
50630
|
}, {
|
|
50631
50631
|
key: "_trackAllocatedMemory",
|
|
50632
50632
|
value: function _trackAllocatedMemory(bytes) {
|
|
50633
|
-
var
|
|
50633
|
+
var name10 = 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(name10, " 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 name10 = 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(name10, " 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 name10 = shaderName || (0, _getShaderName.default)(src) || "(unnamed)";
|
|
54399
|
+
var shaderDescription = "".concat((0, _getShaderTypeName.default)(shaderType), " shader ").concat(name10);
|
|
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(name10) {
|
|
54798
|
+
if (name10[name10.length - 1] !== "]") {
|
|
54799
54799
|
return {
|
|
54800
|
-
name:
|
|
54800
|
+
name: name10,
|
|
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 = name10.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(name10));
|
|
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], name10 = _COMPOSITE_GL_TYPES$g[2];
|
|
55054
55054
|
if (compType === type && compComponents === components) {
|
|
55055
55055
|
return {
|
|
55056
55056
|
glType,
|
|
55057
|
-
name:
|
|
55057
|
+
name: name10
|
|
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), name10 = _gl$getActiveAttrib.name, type = _gl$getActiveAttrib.type, size = _gl$getActiveAttrib.size;
|
|
55142
|
+
var location = gl.getAttribLocation(program.handle, name10);
|
|
55143
55143
|
if (location >= 0) {
|
|
55144
|
-
this._addAttribute(location,
|
|
55144
|
+
this._addAttribute(location, name10, 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), name10 = _gl$getTransformFeedb.name, type = _gl$getTransformFeedb.type, size = _gl$getTransformFeedb.size;
|
|
55161
|
+
this._addVarying(location, name10, 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, name10, 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, name10, accessor);
|
|
55176
55176
|
var attributeInfo = {
|
|
55177
55177
|
location,
|
|
55178
|
-
name:
|
|
55178
|
+
name: name10,
|
|
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, name10, accessor) {
|
|
55188
|
+
if (/instance/i.test(name10)) {
|
|
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, name10, 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: name10,
|
|
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), name10 = _parseUniformName.name;
|
|
55593
|
+
var location = gl.getUniformLocation(this.handle, name10);
|
|
55594
|
+
this._uniformSetters[name10] = (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(name10, "[").concat(l, "]"));
|
|
55598
|
+
this._uniformSetters["".concat(name10, "[").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, name10 = _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(name10 || 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 name10 = 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(name10) + locationOffset,
|
|
56771
|
+
name: name10
|
|
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(name10, 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(name10, " (").concat(typeAndName.name, ")") : name10;
|
|
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 name10 = _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 name10 === "string");
|
|
58412
|
+
this.name = name10;
|
|
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(name10) {
|
|
58624
|
+
return moduleMap[name10];
|
|
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 name10 = match[3];
|
|
59239
59239
|
if (hash) {
|
|
59240
|
-
if (
|
|
59240
|
+
if (name10 === "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 name10 = hook.replace(/\(.+/, "");
|
|
59382
|
+
result[stage][name10] = 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 name10 = definition.split(";")[0];
|
|
59417
59417
|
return {
|
|
59418
59418
|
qualifier,
|
|
59419
59419
|
type,
|
|
59420
|
-
name:
|
|
59420
|
+
name: name10
|
|
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 name10 = module3.name;
|
|
65336
65336
|
modules[count++] = module3;
|
|
65337
|
-
seen[
|
|
65337
|
+
seen[name10] = 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 name10 in geometry.attributes) {
|
|
65410
|
+
var attribute = geometry.attributes[name10];
|
|
65411
|
+
var remappedName = mapAttributeName(name10, options);
|
|
65412
|
+
if (name10 === "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(name10, 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(name10, 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[name10] || name10;
|
|
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 name10 in attributes) {
|
|
65652
|
+
var attribute = attributes[name10];
|
|
65653
|
+
normalizedAttributes[name10] = 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 name10 in this.geometryBuffers) {
|
|
65836
|
+
var buffer = this.geometryBuffers[name10][0] || this.geometryBuffers[name10];
|
|
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 name10 in this.resources) {
|
|
66088
|
+
this.resources[name10].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(name10, opts) {
|
|
66205
66205
|
var buffer = new _webgl.Buffer(this.gl, opts);
|
|
66206
|
-
if (this.resources[
|
|
66207
|
-
this.resources[
|
|
66206
|
+
if (this.resources[name10]) {
|
|
66207
|
+
this.resources[name10].delete();
|
|
66208
66208
|
}
|
|
66209
|
-
this.resources[
|
|
66209
|
+
this.resources[name10] = 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, name10 = attributeData.name;
|
|
66331
|
+
if (name10 && textureMap[name10]) {
|
|
66332
66332
|
var updatedLine = "// ".concat(line, " => Replaced by Transform with a sampler");
|
|
66333
|
-
var _getSamplerDecleratio = getSamplerDeclerations(
|
|
66333
|
+
var _getSamplerDecleratio = getSamplerDeclerations(name10), 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(name10, " = transform_getInput(").concat(samplerName, ", ").concat(sizeName, ").").concat(channels, ";\n");
|
|
66336
|
+
samplerTextureMap[samplerName] = name10;
|
|
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 name10 in sourceTextures) {
|
|
66607
|
+
sourceTextures[name10].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.");
|
|
@@ -73596,9 +73596,9 @@ var WorkerThread = class {
|
|
|
73596
73596
|
constructor(props) {
|
|
73597
73597
|
this.terminated = false;
|
|
73598
73598
|
this._loadableURL = "";
|
|
73599
|
-
const { name:
|
|
73599
|
+
const { name: name10, source, url } = props;
|
|
73600
73600
|
assert3(source || url);
|
|
73601
|
-
this.name =
|
|
73601
|
+
this.name = name10;
|
|
73602
73602
|
this.source = source;
|
|
73603
73603
|
this.url = url;
|
|
73604
73604
|
this.onMessage = NOOP;
|
|
@@ -73606,7 +73606,7 @@ var WorkerThread = class {
|
|
|
73606
73606
|
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
73607
73607
|
}
|
|
73608
73608
|
static isSupported() {
|
|
73609
|
-
return typeof Worker !== "undefined" && isBrowser2 || typeof worker_threads_exports.Worker !==
|
|
73609
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof worker_threads_exports.Worker !== "undefined" && !isBrowser2;
|
|
73610
73610
|
}
|
|
73611
73611
|
destroy() {
|
|
73612
73612
|
this.onMessage = NOOP;
|
|
@@ -73715,9 +73715,9 @@ var WorkerPool = class {
|
|
|
73715
73715
|
this.onDebug = props.onDebug;
|
|
73716
73716
|
}
|
|
73717
73717
|
}
|
|
73718
|
-
async startJob(
|
|
73718
|
+
async startJob(name10, onMessage3 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
|
|
73719
73719
|
const startPromise = new Promise((onStart) => {
|
|
73720
|
-
this.jobQueue.push({ name:
|
|
73720
|
+
this.jobQueue.push({ name: name10, onMessage: onMessage3, onError, onStart });
|
|
73721
73721
|
return this;
|
|
73722
73722
|
});
|
|
73723
73723
|
this._startQueuedJob();
|
|
@@ -73768,8 +73768,8 @@ var WorkerPool = class {
|
|
|
73768
73768
|
}
|
|
73769
73769
|
if (this.count < this._getMaxConcurrency()) {
|
|
73770
73770
|
this.count++;
|
|
73771
|
-
const
|
|
73772
|
-
return new WorkerThread({ name:
|
|
73771
|
+
const name10 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
|
|
73772
|
+
return new WorkerThread({ name: name10, source: this.source, url: this.url });
|
|
73773
73773
|
}
|
|
73774
73774
|
return null;
|
|
73775
73775
|
}
|
|
@@ -73814,16 +73814,16 @@ var WorkerFarm = class {
|
|
|
73814
73814
|
}
|
|
73815
73815
|
}
|
|
73816
73816
|
getWorkerPool(options) {
|
|
73817
|
-
const { name:
|
|
73818
|
-
let workerPool = this.workerPools.get(
|
|
73817
|
+
const { name: name10, source, url } = options;
|
|
73818
|
+
let workerPool = this.workerPools.get(name10);
|
|
73819
73819
|
if (!workerPool) {
|
|
73820
73820
|
workerPool = new WorkerPool({
|
|
73821
|
-
name:
|
|
73821
|
+
name: name10,
|
|
73822
73822
|
source,
|
|
73823
73823
|
url
|
|
73824
73824
|
});
|
|
73825
73825
|
workerPool.setProps(this._getWorkerPoolProps());
|
|
73826
|
-
this.workerPools.set(
|
|
73826
|
+
this.workerPools.set(name10, workerPool);
|
|
73827
73827
|
}
|
|
73828
73828
|
return workerPool;
|
|
73829
73829
|
}
|
|
@@ -73838,7 +73838,7 @@ var WorkerFarm = class {
|
|
|
73838
73838
|
};
|
|
73839
73839
|
|
|
73840
73840
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
73841
|
-
var NPM_TAG = "
|
|
73841
|
+
var NPM_TAG = "beta";
|
|
73842
73842
|
var VERSION2 = typeof VERSION !== "undefined" ? VERSION : NPM_TAG;
|
|
73843
73843
|
function getWorkerName(worker) {
|
|
73844
73844
|
const warning = worker.version !== VERSION2 ? ` (worker-utils@${VERSION2})` : "";
|
|
@@ -73868,10 +73868,10 @@ function getWorkerURL(worker, options = {}) {
|
|
|
73868
73868
|
|
|
73869
73869
|
// ../worker-utils/src/lib/worker-api/process-on-worker.ts
|
|
73870
73870
|
async function processOnWorker(worker, data, options = {}, context = {}) {
|
|
73871
|
-
const
|
|
73871
|
+
const name10 = getWorkerName(worker);
|
|
73872
73872
|
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
73873
73873
|
const { source } = options;
|
|
73874
|
-
const workerPoolProps = { name:
|
|
73874
|
+
const workerPoolProps = { name: name10, source };
|
|
73875
73875
|
if (!source) {
|
|
73876
73876
|
workerPoolProps.url = getWorkerURL(worker, options);
|
|
73877
73877
|
}
|
|
@@ -73960,7 +73960,7 @@ function requireFromString(code, filename2 = "", options) {
|
|
|
73960
73960
|
}
|
|
73961
73961
|
|
|
73962
73962
|
// ../worker-utils/src/lib/library-utils/library-utils.ts
|
|
73963
|
-
var LATEST = "
|
|
73963
|
+
var LATEST = "beta";
|
|
73964
73964
|
var VERSION3 = typeof VERSION !== "undefined" ? VERSION : LATEST;
|
|
73965
73965
|
var loadLibraryPromises = {};
|
|
73966
73966
|
async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
|
|
@@ -74159,10 +74159,10 @@ function canParseWithWorker(loader, options) {
|
|
|
74159
74159
|
return loader.worker && options?.worker;
|
|
74160
74160
|
}
|
|
74161
74161
|
async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
|
|
74162
|
-
const
|
|
74162
|
+
const name10 = loader.id;
|
|
74163
74163
|
const url = getWorkerURL(loader, options);
|
|
74164
74164
|
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
74165
|
-
const workerPool = workerFarm.getWorkerPool({ name:
|
|
74165
|
+
const workerPool = workerFarm.getWorkerPool({ name: name10, url });
|
|
74166
74166
|
options = JSON.parse(JSON.stringify(options));
|
|
74167
74167
|
context = JSON.parse(JSON.stringify(context || {}));
|
|
74168
74168
|
const job = await workerPool.startJob("process-on-worker", onMessage2.bind(null, parseOnMainThread));
|
|
@@ -76460,6 +76460,12 @@ var TileHeader = class {
|
|
|
76460
76460
|
get contentFailed() {
|
|
76461
76461
|
return this.contentState === TILE_CONTENT_STATE.FAILED;
|
|
76462
76462
|
}
|
|
76463
|
+
get distanceToCamera() {
|
|
76464
|
+
return this._distanceToCamera;
|
|
76465
|
+
}
|
|
76466
|
+
get screenSpaceError() {
|
|
76467
|
+
return this._screenSpaceError;
|
|
76468
|
+
}
|
|
76463
76469
|
getScreenSpaceError(frameState, useParentLodMetric) {
|
|
76464
76470
|
switch (this.tileset.type) {
|
|
76465
76471
|
case TILESET_TYPE.I3S:
|
|
@@ -76701,8 +76707,17 @@ var TileHeader = class {
|
|
|
76701
76707
|
case "i3s":
|
|
76702
76708
|
return {
|
|
76703
76709
|
...this.tileset.options.i3s,
|
|
76704
|
-
|
|
76705
|
-
|
|
76710
|
+
_tileOptions: {
|
|
76711
|
+
textureUrl: this.header.textureUrl,
|
|
76712
|
+
textureFormat: this.header.textureFormat,
|
|
76713
|
+
textureLoaderOptions: this.header.textureLoaderOptions,
|
|
76714
|
+
materialDefinition: this.header.materialDefinition,
|
|
76715
|
+
isDracoGeometry: this.header.isDracoGeometry,
|
|
76716
|
+
mbs: this.header.mbs
|
|
76717
|
+
},
|
|
76718
|
+
_tilesetOptions: {
|
|
76719
|
+
store: this.tileset.tileset.store
|
|
76720
|
+
},
|
|
76706
76721
|
isTileHeader: false
|
|
76707
76722
|
};
|
|
76708
76723
|
case "3d-tiles":
|
|
@@ -76882,8 +76897,7 @@ var I3STilesetTraverser = class extends TilesetTraverser {
|
|
|
76882
76897
|
...tileset.loadOptions,
|
|
76883
76898
|
i3s: {
|
|
76884
76899
|
...tileset.loadOptions.i3s,
|
|
76885
|
-
isTileHeader: true
|
|
76886
|
-
loadContent: false
|
|
76900
|
+
isTileHeader: true
|
|
76887
76901
|
}
|
|
76888
76902
|
};
|
|
76889
76903
|
return await load(nodeUrl, loader, options);
|
|
@@ -77216,7 +77230,11 @@ var Tileset3D = class {
|
|
|
77216
77230
|
this.zoom = 1;
|
|
77217
77231
|
return;
|
|
77218
77232
|
}
|
|
77219
|
-
|
|
77233
|
+
if (center[0] !== 0 || center[1] !== 0 || center[2] !== 0) {
|
|
77234
|
+
this.cartographicCenter = import_geospatial6.Ellipsoid.WGS84.cartesianToCartographic(center, new import_core10.Vector3());
|
|
77235
|
+
} else {
|
|
77236
|
+
this.cartographicCenter = new import_core10.Vector3(0, 0, -import_geospatial6.Ellipsoid.WGS84.radii[0]);
|
|
77237
|
+
}
|
|
77220
77238
|
this.cartesianCenter = center;
|
|
77221
77239
|
this.zoom = getZoomFromBoundingVolume(root.boundingVolume, this.cartographicCenter);
|
|
77222
77240
|
}
|
|
@@ -77458,7 +77476,7 @@ var DEFAULT_DRACO_OPTIONS = {
|
|
|
77458
77476
|
};
|
|
77459
77477
|
var DracoLoader = {
|
|
77460
77478
|
name: "Draco",
|
|
77461
|
-
id: "draco",
|
|
77479
|
+
id: isBrowser2 ? "draco" : "draco-nodejs",
|
|
77462
77480
|
module: "draco",
|
|
77463
77481
|
shapes: ["mesh"],
|
|
77464
77482
|
version: VERSION5,
|
|
@@ -77528,8 +77546,8 @@ var Schema = class {
|
|
|
77528
77546
|
}
|
|
77529
77547
|
select(...columnNames) {
|
|
77530
77548
|
const nameMap = Object.create(null);
|
|
77531
|
-
for (const
|
|
77532
|
-
nameMap[
|
|
77549
|
+
for (const name10 of columnNames) {
|
|
77550
|
+
nameMap[name10] = true;
|
|
77533
77551
|
}
|
|
77534
77552
|
const selectedFields = this.fields.filter((field) => nameMap[field.name]);
|
|
77535
77553
|
return new Schema(selectedFields, this.metadata);
|
|
@@ -77574,8 +77592,8 @@ function mergeMaps(m1, m2) {
|
|
|
77574
77592
|
|
|
77575
77593
|
// ../schema/src/lib/schema/impl/field.ts
|
|
77576
77594
|
var Field = class {
|
|
77577
|
-
constructor(
|
|
77578
|
-
this.name =
|
|
77595
|
+
constructor(name10, type, nullable = false, metadata = new Map()) {
|
|
77596
|
+
this.name = name10;
|
|
77579
77597
|
this.type = type;
|
|
77580
77598
|
this.nullable = nullable;
|
|
77581
77599
|
this.metadata = metadata;
|
|
@@ -78497,8 +78515,8 @@ var GLType = class {
|
|
|
78497
78515
|
}
|
|
78498
78516
|
throw new Error(ERR_TYPE_CONVERSION);
|
|
78499
78517
|
}
|
|
78500
|
-
static fromName(
|
|
78501
|
-
const glType = NAME_TO_GL_TYPE[
|
|
78518
|
+
static fromName(name10) {
|
|
78519
|
+
const glType = NAME_TO_GL_TYPE[name10];
|
|
78502
78520
|
if (!glType) {
|
|
78503
78521
|
throw new Error(ERR_TYPE_CONVERSION);
|
|
78504
78522
|
}
|
|
@@ -79010,10 +79028,10 @@ var Tile3DBatchTableParser = class {
|
|
|
79010
79028
|
}
|
|
79011
79029
|
return void 0;
|
|
79012
79030
|
}
|
|
79013
|
-
hasProperty(batchId,
|
|
79031
|
+
hasProperty(batchId, name10) {
|
|
79014
79032
|
this._checkBatchId(batchId);
|
|
79015
|
-
assert2(typeof
|
|
79016
|
-
return defined5(this._properties[
|
|
79033
|
+
assert2(typeof name10 === "string", name10);
|
|
79034
|
+
return defined5(this._properties[name10]) || this._hasPropertyInHierarchy(batchId, name10);
|
|
79017
79035
|
}
|
|
79018
79036
|
getPropertyNames(batchId, results) {
|
|
79019
79037
|
this._checkBatchId(batchId);
|
|
@@ -79026,47 +79044,47 @@ var Tile3DBatchTableParser = class {
|
|
|
79026
79044
|
}
|
|
79027
79045
|
return results;
|
|
79028
79046
|
}
|
|
79029
|
-
getProperty(batchId,
|
|
79047
|
+
getProperty(batchId, name10) {
|
|
79030
79048
|
this._checkBatchId(batchId);
|
|
79031
|
-
assert2(typeof
|
|
79049
|
+
assert2(typeof name10 === "string", name10);
|
|
79032
79050
|
if (this._binaryProperties) {
|
|
79033
|
-
const binaryProperty = this._binaryProperties[
|
|
79051
|
+
const binaryProperty = this._binaryProperties[name10];
|
|
79034
79052
|
if (defined5(binaryProperty)) {
|
|
79035
79053
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
79036
79054
|
}
|
|
79037
79055
|
}
|
|
79038
|
-
const propertyValues = this._properties[
|
|
79056
|
+
const propertyValues = this._properties[name10];
|
|
79039
79057
|
if (defined5(propertyValues)) {
|
|
79040
79058
|
return clone(propertyValues[batchId], true);
|
|
79041
79059
|
}
|
|
79042
79060
|
if (this._hierarchy) {
|
|
79043
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
79061
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name10);
|
|
79044
79062
|
if (defined5(hierarchyProperty)) {
|
|
79045
79063
|
return hierarchyProperty;
|
|
79046
79064
|
}
|
|
79047
79065
|
}
|
|
79048
79066
|
return void 0;
|
|
79049
79067
|
}
|
|
79050
|
-
setProperty(batchId,
|
|
79068
|
+
setProperty(batchId, name10, value) {
|
|
79051
79069
|
const featureCount = this.featureCount;
|
|
79052
79070
|
this._checkBatchId(batchId);
|
|
79053
|
-
assert2(typeof
|
|
79071
|
+
assert2(typeof name10 === "string", name10);
|
|
79054
79072
|
if (this._binaryProperties) {
|
|
79055
|
-
const binaryProperty = this._binaryProperties[
|
|
79073
|
+
const binaryProperty = this._binaryProperties[name10];
|
|
79056
79074
|
if (binaryProperty) {
|
|
79057
79075
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
79058
79076
|
return;
|
|
79059
79077
|
}
|
|
79060
79078
|
}
|
|
79061
79079
|
if (this._hierarchy) {
|
|
79062
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
79080
|
+
if (this._setHierarchyProperty(this, batchId, name10, value)) {
|
|
79063
79081
|
return;
|
|
79064
79082
|
}
|
|
79065
79083
|
}
|
|
79066
|
-
let propertyValues = this._properties[
|
|
79084
|
+
let propertyValues = this._properties[name10];
|
|
79067
79085
|
if (!defined5(propertyValues)) {
|
|
79068
|
-
this._properties[
|
|
79069
|
-
propertyValues = this._properties[
|
|
79086
|
+
this._properties[name10] = new Array(featureCount);
|
|
79087
|
+
propertyValues = this._properties[name10];
|
|
79070
79088
|
}
|
|
79071
79089
|
propertyValues[batchId] = clone(value, true);
|
|
79072
79090
|
}
|
|
@@ -79084,21 +79102,21 @@ var Tile3DBatchTableParser = class {
|
|
|
79084
79102
|
}
|
|
79085
79103
|
_initializeBinaryProperties() {
|
|
79086
79104
|
let binaryProperties = null;
|
|
79087
|
-
for (const
|
|
79088
|
-
const property = this._properties[
|
|
79089
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
79105
|
+
for (const name10 in this._properties) {
|
|
79106
|
+
const property = this._properties[name10];
|
|
79107
|
+
const binaryProperty = this._initializeBinaryProperty(name10, property);
|
|
79090
79108
|
if (binaryProperty) {
|
|
79091
79109
|
binaryProperties = binaryProperties || {};
|
|
79092
|
-
binaryProperties[
|
|
79110
|
+
binaryProperties[name10] = binaryProperty;
|
|
79093
79111
|
}
|
|
79094
79112
|
}
|
|
79095
79113
|
return binaryProperties;
|
|
79096
79114
|
}
|
|
79097
|
-
_initializeBinaryProperty(
|
|
79115
|
+
_initializeBinaryProperty(name10, property) {
|
|
79098
79116
|
if ("byteOffset" in property) {
|
|
79099
79117
|
const tile3DAccessor = property;
|
|
79100
|
-
assert2(this.binary, `Property ${
|
|
79101
|
-
assert2(tile3DAccessor.type, `Property ${
|
|
79118
|
+
assert2(this.binary, `Property ${name10} requires a batch table binary.`);
|
|
79119
|
+
assert2(tile3DAccessor.type, `Property ${name10} requires a type.`);
|
|
79102
79120
|
const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
|
|
79103
79121
|
return {
|
|
79104
79122
|
typedArray: accessor.values,
|
|
@@ -79109,14 +79127,14 @@ var Tile3DBatchTableParser = class {
|
|
|
79109
79127
|
}
|
|
79110
79128
|
return null;
|
|
79111
79129
|
}
|
|
79112
|
-
_hasPropertyInHierarchy(batchId,
|
|
79130
|
+
_hasPropertyInHierarchy(batchId, name10) {
|
|
79113
79131
|
if (!this._hierarchy) {
|
|
79114
79132
|
return false;
|
|
79115
79133
|
}
|
|
79116
79134
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
79117
79135
|
const classId = hierarchy.classIds[instanceIndex];
|
|
79118
79136
|
const instances = hierarchy.classes[classId].instances;
|
|
79119
|
-
return defined5(instances[
|
|
79137
|
+
return defined5(instances[name10]);
|
|
79120
79138
|
});
|
|
79121
79139
|
return defined5(result);
|
|
79122
79140
|
}
|
|
@@ -79124,21 +79142,21 @@ var Tile3DBatchTableParser = class {
|
|
|
79124
79142
|
traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
79125
79143
|
const classId = hierarchy.classIds[instanceIndex];
|
|
79126
79144
|
const instances = hierarchy.classes[classId].instances;
|
|
79127
|
-
for (const
|
|
79128
|
-
if (instances.hasOwnProperty(
|
|
79129
|
-
if (results.indexOf(
|
|
79130
|
-
results.push(
|
|
79145
|
+
for (const name10 in instances) {
|
|
79146
|
+
if (instances.hasOwnProperty(name10)) {
|
|
79147
|
+
if (results.indexOf(name10) === -1) {
|
|
79148
|
+
results.push(name10);
|
|
79131
79149
|
}
|
|
79132
79150
|
}
|
|
79133
79151
|
}
|
|
79134
79152
|
});
|
|
79135
79153
|
}
|
|
79136
|
-
_getHierarchyProperty(batchId,
|
|
79154
|
+
_getHierarchyProperty(batchId, name10) {
|
|
79137
79155
|
return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
79138
79156
|
const classId = hierarchy.classIds[instanceIndex];
|
|
79139
79157
|
const instanceClass = hierarchy.classes[classId];
|
|
79140
79158
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
79141
|
-
const propertyValues = instanceClass.instances[
|
|
79159
|
+
const propertyValues = instanceClass.instances[name10];
|
|
79142
79160
|
if (defined5(propertyValues)) {
|
|
79143
79161
|
if (defined5(propertyValues.typedArray)) {
|
|
79144
79162
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -79148,14 +79166,14 @@ var Tile3DBatchTableParser = class {
|
|
|
79148
79166
|
return null;
|
|
79149
79167
|
});
|
|
79150
79168
|
}
|
|
79151
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
79169
|
+
_setHierarchyProperty(batchTable, batchId, name10, value) {
|
|
79152
79170
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
79153
79171
|
const classId = hierarchy.classIds[instanceIndex];
|
|
79154
79172
|
const instanceClass = hierarchy.classes[classId];
|
|
79155
79173
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
79156
|
-
const propertyValues = instanceClass.instances[
|
|
79174
|
+
const propertyValues = instanceClass.instances[name10];
|
|
79157
79175
|
if (defined5(propertyValues)) {
|
|
79158
|
-
assert2(instanceIndex === batchId, `Inherited property "${
|
|
79176
|
+
assert2(instanceIndex === batchId, `Inherited property "${name10}" is read-only.`);
|
|
79159
79177
|
if (defined5(propertyValues.typedArray)) {
|
|
79160
79178
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
79161
79179
|
} else {
|
|
@@ -79556,7 +79574,7 @@ async function loadDraco(tile, dracoData, options, context) {
|
|
|
79556
79574
|
var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
79557
79575
|
|
|
79558
79576
|
// ../textures/src/lib/utils/version.ts
|
|
79559
|
-
var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "
|
|
79577
|
+
var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
79560
79578
|
|
|
79561
79579
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
79562
79580
|
var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
@@ -80055,7 +80073,7 @@ function selectSupportedBasisFormat() {
|
|
|
80055
80073
|
// ../textures/src/basis-loader.ts
|
|
80056
80074
|
var BasisWorkerLoader = {
|
|
80057
80075
|
name: "Basis",
|
|
80058
|
-
id: "basis",
|
|
80076
|
+
id: isBrowser2 ? "basis" : "basis-nodejs",
|
|
80059
80077
|
module: "textures",
|
|
80060
80078
|
version: VERSION7,
|
|
80061
80079
|
worker: true,
|
|
@@ -81004,12 +81022,12 @@ var GLTFScenegraph = class {
|
|
|
81004
81022
|
return extras[key];
|
|
81005
81023
|
}
|
|
81006
81024
|
getExtension(extensionName) {
|
|
81007
|
-
const isExtension = this.getUsedExtensions().find((
|
|
81025
|
+
const isExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
|
|
81008
81026
|
const extensions = this.json.extensions || {};
|
|
81009
81027
|
return isExtension ? extensions[extensionName] || true : null;
|
|
81010
81028
|
}
|
|
81011
81029
|
getRequiredExtension(extensionName) {
|
|
81012
|
-
const isRequired = this.getRequiredExtensions().find((
|
|
81030
|
+
const isRequired = this.getRequiredExtensions().find((name10) => name10 === extensionName);
|
|
81013
81031
|
return isRequired ? this.getExtension(extensionName) : null;
|
|
81014
81032
|
}
|
|
81015
81033
|
getRequiredExtensions() {
|
|
@@ -81641,11 +81659,11 @@ __export(KHR_draco_mesh_compression_exports, {
|
|
|
81641
81659
|
// ../gltf/src/lib/gltf-utils/gltf-attribute-utils.ts
|
|
81642
81660
|
function getGLTFAccessors(attributes) {
|
|
81643
81661
|
const accessors = {};
|
|
81644
|
-
for (const
|
|
81645
|
-
const attribute = attributes[
|
|
81646
|
-
if (
|
|
81662
|
+
for (const name10 in attributes) {
|
|
81663
|
+
const attribute = attributes[name10];
|
|
81664
|
+
if (name10 !== "indices") {
|
|
81647
81665
|
const glTFAccessor = getGLTFAccessor(attribute);
|
|
81648
|
-
accessors[
|
|
81666
|
+
accessors[name10] = glTFAccessor;
|
|
81649
81667
|
}
|
|
81650
81668
|
}
|
|
81651
81669
|
return accessors;
|
|
@@ -81787,16 +81805,192 @@ function* makeMeshPrimitiveIterator(scenegraph) {
|
|
|
81787
81805
|
}
|
|
81788
81806
|
}
|
|
81789
81807
|
|
|
81808
|
+
// ../gltf/src/lib/extensions/KHR_texture_transform.ts
|
|
81809
|
+
var KHR_texture_transform_exports = {};
|
|
81810
|
+
__export(KHR_texture_transform_exports, {
|
|
81811
|
+
decode: () => decode4,
|
|
81812
|
+
name: () => name5
|
|
81813
|
+
});
|
|
81814
|
+
var import_core15 = __toModule(require_es56());
|
|
81815
|
+
|
|
81816
|
+
// ../gltf/src/lib/gltf-utils/gltf-constants.ts
|
|
81817
|
+
var COMPONENTS = {
|
|
81818
|
+
SCALAR: 1,
|
|
81819
|
+
VEC2: 2,
|
|
81820
|
+
VEC3: 3,
|
|
81821
|
+
VEC4: 4,
|
|
81822
|
+
MAT2: 4,
|
|
81823
|
+
MAT3: 9,
|
|
81824
|
+
MAT4: 16
|
|
81825
|
+
};
|
|
81826
|
+
var BYTES = {
|
|
81827
|
+
5120: 1,
|
|
81828
|
+
5121: 1,
|
|
81829
|
+
5122: 2,
|
|
81830
|
+
5123: 2,
|
|
81831
|
+
5125: 4,
|
|
81832
|
+
5126: 4
|
|
81833
|
+
};
|
|
81834
|
+
|
|
81835
|
+
// ../gltf/src/lib/extensions/KHR_texture_transform.ts
|
|
81836
|
+
var EXT_MESHOPT_TRANSFORM = "KHR_texture_transform";
|
|
81837
|
+
var name5 = EXT_MESHOPT_TRANSFORM;
|
|
81838
|
+
var scratchVector4 = new import_core15.Vector3();
|
|
81839
|
+
var scratchRotationMatrix = new import_core15.Matrix3();
|
|
81840
|
+
var scratchScaleMatrix = new import_core15.Matrix3();
|
|
81841
|
+
async function decode4(gltfData, options) {
|
|
81842
|
+
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
81843
|
+
const extension = gltfScenegraph.getExtension(EXT_MESHOPT_TRANSFORM);
|
|
81844
|
+
if (!extension) {
|
|
81845
|
+
return;
|
|
81846
|
+
}
|
|
81847
|
+
const materials = gltfData.json.materials || [];
|
|
81848
|
+
for (let i = 0; i < materials.length; i++) {
|
|
81849
|
+
transformTexCoords(i, gltfData);
|
|
81850
|
+
}
|
|
81851
|
+
}
|
|
81852
|
+
function transformTexCoords(materialIndex, gltfData) {
|
|
81853
|
+
const processedTexCoords = [];
|
|
81854
|
+
const material = gltfData.json.materials?.[materialIndex];
|
|
81855
|
+
const baseColorTexture = material?.pbrMetallicRoughness?.baseColorTexture;
|
|
81856
|
+
if (baseColorTexture) {
|
|
81857
|
+
transformPrimitives(gltfData, materialIndex, baseColorTexture, processedTexCoords);
|
|
81858
|
+
}
|
|
81859
|
+
const emisiveTexture = material?.emissiveTexture;
|
|
81860
|
+
if (emisiveTexture) {
|
|
81861
|
+
transformPrimitives(gltfData, materialIndex, emisiveTexture, processedTexCoords);
|
|
81862
|
+
}
|
|
81863
|
+
const normalTexture = material?.normalTexture;
|
|
81864
|
+
if (normalTexture) {
|
|
81865
|
+
transformPrimitives(gltfData, materialIndex, normalTexture, processedTexCoords);
|
|
81866
|
+
}
|
|
81867
|
+
const occlusionTexture = material?.occlusionTexture;
|
|
81868
|
+
if (occlusionTexture) {
|
|
81869
|
+
transformPrimitives(gltfData, materialIndex, occlusionTexture, processedTexCoords);
|
|
81870
|
+
}
|
|
81871
|
+
const metallicRoughnessTexture = material?.pbrMetallicRoughness?.metallicRoughnessTexture;
|
|
81872
|
+
if (metallicRoughnessTexture) {
|
|
81873
|
+
transformPrimitives(gltfData, materialIndex, metallicRoughnessTexture, processedTexCoords);
|
|
81874
|
+
}
|
|
81875
|
+
}
|
|
81876
|
+
function transformPrimitives(gltfData, materialIndex, texture, processedTexCoords) {
|
|
81877
|
+
const transformParameters = getTransformParameters(texture, processedTexCoords);
|
|
81878
|
+
if (!transformParameters) {
|
|
81879
|
+
return;
|
|
81880
|
+
}
|
|
81881
|
+
const meshes = gltfData.json.meshes || [];
|
|
81882
|
+
for (const mesh of meshes) {
|
|
81883
|
+
for (const primitive of mesh.primitives) {
|
|
81884
|
+
const material = primitive.material;
|
|
81885
|
+
if (Number.isFinite(material) && materialIndex === material) {
|
|
81886
|
+
transformPrimitive(gltfData, primitive, transformParameters);
|
|
81887
|
+
}
|
|
81888
|
+
}
|
|
81889
|
+
}
|
|
81890
|
+
}
|
|
81891
|
+
function getTransformParameters(texture, processedTexCoords) {
|
|
81892
|
+
const textureInfo = texture.extensions?.[EXT_MESHOPT_TRANSFORM];
|
|
81893
|
+
const { texCoord: originalTexCoord = 0 } = texture;
|
|
81894
|
+
const { texCoord = originalTexCoord } = textureInfo;
|
|
81895
|
+
const isProcessed = processedTexCoords.findIndex(([original, newTexCoord]) => original === originalTexCoord && newTexCoord === texCoord) !== -1;
|
|
81896
|
+
if (!isProcessed) {
|
|
81897
|
+
const matrix = makeTransformationMatrix(textureInfo);
|
|
81898
|
+
if (originalTexCoord !== texCoord) {
|
|
81899
|
+
texture.texCoord = texCoord;
|
|
81900
|
+
}
|
|
81901
|
+
processedTexCoords.push([originalTexCoord, texCoord]);
|
|
81902
|
+
return { originalTexCoord, texCoord, matrix };
|
|
81903
|
+
}
|
|
81904
|
+
return null;
|
|
81905
|
+
}
|
|
81906
|
+
function transformPrimitive(gltfData, primitive, transformParameters) {
|
|
81907
|
+
const { originalTexCoord, texCoord, matrix } = transformParameters;
|
|
81908
|
+
const texCoordAccessor = primitive.attributes[`TEXCOORD_${originalTexCoord}`];
|
|
81909
|
+
if (Number.isFinite(texCoordAccessor)) {
|
|
81910
|
+
const accessor = gltfData.json.accessors?.[texCoordAccessor];
|
|
81911
|
+
if (accessor && accessor.bufferView) {
|
|
81912
|
+
const bufferView = gltfData.json.bufferViews?.[accessor.bufferView];
|
|
81913
|
+
if (bufferView) {
|
|
81914
|
+
const { arrayBuffer, byteOffset: bufferByteOffset } = gltfData.buffers[bufferView.buffer];
|
|
81915
|
+
const byteOffset = (bufferByteOffset || 0) + (accessor.byteOffset || 0) + (bufferView.byteOffset || 0);
|
|
81916
|
+
const { ArrayType, length } = getAccessorArrayTypeAndLength(accessor, bufferView);
|
|
81917
|
+
const bytes = BYTES[accessor.componentType];
|
|
81918
|
+
const components = COMPONENTS[accessor.type];
|
|
81919
|
+
const elementAddressScale = bufferView.byteStride || bytes * components;
|
|
81920
|
+
const result = new Float32Array(length);
|
|
81921
|
+
for (let i = 0; i < accessor.count; i++) {
|
|
81922
|
+
const uv = new ArrayType(arrayBuffer, byteOffset + i * elementAddressScale, 2);
|
|
81923
|
+
scratchVector4.set(uv[0], uv[1], 1);
|
|
81924
|
+
scratchVector4.transformByMatrix3(matrix);
|
|
81925
|
+
result.set([scratchVector4[0], scratchVector4[1]], i * components);
|
|
81926
|
+
}
|
|
81927
|
+
if (originalTexCoord === texCoord) {
|
|
81928
|
+
updateGltf(accessor, bufferView, gltfData.buffers, result);
|
|
81929
|
+
} else {
|
|
81930
|
+
createAttribute(texCoord, accessor, primitive, gltfData, result);
|
|
81931
|
+
}
|
|
81932
|
+
}
|
|
81933
|
+
}
|
|
81934
|
+
}
|
|
81935
|
+
}
|
|
81936
|
+
function updateGltf(accessor, bufferView, buffers, newTexCoordArray) {
|
|
81937
|
+
accessor.componentType = 5126;
|
|
81938
|
+
buffers.push({
|
|
81939
|
+
arrayBuffer: newTexCoordArray.buffer,
|
|
81940
|
+
byteOffset: 0,
|
|
81941
|
+
byteLength: newTexCoordArray.buffer.byteLength
|
|
81942
|
+
});
|
|
81943
|
+
bufferView.buffer = buffers.length - 1;
|
|
81944
|
+
bufferView.byteLength = newTexCoordArray.buffer.byteLength;
|
|
81945
|
+
bufferView.byteOffset = 0;
|
|
81946
|
+
delete bufferView.byteStride;
|
|
81947
|
+
}
|
|
81948
|
+
function createAttribute(newTexCoord, originalAccessor, primitive, gltfData, newTexCoordArray) {
|
|
81949
|
+
gltfData.buffers.push({
|
|
81950
|
+
arrayBuffer: newTexCoordArray.buffer,
|
|
81951
|
+
byteOffset: 0,
|
|
81952
|
+
byteLength: newTexCoordArray.buffer.byteLength
|
|
81953
|
+
});
|
|
81954
|
+
const bufferViews = gltfData.json.bufferViews;
|
|
81955
|
+
if (!bufferViews) {
|
|
81956
|
+
return;
|
|
81957
|
+
}
|
|
81958
|
+
bufferViews.push({
|
|
81959
|
+
buffer: gltfData.buffers.length - 1,
|
|
81960
|
+
byteLength: newTexCoordArray.buffer.byteLength,
|
|
81961
|
+
byteOffset: 0
|
|
81962
|
+
});
|
|
81963
|
+
const accessors = gltfData.json.accessors;
|
|
81964
|
+
if (!accessors) {
|
|
81965
|
+
return;
|
|
81966
|
+
}
|
|
81967
|
+
accessors.push({
|
|
81968
|
+
bufferView: bufferViews?.length - 1,
|
|
81969
|
+
byteOffset: 0,
|
|
81970
|
+
componentType: 5126,
|
|
81971
|
+
count: originalAccessor.count,
|
|
81972
|
+
type: "VEC2"
|
|
81973
|
+
});
|
|
81974
|
+
primitive.attributes[`TEXCOORD_${newTexCoord}`] = accessors.length - 1;
|
|
81975
|
+
}
|
|
81976
|
+
function makeTransformationMatrix(extensionData) {
|
|
81977
|
+
const { offset = [0, 0], rotation = 0, scale = [1, 1] } = extensionData;
|
|
81978
|
+
const translationMatirx = new import_core15.Matrix3().set(1, 0, 0, 0, 1, 0, offset[0], offset[1], 1);
|
|
81979
|
+
const rotationMatirx = scratchRotationMatrix.set(Math.cos(rotation), Math.sin(rotation), 0, -Math.sin(rotation), Math.cos(rotation), 0, 0, 0, 1);
|
|
81980
|
+
const scaleMatrix = scratchScaleMatrix.set(scale[0], 0, 0, 0, scale[1], 0, 0, 0, 1);
|
|
81981
|
+
return translationMatirx.multiplyRight(rotationMatirx).multiplyRight(scaleMatrix);
|
|
81982
|
+
}
|
|
81983
|
+
|
|
81790
81984
|
// ../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts
|
|
81791
81985
|
var KHR_lights_punctual_exports = {};
|
|
81792
81986
|
__export(KHR_lights_punctual_exports, {
|
|
81793
|
-
decode: () =>
|
|
81987
|
+
decode: () => decode5,
|
|
81794
81988
|
encode: () => encode3,
|
|
81795
|
-
name: () =>
|
|
81989
|
+
name: () => name6
|
|
81796
81990
|
});
|
|
81797
81991
|
var KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
|
|
81798
|
-
var
|
|
81799
|
-
async function
|
|
81992
|
+
var name6 = KHR_LIGHTS_PUNCTUAL;
|
|
81993
|
+
async function decode5(gltfData) {
|
|
81800
81994
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
81801
81995
|
const { json } = gltfScenegraph;
|
|
81802
81996
|
const extension = gltfScenegraph.getExtension(KHR_LIGHTS_PUNCTUAL);
|
|
@@ -81833,13 +82027,13 @@ async function encode3(gltfData) {
|
|
|
81833
82027
|
// ../gltf/src/lib/extensions/deprecated/KHR_materials_unlit.ts
|
|
81834
82028
|
var KHR_materials_unlit_exports = {};
|
|
81835
82029
|
__export(KHR_materials_unlit_exports, {
|
|
81836
|
-
decode: () =>
|
|
82030
|
+
decode: () => decode6,
|
|
81837
82031
|
encode: () => encode4,
|
|
81838
|
-
name: () =>
|
|
82032
|
+
name: () => name7
|
|
81839
82033
|
});
|
|
81840
82034
|
var KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
|
|
81841
|
-
var
|
|
81842
|
-
async function
|
|
82035
|
+
var name7 = KHR_MATERIALS_UNLIT;
|
|
82036
|
+
async function decode6(gltfData) {
|
|
81843
82037
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
81844
82038
|
const { json } = gltfScenegraph;
|
|
81845
82039
|
gltfScenegraph.removeExtension(KHR_MATERIALS_UNLIT);
|
|
@@ -81868,13 +82062,13 @@ function encode4(gltfData) {
|
|
|
81868
82062
|
// ../gltf/src/lib/extensions/deprecated/KHR_techniques_webgl.ts
|
|
81869
82063
|
var KHR_techniques_webgl_exports = {};
|
|
81870
82064
|
__export(KHR_techniques_webgl_exports, {
|
|
81871
|
-
decode: () =>
|
|
82065
|
+
decode: () => decode7,
|
|
81872
82066
|
encode: () => encode5,
|
|
81873
|
-
name: () =>
|
|
82067
|
+
name: () => name8
|
|
81874
82068
|
});
|
|
81875
82069
|
var KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
|
|
81876
|
-
var
|
|
81877
|
-
async function
|
|
82070
|
+
var name8 = KHR_TECHNIQUES_WEBGL;
|
|
82071
|
+
async function decode7(gltfData) {
|
|
81878
82072
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
81879
82073
|
const { json } = gltfScenegraph;
|
|
81880
82074
|
const extension = gltfScenegraph.getExtension(KHR_TECHNIQUES_WEBGL);
|
|
@@ -81927,6 +82121,85 @@ function resolveValues(technique, gltfScenegraph) {
|
|
|
81927
82121
|
return values;
|
|
81928
82122
|
}
|
|
81929
82123
|
|
|
82124
|
+
// ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
|
|
82125
|
+
var EXT_feature_metadata_exports = {};
|
|
82126
|
+
__export(EXT_feature_metadata_exports, {
|
|
82127
|
+
decode: () => decode8,
|
|
82128
|
+
name: () => name9
|
|
82129
|
+
});
|
|
82130
|
+
var EXT_FEATURE_METADATA = "EXT_feature_metadata";
|
|
82131
|
+
var name9 = EXT_FEATURE_METADATA;
|
|
82132
|
+
async function decode8(gltfData) {
|
|
82133
|
+
const scenegraph = new GLTFScenegraph(gltfData);
|
|
82134
|
+
decodeExtFeatureMetadata(scenegraph);
|
|
82135
|
+
}
|
|
82136
|
+
function decodeExtFeatureMetadata(scenegraph) {
|
|
82137
|
+
const extension = scenegraph.getExtension(EXT_FEATURE_METADATA);
|
|
82138
|
+
const schemaClasses = extension?.schema?.classes;
|
|
82139
|
+
const featureTables = extension?.featureTables;
|
|
82140
|
+
const featureTextures = extension?.featureTextures;
|
|
82141
|
+
if (featureTextures) {
|
|
82142
|
+
console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');
|
|
82143
|
+
}
|
|
82144
|
+
if (schemaClasses && featureTables) {
|
|
82145
|
+
for (const schemaName in schemaClasses) {
|
|
82146
|
+
const schemaClass = schemaClasses[schemaName];
|
|
82147
|
+
const featureTable = findFeatureTableByName(featureTables, schemaName);
|
|
82148
|
+
if (featureTable) {
|
|
82149
|
+
handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
|
|
82150
|
+
}
|
|
82151
|
+
}
|
|
82152
|
+
}
|
|
82153
|
+
}
|
|
82154
|
+
function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
|
|
82155
|
+
for (const propertyName in schemaClass.properties) {
|
|
82156
|
+
const schemaProperty = schemaClass.properties[propertyName];
|
|
82157
|
+
const featureTableProperty = featureTable?.properties?.[propertyName];
|
|
82158
|
+
const numberOfFeatures = featureTable.count;
|
|
82159
|
+
if (featureTableProperty) {
|
|
82160
|
+
const data = getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
|
|
82161
|
+
featureTableProperty.data = data;
|
|
82162
|
+
}
|
|
82163
|
+
}
|
|
82164
|
+
}
|
|
82165
|
+
function getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
|
|
82166
|
+
const bufferView = featureTableProperty.bufferView;
|
|
82167
|
+
let data = scenegraph.getTypedArrayForBufferView(bufferView);
|
|
82168
|
+
switch (schemaProperty.type) {
|
|
82169
|
+
case "STRING": {
|
|
82170
|
+
const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView;
|
|
82171
|
+
const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);
|
|
82172
|
+
data = getStringAttributes(data, offsetsData, numberOfFeatures);
|
|
82173
|
+
break;
|
|
82174
|
+
}
|
|
82175
|
+
default:
|
|
82176
|
+
}
|
|
82177
|
+
return data;
|
|
82178
|
+
}
|
|
82179
|
+
function findFeatureTableByName(featureTables, schemaClassName) {
|
|
82180
|
+
for (const featureTableName in featureTables) {
|
|
82181
|
+
const featureTable = featureTables[featureTableName];
|
|
82182
|
+
if (featureTable.class === schemaClassName) {
|
|
82183
|
+
return featureTable;
|
|
82184
|
+
}
|
|
82185
|
+
}
|
|
82186
|
+
return null;
|
|
82187
|
+
}
|
|
82188
|
+
function getStringAttributes(data, offsetsData, stringsCount) {
|
|
82189
|
+
const stringsArray = [];
|
|
82190
|
+
const textDecoder = new TextDecoder("utf8");
|
|
82191
|
+
let stringOffset = 0;
|
|
82192
|
+
const bytesPerStringSize = 4;
|
|
82193
|
+
for (let index = 0; index < stringsCount; index++) {
|
|
82194
|
+
const stringByteSize = offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];
|
|
82195
|
+
const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
|
|
82196
|
+
const stringAttribute = textDecoder.decode(stringData);
|
|
82197
|
+
stringsArray.push(stringAttribute);
|
|
82198
|
+
stringOffset += stringByteSize;
|
|
82199
|
+
}
|
|
82200
|
+
return stringsArray;
|
|
82201
|
+
}
|
|
82202
|
+
|
|
81930
82203
|
// ../gltf/src/lib/api/gltf-extensions.ts
|
|
81931
82204
|
var EXTENSIONS2 = [
|
|
81932
82205
|
EXT_meshopt_compression_exports,
|
|
@@ -81935,7 +82208,9 @@ var EXTENSIONS2 = [
|
|
|
81935
82208
|
KHR_draco_mesh_compression_exports,
|
|
81936
82209
|
KHR_lights_punctual_exports,
|
|
81937
82210
|
KHR_materials_unlit_exports,
|
|
81938
|
-
KHR_techniques_webgl_exports
|
|
82211
|
+
KHR_techniques_webgl_exports,
|
|
82212
|
+
KHR_texture_transform_exports,
|
|
82213
|
+
EXT_feature_metadata_exports
|
|
81939
82214
|
];
|
|
81940
82215
|
function preprocessExtensions(gltf, options = {}, context) {
|
|
81941
82216
|
const extensions = EXTENSIONS2.filter((extension) => useExtension(extension.name, options));
|
|
@@ -82168,7 +82443,7 @@ function normalizeGLTFV1(gltf, options = {}) {
|
|
|
82168
82443
|
}
|
|
82169
82444
|
|
|
82170
82445
|
// ../gltf/src/lib/api/post-process-gltf.ts
|
|
82171
|
-
var
|
|
82446
|
+
var COMPONENTS2 = {
|
|
82172
82447
|
SCALAR: 1,
|
|
82173
82448
|
VEC2: 2,
|
|
82174
82449
|
VEC3: 3,
|
|
@@ -82177,7 +82452,7 @@ var COMPONENTS = {
|
|
|
82177
82452
|
MAT3: 9,
|
|
82178
82453
|
MAT4: 16
|
|
82179
82454
|
};
|
|
82180
|
-
var
|
|
82455
|
+
var BYTES2 = {
|
|
82181
82456
|
5120: 1,
|
|
82182
82457
|
5121: 1,
|
|
82183
82458
|
5122: 2,
|
|
@@ -82207,10 +82482,10 @@ var DEFAULT_SAMPLER = {
|
|
|
82207
82482
|
[GL_SAMPLER.TEXTURE_WRAP_T]: GL_SAMPLER.REPEAT
|
|
82208
82483
|
};
|
|
82209
82484
|
function getBytesFromComponentType(componentType) {
|
|
82210
|
-
return
|
|
82485
|
+
return BYTES2[componentType];
|
|
82211
82486
|
}
|
|
82212
82487
|
function getSizeFromAccessorType(type) {
|
|
82213
|
-
return
|
|
82488
|
+
return COMPONENTS2[type];
|
|
82214
82489
|
}
|
|
82215
82490
|
var GLTFPostProcessor = class {
|
|
82216
82491
|
constructor() {
|
|
@@ -82908,7 +83183,7 @@ function parseBatchedModel(tile, arrayBuffer, byteOffset, options, context) {
|
|
|
82908
83183
|
}
|
|
82909
83184
|
|
|
82910
83185
|
// ../3d-tiles/src/lib/parsers/parse-3d-tile-instanced-model.ts
|
|
82911
|
-
var
|
|
83186
|
+
var import_core16 = __toModule(require_es56());
|
|
82912
83187
|
var import_geospatial7 = __toModule(require_es57());
|
|
82913
83188
|
async function parseInstancedModel3DTile(tile, arrayBuffer, byteOffset, options, context) {
|
|
82914
83189
|
byteOffset = parseInstancedModel(tile, arrayBuffer, byteOffset, options, context);
|
|
@@ -82953,19 +83228,19 @@ function extractInstancedAttributes(tile, featureTable, batchTable, instancesLen
|
|
|
82953
83228
|
forwardAxis: [1, 0, 0]
|
|
82954
83229
|
};
|
|
82955
83230
|
const instances = collectionOptions.instances;
|
|
82956
|
-
const instancePosition = new
|
|
82957
|
-
const instanceNormalRight = new
|
|
82958
|
-
const instanceNormalUp = new
|
|
82959
|
-
const instanceNormalForward = new
|
|
82960
|
-
const instanceRotation = new
|
|
82961
|
-
const instanceQuaternion = new
|
|
82962
|
-
const instanceScale = new
|
|
83231
|
+
const instancePosition = new import_core16.Vector3();
|
|
83232
|
+
const instanceNormalRight = new import_core16.Vector3();
|
|
83233
|
+
const instanceNormalUp = new import_core16.Vector3();
|
|
83234
|
+
const instanceNormalForward = new import_core16.Vector3();
|
|
83235
|
+
const instanceRotation = new import_core16.Matrix3();
|
|
83236
|
+
const instanceQuaternion = new import_core16.Quaternion();
|
|
83237
|
+
const instanceScale = new import_core16.Vector3();
|
|
82963
83238
|
const instanceTranslationRotationScale = {};
|
|
82964
|
-
const instanceTransform = new
|
|
83239
|
+
const instanceTransform = new import_core16.Matrix4();
|
|
82965
83240
|
const scratch1 = [];
|
|
82966
83241
|
const scratch2 = [];
|
|
82967
|
-
const scratchVector1 = new
|
|
82968
|
-
const scratchVector23 = new
|
|
83242
|
+
const scratchVector1 = new import_core16.Vector3();
|
|
83243
|
+
const scratchVector23 = new import_core16.Vector3();
|
|
82969
83244
|
for (let i = 0; i < instancesLength; i++) {
|
|
82970
83245
|
let position;
|
|
82971
83246
|
if (featureTable.hasProperty("POSITION")) {
|
|
@@ -83035,7 +83310,7 @@ function extractInstancedAttributes(tile, featureTable, batchTable, instancesLen
|
|
|
83035
83310
|
if (batchId === void 0) {
|
|
83036
83311
|
batchId = i;
|
|
83037
83312
|
}
|
|
83038
|
-
const rotationMatrix = new
|
|
83313
|
+
const rotationMatrix = new import_core16.Matrix4().fromQuaternion(instanceTranslationRotationScale.rotation);
|
|
83039
83314
|
instanceTransform.identity();
|
|
83040
83315
|
instanceTransform.translate(instanceTranslationRotationScale.translation);
|
|
83041
83316
|
instanceTransform.multiplyRight(rotationMatrix);
|
|
@@ -83125,8 +83400,8 @@ async function parse3DTilesSubtree(data) {
|
|
|
83125
83400
|
}
|
|
83126
83401
|
return subtree;
|
|
83127
83402
|
}
|
|
83128
|
-
async function getExplicitBitstream(subtree,
|
|
83129
|
-
const bufferViewIndex = subtree[
|
|
83403
|
+
async function getExplicitBitstream(subtree, name10, internalBinaryBuffer) {
|
|
83404
|
+
const bufferViewIndex = subtree[name10].bufferView;
|
|
83130
83405
|
const bufferView = subtree.bufferViews[bufferViewIndex];
|
|
83131
83406
|
const buffer = subtree.buffers[bufferView.buffer];
|
|
83132
83407
|
if (buffer.uri) {
|
|
@@ -83361,13 +83636,23 @@ function getRefine(refine) {
|
|
|
83361
83636
|
return refine;
|
|
83362
83637
|
}
|
|
83363
83638
|
}
|
|
83639
|
+
function resolveUri(uri, basePath) {
|
|
83640
|
+
const urlSchemeRegex = /^[a-z][0-9a-z+.-]*:/i;
|
|
83641
|
+
if (urlSchemeRegex.test(basePath)) {
|
|
83642
|
+
const url = new URL(uri, `${basePath}/`);
|
|
83643
|
+
return decodeURI(url.toString());
|
|
83644
|
+
} else if (uri.startsWith("/")) {
|
|
83645
|
+
return uri;
|
|
83646
|
+
}
|
|
83647
|
+
return `${basePath}/${uri}`;
|
|
83648
|
+
}
|
|
83364
83649
|
function normalizeTileData(tile, options) {
|
|
83365
83650
|
if (!tile) {
|
|
83366
83651
|
return null;
|
|
83367
83652
|
}
|
|
83368
83653
|
if (tile.content) {
|
|
83369
83654
|
const contentUri = tile.content.uri || tile.content.url;
|
|
83370
|
-
tile.contentUrl =
|
|
83655
|
+
tile.contentUrl = resolveUri(contentUri, options.basePath);
|
|
83371
83656
|
}
|
|
83372
83657
|
tile.id = tile.contentUrl;
|
|
83373
83658
|
tile.lodMetricType = LOD_METRIC_TYPE.GEOMETRIC_ERROR;
|
|
@@ -83405,9 +83690,9 @@ async function normalizeImplicitTileHeaders(tileset) {
|
|
|
83405
83690
|
subtrees: { uri: subtreesUriTemplate }
|
|
83406
83691
|
} = implicitTilingExtension;
|
|
83407
83692
|
const subtreeUrl = replaceContentUrlTemplate(subtreesUriTemplate, 0, 0, 0, 0);
|
|
83408
|
-
const rootSubtreeUrl =
|
|
83693
|
+
const rootSubtreeUrl = resolveUri(subtreeUrl, basePath);
|
|
83409
83694
|
const rootSubtree = await load(rootSubtreeUrl, Tile3DSubtreeLoader);
|
|
83410
|
-
const contentUrlTemplate =
|
|
83695
|
+
const contentUrlTemplate = resolveUri(tileset.root.content.uri, basePath);
|
|
83411
83696
|
const refine = tileset.root.refine;
|
|
83412
83697
|
const rootLodMetricValue = tileset.root.geometricError;
|
|
83413
83698
|
const rootBoundingVolume = tileset.root.boundingVolume;
|
|
@@ -84075,7 +84360,7 @@ async function getTotalFilesSize(dirPath) {
|
|
|
84075
84360
|
}
|
|
84076
84361
|
|
|
84077
84362
|
// src/i3s-converter/helpers/geometry-converter.ts
|
|
84078
|
-
var
|
|
84363
|
+
var import_core22 = __toModule(require_es56());
|
|
84079
84364
|
var import_geospatial9 = __toModule(require_es57());
|
|
84080
84365
|
var import_md5 = __toModule(require_md52());
|
|
84081
84366
|
|
|
@@ -84105,30 +84390,42 @@ function generateAttributes(attributes) {
|
|
|
84105
84390
|
function calculateFaceRangesAndFeaturesCount(featureIndices) {
|
|
84106
84391
|
let rangeIndex = 1;
|
|
84107
84392
|
let featureIndex = 1;
|
|
84108
|
-
let currentFeatureId = featureIndices
|
|
84393
|
+
let currentFeatureId = getFrequentValue(featureIndices.slice(0, VALUES_PER_VERTEX));
|
|
84109
84394
|
const faceRangeList = [];
|
|
84110
84395
|
const featureIds = [];
|
|
84111
84396
|
const uniqueFeatureIds = [currentFeatureId];
|
|
84112
84397
|
faceRangeList[0] = 0;
|
|
84113
84398
|
featureIds[0] = currentFeatureId;
|
|
84114
|
-
for (let index =
|
|
84115
|
-
|
|
84399
|
+
for (let index = VALUES_PER_VERTEX; index < featureIndices.length; index += VALUES_PER_VERTEX) {
|
|
84400
|
+
const newFeatureId = getFrequentValue(featureIndices.slice(index, index + VALUES_PER_VERTEX));
|
|
84401
|
+
if (currentFeatureId !== newFeatureId) {
|
|
84116
84402
|
faceRangeList[rangeIndex] = index / VALUES_PER_VERTEX - 1;
|
|
84117
84403
|
faceRangeList[rangeIndex + 1] = index / VALUES_PER_VERTEX;
|
|
84118
|
-
featureIds[featureIndex] =
|
|
84119
|
-
if (!uniqueFeatureIds.includes(
|
|
84120
|
-
uniqueFeatureIds.push(
|
|
84404
|
+
featureIds[featureIndex] = newFeatureId;
|
|
84405
|
+
if (!uniqueFeatureIds.includes(newFeatureId)) {
|
|
84406
|
+
uniqueFeatureIds.push(newFeatureId);
|
|
84121
84407
|
}
|
|
84122
84408
|
rangeIndex += 2;
|
|
84123
84409
|
featureIndex += 1;
|
|
84124
84410
|
}
|
|
84125
|
-
currentFeatureId =
|
|
84411
|
+
currentFeatureId = newFeatureId;
|
|
84126
84412
|
}
|
|
84127
84413
|
faceRangeList[rangeIndex] = featureIndices.length / VALUES_PER_VERTEX - 1;
|
|
84128
84414
|
const faceRange = new Uint32Array(faceRangeList);
|
|
84129
84415
|
const featureCount = uniqueFeatureIds.length;
|
|
84130
84416
|
return { faceRange, featureCount, featureIds };
|
|
84131
84417
|
}
|
|
84418
|
+
function getFrequentValue(values) {
|
|
84419
|
+
const map = {};
|
|
84420
|
+
let mostFrequentValue = values[0];
|
|
84421
|
+
let maxCount = 1;
|
|
84422
|
+
for (const value of values) {
|
|
84423
|
+
map[value] = (map[value] || 0) + 1;
|
|
84424
|
+
maxCount = maxCount > map[value] ? maxCount : map[value];
|
|
84425
|
+
mostFrequentValue = maxCount > map[value] ? mostFrequentValue : value;
|
|
84426
|
+
}
|
|
84427
|
+
return mostFrequentValue;
|
|
84428
|
+
}
|
|
84132
84429
|
function makeAttributeObjects(attributes) {
|
|
84133
84430
|
const {
|
|
84134
84431
|
featureIds,
|
|
@@ -84228,7 +84525,7 @@ function groupAttributesAndRangesByFeatureId(unifiedObjects, featureCount) {
|
|
|
84228
84525
|
}
|
|
84229
84526
|
|
|
84230
84527
|
// src/i3s-converter/helpers/coordinate-converter.ts
|
|
84231
|
-
var
|
|
84528
|
+
var import_core21 = __toModule(require_es56());
|
|
84232
84529
|
var import_geospatial8 = __toModule(require_es57());
|
|
84233
84530
|
var import_culling5 = __toModule(require_es58());
|
|
84234
84531
|
function createBoundingVolumes(tile, geoidHeightModel) {
|
|
@@ -84236,16 +84533,16 @@ function createBoundingVolumes(tile, geoidHeightModel) {
|
|
|
84236
84533
|
let halfSize;
|
|
84237
84534
|
let quaternion;
|
|
84238
84535
|
const boundingVolume = tile.boundingVolume;
|
|
84239
|
-
const cartographicCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(boundingVolume.center, new
|
|
84536
|
+
const cartographicCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(boundingVolume.center, new import_core21.Vector3());
|
|
84240
84537
|
cartographicCenter[2] = cartographicCenter[2] - geoidHeightModel.getHeight(cartographicCenter[1], cartographicCenter[0]);
|
|
84241
84538
|
if (boundingVolume instanceof import_culling5.OrientedBoundingBox) {
|
|
84242
84539
|
halfSize = boundingVolume.halfSize;
|
|
84243
|
-
radius = new
|
|
84540
|
+
radius = new import_core21.Vector3(halfSize[0], halfSize[1], halfSize[2]).len();
|
|
84244
84541
|
quaternion = boundingVolume.quaternion;
|
|
84245
84542
|
} else {
|
|
84246
84543
|
radius = tile.boundingVolume.radius;
|
|
84247
84544
|
halfSize = [radius, radius, radius];
|
|
84248
|
-
quaternion = new
|
|
84545
|
+
quaternion = new import_core21.Quaternion().fromMatrix3(new import_core21.Matrix3([halfSize[0], 0, 0, 0, halfSize[1], 0, 0, 0, halfSize[2]])).normalize();
|
|
84249
84546
|
}
|
|
84250
84547
|
return {
|
|
84251
84548
|
mbs: [cartographicCenter[0], cartographicCenter[1], cartographicCenter[2], radius],
|
|
@@ -84260,8 +84557,8 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
|
|
|
84260
84557
|
const positionVectors = convertPositionsToVectors(cartesianPositions);
|
|
84261
84558
|
const geometryObb = (0, import_culling5.makeOrientedBoundingBoxFromPoints)(positionVectors);
|
|
84262
84559
|
const geometryMbs = (0, import_culling5.makeBoundingSphereFromPoints)(positionVectors);
|
|
84263
|
-
let mbsCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new
|
|
84264
|
-
let obbCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new
|
|
84560
|
+
let mbsCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new import_core21.Vector3());
|
|
84561
|
+
let obbCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new import_core21.Vector3());
|
|
84265
84562
|
mbsCenter[2] = mbsCenter[2] - geoidHeightModel.getHeight(mbsCenter[1], mbsCenter[0]);
|
|
84266
84563
|
obbCenter[2] = obbCenter[2] - geoidHeightModel.getHeight(obbCenter[1], obbCenter[0]);
|
|
84267
84564
|
return {
|
|
@@ -84276,7 +84573,7 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
|
|
|
84276
84573
|
function convertPositionsToVectors(positions) {
|
|
84277
84574
|
const result = [];
|
|
84278
84575
|
for (let i = 0; i < positions.length; i += 3) {
|
|
84279
|
-
const positionVector = new
|
|
84576
|
+
const positionVector = new import_core21.Vector3([positions[i], positions[i + 1], positions[i + 2]]);
|
|
84280
84577
|
result.push(positionVector);
|
|
84281
84578
|
}
|
|
84282
84579
|
return result;
|
|
@@ -84290,8 +84587,8 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
|
|
|
84290
84587
|
}
|
|
84291
84588
|
const center = sphere.center;
|
|
84292
84589
|
const radius = sphere.radius;
|
|
84293
|
-
const vertexMax = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new
|
|
84294
|
-
const vertexMin = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new
|
|
84590
|
+
const vertexMax = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core21.Vector3(center[0] + radius, center[1] + radius, center[2] + radius), new import_core21.Vector3());
|
|
84591
|
+
const vertexMin = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core21.Vector3(center[0] - radius, center[1] - radius, center[2] - radius), new import_core21.Vector3());
|
|
84295
84592
|
return {
|
|
84296
84593
|
xmin: vertexMin[0],
|
|
84297
84594
|
xmax: vertexMax[0],
|
|
@@ -84303,8 +84600,8 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
|
|
|
84303
84600
|
}
|
|
84304
84601
|
function createObbFromMbs(mbs) {
|
|
84305
84602
|
const radius = mbs[3];
|
|
84306
|
-
const center = new
|
|
84307
|
-
const halfAxex = new
|
|
84603
|
+
const center = new import_core21.Vector3(mbs[0], mbs[1], mbs[2]);
|
|
84604
|
+
const halfAxex = new import_core21.Matrix3([radius, 0, 0, 0, radius, 0, 0, 0, radius]);
|
|
84308
84605
|
return new import_culling5.OrientedBoundingBox(center, halfAxex);
|
|
84309
84606
|
}
|
|
84310
84607
|
|
|
@@ -84321,12 +84618,24 @@ function getB3DMAttributesWithoutBufferView(attributes) {
|
|
|
84321
84618
|
function prepareDataForAttributesConversion(tileContent) {
|
|
84322
84619
|
const gltfMaterials = tileContent.gltf?.materials?.map((material) => ({ id: material.id }));
|
|
84323
84620
|
let nodes = tileContent.gltf?.scene?.nodes || tileContent.gltf?.scenes?.[0]?.nodes || tileContent.gltf?.nodes || [];
|
|
84621
|
+
const images = tileContent.gltf?.images?.map((imageObject) => {
|
|
84622
|
+
const data = imageObject?.image?.compressed ? null : imageObject?.image?.data.subarray();
|
|
84623
|
+
return {
|
|
84624
|
+
data,
|
|
84625
|
+
compressed: Boolean(imageObject?.image?.compressed),
|
|
84626
|
+
height: imageObject.image.height,
|
|
84627
|
+
width: imageObject.image.width,
|
|
84628
|
+
components: imageObject.image.components,
|
|
84629
|
+
mimeType: imageObject.mimeType
|
|
84630
|
+
};
|
|
84631
|
+
}) || [];
|
|
84324
84632
|
const prepearedNodes = nodes.map((node2) => {
|
|
84325
84633
|
if (!node2.mesh) {
|
|
84326
84634
|
return node2;
|
|
84327
84635
|
}
|
|
84328
84636
|
return {
|
|
84329
84637
|
...node2,
|
|
84638
|
+
images,
|
|
84330
84639
|
mesh: {
|
|
84331
84640
|
...node2.mesh,
|
|
84332
84641
|
primitives: node2.mesh?.primitives.map((primitive) => ({
|
|
@@ -84350,6 +84659,130 @@ function prepareDataForAttributesConversion(tileContent) {
|
|
|
84350
84659
|
};
|
|
84351
84660
|
}
|
|
84352
84661
|
|
|
84662
|
+
// src/i3s-converter/helpers/batch-ids-extensions.ts
|
|
84663
|
+
var EXT_MESH_FEATURES = "EXT_mesh_features";
|
|
84664
|
+
var EXT_FEATURE_METADATA2 = "EXT_feature_metadata";
|
|
84665
|
+
function handleBatchIdsExtensions(attributes, primitive, images) {
|
|
84666
|
+
const extensions = primitive?.extensions;
|
|
84667
|
+
if (!extensions) {
|
|
84668
|
+
return [];
|
|
84669
|
+
}
|
|
84670
|
+
for (const [extensionName, extensionData] of Object.entries(extensions || {})) {
|
|
84671
|
+
switch (extensionName) {
|
|
84672
|
+
case EXT_FEATURE_METADATA2:
|
|
84673
|
+
return handleExtFeatureMetadataExtension(attributes, extensionData, images);
|
|
84674
|
+
case EXT_MESH_FEATURES:
|
|
84675
|
+
console.warn("EXT_mesh_features extension is not supported yet");
|
|
84676
|
+
return [];
|
|
84677
|
+
default:
|
|
84678
|
+
return [];
|
|
84679
|
+
}
|
|
84680
|
+
}
|
|
84681
|
+
return [];
|
|
84682
|
+
}
|
|
84683
|
+
function handleExtFeatureMetadataExtension(attributes, extFeatureMetadata, images) {
|
|
84684
|
+
const featureIdAttribute = extFeatureMetadata?.featureIdAttributes?.[0];
|
|
84685
|
+
if (featureIdAttribute?.featureIds?.attribute) {
|
|
84686
|
+
const batchIdsAttribute = attributes[featureIdAttribute.featureIds.attribute];
|
|
84687
|
+
return batchIdsAttribute.value;
|
|
84688
|
+
}
|
|
84689
|
+
if (featureIdAttribute?.featureIds?.hasOwnProperty("constant") && featureIdAttribute?.featureIds?.hasOwnProperty("divisor")) {
|
|
84690
|
+
const featuresCount = attributes?.POSITIONS?.value.length / 3 || 0;
|
|
84691
|
+
return generateImplicitFeatureIds(featuresCount, featureIdAttribute.featureIds.constant, featureIdAttribute.featureIds.divisor);
|
|
84692
|
+
}
|
|
84693
|
+
const featureIdTexture = extFeatureMetadata?.featureIdTextures && extFeatureMetadata?.featureIdTextures[0];
|
|
84694
|
+
if (featureIdTexture) {
|
|
84695
|
+
const textureAttributeIndex = featureIdTexture?.featureIds?.texture?.texCoord || 0;
|
|
84696
|
+
const textCoordAttribute = `TEXCOORD_${textureAttributeIndex}`;
|
|
84697
|
+
const textureCoordinates = attributes[textCoordAttribute].value;
|
|
84698
|
+
return generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, images);
|
|
84699
|
+
}
|
|
84700
|
+
const featureTexture = extFeatureMetadata?.featureTextures && extFeatureMetadata?.featureTextures[0];
|
|
84701
|
+
if (featureTexture) {
|
|
84702
|
+
console.warn("EXT_feature_metadata doesn't yet support featureTextures in primitive");
|
|
84703
|
+
return [];
|
|
84704
|
+
}
|
|
84705
|
+
return [];
|
|
84706
|
+
}
|
|
84707
|
+
function generateImplicitFeatureIds(featuresCount, constant = 0, divisor = 0) {
|
|
84708
|
+
let featureIds = [];
|
|
84709
|
+
if (divisor > 0) {
|
|
84710
|
+
let currentValue = constant;
|
|
84711
|
+
let devisorCounter = divisor;
|
|
84712
|
+
for (let index = 0; index < featuresCount; index++) {
|
|
84713
|
+
featureIds.push(currentValue);
|
|
84714
|
+
devisorCounter -= 1;
|
|
84715
|
+
if (devisorCounter === 0) {
|
|
84716
|
+
currentValue++;
|
|
84717
|
+
devisorCounter = divisor;
|
|
84718
|
+
}
|
|
84719
|
+
}
|
|
84720
|
+
} else {
|
|
84721
|
+
featureIds = Array(featuresCount).fill(constant, 0, featuresCount);
|
|
84722
|
+
}
|
|
84723
|
+
return featureIds;
|
|
84724
|
+
}
|
|
84725
|
+
function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, images) {
|
|
84726
|
+
const CHANNELS_MAP = {
|
|
84727
|
+
r: 0,
|
|
84728
|
+
g: 1,
|
|
84729
|
+
b: 2,
|
|
84730
|
+
a: 3
|
|
84731
|
+
};
|
|
84732
|
+
const textureIndex = featureIdTexture?.featureIds?.texture?.index;
|
|
84733
|
+
const featureChannel = featureIdTexture?.featureIds?.channels;
|
|
84734
|
+
if (!featureChannel || textureIndex === void 0) {
|
|
84735
|
+
return [];
|
|
84736
|
+
}
|
|
84737
|
+
const image = images[textureIndex];
|
|
84738
|
+
const batchIds = [];
|
|
84739
|
+
const channels = CHANNELS_MAP[featureChannel];
|
|
84740
|
+
if (!image.compressed) {
|
|
84741
|
+
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
84742
|
+
const u = textureCoordinates[index];
|
|
84743
|
+
const v = textureCoordinates[index + 1];
|
|
84744
|
+
const tx = Math.min(emod(u) * image.width | 0, image.width - 1);
|
|
84745
|
+
const ty = Math.min(emod(v) * image.height | 0, image.height - 1);
|
|
84746
|
+
const offset = (ty * image.width + tx) * image.components + channels;
|
|
84747
|
+
const batchId = new Uint8Array(image.data)[offset];
|
|
84748
|
+
batchIds.push(batchId);
|
|
84749
|
+
}
|
|
84750
|
+
} else {
|
|
84751
|
+
console.warn(`Can't get batch Ids from ${image.mimeType} compressed texture`);
|
|
84752
|
+
}
|
|
84753
|
+
return batchIds;
|
|
84754
|
+
}
|
|
84755
|
+
function emod(n) {
|
|
84756
|
+
return (n % 1 + 1) % 1;
|
|
84757
|
+
}
|
|
84758
|
+
|
|
84759
|
+
// src/i3s-converter/helpers/feature-attributes.ts
|
|
84760
|
+
function flattenPropertyTableByFeatureIds(featureIds, propertyTable) {
|
|
84761
|
+
const resultPropertyTable = {};
|
|
84762
|
+
for (const propertyName in propertyTable) {
|
|
84763
|
+
const properties = propertyTable[propertyName];
|
|
84764
|
+
resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties, featureIds);
|
|
84765
|
+
}
|
|
84766
|
+
return resultPropertyTable;
|
|
84767
|
+
}
|
|
84768
|
+
function getPropertiesByFeatureIds(properties, featureIds) {
|
|
84769
|
+
const resultProperties = [];
|
|
84770
|
+
for (const featureId of featureIds) {
|
|
84771
|
+
const property = properties[featureId] || null;
|
|
84772
|
+
resultProperties.push(property);
|
|
84773
|
+
}
|
|
84774
|
+
return resultProperties;
|
|
84775
|
+
}
|
|
84776
|
+
function checkPropertiesLength(featureIds, propertyTable) {
|
|
84777
|
+
let needFlatten = false;
|
|
84778
|
+
for (const attribute of Object.values(propertyTable)) {
|
|
84779
|
+
if (featureIds.length !== attribute.length) {
|
|
84780
|
+
needFlatten = true;
|
|
84781
|
+
}
|
|
84782
|
+
}
|
|
84783
|
+
return needFlatten;
|
|
84784
|
+
}
|
|
84785
|
+
|
|
84353
84786
|
// src/i3s-converter/helpers/geometry-converter.ts
|
|
84354
84787
|
var DEFAULT_ROUGHNESS_FACTOR = 1;
|
|
84355
84788
|
var DEFAULT_METALLIC_FACTOR = 1;
|
|
@@ -84361,8 +84794,10 @@ var SHORT_INT_TYPE = "Int32";
|
|
|
84361
84794
|
var DOUBLE_TYPE = "Float64";
|
|
84362
84795
|
var OBJECT_ID_TYPE = "Oid32";
|
|
84363
84796
|
var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ["CUSTOM_ATTRIBUTE_2", "_BATCHID", "BATCHID"];
|
|
84364
|
-
var
|
|
84365
|
-
|
|
84797
|
+
var EXT_FEATURE_METADATA3 = "EXT_feature_metadata";
|
|
84798
|
+
var EXT_MESH_FEATURES2 = "EXT_mesh_features";
|
|
84799
|
+
var scratchVector5 = new import_core22.Vector3();
|
|
84800
|
+
async function convertB3dmToI3sGeometry(tileContent, nodeId, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, geoidHeightModel, workerSource) {
|
|
84366
84801
|
const useCartesianPositions = generateBoundingVolumes;
|
|
84367
84802
|
const materialAndTextureList = convertMaterials(tileContent.gltf?.materials);
|
|
84368
84803
|
const dataForAttributesConversion = prepareDataForAttributesConversion(tileContent);
|
|
@@ -84398,6 +84833,7 @@ async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray,
|
|
|
84398
84833
|
tileContent,
|
|
84399
84834
|
nodeId: nodesCounter,
|
|
84400
84835
|
featuresHashArray,
|
|
84836
|
+
propertyTable,
|
|
84401
84837
|
attributeStorageInfo,
|
|
84402
84838
|
draco,
|
|
84403
84839
|
workerSource
|
|
@@ -84416,10 +84852,10 @@ function _generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeigh
|
|
|
84416
84852
|
const cartographicOrigin = boundingVolumes.obb.center;
|
|
84417
84853
|
for (let index = 0; index < attributes.positions.length; index += VALUES_PER_VERTEX2) {
|
|
84418
84854
|
const vertex = attributes.positions.subarray(index, index + VALUES_PER_VERTEX2);
|
|
84419
|
-
import_geospatial9.Ellipsoid.WGS84.cartesianToCartographic(Array.from(vertex),
|
|
84420
|
-
|
|
84421
|
-
|
|
84422
|
-
attributes.positions.set(
|
|
84855
|
+
import_geospatial9.Ellipsoid.WGS84.cartesianToCartographic(Array.from(vertex), scratchVector5);
|
|
84856
|
+
scratchVector5[2] = scratchVector5[2] - geoidHeightModel.getHeight(scratchVector5[1], scratchVector5[0]);
|
|
84857
|
+
scratchVector5 = scratchVector5.subtract(cartographicOrigin);
|
|
84858
|
+
attributes.positions.set(scratchVector5, index);
|
|
84423
84859
|
}
|
|
84424
84860
|
}
|
|
84425
84861
|
}
|
|
@@ -84430,6 +84866,7 @@ async function _makeNodeResources({
|
|
|
84430
84866
|
tileContent,
|
|
84431
84867
|
nodeId,
|
|
84432
84868
|
featuresHashArray,
|
|
84869
|
+
propertyTable,
|
|
84433
84870
|
attributeStorageInfo,
|
|
84434
84871
|
draco,
|
|
84435
84872
|
workerSource
|
|
@@ -84452,7 +84889,10 @@ async function _makeNodeResources({
|
|
|
84452
84889
|
featureIds,
|
|
84453
84890
|
faceRange
|
|
84454
84891
|
}, workerSource.draco) : null;
|
|
84455
|
-
|
|
84892
|
+
let attributes = [];
|
|
84893
|
+
if (attributeStorageInfo && propertyTable) {
|
|
84894
|
+
attributes = convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo);
|
|
84895
|
+
}
|
|
84456
84896
|
return {
|
|
84457
84897
|
geometry: fileBuffer,
|
|
84458
84898
|
compressedGeometry,
|
|
@@ -84496,7 +84936,7 @@ async function convertAttributes(attributesData, useCartesianPositions) {
|
|
|
84496
84936
|
}
|
|
84497
84937
|
return attributesMap;
|
|
84498
84938
|
}
|
|
84499
|
-
function convertNodes(nodes, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new
|
|
84939
|
+
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])) {
|
|
84500
84940
|
if (nodes) {
|
|
84501
84941
|
for (const node2 of nodes) {
|
|
84502
84942
|
convertNode(node2, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix);
|
|
@@ -84520,15 +84960,16 @@ function getCompositeTransformationMatrix(node2, matrix) {
|
|
|
84520
84960
|
}
|
|
84521
84961
|
return transformationMatrix;
|
|
84522
84962
|
}
|
|
84523
|
-
function convertNode(node2, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new
|
|
84963
|
+
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])) {
|
|
84524
84964
|
const transformationMatrix = getCompositeTransformationMatrix(node2, matrix);
|
|
84525
84965
|
const mesh = node2.mesh;
|
|
84966
|
+
const images = node2.images;
|
|
84526
84967
|
if (mesh) {
|
|
84527
|
-
convertMesh(mesh, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
|
|
84968
|
+
convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
|
|
84528
84969
|
}
|
|
84529
84970
|
convertNodes(node2.children || [], cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
|
|
84530
84971
|
}
|
|
84531
|
-
function convertMesh(mesh, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions = false, matrix = new
|
|
84972
|
+
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])) {
|
|
84532
84973
|
for (const primitive of mesh.primitives) {
|
|
84533
84974
|
let outputAttributes = null;
|
|
84534
84975
|
if (primitive.material) {
|
|
@@ -84562,7 +85003,7 @@ function convertMesh(mesh, cartographicOrigin, cartesianModelMatrix, attributesM
|
|
|
84562
85003
|
outputAttributes.texCoords = concatenateTypedArrays(outputAttributes.texCoords, flattenTexCoords(attributes.TEXCOORD_0 && attributes.TEXCOORD_0.value, primitive.indices?.value));
|
|
84563
85004
|
outputAttributes.colors = concatenateTypedArrays(outputAttributes.colors, flattenColors(attributes.COLOR_0, primitive.indices?.value));
|
|
84564
85005
|
outputAttributes.featureIndicesGroups = outputAttributes.featureIndicesGroups || [];
|
|
84565
|
-
outputAttributes.featureIndicesGroups.push(flattenBatchIds(
|
|
85006
|
+
outputAttributes.featureIndicesGroups.push(flattenBatchIds(getBatchIds(attributes, primitive, images), primitive.indices?.value));
|
|
84566
85007
|
}
|
|
84567
85008
|
}
|
|
84568
85009
|
function transformVertexArray(args) {
|
|
@@ -84574,7 +85015,7 @@ function transformVertexArray(args) {
|
|
|
84574
85015
|
for (let i = 0; i < indices.length; i++) {
|
|
84575
85016
|
const coordIndex = indices[i] * VALUES_PER_VERTEX2;
|
|
84576
85017
|
const vertex = vertices.subarray(coordIndex, coordIndex + VALUES_PER_VERTEX2);
|
|
84577
|
-
let vertexVector = new
|
|
85018
|
+
let vertexVector = new import_core22.Vector3(Array.from(vertex));
|
|
84578
85019
|
vertexVector = attributeSpecificTransformation(vertexVector, args);
|
|
84579
85020
|
newVertices[i * VALUES_PER_VERTEX2] = vertexVector.x;
|
|
84580
85021
|
newVertices[i * VALUES_PER_VERTEX2 + 1] = vertexVector.y;
|
|
@@ -84647,16 +85088,18 @@ function flattenBatchIds(batchedIds, indices) {
|
|
|
84647
85088
|
}
|
|
84648
85089
|
return newBatchIds;
|
|
84649
85090
|
}
|
|
84650
|
-
function
|
|
84651
|
-
|
|
85091
|
+
function getBatchIds(attributes, primitive, images) {
|
|
85092
|
+
const batchIds = handleBatchIdsExtensions(attributes, primitive, images);
|
|
85093
|
+
if (batchIds.length) {
|
|
85094
|
+
return batchIds;
|
|
85095
|
+
}
|
|
84652
85096
|
for (let index = 0; index < BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES.length; index++) {
|
|
84653
85097
|
const possibleBatchIdAttributeName = BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES[index];
|
|
84654
85098
|
if (attributes[possibleBatchIdAttributeName] && attributes[possibleBatchIdAttributeName].value) {
|
|
84655
|
-
|
|
84656
|
-
break;
|
|
85099
|
+
return attributes[possibleBatchIdAttributeName].value;
|
|
84657
85100
|
}
|
|
84658
85101
|
}
|
|
84659
|
-
return
|
|
85102
|
+
return [];
|
|
84660
85103
|
}
|
|
84661
85104
|
function convertMaterials(sourceMaterials = []) {
|
|
84662
85105
|
const result = [];
|
|
@@ -84749,10 +85192,10 @@ function convertGLTFMaterialToI3sSharedResources(gltfMaterial, nodeId) {
|
|
|
84749
85192
|
}
|
|
84750
85193
|
function extractSharedResourcesMaterialInfo(baseColorFactor, metallicFactor = 1) {
|
|
84751
85194
|
const matDielectricColorComponent = 0.04 / 255;
|
|
84752
|
-
const black = new
|
|
84753
|
-
const unitVector = new
|
|
84754
|
-
const dielectricSpecular = new
|
|
84755
|
-
const baseColorVector = new
|
|
85195
|
+
const black = new import_core22.Vector4(0, 0, 0, 1);
|
|
85196
|
+
const unitVector = new import_core22.Vector4(1, 1, 1, 1);
|
|
85197
|
+
const dielectricSpecular = new import_core22.Vector4(matDielectricColorComponent, matDielectricColorComponent, matDielectricColorComponent, 0);
|
|
85198
|
+
const baseColorVector = new import_core22.Vector4(baseColorFactor);
|
|
84756
85199
|
const firstOperand = unitVector.subtract(dielectricSpecular).multiply(baseColorVector);
|
|
84757
85200
|
const diffuse = firstOperand.lerp(firstOperand, black, metallicFactor);
|
|
84758
85201
|
dielectricSpecular[3] = 1;
|
|
@@ -84826,37 +85269,40 @@ function replaceIndicesByUnique(indicesArray, featureMap) {
|
|
|
84826
85269
|
indicesArray[index] = featureMap[indicesArray[index]];
|
|
84827
85270
|
}
|
|
84828
85271
|
}
|
|
84829
|
-
function
|
|
85272
|
+
function convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo) {
|
|
84830
85273
|
const attributeBuffers = [];
|
|
84831
|
-
|
|
84832
|
-
|
|
84833
|
-
|
|
84834
|
-
|
|
84835
|
-
|
|
84836
|
-
|
|
84837
|
-
|
|
84838
|
-
|
|
84839
|
-
|
|
84840
|
-
|
|
84841
|
-
|
|
84842
|
-
attributeBuffer = generateShortIntegerAttributeBuffer(batchTableWithFeatureIds[key]);
|
|
84843
|
-
break;
|
|
84844
|
-
case DOUBLE_TYPE:
|
|
84845
|
-
attributeBuffer = generateDoubleAttributeBuffer(batchTableWithFeatureIds[key]);
|
|
84846
|
-
break;
|
|
84847
|
-
case STRING_TYPE:
|
|
84848
|
-
attributeBuffer = generateStringAttributeBuffer(batchTableWithFeatureIds[key]);
|
|
84849
|
-
break;
|
|
84850
|
-
default:
|
|
84851
|
-
attributeBuffer = generateStringAttributeBuffer(batchTableWithFeatureIds[key]);
|
|
84852
|
-
}
|
|
84853
|
-
if (attributeBuffer) {
|
|
84854
|
-
attributeBuffers.push(attributeBuffer);
|
|
84855
|
-
}
|
|
84856
|
-
}
|
|
85274
|
+
const needFlattenPropertyTable = checkPropertiesLength(featureIds, propertyTable);
|
|
85275
|
+
const properties = needFlattenPropertyTable ? flattenPropertyTableByFeatureIds(featureIds, propertyTable) : propertyTable;
|
|
85276
|
+
const propertyTableWithObjectIds = {
|
|
85277
|
+
OBJECTID: featureIds,
|
|
85278
|
+
...properties
|
|
85279
|
+
};
|
|
85280
|
+
for (const propertyName in propertyTableWithObjectIds) {
|
|
85281
|
+
const type = getAttributeType(propertyName, attributeStorageInfo);
|
|
85282
|
+
const value = propertyTableWithObjectIds[propertyName];
|
|
85283
|
+
const attributeBuffer = generateAttributeBuffer(type, value);
|
|
85284
|
+
attributeBuffers.push(attributeBuffer);
|
|
84857
85285
|
}
|
|
84858
85286
|
return attributeBuffers;
|
|
84859
85287
|
}
|
|
85288
|
+
function generateAttributeBuffer(type, value) {
|
|
85289
|
+
let attributeBuffer;
|
|
85290
|
+
switch (type) {
|
|
85291
|
+
case OBJECT_ID_TYPE:
|
|
85292
|
+
case SHORT_INT_TYPE:
|
|
85293
|
+
attributeBuffer = generateShortIntegerAttributeBuffer(value);
|
|
85294
|
+
break;
|
|
85295
|
+
case DOUBLE_TYPE:
|
|
85296
|
+
attributeBuffer = generateDoubleAttributeBuffer(value);
|
|
85297
|
+
break;
|
|
85298
|
+
case STRING_TYPE:
|
|
85299
|
+
attributeBuffer = generateStringAttributeBuffer(value);
|
|
85300
|
+
break;
|
|
85301
|
+
default:
|
|
85302
|
+
attributeBuffer = generateStringAttributeBuffer(value);
|
|
85303
|
+
}
|
|
85304
|
+
return attributeBuffer;
|
|
85305
|
+
}
|
|
84860
85306
|
function getAttributeType(key, attributeStorageInfo) {
|
|
84861
85307
|
const attribute = attributeStorageInfo.find((attr) => attr.name === key);
|
|
84862
85308
|
return attribute.attributeValues.valueType;
|
|
@@ -84941,6 +85387,59 @@ function generateFeatureIndexAttribute(featureIndex, faceRange) {
|
|
|
84941
85387
|
}
|
|
84942
85388
|
return orderedFeatureIndices;
|
|
84943
85389
|
}
|
|
85390
|
+
function getPropertyTable(sourceTile) {
|
|
85391
|
+
const batchTableJson = sourceTile?.content?.batchTableJson;
|
|
85392
|
+
if (batchTableJson) {
|
|
85393
|
+
return batchTableJson;
|
|
85394
|
+
}
|
|
85395
|
+
const { extensionName, extension } = getPropertyTableExtension(sourceTile);
|
|
85396
|
+
switch (extensionName) {
|
|
85397
|
+
case EXT_MESH_FEATURES2: {
|
|
85398
|
+
console.warn("The I3S converter does not yet support the EXT_mesh_features extension");
|
|
85399
|
+
return null;
|
|
85400
|
+
}
|
|
85401
|
+
case EXT_FEATURE_METADATA3: {
|
|
85402
|
+
return getPropertyTableFromExtFeatureMetadata(extension);
|
|
85403
|
+
}
|
|
85404
|
+
default:
|
|
85405
|
+
return null;
|
|
85406
|
+
}
|
|
85407
|
+
}
|
|
85408
|
+
function getPropertyTableExtension(sourceTile) {
|
|
85409
|
+
const extensionsWithPropertyTables = [EXT_FEATURE_METADATA3, EXT_MESH_FEATURES2];
|
|
85410
|
+
const extensionsUsed = sourceTile?.content?.gltf?.extensionsUsed;
|
|
85411
|
+
if (!extensionsUsed) {
|
|
85412
|
+
return { extensionName: null, extension: null };
|
|
85413
|
+
}
|
|
85414
|
+
let extensionName = "";
|
|
85415
|
+
for (const extensionItem of sourceTile?.content?.gltf?.extensionsUsed) {
|
|
85416
|
+
if (extensionsWithPropertyTables.includes(extensionItem)) {
|
|
85417
|
+
extensionName = extensionItem;
|
|
85418
|
+
break;
|
|
85419
|
+
}
|
|
85420
|
+
}
|
|
85421
|
+
const extension = sourceTile?.content?.gltf?.extensions?.[extensionName];
|
|
85422
|
+
return { extensionName, extension };
|
|
85423
|
+
}
|
|
85424
|
+
function getPropertyTableFromExtFeatureMetadata(extension) {
|
|
85425
|
+
if (extension?.featureTextures) {
|
|
85426
|
+
console.warn("The I3S converter does not yet support the EXT_feature_metadata feature textures");
|
|
85427
|
+
return null;
|
|
85428
|
+
}
|
|
85429
|
+
if (extension?.featureTables) {
|
|
85430
|
+
const firstFeatureTableName = Object.keys(extension.featureTables)?.[0];
|
|
85431
|
+
if (firstFeatureTableName) {
|
|
85432
|
+
const featureTable = extension?.featureTables[firstFeatureTableName];
|
|
85433
|
+
const propertyTable = {};
|
|
85434
|
+
for (const propertyName in featureTable.properties) {
|
|
85435
|
+
propertyTable[propertyName] = featureTable.properties[propertyName].data;
|
|
85436
|
+
}
|
|
85437
|
+
return propertyTable;
|
|
85438
|
+
}
|
|
85439
|
+
}
|
|
85440
|
+
console.warn("The I3S converter couldn't handle EXT_feature_metadata extension");
|
|
85441
|
+
return null;
|
|
85442
|
+
}
|
|
84944
85443
|
|
|
84945
85444
|
// src/i3s-converter/helpers/create-scene-server-path.ts
|
|
84946
85445
|
var import_json_map_transform2 = __toModule(require_json_map_transform());
|
|
@@ -85569,7 +86068,7 @@ function transfromTextureDefinitions(textureDefinitionInfos, thisObject, origina
|
|
|
85569
86068
|
// src/i3s-converter/helpers/node-debug.ts
|
|
85570
86069
|
var import_culling6 = __toModule(require_es58());
|
|
85571
86070
|
var import_engine = __toModule(require_es515());
|
|
85572
|
-
var
|
|
86071
|
+
var import_core24 = __toModule(require_es56());
|
|
85573
86072
|
var import_geospatial10 = __toModule(require_es57());
|
|
85574
86073
|
function validateNodeBoundingVolumes(node2) {
|
|
85575
86074
|
if (!node2?.parentNode?.obb || !node2?.parentNode?.mbs) {
|
|
@@ -85614,7 +86113,7 @@ function getTileObbVertices(node2) {
|
|
|
85614
86113
|
const obbCenterCartesian = import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(node2.obb.center);
|
|
85615
86114
|
let vertices = [];
|
|
85616
86115
|
for (let i = 0; i < positions.length; i += 3) {
|
|
85617
|
-
const positionsVector = new
|
|
86116
|
+
const positionsVector = new import_core24.Vector3(positions[i] *= halfSize[0], positions[i + 1] *= halfSize[1], positions[i + 2] *= halfSize[2]);
|
|
85618
86117
|
const rotatedPositions = positionsVector.transformByQuaternion(node2.obb.quaternion).add(obbCenterCartesian);
|
|
85619
86118
|
vertices = vertices.concat(rotatedPositions);
|
|
85620
86119
|
}
|
|
@@ -85702,7 +86201,7 @@ var WriteQueue = class extends Queue {
|
|
|
85702
86201
|
archiveKeys.push(archiveKey);
|
|
85703
86202
|
promises.push(writePromise);
|
|
85704
86203
|
}
|
|
85705
|
-
const writeResults = await Promise.
|
|
86204
|
+
const writeResults = await Promise.allSettled(promises);
|
|
85706
86205
|
this.updateFileMap(archiveKeys, writeResults);
|
|
85707
86206
|
}
|
|
85708
86207
|
this.writePromise = null;
|
|
@@ -85710,10 +86209,9 @@ var WriteQueue = class extends Queue {
|
|
|
85710
86209
|
updateFileMap(archiveKeys, writeResults) {
|
|
85711
86210
|
for (let i = 0; i < archiveKeys.length; i++) {
|
|
85712
86211
|
const archiveKey = archiveKeys[i];
|
|
85713
|
-
if (
|
|
85714
|
-
|
|
86212
|
+
if (archiveKey && "value" in writeResults[i]) {
|
|
86213
|
+
this.fileMap[archiveKey] = writeResults[i].value;
|
|
85715
86214
|
}
|
|
85716
|
-
this.fileMap[archiveKey] = writeResults[i];
|
|
85717
86215
|
}
|
|
85718
86216
|
}
|
|
85719
86217
|
};
|
|
@@ -86026,11 +86524,11 @@ var I3SConverter = class {
|
|
|
86026
86524
|
await this._updateTilesetOptions();
|
|
86027
86525
|
await this.sourceTileset._loadTile(sourceTile);
|
|
86028
86526
|
let boundingVolumes = createBoundingVolumes(sourceTile, this.geoidHeightModel);
|
|
86029
|
-
const
|
|
86030
|
-
if (
|
|
86031
|
-
this.
|
|
86527
|
+
const propertyTable = getPropertyTable(sourceTile);
|
|
86528
|
+
if (propertyTable && !this.layers0?.attributeStorageInfo?.length) {
|
|
86529
|
+
this._convertPropertyTableToNodeAttributes(propertyTable);
|
|
86032
86530
|
}
|
|
86033
|
-
const resourcesData = await this._convertResources(sourceTile);
|
|
86531
|
+
const resourcesData = await this._convertResources(sourceTile, propertyTable);
|
|
86034
86532
|
const nodes = [];
|
|
86035
86533
|
const nodesInPage = [];
|
|
86036
86534
|
const emptyResources = {
|
|
@@ -86074,17 +86572,11 @@ var I3SConverter = class {
|
|
|
86074
86572
|
});
|
|
86075
86573
|
return nodes;
|
|
86076
86574
|
}
|
|
86077
|
-
|
|
86078
|
-
const batchTable = sourceTileContent && sourceTileContent.batchTableJson;
|
|
86079
|
-
if (batchTable && !this.layers0?.attributeStorageInfo?.length) {
|
|
86080
|
-
this._convertBatchTableInfoToNodeAttributes(batchTable);
|
|
86081
|
-
}
|
|
86082
|
-
}
|
|
86083
|
-
async _convertResources(sourceTile) {
|
|
86575
|
+
async _convertResources(sourceTile, propertyTable) {
|
|
86084
86576
|
if (!this.isContentSupported(sourceTile)) {
|
|
86085
86577
|
return null;
|
|
86086
86578
|
}
|
|
86087
|
-
const resourcesData = await convertB3dmToI3sGeometry(sourceTile.content, Number(this.nodePages.nodesCounter), this.featuresHashArray, this.layers0?.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.geoidHeightModel, this.workerSource);
|
|
86579
|
+
const resourcesData = await convertB3dmToI3sGeometry(sourceTile.content, Number(this.nodePages.nodesCounter), propertyTable, this.featuresHashArray, this.layers0?.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.geoidHeightModel, this.workerSource);
|
|
86088
86580
|
return resourcesData;
|
|
86089
86581
|
}
|
|
86090
86582
|
_createNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentId, resources) {
|
|
@@ -86236,7 +86728,9 @@ var I3SConverter = class {
|
|
|
86236
86728
|
await this.writeTextureFile(textureData, "0", format, childPath, slpkChildPath);
|
|
86237
86729
|
if (this.generateTextures) {
|
|
86238
86730
|
formats2.push({ name: "1", format: "ktx2" });
|
|
86239
|
-
const
|
|
86731
|
+
const copyArrayBuffer2 = texture.image.data.subarray();
|
|
86732
|
+
const arrayToEncode = new Uint8Array(copyArrayBuffer2);
|
|
86733
|
+
const ktx2TextureData = encode({ ...texture.image, data: arrayToEncode }, KTX2BasisWriterWorker, {
|
|
86240
86734
|
...KTX2BasisWriterWorker.options,
|
|
86241
86735
|
source: this.workerSource.ktx2,
|
|
86242
86736
|
reuseWorkers: true,
|
|
@@ -86261,16 +86755,16 @@ var I3SConverter = class {
|
|
|
86261
86755
|
}
|
|
86262
86756
|
}
|
|
86263
86757
|
}
|
|
86264
|
-
async writeTextureFile(textureData,
|
|
86758
|
+
async writeTextureFile(textureData, name10, format, childPath, slpkChildPath) {
|
|
86265
86759
|
if (this.options.slpk) {
|
|
86266
86760
|
const slpkTexturePath = (0, import_path7.join)(childPath, "textures");
|
|
86267
86761
|
const compress = false;
|
|
86268
86762
|
await this.writeQueue.enqueue({
|
|
86269
|
-
archiveKey: `${slpkChildPath}/textures/${
|
|
86270
|
-
writePromise: writeFileForSlpk(slpkTexturePath, textureData, `${
|
|
86763
|
+
archiveKey: `${slpkChildPath}/textures/${name10}.${format}`,
|
|
86764
|
+
writePromise: writeFileForSlpk(slpkTexturePath, textureData, `${name10}.${format}`, compress)
|
|
86271
86765
|
});
|
|
86272
86766
|
} else {
|
|
86273
|
-
const texturePath = (0, import_path7.join)(childPath, `textures/${
|
|
86767
|
+
const texturePath = (0, import_path7.join)(childPath, `textures/${name10}/`);
|
|
86274
86768
|
await this.writeQueue.enqueue({
|
|
86275
86769
|
writePromise: writeFile3(texturePath, textureData, `index.${format}`)
|
|
86276
86770
|
});
|
|
@@ -86385,19 +86879,19 @@ var I3SConverter = class {
|
|
|
86385
86879
|
alias: key
|
|
86386
86880
|
};
|
|
86387
86881
|
}
|
|
86388
|
-
|
|
86882
|
+
_convertPropertyTableToNodeAttributes(propertyTable) {
|
|
86389
86883
|
let attributeIndex = 0;
|
|
86390
|
-
const
|
|
86884
|
+
const propertyTableWithObjectId = {
|
|
86391
86885
|
OBJECTID: [0],
|
|
86392
|
-
...
|
|
86886
|
+
...propertyTable
|
|
86393
86887
|
};
|
|
86394
|
-
for (const key in
|
|
86395
|
-
const firstAttribute =
|
|
86888
|
+
for (const key in propertyTableWithObjectId) {
|
|
86889
|
+
const firstAttribute = propertyTableWithObjectId[key][0];
|
|
86396
86890
|
const attributeType = this.getAttributeType(key, firstAttribute);
|
|
86397
86891
|
const storageAttribute = this._createdStorageAttribute(attributeIndex, key, attributeType);
|
|
86398
86892
|
const fieldAttributeType = this._getFieldAttributeType(attributeType);
|
|
86399
86893
|
const fieldAttribute = this._createFieldAttribute(key, fieldAttributeType);
|
|
86400
|
-
const popupInfo = this._createPopupInfo(
|
|
86894
|
+
const popupInfo = this._createPopupInfo(propertyTableWithObjectId);
|
|
86401
86895
|
this.layers0.attributeStorageInfo.push(storageAttribute);
|
|
86402
86896
|
this.layers0.fields.push(fieldAttribute);
|
|
86403
86897
|
this.layers0.popupInfo = popupInfo;
|
|
@@ -86419,13 +86913,13 @@ var I3SConverter = class {
|
|
|
86419
86913
|
return "esriFieldTypeString";
|
|
86420
86914
|
}
|
|
86421
86915
|
}
|
|
86422
|
-
_createPopupInfo(
|
|
86916
|
+
_createPopupInfo(propertyTable) {
|
|
86423
86917
|
const title = "{OBJECTID}";
|
|
86424
86918
|
const mediaInfos = [];
|
|
86425
86919
|
const fieldInfos = [];
|
|
86426
86920
|
const popupElements = [];
|
|
86427
86921
|
const expressionInfos = [];
|
|
86428
|
-
for (const key in
|
|
86922
|
+
for (const key in propertyTable) {
|
|
86429
86923
|
fieldInfos.push({
|
|
86430
86924
|
fieldName: key,
|
|
86431
86925
|
visible: true,
|
|
@@ -86525,7 +87019,7 @@ var import_process3 = __toModule(require("process"));
|
|
|
86525
87019
|
var import_json_map_transform8 = __toModule(require_json_map_transform());
|
|
86526
87020
|
|
|
86527
87021
|
// ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
|
|
86528
|
-
var
|
|
87022
|
+
var import_core27 = __toModule(require_es56());
|
|
86529
87023
|
var import_geospatial11 = __toModule(require_es57());
|
|
86530
87024
|
|
|
86531
87025
|
// ../i3s/src/types.ts
|
|
@@ -86628,7 +87122,7 @@ var COORDINATE_SYSTEM;
|
|
|
86628
87122
|
})(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
|
|
86629
87123
|
|
|
86630
87124
|
// ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
|
|
86631
|
-
var
|
|
87125
|
+
var scratchVector6 = new import_core27.Vector3([0, 0, 0]);
|
|
86632
87126
|
function getLoaderForTextureFormat(textureFormat) {
|
|
86633
87127
|
switch (textureFormat) {
|
|
86634
87128
|
case "ktx-etc2":
|
|
@@ -86643,29 +87137,37 @@ function getLoaderForTextureFormat(textureFormat) {
|
|
|
86643
87137
|
}
|
|
86644
87138
|
}
|
|
86645
87139
|
var I3S_ATTRIBUTE_TYPE = "i3s-attribute-type";
|
|
86646
|
-
|
|
86647
|
-
|
|
86648
|
-
|
|
86649
|
-
|
|
86650
|
-
|
|
86651
|
-
|
|
86652
|
-
|
|
87140
|
+
var defaultContent = {
|
|
87141
|
+
attributes: {},
|
|
87142
|
+
indices: null,
|
|
87143
|
+
featureIds: [],
|
|
87144
|
+
vertexCount: 0,
|
|
87145
|
+
modelMatrix: new import_core27.Matrix4(),
|
|
87146
|
+
coordinateSystem: 0,
|
|
87147
|
+
byteLength: 0,
|
|
87148
|
+
texture: null
|
|
87149
|
+
};
|
|
87150
|
+
async function parseI3STileContent(arrayBuffer, tileOptions, tilesetOptions, options, context) {
|
|
87151
|
+
const content = defaultContent;
|
|
87152
|
+
if (tileOptions.textureUrl) {
|
|
87153
|
+
const url = getUrlWithToken(tileOptions.textureUrl, options?.i3s?.token);
|
|
87154
|
+
const loader = getLoaderForTextureFormat(tileOptions.textureFormat);
|
|
86653
87155
|
const response = await fetch(url, options?.fetch);
|
|
86654
87156
|
const arrayBuffer2 = await response.arrayBuffer();
|
|
86655
87157
|
if (options?.i3s.decodeTextures) {
|
|
86656
87158
|
if (loader === ImageLoader) {
|
|
86657
|
-
const options2 = { ...
|
|
87159
|
+
const options2 = { ...tileOptions.textureLoaderOptions, image: { type: "data" } };
|
|
86658
87160
|
try {
|
|
86659
|
-
|
|
87161
|
+
content.texture = await context.parse(arrayBuffer2, options2);
|
|
86660
87162
|
} catch (e) {
|
|
86661
|
-
|
|
87163
|
+
content.texture = await parse(arrayBuffer2, loader, options2);
|
|
86662
87164
|
}
|
|
86663
87165
|
} else if (loader === CompressedTextureLoader || loader === BasisLoader) {
|
|
86664
|
-
let texture = await load(arrayBuffer2, loader,
|
|
87166
|
+
let texture = await load(arrayBuffer2, loader, tileOptions.textureLoaderOptions);
|
|
86665
87167
|
if (loader === BasisLoader) {
|
|
86666
87168
|
texture = texture[0];
|
|
86667
87169
|
}
|
|
86668
|
-
|
|
87170
|
+
content.texture = {
|
|
86669
87171
|
compressed: true,
|
|
86670
87172
|
mipmaps: false,
|
|
86671
87173
|
width: texture[0].width,
|
|
@@ -86674,27 +87176,23 @@ async function parseI3STileContent(arrayBuffer, tile, tileset, options, context)
|
|
|
86674
87176
|
};
|
|
86675
87177
|
}
|
|
86676
87178
|
} else {
|
|
86677
|
-
|
|
87179
|
+
content.texture = arrayBuffer2;
|
|
86678
87180
|
}
|
|
86679
87181
|
}
|
|
86680
|
-
|
|
86681
|
-
if (
|
|
86682
|
-
|
|
87182
|
+
content.material = makePbrMaterial(tileOptions.materialDefinition, content.texture);
|
|
87183
|
+
if (content.material) {
|
|
87184
|
+
content.texture = null;
|
|
86683
87185
|
}
|
|
86684
|
-
return await parseI3SNodeGeometry(arrayBuffer,
|
|
87186
|
+
return await parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options);
|
|
86685
87187
|
}
|
|
86686
|
-
async function parseI3SNodeGeometry(arrayBuffer,
|
|
86687
|
-
if (!tile.content) {
|
|
86688
|
-
return tile;
|
|
86689
|
-
}
|
|
86690
|
-
const content = tile.content;
|
|
87188
|
+
async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options) {
|
|
86691
87189
|
const contentByteLength = arrayBuffer.byteLength;
|
|
86692
87190
|
let attributes;
|
|
86693
87191
|
let vertexCount;
|
|
86694
87192
|
let byteOffset = 0;
|
|
86695
87193
|
let featureCount = 0;
|
|
86696
87194
|
let indices;
|
|
86697
|
-
if (
|
|
87195
|
+
if (tileOptions.isDracoGeometry) {
|
|
86698
87196
|
const decompressedGeometry = await parse(arrayBuffer, DracoLoader2, {
|
|
86699
87197
|
draco: {
|
|
86700
87198
|
attributeNameEntry: I3S_ATTRIBUTE_TYPE
|
|
@@ -86729,8 +87227,8 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
|
|
|
86729
87227
|
ordering: attributesOrder,
|
|
86730
87228
|
featureAttributes,
|
|
86731
87229
|
featureAttributeOrder
|
|
86732
|
-
} =
|
|
86733
|
-
const headers = parseHeaders(
|
|
87230
|
+
} = tilesetOptions.store.defaultGeometrySchema;
|
|
87231
|
+
const headers = parseHeaders(arrayBuffer, tilesetOptions);
|
|
86734
87232
|
byteOffset = headers.byteOffset;
|
|
86735
87233
|
vertexCount = headers.vertexCount;
|
|
86736
87234
|
featureCount = headers.featureCount;
|
|
@@ -86740,7 +87238,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
|
|
|
86740
87238
|
attributes = concatAttributes(normalizedVertexAttributes, normalizedFeatureAttributes);
|
|
86741
87239
|
}
|
|
86742
87240
|
if (!options?.i3s?.coordinateSystem || options.i3s.coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS) {
|
|
86743
|
-
const enuMatrix = parsePositions2(attributes.position,
|
|
87241
|
+
const enuMatrix = parsePositions2(attributes.position, tileOptions);
|
|
86744
87242
|
content.modelMatrix = enuMatrix.invert();
|
|
86745
87243
|
content.coordinateSystem = COORDINATE_SYSTEM.METER_OFFSETS;
|
|
86746
87244
|
} else {
|
|
@@ -86756,7 +87254,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
|
|
|
86756
87254
|
};
|
|
86757
87255
|
content.indices = indices || null;
|
|
86758
87256
|
if (attributes.id && attributes.id.value) {
|
|
86759
|
-
|
|
87257
|
+
content.featureIds = attributes.id.value;
|
|
86760
87258
|
}
|
|
86761
87259
|
for (const attributeIndex in content.attributes) {
|
|
86762
87260
|
if (!content.attributes[attributeIndex]) {
|
|
@@ -86765,7 +87263,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
|
|
|
86765
87263
|
}
|
|
86766
87264
|
content.vertexCount = vertexCount;
|
|
86767
87265
|
content.byteLength = contentByteLength;
|
|
86768
|
-
return
|
|
87266
|
+
return content;
|
|
86769
87267
|
}
|
|
86770
87268
|
function updateAttributesMetadata(attributes, decompressedGeometry) {
|
|
86771
87269
|
for (const key in decompressedGeometry.loaderData.attributes) {
|
|
@@ -86792,11 +87290,11 @@ function normalizeAttribute(attribute) {
|
|
|
86792
87290
|
attribute.normalized = true;
|
|
86793
87291
|
return attribute;
|
|
86794
87292
|
}
|
|
86795
|
-
function parseHeaders(
|
|
87293
|
+
function parseHeaders(arrayBuffer, options) {
|
|
86796
87294
|
let byteOffset = 0;
|
|
86797
87295
|
let vertexCount = 0;
|
|
86798
87296
|
let featureCount = 0;
|
|
86799
|
-
for (const { property, type } of
|
|
87297
|
+
for (const { property, type } of options.store.defaultGeometrySchema.header) {
|
|
86800
87298
|
const TypedArrayTypeHeader = getConstructorForDataFormat(type);
|
|
86801
87299
|
switch (property) {
|
|
86802
87300
|
case HeaderAttributeProperty.vertexCount:
|
|
@@ -86866,13 +87364,13 @@ function parseUint64Values(buffer, elementsCount, attributeSize) {
|
|
|
86866
87364
|
}
|
|
86867
87365
|
return new Uint32Array(values);
|
|
86868
87366
|
}
|
|
86869
|
-
function parsePositions2(attribute,
|
|
86870
|
-
const mbs =
|
|
87367
|
+
function parsePositions2(attribute, options) {
|
|
87368
|
+
const mbs = options.mbs;
|
|
86871
87369
|
const value = attribute.value;
|
|
86872
87370
|
const metadata = attribute.metadata;
|
|
86873
|
-
const enuMatrix = new
|
|
86874
|
-
const cartographicOrigin = new
|
|
86875
|
-
const cartesianOrigin = new
|
|
87371
|
+
const enuMatrix = new import_core27.Matrix4();
|
|
87372
|
+
const cartographicOrigin = new import_core27.Vector3(mbs[0], mbs[1], mbs[2]);
|
|
87373
|
+
const cartesianOrigin = new import_core27.Vector3();
|
|
86876
87374
|
import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(cartographicOrigin, cartesianOrigin);
|
|
86877
87375
|
import_geospatial11.Ellipsoid.WGS84.eastNorthUpToFixedFrame(cartesianOrigin, enuMatrix);
|
|
86878
87376
|
attribute.value = offsetsToCartesians(value, metadata, cartographicOrigin);
|
|
@@ -86888,10 +87386,10 @@ function offsetsToCartesians(vertices, metadata = {}, cartographicOrigin) {
|
|
|
86888
87386
|
positions[i + 2] = vertices[i + 2] + cartographicOrigin.z;
|
|
86889
87387
|
}
|
|
86890
87388
|
for (let i = 0; i < positions.length; i += 3) {
|
|
86891
|
-
import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3),
|
|
86892
|
-
positions[i] =
|
|
86893
|
-
positions[i + 1] =
|
|
86894
|
-
positions[i + 2] =
|
|
87389
|
+
import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3), scratchVector6);
|
|
87390
|
+
positions[i] = scratchVector6.x;
|
|
87391
|
+
positions[i + 1] = scratchVector6.y;
|
|
87392
|
+
positions[i + 2] = scratchVector6.z;
|
|
86895
87393
|
}
|
|
86896
87394
|
return positions;
|
|
86897
87395
|
}
|
|
@@ -86899,7 +87397,7 @@ function getModelMatrix(positions) {
|
|
|
86899
87397
|
const metadata = positions.metadata;
|
|
86900
87398
|
const scaleX = metadata?.["i3s-scale_x"]?.double || 1;
|
|
86901
87399
|
const scaleY = metadata?.["i3s-scale_y"]?.double || 1;
|
|
86902
|
-
const modelMatrix = new
|
|
87400
|
+
const modelMatrix = new import_core27.Matrix4();
|
|
86903
87401
|
modelMatrix[0] = scaleX;
|
|
86904
87402
|
modelMatrix[5] = scaleY;
|
|
86905
87403
|
return modelMatrix;
|
|
@@ -86999,7 +87497,7 @@ function getFeatureIdsFromFeatureIndexMetadata(featureIndex) {
|
|
|
86999
87497
|
}
|
|
87000
87498
|
|
|
87001
87499
|
// ../i3s/src/i3s-content-loader.ts
|
|
87002
|
-
var VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "
|
|
87500
|
+
var VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
87003
87501
|
var I3SContentLoader = {
|
|
87004
87502
|
name: "I3S Content (Indexed Scene Layers)",
|
|
87005
87503
|
id: "i3s-content",
|
|
@@ -87014,9 +87512,13 @@ var I3SContentLoader = {
|
|
|
87014
87512
|
}
|
|
87015
87513
|
};
|
|
87016
87514
|
async function parse6(data, options, context) {
|
|
87017
|
-
const { tile, tileset } = options?.i3s || {};
|
|
87018
|
-
|
|
87019
|
-
|
|
87515
|
+
const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
|
|
87516
|
+
const tileOptions = _tileOptions || tile;
|
|
87517
|
+
const tilesetOptions = _tilesetOptions || tileset;
|
|
87518
|
+
if (!tileOptions || !tilesetOptions) {
|
|
87519
|
+
return null;
|
|
87520
|
+
}
|
|
87521
|
+
return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
|
|
87020
87522
|
}
|
|
87021
87523
|
|
|
87022
87524
|
// ../i3s/src/lib/parsers/parse-i3s.ts
|
|
@@ -87214,7 +87716,7 @@ var I3SNodePagesTiles = class {
|
|
|
87214
87716
|
};
|
|
87215
87717
|
|
|
87216
87718
|
// ../i3s/src/lib/parsers/parse-i3s.ts
|
|
87217
|
-
function normalizeTileData2(tile,
|
|
87719
|
+
function normalizeTileData2(tile, context) {
|
|
87218
87720
|
const url = context.url || "";
|
|
87219
87721
|
let contentUrl;
|
|
87220
87722
|
if (tile.geometryData) {
|
|
@@ -87302,12 +87804,13 @@ var I3SLoader = {
|
|
|
87302
87804
|
extensions: ["bin"],
|
|
87303
87805
|
options: {
|
|
87304
87806
|
i3s: {
|
|
87305
|
-
loadContent: true,
|
|
87306
87807
|
token: null,
|
|
87307
87808
|
isTileset: "auto",
|
|
87308
87809
|
isTileHeader: "auto",
|
|
87309
87810
|
tile: null,
|
|
87310
87811
|
tileset: null,
|
|
87812
|
+
_tileOptions: null,
|
|
87813
|
+
_tilesetOptions: null,
|
|
87311
87814
|
useDracoGeometry: true,
|
|
87312
87815
|
useCompressedTextures: true,
|
|
87313
87816
|
decodeTextures: true,
|
|
@@ -87315,7 +87818,7 @@ var I3SLoader = {
|
|
|
87315
87818
|
}
|
|
87316
87819
|
}
|
|
87317
87820
|
};
|
|
87318
|
-
async function parseI3S(data, options, context) {
|
|
87821
|
+
async function parseI3S(data, options = {}, context) {
|
|
87319
87822
|
const url = context.url;
|
|
87320
87823
|
options.i3s = options.i3s || {};
|
|
87321
87824
|
const magicNumber = getMagicNumber(data);
|
|
@@ -87337,11 +87840,7 @@ async function parseI3S(data, options, context) {
|
|
|
87337
87840
|
if (isTileset) {
|
|
87338
87841
|
data = await parseTileset2(data, options, context);
|
|
87339
87842
|
} else if (isTileHeader) {
|
|
87340
|
-
data = await parseTile2(data,
|
|
87341
|
-
if (options.i3s.loadContent) {
|
|
87342
|
-
options.i3s.tile = data;
|
|
87343
|
-
await load(data.contentUrl, I3SLoader, options);
|
|
87344
|
-
}
|
|
87843
|
+
data = await parseTile2(data, context);
|
|
87345
87844
|
} else {
|
|
87346
87845
|
data = await parseTileContent(data, options);
|
|
87347
87846
|
}
|
|
@@ -87356,9 +87855,9 @@ async function parseTileset2(data, options, context) {
|
|
|
87356
87855
|
await normalizeTilesetData(tilesetJson, options, context);
|
|
87357
87856
|
return tilesetJson;
|
|
87358
87857
|
}
|
|
87359
|
-
async function parseTile2(data,
|
|
87858
|
+
async function parseTile2(data, context) {
|
|
87360
87859
|
data = JSON.parse(new TextDecoder().decode(data));
|
|
87361
|
-
return normalizeTileData2(data,
|
|
87860
|
+
return normalizeTileData2(data, context);
|
|
87362
87861
|
}
|
|
87363
87862
|
function getMagicNumber(data) {
|
|
87364
87863
|
if (data instanceof ArrayBuffer) {
|
|
@@ -87443,7 +87942,7 @@ async function parse8(data, options) {
|
|
|
87443
87942
|
}
|
|
87444
87943
|
|
|
87445
87944
|
// src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.ts
|
|
87446
|
-
var
|
|
87945
|
+
var import_core31 = __toModule(require_es56());
|
|
87447
87946
|
var import_geospatial13 = __toModule(require_es57());
|
|
87448
87947
|
var import_culling8 = __toModule(require_es58());
|
|
87449
87948
|
function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
|
|
@@ -87452,7 +87951,7 @@ function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
|
|
|
87452
87951
|
i3SObb.center[1],
|
|
87453
87952
|
i3SObb.center[2] + geoidHeightModel.getHeight(i3SObb.center[1], i3SObb.center[0])
|
|
87454
87953
|
];
|
|
87455
|
-
const cartesianCenter = import_geospatial13.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new
|
|
87954
|
+
const cartesianCenter = import_geospatial13.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new import_core31.Vector3());
|
|
87456
87955
|
const tiles3DObb = new import_culling8.OrientedBoundingBox().fromCenterHalfSizeQuaternion(cartesianCenter, i3SObb.halfSize, i3SObb.quaternion);
|
|
87457
87956
|
return [...tiles3DObb.center, ...tiles3DObb.halfAxes.toArray()];
|
|
87458
87957
|
}
|
|
@@ -87496,7 +87995,7 @@ var TILESET = () => ({
|
|
|
87496
87995
|
});
|
|
87497
87996
|
|
|
87498
87997
|
// src/3d-tiles-converter/helpers/b3dm-converter.ts
|
|
87499
|
-
var
|
|
87998
|
+
var import_core33 = __toModule(require_es56());
|
|
87500
87999
|
var import_geospatial14 = __toModule(require_es57());
|
|
87501
88000
|
|
|
87502
88001
|
// src/3d-tiles-converter/helpers/texture-atlas.ts
|
|
@@ -87531,8 +88030,8 @@ function normalizeRegions(regions) {
|
|
|
87531
88030
|
}
|
|
87532
88031
|
|
|
87533
88032
|
// src/3d-tiles-converter/helpers/b3dm-converter.ts
|
|
87534
|
-
var Z_UP_TO_Y_UP_MATRIX = new
|
|
87535
|
-
var
|
|
88033
|
+
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]);
|
|
88034
|
+
var scratchVector7 = new import_core33.Vector3();
|
|
87536
88035
|
var B3dmConverter = class {
|
|
87537
88036
|
async convert(i3sAttributesData, featureAttributes = null) {
|
|
87538
88037
|
const gltf = await this.buildGltf(i3sAttributesData);
|
|
@@ -87601,16 +88100,16 @@ var B3dmConverter = class {
|
|
|
87601
88100
|
const newPositionsValue = new Float32Array(positionsValue.length);
|
|
87602
88101
|
for (let index = 0; index < positionsValue.length; index += 3) {
|
|
87603
88102
|
const vertex = positionsValue.subarray(index, index + 3);
|
|
87604
|
-
const cartesianOriginVector = new
|
|
87605
|
-
let vertexVector = new
|
|
87606
|
-
import_geospatial14.Ellipsoid.WGS84.cartographicToCartesian(vertexVector,
|
|
87607
|
-
vertexVector =
|
|
88103
|
+
const cartesianOriginVector = new import_core33.Vector3(cartesianOrigin);
|
|
88104
|
+
let vertexVector = new import_core33.Vector3(Array.from(vertex)).transform(modelMatrix).add(cartographicOrigin);
|
|
88105
|
+
import_geospatial14.Ellipsoid.WGS84.cartographicToCartesian(vertexVector, scratchVector7);
|
|
88106
|
+
vertexVector = scratchVector7.subtract(cartesianOriginVector);
|
|
87608
88107
|
newPositionsValue.set(vertexVector, index);
|
|
87609
88108
|
}
|
|
87610
88109
|
return newPositionsValue;
|
|
87611
88110
|
}
|
|
87612
88111
|
_generateTransformMatrix(cartesianOrigin) {
|
|
87613
|
-
const translateOriginMatrix = new
|
|
88112
|
+
const translateOriginMatrix = new import_core33.Matrix4().translate(cartesianOrigin);
|
|
87614
88113
|
const result = translateOriginMatrix.multiplyLeft(Z_UP_TO_Y_UP_MATRIX);
|
|
87615
88114
|
return result;
|
|
87616
88115
|
}
|