@loaders.gl/tile-converter 3.1.0-beta.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/dist/bundle.js +1455 -1296
  2. package/dist/converter.min.js +292 -0
  3. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +429 -189
  4. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  5. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +306 -209
  6. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  7. package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +8 -4
  8. package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -1
  9. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js +13 -13
  10. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
  11. package/dist/es5/3d-tiles-converter/json-templates/tileset.js +51 -32
  12. package/dist/es5/3d-tiles-converter/json-templates/tileset.js.map +1 -1
  13. package/dist/es5/bundle.js +1 -1
  14. package/dist/es5/bundle.js.map +1 -1
  15. package/dist/es5/deps-installer/deps-installer.js +61 -17
  16. package/dist/es5/deps-installer/deps-installer.js.map +1 -1
  17. package/dist/es5/i3s-converter/helpers/coordinate-converter.js +55 -16
  18. package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  19. package/dist/es5/i3s-converter/helpers/create-scene-server-path.js +33 -9
  20. package/dist/es5/i3s-converter/helpers/create-scene-server-path.js.map +1 -1
  21. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +103 -93
  22. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  23. package/dist/es5/i3s-converter/helpers/geometry-converter.d.ts +5 -1
  24. package/dist/es5/i3s-converter/helpers/geometry-converter.js +546 -351
  25. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  26. package/dist/es5/i3s-converter/helpers/node-debug.js +27 -31
  27. package/dist/es5/i3s-converter/helpers/node-debug.js.map +1 -1
  28. package/dist/es5/i3s-converter/helpers/node-pages.js +209 -101
  29. package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
  30. package/dist/es5/i3s-converter/i3s-converter.js +1645 -700
  31. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  32. package/dist/es5/i3s-converter/json-templates/layers.js +213 -177
  33. package/dist/es5/i3s-converter/json-templates/layers.js.map +1 -1
  34. package/dist/es5/i3s-converter/json-templates/metadata.js +24 -20
  35. package/dist/es5/i3s-converter/json-templates/metadata.js.map +1 -1
  36. package/dist/es5/i3s-converter/json-templates/node.js +92 -74
  37. package/dist/es5/i3s-converter/json-templates/node.js.map +1 -1
  38. package/dist/es5/i3s-converter/json-templates/scene-server.js +34 -28
  39. package/dist/es5/i3s-converter/json-templates/scene-server.js.map +1 -1
  40. package/dist/es5/i3s-converter/json-templates/shared-resources.js +162 -107
  41. package/dist/es5/i3s-converter/json-templates/shared-resources.js.map +1 -1
  42. package/dist/es5/i3s-converter/json-templates/store.js +4 -2
  43. package/dist/es5/i3s-converter/json-templates/store.js.map +1 -1
  44. package/dist/es5/i3s-converter/types.js +2 -0
  45. package/dist/es5/i3s-converter/types.js.map +1 -0
  46. package/dist/es5/i3s-server/app.js +6 -6
  47. package/dist/es5/i3s-server/app.js.map +1 -1
  48. package/dist/es5/i3s-server/controllers/index-controller.js +60 -20
  49. package/dist/es5/i3s-server/controllers/index-controller.js.map +1 -1
  50. package/dist/es5/i3s-server/routes/index.js +41 -14
  51. package/dist/es5/i3s-server/routes/index.js.map +1 -1
  52. package/dist/es5/index.js +4 -4
  53. package/dist/es5/lib/utils/{compress-utils.d.ts → compress-util.d.ts} +0 -0
  54. package/dist/es5/lib/utils/compress-util.js +345 -123
  55. package/dist/es5/lib/utils/compress-util.js.map +1 -1
  56. package/dist/es5/lib/utils/file-utils.js +98 -20
  57. package/dist/es5/lib/utils/file-utils.js.map +1 -1
  58. package/dist/es5/lib/utils/lod-conversion-utils.js +9 -9
  59. package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
  60. package/dist/es5/lib/utils/statistic-utills.js +152 -41
  61. package/dist/es5/lib/utils/statistic-utills.js.map +1 -1
  62. package/dist/es5/pgm-loader.js +31 -4
  63. package/dist/es5/pgm-loader.js.map +1 -1
  64. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +7 -6
  65. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  66. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +7 -0
  67. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  68. package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -1
  69. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js +1 -1
  70. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
  71. package/dist/esm/3d-tiles-converter/json-templates/tileset.js +12 -9
  72. package/dist/esm/3d-tiles-converter/json-templates/tileset.js.map +1 -1
  73. package/dist/esm/deps-installer/deps-installer.js +2 -6
  74. package/dist/esm/deps-installer/deps-installer.js.map +1 -1
  75. package/dist/esm/i3s-converter/helpers/coordinate-converter.js +35 -3
  76. package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  77. package/dist/esm/i3s-converter/helpers/create-scene-server-path.js +2 -2
  78. package/dist/esm/i3s-converter/helpers/create-scene-server-path.js.map +1 -1
  79. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  80. package/dist/esm/i3s-converter/helpers/geometry-converter.d.ts +5 -1
  81. package/dist/esm/i3s-converter/helpers/geometry-converter.js +52 -34
  82. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  83. package/dist/esm/i3s-converter/helpers/node-debug.js +2 -4
  84. package/dist/esm/i3s-converter/helpers/node-debug.js.map +1 -1
  85. package/dist/esm/i3s-converter/helpers/node-pages.js +15 -4
  86. package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -1
  87. package/dist/esm/i3s-converter/i3s-converter.js +147 -62
  88. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  89. package/dist/esm/i3s-converter/json-templates/layers.js +37 -27
  90. package/dist/esm/i3s-converter/json-templates/layers.js.map +1 -1
  91. package/dist/esm/i3s-converter/json-templates/metadata.js +2 -2
  92. package/dist/esm/i3s-converter/json-templates/metadata.js.map +1 -1
  93. package/dist/esm/i3s-converter/json-templates/node.js +16 -12
  94. package/dist/esm/i3s-converter/json-templates/node.js.map +1 -1
  95. package/dist/esm/i3s-converter/json-templates/scene-server.js +2 -2
  96. package/dist/esm/i3s-converter/json-templates/scene-server.js.map +1 -1
  97. package/dist/esm/i3s-converter/json-templates/shared-resources.js +19 -14
  98. package/dist/esm/i3s-converter/json-templates/shared-resources.js.map +1 -1
  99. package/dist/esm/i3s-converter/json-templates/store.js.map +1 -1
  100. package/dist/esm/i3s-converter/types.js +2 -0
  101. package/dist/esm/i3s-converter/types.js.map +1 -0
  102. package/dist/esm/lib/utils/{compress-utils.d.ts → compress-util.d.ts} +0 -0
  103. package/dist/esm/pgm-loader.js +3 -3
  104. package/dist/esm/pgm-loader.js.map +1 -1
  105. package/package.json +16 -14
  106. package/src/3d-tiles-converter/3d-tiles-converter.ts +21 -20
  107. package/src/3d-tiles-converter/helpers/{b3dm-converter.js → b3dm-converter.ts} +19 -2
  108. package/src/3d-tiles-converter/helpers/{i3s-obb-to-3d-tiles-obb.js → i3s-obb-to-3d-tiles-obb.ts} +16 -1
  109. package/src/3d-tiles-converter/helpers/texture-atlas.ts +4 -4
  110. package/src/3d-tiles-converter/json-templates/{tileset.js → tileset.ts} +9 -9
  111. package/src/deps-installer/deps-installer.js +2 -2
  112. package/src/i3s-converter/helpers/coordinate-converter.ts +62 -9
  113. package/src/i3s-converter/helpers/{create-scene-server-path.js → create-scene-server-path.ts} +2 -2
  114. package/src/i3s-converter/helpers/{geometry-attributes.js → geometry-attributes.ts} +4 -4
  115. package/src/i3s-converter/helpers/geometry-converter.d.ts +5 -1
  116. package/src/i3s-converter/helpers/geometry-converter.js +68 -26
  117. package/src/i3s-converter/helpers/{node-debug.js → node-debug.ts} +3 -2
  118. package/src/i3s-converter/helpers/{node-pages.js → node-pages.ts} +41 -26
  119. package/src/i3s-converter/i3s-converter.ts +204 -133
  120. package/src/i3s-converter/json-templates/{layers.js → layers.ts} +29 -27
  121. package/src/i3s-converter/json-templates/{metadata.js → metadata.ts} +2 -2
  122. package/src/i3s-converter/json-templates/{node.js → node.ts} +12 -12
  123. package/src/i3s-converter/json-templates/{scene-server.js → scene-server.ts} +2 -2
  124. package/src/i3s-converter/json-templates/{shared-resources.js → shared-resources.ts} +14 -14
  125. package/src/i3s-converter/json-templates/{store.js → store.ts} +0 -0
  126. package/src/i3s-converter/types.ts +14 -0
  127. package/src/lib/utils/{compress-utils.d.ts → compress-util.d.ts} +0 -0
  128. package/src/pgm-loader.ts +2 -2
  129. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.d.ts +0 -23
  130. package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +0 -16
  131. package/dist/es5/i3s-converter/helpers/node-pages.d.ts +0 -144
  132. package/dist/es5/lib/geoid-height-model.d.ts +0 -41
  133. package/dist/es5/lib/geoid-height-model.js +0 -149
  134. package/dist/es5/lib/geoid-height-model.js.map +0 -1
  135. package/dist/es5/lib/pgm-parser.d.ts +0 -14
  136. package/dist/es5/lib/pgm-parser.js +0 -192
  137. package/dist/es5/lib/pgm-parser.js.map +0 -1
  138. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.d.ts +0 -23
  139. package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +0 -16
  140. package/dist/esm/i3s-converter/helpers/node-pages.d.ts +0 -144
  141. package/dist/esm/lib/geoid-height-model.d.ts +0 -41
  142. package/dist/esm/lib/geoid-height-model.js +0 -140
  143. package/dist/esm/lib/geoid-height-model.js.map +0 -1
  144. package/dist/esm/lib/pgm-parser.d.ts +0 -14
  145. package/dist/esm/lib/pgm-parser.js +0 -183
  146. package/dist/esm/lib/pgm-parser.js.map +0 -1
  147. package/src/3d-tiles-converter/helpers/b3dm-converter.d.ts +0 -23
  148. package/src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +0 -16
  149. package/src/i3s-converter/helpers/node-pages.d.ts +0 -144
  150. package/src/lib/geoid-height-model.d.ts +0 -41
  151. package/src/lib/geoid-height-model.js +0 -239
  152. package/src/lib/pgm-parser.d.ts +0 -14
  153. package/src/lib/pgm-parser.js +0 -179
package/dist/bundle.js CHANGED
@@ -34,7 +34,6 @@ var require_interopRequireDefault = __commonJS({
34
34
  };
35
35
  }
36
36
  module2.exports = _interopRequireDefault;
37
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
38
37
  }
39
38
  });
40
39
 
@@ -47,7 +46,6 @@ var require_classCallCheck = __commonJS({
47
46
  }
48
47
  }
49
48
  module2.exports = _classCallCheck;
50
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
51
49
  }
52
50
  });
53
51
 
@@ -72,7 +70,6 @@ var require_createClass = __commonJS({
72
70
  return Constructor;
73
71
  }
74
72
  module2.exports = _createClass;
75
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
76
73
  }
77
74
  });
78
75
 
@@ -384,17 +381,14 @@ var require_typeof = __commonJS({
384
381
  module2.exports = _typeof = function _typeof2(obj2) {
385
382
  return typeof obj2;
386
383
  };
387
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
388
384
  } else {
389
385
  module2.exports = _typeof = function _typeof2(obj2) {
390
386
  return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
391
387
  };
392
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
393
388
  }
394
389
  return _typeof(obj);
395
390
  }
396
391
  module2.exports = _typeof;
397
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
398
392
  }
399
393
  });
400
394
 
@@ -554,7 +548,6 @@ var require_arrayLikeToArray = __commonJS({
554
548
  return arr2;
555
549
  }
556
550
  module2.exports = _arrayLikeToArray;
557
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
558
551
  }
559
552
  });
560
553
 
@@ -567,7 +560,6 @@ var require_arrayWithoutHoles = __commonJS({
567
560
  return arrayLikeToArray(arr);
568
561
  }
569
562
  module2.exports = _arrayWithoutHoles;
570
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
571
563
  }
572
564
  });
573
565
 
@@ -575,11 +567,10 @@ var require_arrayWithoutHoles = __commonJS({
575
567
  var require_iterableToArray = __commonJS({
576
568
  "../../node_modules/@babel/runtime/helpers/iterableToArray.js"(exports, module2) {
577
569
  function _iterableToArray(iter) {
578
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
570
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
579
571
  return Array.from(iter);
580
572
  }
581
573
  module2.exports = _iterableToArray;
582
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
583
574
  }
584
575
  });
585
576
 
@@ -601,7 +592,6 @@ var require_unsupportedIterableToArray = __commonJS({
601
592
  return arrayLikeToArray(o, minLen);
602
593
  }
603
594
  module2.exports = _unsupportedIterableToArray;
604
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
605
595
  }
606
596
  });
607
597
 
@@ -612,7 +602,6 @@ var require_nonIterableSpread = __commonJS({
612
602
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
613
603
  }
614
604
  module2.exports = _nonIterableSpread;
615
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
616
605
  }
617
606
  });
618
607
 
@@ -627,7 +616,6 @@ var require_toConsumableArray = __commonJS({
627
616
  return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
628
617
  }
629
618
  module2.exports = _toConsumableArray;
630
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
631
619
  }
632
620
  });
633
621
 
@@ -648,7 +636,6 @@ var require_defineProperty = __commonJS({
648
636
  return obj;
649
637
  }
650
638
  module2.exports = _defineProperty;
651
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
652
639
  }
653
640
  });
654
641
 
@@ -1674,11 +1661,9 @@ var require_setPrototypeOf = __commonJS({
1674
1661
  o2.__proto__ = p2;
1675
1662
  return o2;
1676
1663
  };
1677
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
1678
1664
  return _setPrototypeOf(o, p);
1679
1665
  }
1680
1666
  module2.exports = _setPrototypeOf;
1681
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
1682
1667
  }
1683
1668
  });
1684
1669
 
@@ -1693,7 +1678,7 @@ var require_isNativeReflectConstruct = __commonJS({
1693
1678
  if (typeof Proxy === "function")
1694
1679
  return true;
1695
1680
  try {
1696
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
1681
+ Date.prototype.toString.call(Reflect.construct(Date, [], function() {
1697
1682
  }));
1698
1683
  return true;
1699
1684
  } catch (e) {
@@ -1701,7 +1686,6 @@ var require_isNativeReflectConstruct = __commonJS({
1701
1686
  }
1702
1687
  }
1703
1688
  module2.exports = _isNativeReflectConstruct;
1704
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
1705
1689
  }
1706
1690
  });
1707
1691
 
@@ -1713,7 +1697,6 @@ var require_construct = __commonJS({
1713
1697
  function _construct(Parent, args, Class) {
1714
1698
  if (isNativeReflectConstruct()) {
1715
1699
  module2.exports = _construct = Reflect.construct;
1716
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
1717
1700
  } else {
1718
1701
  module2.exports = _construct = function _construct2(Parent2, args2, Class2) {
1719
1702
  var a = [null];
@@ -1724,12 +1707,10 @@ var require_construct = __commonJS({
1724
1707
  setPrototypeOf(instance, Class2.prototype);
1725
1708
  return instance;
1726
1709
  };
1727
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
1728
1710
  }
1729
1711
  return _construct.apply(null, arguments);
1730
1712
  }
1731
1713
  module2.exports = _construct;
1732
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
1733
1714
  }
1734
1715
  });
1735
1716
 
@@ -1977,7 +1958,6 @@ var require_inherits = __commonJS({
1977
1958
  setPrototypeOf(subClass, superClass);
1978
1959
  }
1979
1960
  module2.exports = _inherits;
1980
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
1981
1961
  }
1982
1962
  });
1983
1963
 
@@ -1991,14 +1971,13 @@ var require_assertThisInitialized = __commonJS({
1991
1971
  return self2;
1992
1972
  }
1993
1973
  module2.exports = _assertThisInitialized;
1994
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
1995
1974
  }
1996
1975
  });
1997
1976
 
1998
1977
  // ../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
1999
1978
  var require_possibleConstructorReturn = __commonJS({
2000
1979
  "../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"(exports, module2) {
2001
- var _typeof = require_typeof()["default"];
1980
+ var _typeof = require_typeof();
2002
1981
  var assertThisInitialized = require_assertThisInitialized();
2003
1982
  function _possibleConstructorReturn(self2, call) {
2004
1983
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
@@ -2007,7 +1986,6 @@ var require_possibleConstructorReturn = __commonJS({
2007
1986
  return assertThisInitialized(self2);
2008
1987
  }
2009
1988
  module2.exports = _possibleConstructorReturn;
2010
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
2011
1989
  }
2012
1990
  });
2013
1991
 
@@ -2018,11 +1996,9 @@ var require_getPrototypeOf = __commonJS({
2018
1996
  module2.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
2019
1997
  return o2.__proto__ || Object.getPrototypeOf(o2);
2020
1998
  };
2021
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
2022
1999
  return _getPrototypeOf(o);
2023
2000
  }
2024
2001
  module2.exports = _getPrototypeOf;
2025
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
2026
2002
  }
2027
2003
  });
2028
2004
 
@@ -5070,7 +5046,6 @@ var require_arrayWithHoles = __commonJS({
5070
5046
  return arr;
5071
5047
  }
5072
5048
  module2.exports = _arrayWithHoles;
5073
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
5074
5049
  }
5075
5050
  });
5076
5051
 
@@ -5078,15 +5053,14 @@ var require_arrayWithHoles = __commonJS({
5078
5053
  var require_iterableToArrayLimit = __commonJS({
5079
5054
  "../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"(exports, module2) {
5080
5055
  function _iterableToArrayLimit(arr, i) {
5081
- var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
5082
- if (_i == null)
5056
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
5083
5057
  return;
5084
5058
  var _arr = [];
5085
5059
  var _n = true;
5086
5060
  var _d = false;
5087
- var _s, _e;
5061
+ var _e = void 0;
5088
5062
  try {
5089
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
5063
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
5090
5064
  _arr.push(_s.value);
5091
5065
  if (i && _arr.length === i)
5092
5066
  break;
@@ -5106,7 +5080,6 @@ var require_iterableToArrayLimit = __commonJS({
5106
5080
  return _arr;
5107
5081
  }
5108
5082
  module2.exports = _iterableToArrayLimit;
5109
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
5110
5083
  }
5111
5084
  });
5112
5085
 
@@ -5117,7 +5090,6 @@ var require_nonIterableRest = __commonJS({
5117
5090
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5118
5091
  }
5119
5092
  module2.exports = _nonIterableRest;
5120
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
5121
5093
  }
5122
5094
  });
5123
5095
 
@@ -5132,7 +5104,6 @@ var require_slicedToArray = __commonJS({
5132
5104
  return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
5133
5105
  }
5134
5106
  module2.exports = _slicedToArray;
5135
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
5136
5107
  }
5137
5108
  });
5138
5109
 
@@ -9317,7 +9288,7 @@ var require_type_utils = __commonJS({
9317
9288
  var noop2 = function noop3(x) {
9318
9289
  return x;
9319
9290
  };
9320
- var scratchVector6 = new _core.Vector3();
9291
+ var scratchVector7 = new _core.Vector3();
9321
9292
  function fromCartographic(cartographic, result) {
9322
9293
  var map = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : noop2;
9323
9294
  if ((0, _core.isArray)(cartographic)) {
@@ -9336,11 +9307,11 @@ var require_type_utils = __commonJS({
9336
9307
  return result;
9337
9308
  }
9338
9309
  function fromCartographicToRadians(cartographic) {
9339
- var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector6;
9310
+ var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector7;
9340
9311
  return fromCartographic(cartographic, vector, _core.config._cartographicRadians ? noop2 : _core.toRadians);
9341
9312
  }
9342
9313
  function fromCartographicToDegrees(cartographic) {
9343
- var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector6;
9314
+ var vector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scratchVector7;
9344
9315
  return fromCartographic(cartographic, vector, _core.config._cartographicRadians ? _core.toDegrees : noop2);
9345
9316
  }
9346
9317
  function toCartographic(vector, cartographic) {
@@ -9370,7 +9341,7 @@ var require_type_utils = __commonJS({
9370
9341
  if (!vector) {
9371
9342
  return false;
9372
9343
  }
9373
- scratchVector6.from(vector);
9344
+ scratchVector7.from(vector);
9374
9345
  var oneOverRadiiSquared = _constants.WGS84_CONSTANTS.oneOverRadiiSquared, centerToleranceSquared = _constants.WGS84_CONSTANTS.centerToleranceSquared;
9375
9346
  var x2 = vector[0] * vector[0] * oneOverRadiiSquared[0];
9376
9347
  var y2 = vector[1] * vector[1] * oneOverRadiiSquared[1];
@@ -9429,13 +9400,13 @@ var require_scale_to_geodetic_surface = __commonJS({
9429
9400
  }
9430
9401
  return newObj;
9431
9402
  }
9432
- var scratchVector6 = new _core.Vector3();
9403
+ var scratchVector7 = new _core.Vector3();
9433
9404
  var scaleToGeodeticSurfaceIntersection = new _core.Vector3();
9434
9405
  var scaleToGeodeticSurfaceGradient = new _core.Vector3();
9435
9406
  function scaleToGeodeticSurface(cartesian, ellipsoid) {
9436
9407
  var result = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : new _core.Vector3();
9437
9408
  var oneOverRadii = ellipsoid.oneOverRadii, oneOverRadiiSquared = ellipsoid.oneOverRadiiSquared, centerToleranceSquared = ellipsoid.centerToleranceSquared;
9438
- scratchVector6.from(cartesian);
9409
+ scratchVector7.from(cartesian);
9439
9410
  var positionX = cartesian.x;
9440
9411
  var positionY = cartesian.y;
9441
9412
  var positionZ = cartesian.z;
@@ -9482,7 +9453,7 @@ var require_scale_to_geodetic_surface = __commonJS({
9482
9453
  var derivative = -2 * denominator;
9483
9454
  correction = func / derivative;
9484
9455
  } while (Math.abs(func) > _core._MathUtils.EPSILON12);
9485
- return scratchVector6.scale([xMultiplier, yMultiplier, zMultiplier]).to(result);
9456
+ return scratchVector7.scale([xMultiplier, yMultiplier, zMultiplier]).to(result);
9486
9457
  }
9487
9458
  }
9488
9459
  });
@@ -9668,7 +9639,7 @@ var require_ellipsoid = __commonJS({
9668
9639
  }
9669
9640
  return newObj;
9670
9641
  }
9671
- var scratchVector6 = new _core.Vector3();
9642
+ var scratchVector7 = new _core.Vector3();
9672
9643
  var scratchNormal2 = new _core.Vector3();
9673
9644
  var scratchK = new _core.Vector3();
9674
9645
  var scratchPosition3 = new _core.Vector3();
@@ -9755,7 +9726,7 @@ var require_ellipsoid = __commonJS({
9755
9726
  key: "geocentricSurfaceNormal",
9756
9727
  value: function geocentricSurfaceNormal(cartesian) {
9757
9728
  var result = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0, 0];
9758
- return scratchVector6.from(cartesian).normalize().to(result);
9729
+ return scratchVector7.from(cartesian).normalize().to(result);
9759
9730
  }
9760
9731
  }, {
9761
9732
  key: "geodeticSurfaceNormalCartographic",
@@ -9765,14 +9736,14 @@ var require_ellipsoid = __commonJS({
9765
9736
  var longitude = cartographicVectorRadians[0];
9766
9737
  var latitude = cartographicVectorRadians[1];
9767
9738
  var cosLatitude = Math.cos(latitude);
9768
- scratchVector6.set(cosLatitude * Math.cos(longitude), cosLatitude * Math.sin(longitude), Math.sin(latitude)).normalize();
9769
- return scratchVector6.to(result);
9739
+ scratchVector7.set(cosLatitude * Math.cos(longitude), cosLatitude * Math.sin(longitude), Math.sin(latitude)).normalize();
9740
+ return scratchVector7.to(result);
9770
9741
  }
9771
9742
  }, {
9772
9743
  key: "geodeticSurfaceNormal",
9773
9744
  value: function geodeticSurfaceNormal(cartesian) {
9774
9745
  var result = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0, 0];
9775
- return scratchVector6.from(cartesian).scale(this.oneOverRadiiSquared).normalize().to(result);
9746
+ return scratchVector7.from(cartesian).scale(this.oneOverRadiiSquared).normalize().to(result);
9776
9747
  }
9777
9748
  }, {
9778
9749
  key: "scaleToGeodeticSurface",
@@ -9885,7 +9856,7 @@ var require_axis_aligned_bounding_box = __commonJS({
9885
9856
  var _createClass2 = _interopRequireDefault(require_createClass());
9886
9857
  var _core = require_es53();
9887
9858
  var _constants = require_constants2();
9888
- var scratchVector6 = new _core.Vector3();
9859
+ var scratchVector7 = new _core.Vector3();
9889
9860
  var scratchNormal2 = new _core.Vector3();
9890
9861
  var AxisAlignedBoundingBox = function() {
9891
9862
  function AxisAlignedBoundingBox2() {
@@ -9893,7 +9864,7 @@ var require_axis_aligned_bounding_box = __commonJS({
9893
9864
  var maximum = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0, 0, 0];
9894
9865
  var center = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
9895
9866
  (0, _classCallCheck2.default)(this, AxisAlignedBoundingBox2);
9896
- center = center || scratchVector6.copy(minimum).add(maximum).scale(0.5);
9867
+ center = center || scratchVector7.copy(minimum).add(maximum).scale(0.5);
9897
9868
  this.center = new _core.Vector3(center);
9898
9869
  this.halfDiagonal = new _core.Vector3(maximum).subtract(this.center);
9899
9870
  this.minimum = new _core.Vector3(minimum);
@@ -9941,7 +9912,7 @@ var require_axis_aligned_bounding_box = __commonJS({
9941
9912
  }, {
9942
9913
  key: "distanceSquaredTo",
9943
9914
  value: function distanceSquaredTo(point) {
9944
- var offset = scratchVector6.from(point).subtract(this.center);
9915
+ var offset = scratchVector7.from(point).subtract(this.center);
9945
9916
  var halfDiagonal = this.halfDiagonal;
9946
9917
  var distanceSquared = 0;
9947
9918
  var d;
@@ -10019,7 +9990,7 @@ var require_bounding_sphere = __commonJS({
10019
9990
  }
10020
9991
  return newObj;
10021
9992
  }
10022
- var scratchVector6 = new _core.Vector3();
9993
+ var scratchVector7 = new _core.Vector3();
10023
9994
  var scratchVector23 = new _core.Vector3();
10024
9995
  var BoundingSphere3 = function() {
10025
9996
  function BoundingSphere4() {
@@ -10040,7 +10011,7 @@ var require_bounding_sphere = __commonJS({
10040
10011
  }, {
10041
10012
  key: "fromCornerPoints",
10042
10013
  value: function fromCornerPoints(corner, oppositeCorner) {
10043
- oppositeCorner = scratchVector6.from(oppositeCorner);
10014
+ oppositeCorner = scratchVector7.from(oppositeCorner);
10044
10015
  this.center = new _core.Vector3().from(corner).add(oppositeCorner).scale(0.5);
10045
10016
  this.radius = this.center.distance(oppositeCorner);
10046
10017
  return this;
@@ -10062,7 +10033,7 @@ var require_bounding_sphere = __commonJS({
10062
10033
  var leftRadius = this.radius;
10063
10034
  var rightCenter = boundingSphere.center;
10064
10035
  var rightRadius = boundingSphere.radius;
10065
- var toRightCenter = scratchVector6.copy(rightCenter).subtract(leftCenter);
10036
+ var toRightCenter = scratchVector7.copy(rightCenter).subtract(leftCenter);
10066
10037
  var centerSeparation = toRightCenter.magnitude();
10067
10038
  if (leftRadius >= centerSeparation + rightRadius) {
10068
10039
  return this.clone();
@@ -10079,7 +10050,7 @@ var require_bounding_sphere = __commonJS({
10079
10050
  }, {
10080
10051
  key: "expand",
10081
10052
  value: function expand(point) {
10082
- point = scratchVector6.from(point);
10053
+ point = scratchVector7.from(point);
10083
10054
  var radius = point.subtract(this.center).magnitude();
10084
10055
  if (radius > this.radius) {
10085
10056
  this.radius = radius;
@@ -10090,14 +10061,14 @@ var require_bounding_sphere = __commonJS({
10090
10061
  key: "transform",
10091
10062
  value: function transform9(_transform) {
10092
10063
  this.center.transform(_transform);
10093
- var scale = mat4.getScaling(scratchVector6, _transform);
10064
+ var scale = mat4.getScaling(scratchVector7, _transform);
10094
10065
  this.radius = Math.max(scale[0], Math.max(scale[1], scale[2])) * this.radius;
10095
10066
  return this;
10096
10067
  }
10097
10068
  }, {
10098
10069
  key: "distanceSquaredTo",
10099
10070
  value: function distanceSquaredTo(point) {
10100
- point = scratchVector6.from(point);
10071
+ point = scratchVector7.from(point);
10101
10072
  var delta = point.subtract(this.center);
10102
10073
  return delta.lengthSquared() - this.radius * this.radius;
10103
10074
  }
@@ -10997,7 +10968,7 @@ var require_bounding_sphere_from_points = __commonJS({
10997
10968
  Object.defineProperty(exports, "__esModule", {
10998
10969
  value: true
10999
10970
  });
11000
- exports.default = makeBoundingSphereFromPoints;
10971
+ exports.default = makeBoundingSphereFromPoints2;
11001
10972
  var _core = require_es53();
11002
10973
  var _boundingSphere = _interopRequireDefault(require_bounding_sphere());
11003
10974
  function _createForOfIteratorHelper(o, allowArrayLike) {
@@ -11073,7 +11044,7 @@ var require_bounding_sphere_from_points = __commonJS({
11073
11044
  var fromPointsMaxBoxPt = new _core.Vector3();
11074
11045
  var fromPointsNaiveCenterScratch = new _core.Vector3();
11075
11046
  var volumeConstant = 4 / 3 * Math.PI;
11076
- function makeBoundingSphereFromPoints(positions) {
11047
+ function makeBoundingSphereFromPoints2(positions) {
11077
11048
  var result = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new _boundingSphere.default();
11078
11049
  if (!positions || positions.length === 0) {
11079
11050
  return result.fromCenterRadius([0, 0, 0], 0);
@@ -11290,7 +11261,7 @@ var require_bounding_box_from_points = __commonJS({
11290
11261
  Object.defineProperty(exports, "__esModule", {
11291
11262
  value: true
11292
11263
  });
11293
- exports.makeOrientedBoundingBoxFromPoints = makeOrientedBoundingBoxFromPoints;
11264
+ exports.makeOrientedBoundingBoxFromPoints = makeOrientedBoundingBoxFromPoints2;
11294
11265
  exports.makeAxisAlignedBoundingBoxFromPoints = makeAxisAlignedBoundingBoxFromPoints;
11295
11266
  var _core = require_es53();
11296
11267
  var _computeEigenDecomposition = _interopRequireDefault(require_compute_eigen_decomposition());
@@ -11360,13 +11331,13 @@ var require_bounding_box_from_points = __commonJS({
11360
11331
  var scratchVector33 = new _core.Vector3();
11361
11332
  var scratchVector42 = new _core.Vector3();
11362
11333
  var scratchVector52 = new _core.Vector3();
11363
- var scratchVector6 = new _core.Vector3();
11334
+ var scratchVector62 = new _core.Vector3();
11364
11335
  var scratchCovarianceResult = new _core.Matrix3();
11365
11336
  var scratchEigenResult = {
11366
11337
  diagonal: new _core.Matrix3(),
11367
11338
  unitary: new _core.Matrix3()
11368
11339
  };
11369
- function makeOrientedBoundingBoxFromPoints(positions) {
11340
+ function makeOrientedBoundingBoxFromPoints2(positions) {
11370
11341
  var result = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new _orientedBoundingBox.default();
11371
11342
  if (!positions || positions.length === 0) {
11372
11343
  result.halfAxes = new _core.Matrix3([0, 0, 0, 0, 0, 0, 0, 0, 0]);
@@ -11431,7 +11402,7 @@ var require_bounding_box_from_points = __commonJS({
11431
11402
  var rotation = result.halfAxes.copy(unitary);
11432
11403
  var v12 = rotation.getColumn(0, scratchVector42);
11433
11404
  var v2 = rotation.getColumn(1, scratchVector52);
11434
- var v32 = rotation.getColumn(2, scratchVector6);
11405
+ var v32 = rotation.getColumn(2, scratchVector62);
11435
11406
  var u1 = -Number.MAX_VALUE;
11436
11407
  var u2 = -Number.MAX_VALUE;
11437
11408
  var u3 = -Number.MAX_VALUE;
@@ -45981,6 +45952,427 @@ var require_regenerator = __commonJS({
45981
45952
  }
45982
45953
  });
45983
45954
 
45955
+ // ../../node_modules/@math.gl/geoid/dist/es5/geoid.js
45956
+ var require_geoid = __commonJS({
45957
+ "../../node_modules/@math.gl/geoid/dist/es5/geoid.js"(exports) {
45958
+ "use strict";
45959
+ var _interopRequireDefault = require_interopRequireDefault();
45960
+ Object.defineProperty(exports, "__esModule", {
45961
+ value: true
45962
+ });
45963
+ exports.default = void 0;
45964
+ var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
45965
+ var _createClass2 = _interopRequireDefault(require_createClass());
45966
+ var c0_ = 240;
45967
+ var c3_ = [9, -18, -88, 0, 96, 90, 0, 0, -60, -20, -9, 18, 8, 0, -96, 30, 0, 0, 60, -20, 9, -88, -18, 90, 96, 0, -20, -60, 0, 0, 186, -42, -42, -150, -96, -150, 60, 60, 60, 60, 54, 162, -78, 30, -24, -90, -60, 60, -60, 60, -9, -32, 18, 30, 24, 0, 20, -60, 0, 0, -9, 8, 18, 30, -96, 0, -20, 60, 0, 0, 54, -78, 162, -90, -24, 30, 60, -60, 60, -60, -54, 78, 78, 90, 144, 90, -60, -60, -60, -60, 9, -8, -18, -30, -24, 0, 20, 60, 0, 0, -9, 18, -32, 0, 24, 30, 0, 0, -60, 20, 9, -18, -8, 0, -24, -30, 0, 0, 60, 20];
45968
+ var c0n_ = 372;
45969
+ var c3n_ = [0, 0, -131, 0, 138, 144, 0, 0, -102, -31, 0, 0, 7, 0, -138, 42, 0, 0, 102, -31, 62, 0, -31, 0, 0, -62, 0, 0, 0, 31, 124, 0, -62, 0, 0, -124, 0, 0, 0, 62, 124, 0, -62, 0, 0, -124, 0, 0, 0, 62, 62, 0, -31, 0, 0, -62, 0, 0, 0, 31, 0, 0, 45, 0, -183, -9, 0, 93, 18, 0, 0, 0, 216, 0, 33, 87, 0, -93, 12, -93, 0, 0, 156, 0, 153, 99, 0, -93, -12, -93, 0, 0, -45, 0, -3, 9, 0, 93, -18, 0, 0, 0, -55, 0, 48, 42, 0, 0, -84, 31, 0, 0, -7, 0, -48, -42, 0, 0, 84, 31];
45970
+ var c0s_ = 372;
45971
+ var c3s_ = [18, -36, -122, 0, 120, 135, 0, 0, -84, -31, -18, 36, -2, 0, -120, 51, 0, 0, 84, -31, 36, -165, -27, 93, 147, -9, 0, -93, 18, 0, 210, 45, -111, -93, -57, -192, 0, 93, 12, 93, 162, 141, -75, -93, -129, -180, 0, 93, -12, 93, -36, -21, 27, 93, 39, 9, 0, -93, -18, 0, 0, 0, 62, 0, 0, 31, 0, 0, 0, -31, 0, 0, 124, 0, 0, 62, 0, 0, 0, -62, 0, 0, 124, 0, 0, 62, 0, 0, 0, -62, 0, 0, 62, 0, 0, 31, 0, 0, 0, -31, -18, 36, -64, 0, 66, 51, 0, 0, -102, 31, 18, -36, 2, 0, -66, -51, 0, 0, 102, 31];
45972
+ var stencilsize_ = 12;
45973
+ var nterms_ = (3 + 1) * (3 + 2) / 2;
45974
+ var PIXEL_SIZE = 2;
45975
+ var Geoid = function() {
45976
+ function Geoid2(options) {
45977
+ (0, _classCallCheck2.default)(this, Geoid2);
45978
+ this.options = options;
45979
+ this._v00 = 0;
45980
+ this._v01 = 0;
45981
+ this._v10 = 0;
45982
+ this._v11 = 0;
45983
+ this._t = [];
45984
+ this._ix = this.options._width;
45985
+ this._iy = this.options._height;
45986
+ }
45987
+ (0, _createClass2.default)(Geoid2, [{
45988
+ key: "getHeight",
45989
+ value: function getHeight(lat, lon) {
45990
+ lat = Math.abs(lat) > 90 ? NaN : lat;
45991
+ if (isNaN(lat) || isNaN(lon)) {
45992
+ return NaN;
45993
+ }
45994
+ var rem = remainder(lon, 360);
45995
+ lon = rem !== -180 ? rem : 180;
45996
+ var fx = lon * this.options._rlonres;
45997
+ var fy = -lat * this.options._rlatres;
45998
+ var ix = Math.floor(fx);
45999
+ var iy = Math.min(Math.round((this.options._height - 1) / 2 - 1), Math.floor(fy));
46000
+ fx -= ix;
46001
+ fy -= iy;
46002
+ iy += (this.options._height - 1) / 2;
46003
+ ix += ix < 0 ? this.options._width : ix >= this.options._width ? -this.options._width : 0;
46004
+ var v00 = 0;
46005
+ var v01 = 0;
46006
+ var v10 = 0;
46007
+ var v11 = 0;
46008
+ var t = new Array(nterms_);
46009
+ if (!(ix === this._ix && iy === this._iy)) {
46010
+ if (!this.options.cubic) {
46011
+ v00 = this._rawval(ix, iy);
46012
+ v01 = this._rawval(ix + 1, iy);
46013
+ v10 = this._rawval(ix, iy + 1);
46014
+ v11 = this._rawval(ix + 1, iy + 1);
46015
+ } else {
46016
+ var v = [this._rawval(ix, iy - 1), this._rawval(ix + 1, iy - 1), this._rawval(ix - 1, iy), this._rawval(ix, iy), this._rawval(ix + 1, iy), this._rawval(ix + 2, iy), this._rawval(ix - 1, iy + 1), this._rawval(ix, iy + 1), this._rawval(ix + 1, iy + 1), this._rawval(ix + 2, iy + 1), this._rawval(ix, iy + 2), this._rawval(ix + 1, iy + 2)];
46017
+ var c3x = c3n_;
46018
+ if (iy !== 0) {
46019
+ c3x = iy === this.options._height - 2 ? c3s_ : c3_;
46020
+ }
46021
+ var c0x = c0n_;
46022
+ if (iy !== 0) {
46023
+ c0x = iy === this.options._height - 2 ? c0s_ : c0_;
46024
+ }
46025
+ for (var i = 0; i < nterms_; ++i) {
46026
+ t[i] = 0;
46027
+ for (var j = 0; j < stencilsize_; ++j) {
46028
+ t[i] += v[j] * c3x[nterms_ * j + i];
46029
+ }
46030
+ t[i] /= c0x;
46031
+ }
46032
+ }
46033
+ } else if (!this.options.cubic) {
46034
+ v00 = this._v00;
46035
+ v01 = this._v01;
46036
+ v10 = this._v10;
46037
+ v11 = this._v11;
46038
+ } else {
46039
+ t = this._t;
46040
+ }
46041
+ if (!this.options.cubic) {
46042
+ var a = (1 - fx) * v00 + fx * v01;
46043
+ var b = (1 - fx) * v10 + fx * v11;
46044
+ var c = (1 - fy) * a + fy * b;
46045
+ var _h = this.options._offset + this.options._scale * c;
46046
+ this._ix = ix;
46047
+ this._iy = iy;
46048
+ this._v00 = v00;
46049
+ this._v01 = v01;
46050
+ this._v10 = v10;
46051
+ this._v11 = v11;
46052
+ return _h;
46053
+ }
46054
+ var h = t[0] + fx * (t[1] + fx * (t[3] + fx * t[6])) + fy * (t[2] + fx * (t[4] + fx * t[7]) + fy * (t[5] + fx * t[8] + fy * t[9]));
46055
+ h = this.options._offset + this.options._scale * h;
46056
+ this._ix = ix;
46057
+ this._iy = iy;
46058
+ this._t = t;
46059
+ return h;
46060
+ }
46061
+ }, {
46062
+ key: "_rawval",
46063
+ value: function _rawval(ix, iy) {
46064
+ if (ix < 0) {
46065
+ ix += this.options._width;
46066
+ } else if (ix >= this.options._width) {
46067
+ ix -= this.options._width;
46068
+ }
46069
+ if (iy < 0 || iy >= this.options._height) {
46070
+ iy = iy < 0 ? -iy : 2 * (this.options._height - 1) - iy;
46071
+ ix += (ix < this.options._width / 2 ? 1 : -1) * this.options._width / 2;
46072
+ }
46073
+ var bufferPosition = this.options._datastart + PIXEL_SIZE * (iy * this.options._swidth + ix);
46074
+ var a = this.options.data[bufferPosition];
46075
+ var b = this.options.data[bufferPosition + 1];
46076
+ var r = a << 8 | b;
46077
+ return r;
46078
+ }
46079
+ }]);
46080
+ return Geoid2;
46081
+ }();
46082
+ exports.default = Geoid;
46083
+ function remainder(x, y) {
46084
+ y = Math.abs(y);
46085
+ var z = fmod(x, y);
46086
+ if (2 * Math.abs(z) === y)
46087
+ z -= fmod(x, 2 * y) - z;
46088
+ else if (2 * Math.abs(z) > y)
46089
+ z += z < 0 ? y : -y;
46090
+ return z;
46091
+ }
46092
+ function fmod(x, y) {
46093
+ return x - Math.floor(x / y) * y;
46094
+ }
46095
+ }
46096
+ });
46097
+
46098
+ // ../../node_modules/@math.gl/geoid/dist/es5/parse-pgm.js
46099
+ var require_parse_pgm = __commonJS({
46100
+ "../../node_modules/@math.gl/geoid/dist/es5/parse-pgm.js"(exports) {
46101
+ "use strict";
46102
+ var _interopRequireDefault = require_interopRequireDefault();
46103
+ Object.defineProperty(exports, "__esModule", {
46104
+ value: true
46105
+ });
46106
+ exports.parsePGM = parsePGM2;
46107
+ var _regenerator = _interopRequireDefault(require_regenerator());
46108
+ var _geoid = _interopRequireDefault(require_geoid());
46109
+ function _createForOfIteratorHelper(o, allowArrayLike) {
46110
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
46111
+ if (!it) {
46112
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
46113
+ if (it)
46114
+ o = it;
46115
+ var i = 0;
46116
+ var F = function F2() {
46117
+ };
46118
+ return { s: F, n: function n() {
46119
+ if (i >= o.length)
46120
+ return { done: true };
46121
+ return { done: false, value: o[i++] };
46122
+ }, e: function e(_e) {
46123
+ throw _e;
46124
+ }, f: F };
46125
+ }
46126
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
46127
+ }
46128
+ var normalCompletion = true, didErr = false, err;
46129
+ return { s: function s() {
46130
+ it = it.call(o);
46131
+ }, n: function n() {
46132
+ var step = it.next();
46133
+ normalCompletion = step.done;
46134
+ return step;
46135
+ }, e: function e(_e2) {
46136
+ didErr = true;
46137
+ err = _e2;
46138
+ }, f: function f() {
46139
+ try {
46140
+ if (!normalCompletion && it.return != null)
46141
+ it.return();
46142
+ } finally {
46143
+ if (didErr)
46144
+ throw err;
46145
+ }
46146
+ } };
46147
+ }
46148
+ function _unsupportedIterableToArray(o, minLen) {
46149
+ if (!o)
46150
+ return;
46151
+ if (typeof o === "string")
46152
+ return _arrayLikeToArray(o, minLen);
46153
+ var n = Object.prototype.toString.call(o).slice(8, -1);
46154
+ if (n === "Object" && o.constructor)
46155
+ n = o.constructor.name;
46156
+ if (n === "Map" || n === "Set")
46157
+ return Array.from(o);
46158
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
46159
+ return _arrayLikeToArray(o, minLen);
46160
+ }
46161
+ function _arrayLikeToArray(arr, len) {
46162
+ if (len == null || len > arr.length)
46163
+ len = arr.length;
46164
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
46165
+ arr2[i] = arr[i];
46166
+ }
46167
+ return arr2;
46168
+ }
46169
+ var _marked = _regenerator.default.mark(_getLineGenerator);
46170
+ var ENDL = 10;
46171
+ var PIXEL_MAX = 65535;
46172
+ function parsePGM2(data, options) {
46173
+ var getline = _getLineGenerator(data);
46174
+ var currentLine = getline.next();
46175
+ if (currentLine.done || currentLine.value.line !== "P5") {
46176
+ throw new Error("Geoid model file: File not in PGM format");
46177
+ }
46178
+ var _offset = Number.MAX_VALUE;
46179
+ var _scale = 0;
46180
+ var _maxerror = -1;
46181
+ var _rmserror = -1;
46182
+ var _description = "NONE";
46183
+ var _datetime = "UNKNOWN";
46184
+ var _width = 0;
46185
+ var _height = 0;
46186
+ var _datastart = null;
46187
+ var _swidth = null;
46188
+ do {
46189
+ currentLine = getline.next();
46190
+ var s = currentLine.value.line;
46191
+ if (!s.length) {
46192
+ continue;
46193
+ }
46194
+ if (s[0] === "#") {
46195
+ var sArr = s.split(" ");
46196
+ var commentId = sArr[0];
46197
+ var key = sArr[1];
46198
+ if (commentId !== "#" || !key) {
46199
+ continue;
46200
+ }
46201
+ var infoArr = sArr.length > 2 ? sArr.slice(2) : [];
46202
+ if (key === "Description") {
46203
+ _description = infoArr.join(" ");
46204
+ } else if (key === "DateTime") {
46205
+ _datetime = infoArr.join(" ");
46206
+ } else if (key === "Offset") {
46207
+ if (!sArr[2]) {
46208
+ throw new Error("Geoid model file: Error reading offset");
46209
+ }
46210
+ _offset = parseInt(sArr[2], 10);
46211
+ } else if (key === "Scale") {
46212
+ if (!sArr[2]) {
46213
+ throw new Error("Geoid model file: Error reading scale");
46214
+ }
46215
+ _scale = parseFloat(sArr[2]);
46216
+ } else if (key === (options.cubic ? "MaxCubicError" : "MaxBilinearError")) {
46217
+ if (isFinite(parseFloat(sArr[2]))) {
46218
+ _maxerror = parseFloat(sArr[2]);
46219
+ }
46220
+ } else if (key === (options.cubic ? "RMSCubicError" : "RMSBilinearError")) {
46221
+ if (isFinite(parseFloat(sArr[2]))) {
46222
+ _rmserror = parseFloat(sArr[2]);
46223
+ }
46224
+ }
46225
+ } else {
46226
+ var _sArr = s.split(" ");
46227
+ _sArr = _sArr.filter(function(testString) {
46228
+ return testString !== "";
46229
+ });
46230
+ _width = parseInt(_sArr[0], 10);
46231
+ _height = parseInt(_sArr[1], 10);
46232
+ if (!(_width && _height)) {
46233
+ throw new Error("Geoid model file: Error reading raster size");
46234
+ }
46235
+ break;
46236
+ }
46237
+ } while (!currentLine.done);
46238
+ currentLine = getline.next();
46239
+ var maxval = parseInt(currentLine.value.line, 10);
46240
+ if (currentLine.done) {
46241
+ throw new Error("Geoid model file: Error reading maxval");
46242
+ }
46243
+ if (maxval !== PIXEL_MAX) {
46244
+ throw new Error("Geoid model file: Incorrect value of maxval");
46245
+ }
46246
+ _datastart = currentLine.value.offset;
46247
+ _swidth = _width;
46248
+ if (_offset === Number.MAX_VALUE) {
46249
+ throw new Error("Geoid model file: Offset not set");
46250
+ }
46251
+ if (_scale === 0) {
46252
+ throw new Error("Geoid model file: Scale not set");
46253
+ }
46254
+ if (_scale < 0) {
46255
+ throw new Error("Geoid model file: Scale must be positive");
46256
+ }
46257
+ if (_height < 2 || _width < 2) {
46258
+ throw new Error("Geoid model file: Raster size too small");
46259
+ }
46260
+ if (_width & 1) {
46261
+ throw new Error("Geoid model file: Raster width is odd");
46262
+ }
46263
+ if (!(_height & 1)) {
46264
+ throw new Error("Geoid model file: Raster height is even");
46265
+ }
46266
+ var _rlonres = _width / 360;
46267
+ var _rlatres = (_height - 1) / 180;
46268
+ return new _geoid.default({
46269
+ cubic: options.cubic,
46270
+ _width,
46271
+ _height,
46272
+ _rlonres,
46273
+ _rlatres,
46274
+ _offset,
46275
+ _scale,
46276
+ _swidth,
46277
+ _datastart,
46278
+ _maxerror,
46279
+ _rmserror,
46280
+ _description,
46281
+ _datetime,
46282
+ data
46283
+ });
46284
+ }
46285
+ function _getLineGenerator(data) {
46286
+ var offset, endLineIndex, line, _line;
46287
+ return _regenerator.default.wrap(function _getLineGenerator$(_context) {
46288
+ while (1) {
46289
+ switch (_context.prev = _context.next) {
46290
+ case 0:
46291
+ offset = 0;
46292
+ case 1:
46293
+ endLineIndex = data.indexOf(ENDL, offset);
46294
+ if (!(endLineIndex !== -1)) {
46295
+ _context.next = 9;
46296
+ break;
46297
+ }
46298
+ line = data.subarray(offset, endLineIndex);
46299
+ offset = endLineIndex + 1;
46300
+ _context.next = 7;
46301
+ return {
46302
+ offset,
46303
+ line: _getStringFromCharArray(line)
46304
+ };
46305
+ case 7:
46306
+ _context.next = 13;
46307
+ break;
46308
+ case 9:
46309
+ _line = data.subarray(offset, data.length);
46310
+ offset = data.length;
46311
+ _context.next = 13;
46312
+ return {
46313
+ offset,
46314
+ line: _getStringFromCharArray(_line)
46315
+ };
46316
+ case 13:
46317
+ if (offset < data.length) {
46318
+ _context.next = 1;
46319
+ break;
46320
+ }
46321
+ case 14:
46322
+ return _context.abrupt("return", {
46323
+ offset,
46324
+ line: ""
46325
+ });
46326
+ case 15:
46327
+ case "end":
46328
+ return _context.stop();
46329
+ }
46330
+ }
46331
+ }, _marked);
46332
+ }
46333
+ function _getStringFromCharArray(array) {
46334
+ var s = "";
46335
+ var _iterator = _createForOfIteratorHelper(array), _step;
46336
+ try {
46337
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
46338
+ var char = _step.value;
46339
+ s += String.fromCharCode(char);
46340
+ }
46341
+ } catch (err) {
46342
+ _iterator.e(err);
46343
+ } finally {
46344
+ _iterator.f();
46345
+ }
46346
+ return s;
46347
+ }
46348
+ }
46349
+ });
46350
+
46351
+ // ../../node_modules/@math.gl/geoid/dist/es5/index.js
46352
+ var require_es56 = __commonJS({
46353
+ "../../node_modules/@math.gl/geoid/dist/es5/index.js"(exports) {
46354
+ "use strict";
46355
+ var _interopRequireDefault = require_interopRequireDefault();
46356
+ Object.defineProperty(exports, "__esModule", {
46357
+ value: true
46358
+ });
46359
+ Object.defineProperty(exports, "parsePGM", {
46360
+ enumerable: true,
46361
+ get: function get() {
46362
+ return _parsePgm.parsePGM;
46363
+ }
46364
+ });
46365
+ Object.defineProperty(exports, "Geoid", {
46366
+ enumerable: true,
46367
+ get: function get() {
46368
+ return _geoid.default;
46369
+ }
46370
+ });
46371
+ var _parsePgm = require_parse_pgm();
46372
+ var _geoid = _interopRequireDefault(require_geoid());
46373
+ }
46374
+ });
46375
+
45984
46376
  // ../../node_modules/@babel/runtime/helpers/asyncToGenerator.js
45985
46377
  var require_asyncToGenerator = __commonJS({
45986
46378
  "../../node_modules/@babel/runtime/helpers/asyncToGenerator.js"(exports, module2) {
@@ -46014,7 +46406,6 @@ var require_asyncToGenerator = __commonJS({
46014
46406
  };
46015
46407
  }
46016
46408
  module2.exports = _asyncToGenerator;
46017
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
46018
46409
  }
46019
46410
  });
46020
46411
 
@@ -47791,7 +48182,7 @@ var require_context = __commonJS({
47791
48182
  });
47792
48183
 
47793
48184
  // ../../node_modules/@luma.gl/gltools/dist/es5/index.js
47794
- var require_es56 = __commonJS({
48185
+ var require_es57 = __commonJS({
47795
48186
  "../../node_modules/@luma.gl/gltools/dist/es5/index.js"(exports) {
47796
48187
  "use strict";
47797
48188
  Object.defineProperty(exports, "__esModule", {
@@ -47938,7 +48329,7 @@ var require_init2 = __commonJS({
47938
48329
  exports.default = exports.lumaStats = void 0;
47939
48330
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
47940
48331
  var _createClass2 = _interopRequireDefault(require_createClass());
47941
- var _gltools = require_es56();
48332
+ var _gltools = require_es57();
47942
48333
  var _probe = require_es52();
47943
48334
  var _env = require_env2();
47944
48335
  var VERSION15 = true ? "8.5.4" : "untranspiled source";
@@ -48216,7 +48607,7 @@ var require_stub_methods = __commonJS({
48216
48607
  value: true
48217
48608
  });
48218
48609
  exports.stubRemovedMethods = stubRemovedMethods;
48219
- var _gltools = require_es56();
48610
+ var _gltools = require_es57();
48220
48611
  function stubRemovedMethods(instance, className, version2, methodNames) {
48221
48612
  var upgradeMessage = "See luma.gl ".concat(version2, " Upgrade Guide at https://luma.gl/docs/upgrade-guide");
48222
48613
  var prototype = Object.getPrototypeOf(instance);
@@ -48241,7 +48632,7 @@ var require_check_props = __commonJS({
48241
48632
  value: true
48242
48633
  });
48243
48634
  exports.checkProps = checkProps;
48244
- var _gltools = require_es56();
48635
+ var _gltools = require_es57();
48245
48636
  function checkProps(className, props, propChecks) {
48246
48637
  var _propChecks$removedPr = propChecks.removedProps, removedProps = _propChecks$removedPr === void 0 ? {} : _propChecks$removedPr, _propChecks$deprecate = propChecks.deprecatedProps, deprecatedProps = _propChecks$deprecate === void 0 ? {} : _propChecks$deprecate, _propChecks$replacedP = propChecks.replacedProps, replacedProps = _propChecks$replacedP === void 0 ? {} : _propChecks$replacedP;
48247
48638
  for (var propName in removedProps) {
@@ -48468,7 +48859,7 @@ var require_resource = __commonJS({
48468
48859
  exports.default = void 0;
48469
48860
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
48470
48861
  var _createClass2 = _interopRequireDefault(require_createClass());
48471
- var _gltools = require_es56();
48862
+ var _gltools = require_es57();
48472
48863
  var _init = require_init2();
48473
48864
  var _webglUtils = require_webgl_utils();
48474
48865
  var _utils = require_utils4();
@@ -48917,7 +49308,7 @@ var require_buffer = __commonJS({
48917
49308
  var _resource = _interopRequireDefault(require_resource());
48918
49309
  var _accessor = _interopRequireDefault(require_accessor());
48919
49310
  var _webglUtils = require_webgl_utils();
48920
- var _gltools = require_es56();
49311
+ var _gltools = require_es57();
48921
49312
  var _utils = require_utils4();
48922
49313
  function _createSuper(Derived) {
48923
49314
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
@@ -49296,7 +49687,7 @@ var require_texture_formats = __commonJS({
49296
49687
  exports.isLinearFilteringSupported = isLinearFilteringSupported;
49297
49688
  exports.TYPE_SIZES = exports.DATA_FORMAT_CHANNELS = exports.TEXTURE_FORMATS = void 0;
49298
49689
  var _defineProperty2 = _interopRequireDefault(require_defineProperty());
49299
- var _gltools = require_es56();
49690
+ var _gltools = require_es57();
49300
49691
  var _TEXTURE_FORMATS;
49301
49692
  var _DATA_FORMAT_CHANNELS;
49302
49693
  var _TYPE_SIZES;
@@ -49377,7 +49768,7 @@ var require_texture = __commonJS({
49377
49768
  var _inherits2 = _interopRequireDefault(require_inherits());
49378
49769
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
49379
49770
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
49380
- var _gltools = require_es56();
49771
+ var _gltools = require_es57();
49381
49772
  var _env = require_env2();
49382
49773
  var _resource = _interopRequireDefault(require_resource());
49383
49774
  var _buffer = _interopRequireDefault(require_buffer());
@@ -50097,7 +50488,7 @@ var require_texture_2d = __commonJS({
50097
50488
  var _inherits2 = _interopRequireDefault(require_inherits());
50098
50489
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
50099
50490
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
50100
- var _gltools = require_es56();
50491
+ var _gltools = require_es57();
50101
50492
  var _texture = _interopRequireDefault(require_texture());
50102
50493
  var _loadFile = require_load_file();
50103
50494
  function _createSuper(Derived) {
@@ -50182,7 +50573,7 @@ var require_texture_cube = __commonJS({
50182
50573
  var _inherits2 = _interopRequireDefault(require_inherits());
50183
50574
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
50184
50575
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
50185
- var _gltools = require_es56();
50576
+ var _gltools = require_es57();
50186
50577
  var _texture = _interopRequireDefault(require_texture());
50187
50578
  function _createSuper(Derived) {
50188
50579
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
@@ -50348,7 +50739,7 @@ var require_texture_3d = __commonJS({
50348
50739
  var _inherits2 = _interopRequireDefault(require_inherits());
50349
50740
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
50350
50741
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
50351
- var _gltools = require_es56();
50742
+ var _gltools = require_es57();
50352
50743
  var _texture = _interopRequireDefault(require_texture());
50353
50744
  var _textureFormats = require_texture_formats();
50354
50745
  var _buffer = _interopRequireDefault(require_buffer());
@@ -50451,7 +50842,6 @@ var require_superPropBase = __commonJS({
50451
50842
  return object;
50452
50843
  }
50453
50844
  module2.exports = _superPropBase;
50454
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
50455
50845
  }
50456
50846
  });
50457
50847
 
@@ -50462,7 +50852,6 @@ var require_get = __commonJS({
50462
50852
  function _get(target, property, receiver) {
50463
50853
  if (typeof Reflect !== "undefined" && Reflect.get) {
50464
50854
  module2.exports = _get = Reflect.get;
50465
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
50466
50855
  } else {
50467
50856
  module2.exports = _get = function _get2(target2, property2, receiver2) {
50468
50857
  var base = superPropBase(target2, property2);
@@ -50474,12 +50863,10 @@ var require_get = __commonJS({
50474
50863
  }
50475
50864
  return desc.value;
50476
50865
  };
50477
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
50478
50866
  }
50479
50867
  return _get(target, property, receiver || target);
50480
50868
  }
50481
50869
  module2.exports = _get;
50482
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
50483
50870
  }
50484
50871
  });
50485
50872
 
@@ -50634,7 +51021,7 @@ var require_renderbuffer = __commonJS({
50634
51021
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
50635
51022
  var _resource = _interopRequireDefault(require_resource());
50636
51023
  var _renderbufferFormats = _interopRequireDefault(require_renderbuffer_formats());
50637
- var _gltools = require_es56();
51024
+ var _gltools = require_es57();
50638
51025
  var _utils = require_utils4();
50639
51026
  function _createSuper(Derived) {
50640
51027
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
@@ -50784,7 +51171,7 @@ var require_clear = __commonJS({
50784
51171
  exports.clear = clear;
50785
51172
  exports.clearBuffer = clearBuffer;
50786
51173
  var _slicedToArray2 = _interopRequireDefault(require_slicedToArray());
50787
- var _gltools = require_es56();
51174
+ var _gltools = require_es57();
50788
51175
  var _utils = require_utils4();
50789
51176
  var GL_DEPTH_BUFFER_BIT = 256;
50790
51177
  var GL_STENCIL_BUFFER_BIT = 1024;
@@ -50927,7 +51314,7 @@ var require_copy_and_blit = __commonJS({
50927
51314
  var _buffer = _interopRequireDefault(require_buffer());
50928
51315
  var _framebuffer = _interopRequireDefault(require_framebuffer());
50929
51316
  var _texture = _interopRequireDefault(require_texture());
50930
- var _gltools = require_es56();
51317
+ var _gltools = require_es57();
50931
51318
  var _webglUtils = require_webgl_utils();
50932
51319
  var _typedArrayUtils = require_typed_array_utils();
50933
51320
  var _formatUtils = require_format_utils();
@@ -51296,7 +51683,7 @@ var require_limits = __commonJS({
51296
51683
  exports.getContextInfo = getContextInfo;
51297
51684
  var _defineProperty2 = _interopRequireDefault(require_defineProperty());
51298
51685
  var _webglLimitsTable = _interopRequireDefault(require_webgl_limits_table());
51299
- var _gltools = require_es56();
51686
+ var _gltools = require_es57();
51300
51687
  function getContextLimits(gl) {
51301
51688
  gl.luma = gl.luma || {};
51302
51689
  if (!gl.luma.limits) {
@@ -51409,7 +51796,7 @@ var require_features = __commonJS({
51409
51796
  exports.hasFeatures = hasFeatures;
51410
51797
  exports.getFeatures = getFeatures;
51411
51798
  var _webglFeaturesTable = _interopRequireDefault(require_webgl_features_table());
51412
- var _gltools = require_es56();
51799
+ var _gltools = require_es57();
51413
51800
  var _utils = require_utils4();
51414
51801
  function _createForOfIteratorHelper(o, allowArrayLike) {
51415
51802
  var it;
@@ -51670,7 +52057,7 @@ var require_framebuffer = __commonJS({
51670
52057
  var _inherits2 = _interopRequireDefault(require_inherits());
51671
52058
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
51672
52059
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
51673
- var _gltools = require_es56();
52060
+ var _gltools = require_es57();
51674
52061
  var _resource = _interopRequireDefault(require_resource());
51675
52062
  var _texture2d = _interopRequireDefault(require_texture_2d());
51676
52063
  var _renderbuffer = _interopRequireDefault(require_renderbuffer());
@@ -52403,18 +52790,18 @@ var require_texture_utils = __commonJS({
52403
52790
  // ../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js
52404
52791
  var require_interopRequireWildcard = __commonJS({
52405
52792
  "../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js"(exports, module2) {
52406
- var _typeof = require_typeof()["default"];
52407
- function _getRequireWildcardCache(nodeInterop) {
52793
+ var _typeof = require_typeof();
52794
+ function _getRequireWildcardCache() {
52408
52795
  if (typeof WeakMap !== "function")
52409
52796
  return null;
52410
- var cacheBabelInterop = new WeakMap();
52411
- var cacheNodeInterop = new WeakMap();
52412
- return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
52413
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
52414
- })(nodeInterop);
52797
+ var cache = new WeakMap();
52798
+ _getRequireWildcardCache = function _getRequireWildcardCache2() {
52799
+ return cache;
52800
+ };
52801
+ return cache;
52415
52802
  }
52416
- function _interopRequireWildcard(obj, nodeInterop) {
52417
- if (!nodeInterop && obj && obj.__esModule) {
52803
+ function _interopRequireWildcard(obj) {
52804
+ if (obj && obj.__esModule) {
52418
52805
  return obj;
52419
52806
  }
52420
52807
  if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
@@ -52422,14 +52809,14 @@ var require_interopRequireWildcard = __commonJS({
52422
52809
  "default": obj
52423
52810
  };
52424
52811
  }
52425
- var cache = _getRequireWildcardCache(nodeInterop);
52812
+ var cache = _getRequireWildcardCache();
52426
52813
  if (cache && cache.has(obj)) {
52427
52814
  return cache.get(obj);
52428
52815
  }
52429
52816
  var newObj = {};
52430
52817
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
52431
52818
  for (var key in obj) {
52432
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
52819
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
52433
52820
  var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
52434
52821
  if (desc && (desc.get || desc.set)) {
52435
52822
  Object.defineProperty(newObj, key, desc);
@@ -52445,7 +52832,6 @@ var require_interopRequireWildcard = __commonJS({
52445
52832
  return newObj;
52446
52833
  }
52447
52834
  module2.exports = _interopRequireWildcard;
52448
- module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
52449
52835
  }
52450
52836
  });
52451
52837
 
@@ -52658,7 +53044,7 @@ var require_shader = __commonJS({
52658
53044
  var _inherits2 = _interopRequireDefault(require_inherits());
52659
53045
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
52660
53046
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
52661
- var _gltools = require_es56();
53047
+ var _gltools = require_es57();
52662
53048
  var _glslUtils = require_glsl_utils();
52663
53049
  var _utils = require_utils4();
52664
53050
  var _resource = _interopRequireDefault(require_resource());
@@ -52856,7 +53242,7 @@ var require_uniforms = __commonJS({
52856
53242
  exports.checkUniformValues = checkUniformValues;
52857
53243
  exports.copyUniform = copyUniform;
52858
53244
  var _defineProperty2 = _interopRequireDefault(require_defineProperty());
52859
- var _gltools = require_es56();
53245
+ var _gltools = require_es57();
52860
53246
  var _framebuffer = _interopRequireDefault(require_framebuffer());
52861
53247
  var _renderbuffer = _interopRequireDefault(require_renderbuffer());
52862
53248
  var _texture = _interopRequireDefault(require_texture());
@@ -53189,7 +53575,7 @@ var require_program_configuration = __commonJS({
53189
53575
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
53190
53576
  var _createClass2 = _interopRequireDefault(require_createClass());
53191
53577
  var _accessor = _interopRequireDefault(require_accessor());
53192
- var _gltools = require_es56();
53578
+ var _gltools = require_es57();
53193
53579
  var _attributeUtils = require_attribute_utils();
53194
53580
  var ProgramConfiguration = function() {
53195
53581
  function ProgramConfiguration2(program) {
@@ -53348,7 +53734,7 @@ var require_program = __commonJS({
53348
53734
  var _uniforms = require_uniforms();
53349
53735
  var _shader = require_shader();
53350
53736
  var _programConfiguration = _interopRequireDefault(require_program_configuration());
53351
- var _gltools = require_es56();
53737
+ var _gltools = require_es57();
53352
53738
  var _webglUtils = require_webgl_utils();
53353
53739
  var _attributeUtils = require_attribute_utils();
53354
53740
  var _utils = require_utils4();
@@ -53759,7 +54145,7 @@ var require_query = __commonJS({
53759
54145
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
53760
54146
  var _resource = _interopRequireDefault(require_resource());
53761
54147
  var _features = require_features2();
53762
- var _gltools = require_es56();
54148
+ var _gltools = require_es57();
53763
54149
  var _utils = require_utils4();
53764
54150
  function _createForOfIteratorHelper(o, allowArrayLike) {
53765
54151
  var it;
@@ -54023,7 +54409,7 @@ var require_transform_feedback = __commonJS({
54023
54409
  var _inherits2 = _interopRequireDefault(require_inherits());
54024
54410
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
54025
54411
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
54026
- var _gltools = require_es56();
54412
+ var _gltools = require_es57();
54027
54413
  var _resource = _interopRequireDefault(require_resource());
54028
54414
  var _buffer = _interopRequireDefault(require_buffer());
54029
54415
  var _utils = require_utils4();
@@ -54308,7 +54694,7 @@ var require_vertex_array_object = __commonJS({
54308
54694
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
54309
54695
  var _resource = _interopRequireDefault(require_resource());
54310
54696
  var _buffer = _interopRequireDefault(require_buffer());
54311
- var _gltools = require_es56();
54697
+ var _gltools = require_es57();
54312
54698
  var _arrayUtilsFlat = require_array_utils_flat();
54313
54699
  var _utils = require_utils4();
54314
54700
  var _probe = require_es52();
@@ -54636,7 +55022,7 @@ var require_vertex_array = __commonJS({
54636
55022
  exports.default = void 0;
54637
55023
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
54638
55024
  var _createClass2 = _interopRequireDefault(require_createClass());
54639
- var _gltools = require_es56();
55025
+ var _gltools = require_es57();
54640
55026
  var _accessor2 = _interopRequireDefault(require_accessor());
54641
55027
  var _buffer = _interopRequireDefault(require_buffer());
54642
55028
  var _vertexArrayObject = _interopRequireDefault(require_vertex_array_object());
@@ -55512,7 +55898,7 @@ var require_debug_program_configuration = __commonJS({
55512
55898
  });
55513
55899
 
55514
55900
  // ../../node_modules/@luma.gl/webgl/dist/es5/index.js
55515
- var require_es57 = __commonJS({
55901
+ var require_es58 = __commonJS({
55516
55902
  "../../node_modules/@luma.gl/webgl/dist/es5/index.js"(exports) {
55517
55903
  "use strict";
55518
55904
  var _interopRequireDefault = require_interopRequireDefault();
@@ -55858,7 +56244,7 @@ var require_es57 = __commonJS({
55858
56244
  var _loadFile = require_load_file();
55859
56245
  var _getShaderName = _interopRequireDefault(require_get_shader_name());
55860
56246
  var _getShaderVersion = _interopRequireDefault(require_get_shader_version());
55861
- var _gltools = require_es56();
56247
+ var _gltools = require_es57();
55862
56248
  var _assert = _interopRequireDefault(require_assert4());
55863
56249
  var _utils = require_utils3();
55864
56250
  var _uniforms = require_uniforms();
@@ -55882,8 +56268,8 @@ var require_animation_loop = __commonJS({
55882
56268
  var _asyncToGenerator2 = _interopRequireDefault(require_asyncToGenerator());
55883
56269
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
55884
56270
  var _createClass2 = _interopRequireDefault(require_createClass());
55885
- var _gltools = require_es56();
55886
- var _webgl = require_es57();
56271
+ var _gltools = require_es57();
56272
+ var _webgl = require_es58();
55887
56273
  var _env = require_env2();
55888
56274
  var isPage = (0, _env.isBrowser)() && typeof document !== "undefined";
55889
56275
  var statIdCounter = 0;
@@ -61553,7 +61939,7 @@ var require_pose2 = __commonJS({
61553
61939
  });
61554
61940
 
61555
61941
  // ../../node_modules/@luma.gl/shadertools/node_modules/@math.gl/core/dist/es5/index.js
61556
- var require_es58 = __commonJS({
61942
+ var require_es59 = __commonJS({
61557
61943
  "../../node_modules/@luma.gl/shadertools/node_modules/@math.gl/core/dist/es5/index.js"(exports) {
61558
61944
  "use strict";
61559
61945
  var _interopRequireDefault = require_interopRequireDefault();
@@ -61803,7 +62189,7 @@ var require_project = __commonJS({
61803
62189
  value: true
61804
62190
  });
61805
62191
  exports.project = void 0;
61806
- var _core = require_es58();
62192
+ var _core = require_es59();
61807
62193
  var IDENTITY_MATRIX = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
61808
62194
  var DEFAULT_MODULE_OPTIONS = {
61809
62195
  modelMatrix: IDENTITY_MATRIX,
@@ -63133,7 +63519,7 @@ var require_modules = __commonJS({
63133
63519
  });
63134
63520
 
63135
63521
  // ../../node_modules/@luma.gl/shadertools/dist/es5/index.js
63136
- var require_es59 = __commonJS({
63522
+ var require_es510 = __commonJS({
63137
63523
  "../../node_modules/@luma.gl/shadertools/dist/es5/index.js"(exports) {
63138
63524
  "use strict";
63139
63525
  Object.defineProperty(exports, "__esModule", {
@@ -63230,8 +63616,8 @@ var require_program_manager = __commonJS({
63230
63616
  exports.default = void 0;
63231
63617
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
63232
63618
  var _createClass2 = _interopRequireDefault(require_createClass());
63233
- var _shadertools = require_es59();
63234
- var _webgl = require_es57();
63619
+ var _shadertools = require_es510();
63620
+ var _webgl = require_es58();
63235
63621
  function _createForOfIteratorHelper(o, allowArrayLike) {
63236
63622
  var it;
63237
63623
  if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
@@ -63479,7 +63865,7 @@ var require_model_utils = __commonJS({
63479
63865
  exports.getBuffersFromGeometry = getBuffersFromGeometry;
63480
63866
  exports.inferAttributeAccessor = inferAttributeAccessor;
63481
63867
  var _defineProperty2 = _interopRequireDefault(require_defineProperty());
63482
- var _webgl = require_es57();
63868
+ var _webgl = require_es58();
63483
63869
  function ownKeys(object, enumerableOnly) {
63484
63870
  var keys = Object.keys(object);
63485
63871
  if (Object.getOwnPropertySymbols) {
@@ -63596,9 +63982,9 @@ var require_model = __commonJS({
63596
63982
  var _defineProperty2 = _interopRequireDefault(require_defineProperty());
63597
63983
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
63598
63984
  var _createClass2 = _interopRequireDefault(require_createClass());
63599
- var _gltools = require_es56();
63985
+ var _gltools = require_es57();
63600
63986
  var _programManager = _interopRequireDefault(require_program_manager());
63601
- var _webgl = require_es57();
63987
+ var _webgl = require_es58();
63602
63988
  var _modelUtils = require_model_utils();
63603
63989
  var LOG_DRAW_PRIORITY = 2;
63604
63990
  var LOG_DRAW_TIMEOUT = 1e4;
@@ -64045,8 +64431,8 @@ var require_buffer_transform = __commonJS({
64045
64431
  exports.default = void 0;
64046
64432
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
64047
64433
  var _createClass2 = _interopRequireDefault(require_createClass());
64048
- var _gltools = require_es56();
64049
- var _webgl = require_es57();
64434
+ var _gltools = require_es57();
64435
+ var _webgl = require_es58();
64050
64436
  function _createForOfIteratorHelper(o, allowArrayLike) {
64051
64437
  var it;
64052
64438
  if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
@@ -64346,8 +64732,8 @@ var require_transform_shader_utils = __commonJS({
64346
64732
  exports.getSizeUniforms = getSizeUniforms;
64347
64733
  exports.getVaryingType = getVaryingType;
64348
64734
  exports.processAttributeDefinition = processAttributeDefinition;
64349
- var _webgl = require_es57();
64350
- var _shadertools = require_es59();
64735
+ var _webgl = require_es58();
64736
+ var _shadertools = require_es510();
64351
64737
  var SAMPLER_UNIFORM_PREFIX = "transform_uSampler_";
64352
64738
  var SIZE_UNIFORM_PREFIX = "transform_uSize_";
64353
64739
  var VS_POS_VARIABLE = "transform_position";
@@ -64475,8 +64861,8 @@ var require_texture_transform = __commonJS({
64475
64861
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
64476
64862
  var _createClass2 = _interopRequireDefault(require_createClass());
64477
64863
  var _defineProperty2 = _interopRequireDefault(require_defineProperty());
64478
- var _webgl = require_es57();
64479
- var _shadertools = require_es59();
64864
+ var _webgl = require_es58();
64865
+ var _shadertools = require_es510();
64480
64866
  var _transformShaderUtils = require_transform_shader_utils();
64481
64867
  var _SRC_TEX_PARAMETER_OV;
64482
64868
  var SRC_TEX_PARAMETER_OVERRIDES = (_SRC_TEX_PARAMETER_OV = {}, (0, _defineProperty2.default)(_SRC_TEX_PARAMETER_OV, 10241, 9728), (0, _defineProperty2.default)(_SRC_TEX_PARAMETER_OV, 10240, 9728), (0, _defineProperty2.default)(_SRC_TEX_PARAMETER_OV, 10242, 33071), (0, _defineProperty2.default)(_SRC_TEX_PARAMETER_OV, 10243, 33071), _SRC_TEX_PARAMETER_OV);
@@ -64801,11 +65187,11 @@ var require_transform2 = __commonJS({
64801
65187
  exports.default = void 0;
64802
65188
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
64803
65189
  var _createClass2 = _interopRequireDefault(require_createClass());
64804
- var _shadertools = require_es59();
65190
+ var _shadertools = require_es510();
64805
65191
  var _bufferTransform = _interopRequireDefault(require_buffer_transform());
64806
65192
  var _textureTransform = _interopRequireDefault(require_texture_transform());
64807
- var _gltools = require_es56();
64808
- var _webgl = require_es57();
65193
+ var _gltools = require_es57();
65194
+ var _webgl = require_es58();
64809
65195
  var _model = _interopRequireDefault(require_model());
64810
65196
  function _createForOfIteratorHelper(o, allowArrayLike) {
64811
65197
  var it;
@@ -65080,7 +65466,7 @@ var require_geometry = __commonJS({
65080
65466
  var _defineProperty2 = _interopRequireDefault(require_defineProperty());
65081
65467
  var _classCallCheck2 = _interopRequireDefault(require_classCallCheck());
65082
65468
  var _createClass2 = _interopRequireDefault(require_createClass());
65083
- var _webgl = require_es57();
65469
+ var _webgl = require_es58();
65084
65470
  function ownKeys(object, enumerableOnly) {
65085
65471
  var keys = Object.keys(object);
65086
65472
  if (Object.getOwnPropertySymbols) {
@@ -65230,7 +65616,7 @@ var require_truncated_cone_geometry = __commonJS({
65230
65616
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
65231
65617
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
65232
65618
  var _geometry = _interopRequireDefault(require_geometry());
65233
- var _webgl = require_es57();
65619
+ var _webgl = require_es58();
65234
65620
  function ownKeys(object, enumerableOnly) {
65235
65621
  var keys = Object.keys(object);
65236
65622
  if (Object.getOwnPropertySymbols) {
@@ -65412,7 +65798,7 @@ var require_cone_geometry = __commonJS({
65412
65798
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
65413
65799
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
65414
65800
  var _truncatedConeGeometry = _interopRequireDefault(require_truncated_cone_geometry());
65415
- var _webgl = require_es57();
65801
+ var _webgl = require_es58();
65416
65802
  function ownKeys(object, enumerableOnly) {
65417
65803
  var keys = Object.keys(object);
65418
65804
  if (Object.getOwnPropertySymbols) {
@@ -65506,7 +65892,7 @@ var require_cube_geometry = __commonJS({
65506
65892
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
65507
65893
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
65508
65894
  var _geometry = _interopRequireDefault(require_geometry());
65509
- var _webgl = require_es57();
65895
+ var _webgl = require_es58();
65510
65896
  function ownKeys(object, enumerableOnly) {
65511
65897
  var keys = Object.keys(object);
65512
65898
  if (Object.getOwnPropertySymbols) {
@@ -65619,7 +66005,7 @@ var require_cylinder_geometry = __commonJS({
65619
66005
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
65620
66006
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
65621
66007
  var _truncatedConeGeometry = _interopRequireDefault(require_truncated_cone_geometry());
65622
- var _webgl = require_es57();
66008
+ var _webgl = require_es58();
65623
66009
  function ownKeys(object, enumerableOnly) {
65624
66010
  var keys = Object.keys(object);
65625
66011
  if (Object.getOwnPropertySymbols) {
@@ -69495,7 +69881,7 @@ var require_pose3 = __commonJS({
69495
69881
  });
69496
69882
 
69497
69883
  // ../../node_modules/@luma.gl/engine/node_modules/@math.gl/core/dist/es5/index.js
69498
- var require_es510 = __commonJS({
69884
+ var require_es511 = __commonJS({
69499
69885
  "../../node_modules/@luma.gl/engine/node_modules/@math.gl/core/dist/es5/index.js"(exports) {
69500
69886
  "use strict";
69501
69887
  var _interopRequireDefault = require_interopRequireDefault();
@@ -69751,9 +70137,9 @@ var require_ico_sphere_geometry = __commonJS({
69751
70137
  var _inherits2 = _interopRequireDefault(require_inherits());
69752
70138
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
69753
70139
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
69754
- var _core = require_es510();
70140
+ var _core = require_es511();
69755
70141
  var _geometry = _interopRequireDefault(require_geometry());
69756
- var _webgl = require_es57();
70142
+ var _webgl = require_es58();
69757
70143
  function ownKeys(object, enumerableOnly) {
69758
70144
  var keys = Object.keys(object);
69759
70145
  if (Object.getOwnPropertySymbols) {
@@ -70030,7 +70416,7 @@ var require_plane_geometry = __commonJS({
70030
70416
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
70031
70417
  var _geometry = _interopRequireDefault(require_geometry());
70032
70418
  var _geometryUtils = require_geometry_utils();
70033
- var _webgl = require_es57();
70419
+ var _webgl = require_es58();
70034
70420
  function ownKeys(object, enumerableOnly) {
70035
70421
  var keys = Object.keys(object);
70036
70422
  if (Object.getOwnPropertySymbols) {
@@ -70212,7 +70598,7 @@ var require_sphere_geometry = __commonJS({
70212
70598
  var _possibleConstructorReturn2 = _interopRequireDefault(require_possibleConstructorReturn());
70213
70599
  var _getPrototypeOf2 = _interopRequireDefault(require_getPrototypeOf());
70214
70600
  var _geometry = _interopRequireDefault(require_geometry());
70215
- var _webgl = require_es57();
70601
+ var _webgl = require_es58();
70216
70602
  function ownKeys(object, enumerableOnly) {
70217
70603
  var keys = Object.keys(object);
70218
70604
  if (Object.getOwnPropertySymbols) {
@@ -70773,7 +71159,7 @@ var require_clip_space = __commonJS({
70773
71159
  });
70774
71160
 
70775
71161
  // ../../node_modules/@luma.gl/engine/dist/es5/index.js
70776
- var require_es511 = __commonJS({
71162
+ var require_es512 = __commonJS({
70777
71163
  "../../node_modules/@luma.gl/engine/dist/es5/index.js"(exports) {
70778
71164
  "use strict";
70779
71165
  var _interopRequireDefault = require_interopRequireDefault();
@@ -70889,7 +71275,7 @@ var require_es511 = __commonJS({
70889
71275
  });
70890
71276
 
70891
71277
  // ../../node_modules/@luma.gl/constants/dist/es5/index.js
70892
- var require_es512 = __commonJS({
71278
+ var require_es513 = __commonJS({
70893
71279
  "../../node_modules/@luma.gl/constants/dist/es5/index.js"(exports) {
70894
71280
  "use strict";
70895
71281
  Object.defineProperty(exports, "__esModule", {
@@ -71913,6 +72299,9 @@ function getWorkerURL(worker, options = {}) {
71913
72299
  const workerOptions = options[worker.id] || {};
71914
72300
  const workerFile = `${worker.id}-worker.js`;
71915
72301
  let url = workerOptions.workerUrl;
72302
+ if (!url && worker.id === "compression") {
72303
+ url = options.workerUrl;
72304
+ }
71916
72305
  if (options._workerType === "test") {
71917
72306
  url = `modules/${worker.module}/dist/${workerFile}`;
71918
72307
  }
@@ -74271,6 +74660,7 @@ var TileHeader = class {
74271
74660
  this.depth = 0;
74272
74661
  this.viewportIds = [];
74273
74662
  this.userData = {};
74663
+ this.extensions = null;
74274
74664
  this._priority = 0;
74275
74665
  this._touchedFrame = 0;
74276
74666
  this._visitedFrame = 0;
@@ -75176,7 +75566,8 @@ var TILE3D_TYPE = {
75176
75566
  BATCHED_3D_MODEL: "b3dm",
75177
75567
  INSTANCED_3D_MODEL: "i3dm",
75178
75568
  GEOMETRY: "geom",
75179
- VECTOR: "vect"
75569
+ VECTOR: "vect",
75570
+ GLTF: "glTF"
75180
75571
  };
75181
75572
  var TILE3D_TYPES = Object.keys(TILE3D_TYPE);
75182
75573
  var MAGIC_ARRAY = {
@@ -77678,8 +78069,8 @@ function initializeBasisEncoderModule(BasisEncoderModule, wasmBinary) {
77678
78069
  });
77679
78070
  }
77680
78071
 
77681
- // ../textures/src/lib/gl-constants.ts
77682
- var GL3 = {
78072
+ // ../textures/src/lib/gl-extensions.ts
78073
+ var GL_EXTENSIONS_CONSTANTS = {
77683
78074
  COMPRESSED_RGB_S3TC_DXT1_EXT: 33776,
77684
78075
  COMPRESSED_RGBA_S3TC_DXT1_EXT: 33777,
77685
78076
  COMPRESSED_RGBA_S3TC_DXT3_EXT: 33778,
@@ -77818,72 +78209,72 @@ function getLevelSize(options, levelWidth, levelHeight, data, index) {
77818
78209
 
77819
78210
  // ../textures/src/lib/utils/ktx-format-helper.ts
77820
78211
  var VULKAN_TO_WEBGL_FORMAT_MAP = {
77821
- 131: GL3.COMPRESSED_RGB_S3TC_DXT1_EXT,
77822
- 132: GL3.COMPRESSED_SRGB_S3TC_DXT1_EXT,
77823
- 133: GL3.COMPRESSED_RGBA_S3TC_DXT1_EXT,
77824
- 134: GL3.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
77825
- 135: GL3.COMPRESSED_RGBA_S3TC_DXT3_EXT,
77826
- 136: GL3.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
77827
- 137: GL3.COMPRESSED_RGBA_S3TC_DXT5_EXT,
77828
- 138: GL3.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
77829
- 139: GL3.COMPRESSED_RED_RGTC1_EXT,
77830
- 140: GL3.COMPRESSED_SIGNED_RED_RGTC1_EXT,
77831
- 141: GL3.COMPRESSED_RED_GREEN_RGTC2_EXT,
77832
- 142: GL3.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
77833
- 147: GL3.COMPRESSED_RGB8_ETC2,
77834
- 148: GL3.COMPRESSED_SRGB8_ETC2,
77835
- 149: GL3.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
77836
- 150: GL3.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
77837
- 151: GL3.COMPRESSED_RGBA8_ETC2_EAC,
77838
- 152: GL3.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
77839
- 153: GL3.COMPRESSED_R11_EAC,
77840
- 154: GL3.COMPRESSED_SIGNED_R11_EAC,
77841
- 155: GL3.COMPRESSED_RG11_EAC,
77842
- 156: GL3.COMPRESSED_SIGNED_RG11_EAC,
77843
- 157: GL3.COMPRESSED_RGBA_ASTC_4x4_KHR,
77844
- 158: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
77845
- 159: GL3.COMPRESSED_RGBA_ASTC_5x4_KHR,
77846
- 160: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,
77847
- 161: GL3.COMPRESSED_RGBA_ASTC_5x5_KHR,
77848
- 162: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
77849
- 163: GL3.COMPRESSED_RGBA_ASTC_6x5_KHR,
77850
- 164: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
77851
- 165: GL3.COMPRESSED_RGBA_ASTC_6x6_KHR,
77852
- 166: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
77853
- 167: GL3.COMPRESSED_RGBA_ASTC_8x5_KHR,
77854
- 168: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
77855
- 169: GL3.COMPRESSED_RGBA_ASTC_8x6_KHR,
77856
- 170: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
77857
- 171: GL3.COMPRESSED_RGBA_ASTC_8x8_KHR,
77858
- 172: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
77859
- 173: GL3.COMPRESSED_RGBA_ASTC_10x5_KHR,
77860
- 174: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
77861
- 175: GL3.COMPRESSED_RGBA_ASTC_10x6_KHR,
77862
- 176: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
77863
- 177: GL3.COMPRESSED_RGBA_ASTC_10x8_KHR,
77864
- 178: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
77865
- 179: GL3.COMPRESSED_RGBA_ASTC_10x10_KHR,
77866
- 180: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
77867
- 181: GL3.COMPRESSED_RGBA_ASTC_12x10_KHR,
77868
- 182: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
77869
- 183: GL3.COMPRESSED_RGBA_ASTC_12x12_KHR,
77870
- 184: GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
77871
- 1000054e3: GL3.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
77872
- 1000054001: GL3.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
77873
- 1000066e3: GL3.COMPRESSED_RGBA_ASTC_4x4_KHR,
77874
- 1000066001: GL3.COMPRESSED_RGBA_ASTC_5x4_KHR,
77875
- 1000066002: GL3.COMPRESSED_RGBA_ASTC_5x5_KHR,
77876
- 1000066003: GL3.COMPRESSED_RGBA_ASTC_6x5_KHR,
77877
- 1000066004: GL3.COMPRESSED_RGBA_ASTC_6x6_KHR,
77878
- 1000066005: GL3.COMPRESSED_RGBA_ASTC_8x5_KHR,
77879
- 1000066006: GL3.COMPRESSED_RGBA_ASTC_8x6_KHR,
77880
- 1000066007: GL3.COMPRESSED_RGBA_ASTC_8x8_KHR,
77881
- 1000066008: GL3.COMPRESSED_RGBA_ASTC_10x5_KHR,
77882
- 1000066009: GL3.COMPRESSED_RGBA_ASTC_10x6_KHR,
77883
- 1000066010: GL3.COMPRESSED_RGBA_ASTC_10x8_KHR,
77884
- 1000066011: GL3.COMPRESSED_RGBA_ASTC_10x10_KHR,
77885
- 1000066012: GL3.COMPRESSED_RGBA_ASTC_12x10_KHR,
77886
- 1000066013: GL3.COMPRESSED_RGBA_ASTC_12x12_KHR
78212
+ 131: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT,
78213
+ 132: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_S3TC_DXT1_EXT,
78214
+ 133: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
78215
+ 134: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
78216
+ 135: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
78217
+ 136: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
78218
+ 137: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
78219
+ 138: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
78220
+ 139: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RED_RGTC1_EXT,
78221
+ 140: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_RED_RGTC1_EXT,
78222
+ 141: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RED_GREEN_RGTC2_EXT,
78223
+ 142: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
78224
+ 147: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_ETC2,
78225
+ 148: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ETC2,
78226
+ 149: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
78227
+ 150: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
78228
+ 151: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA8_ETC2_EAC,
78229
+ 152: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
78230
+ 153: GL_EXTENSIONS_CONSTANTS.COMPRESSED_R11_EAC,
78231
+ 154: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_R11_EAC,
78232
+ 155: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RG11_EAC,
78233
+ 156: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_RG11_EAC,
78234
+ 157: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4x4_KHR,
78235
+ 158: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
78236
+ 159: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x4_KHR,
78237
+ 160: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,
78238
+ 161: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x5_KHR,
78239
+ 162: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
78240
+ 163: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x5_KHR,
78241
+ 164: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
78242
+ 165: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x6_KHR,
78243
+ 166: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
78244
+ 167: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x5_KHR,
78245
+ 168: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
78246
+ 169: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x6_KHR,
78247
+ 170: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
78248
+ 171: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x8_KHR,
78249
+ 172: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
78250
+ 173: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x5_KHR,
78251
+ 174: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
78252
+ 175: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x6_KHR,
78253
+ 176: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
78254
+ 177: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x8_KHR,
78255
+ 178: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
78256
+ 179: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x10_KHR,
78257
+ 180: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
78258
+ 181: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x10_KHR,
78259
+ 182: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
78260
+ 183: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x12_KHR,
78261
+ 184: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
78262
+ 1000054e3: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
78263
+ 1000054001: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
78264
+ 1000066e3: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4x4_KHR,
78265
+ 1000066001: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x4_KHR,
78266
+ 1000066002: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x5_KHR,
78267
+ 1000066003: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x5_KHR,
78268
+ 1000066004: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x6_KHR,
78269
+ 1000066005: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x5_KHR,
78270
+ 1000066006: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x6_KHR,
78271
+ 1000066007: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x8_KHR,
78272
+ 1000066008: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x5_KHR,
78273
+ 1000066009: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x6_KHR,
78274
+ 1000066010: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x8_KHR,
78275
+ 1000066011: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x10_KHR,
78276
+ 1000066012: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x10_KHR,
78277
+ 1000066013: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x12_KHR
77887
78278
  };
77888
78279
  function mapVkFormatToWebGL(vkFormat) {
77889
78280
  return VULKAN_TO_WEBGL_FORMAT_MAP[vkFormat];
@@ -77925,19 +78316,43 @@ function parseKTX(arrayBuffer) {
77925
78316
  });
77926
78317
  }
77927
78318
 
77928
- // ../textures/src/lib/parsers/parse-basis.js
78319
+ // ../textures/src/lib/parsers/parse-basis.ts
77929
78320
  var OutputFormat = {
77930
- etc1: { basisFormat: 0, compressed: true, format: GL3.COMPRESSED_RGB_ETC1_WEBGL },
78321
+ etc1: {
78322
+ basisFormat: 0,
78323
+ compressed: true,
78324
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ETC1_WEBGL
78325
+ },
77931
78326
  etc2: { basisFormat: 1, compressed: true },
77932
- bc1: { basisFormat: 2, compressed: true, format: GL3.COMPRESSED_RGB_S3TC_DXT1_EXT },
77933
- bc3: { basisFormat: 3, compressed: true, format: GL3.COMPRESSED_RGBA_S3TC_DXT5_EXT },
78327
+ bc1: {
78328
+ basisFormat: 2,
78329
+ compressed: true,
78330
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT
78331
+ },
78332
+ bc3: {
78333
+ basisFormat: 3,
78334
+ compressed: true,
78335
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT
78336
+ },
77934
78337
  bc4: { basisFormat: 4, compressed: true },
77935
78338
  bc5: { basisFormat: 5, compressed: true },
77936
78339
  "bc7-m6-opaque-only": { basisFormat: 6, compressed: true },
77937
78340
  "bc7-m5": { basisFormat: 7, compressed: true },
77938
- "pvrtc1-4-rgb": { basisFormat: 8, compressed: true, format: GL3.COMPRESSED_RGB_PVRTC_4BPPV1_IMG },
77939
- "pvrtc1-4-rgba": { basisFormat: 9, compressed: true, format: GL3.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG },
77940
- "astc-4x4": { basisFormat: 10, compressed: true, format: GL3.COMPRESSED_RGBA_ASTC_4X4_KHR },
78341
+ "pvrtc1-4-rgb": {
78342
+ basisFormat: 8,
78343
+ compressed: true,
78344
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
78345
+ },
78346
+ "pvrtc1-4-rgba": {
78347
+ basisFormat: 9,
78348
+ compressed: true,
78349
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
78350
+ },
78351
+ "astc-4x4": {
78352
+ basisFormat: 10,
78353
+ compressed: true,
78354
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4X4_KHR
78355
+ },
77941
78356
  "atc-rgb": { basisFormat: 11, compressed: true },
77942
78357
  "atc-rgba-interpolated-alpha": { basisFormat: 12, compressed: true },
77943
78358
  rgba32: { basisFormat: 13, compressed: false },
@@ -78120,12 +78535,12 @@ var DDS_CONSTANTS = {
78120
78535
  DDPF_FOURCC: 4
78121
78536
  };
78122
78537
  var DDS_PIXEL_FORMATS = {
78123
- DXT1: GL3.COMPRESSED_RGB_S3TC_DXT1_EXT,
78124
- DXT3: GL3.COMPRESSED_RGBA_S3TC_DXT3_EXT,
78125
- DXT5: GL3.COMPRESSED_RGBA_S3TC_DXT5_EXT,
78126
- "ATC ": GL3.COMPRESSED_RGB_ATC_WEBGL,
78127
- ATCA: GL3.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
78128
- ATCI: GL3.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL
78538
+ DXT1: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT,
78539
+ DXT3: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
78540
+ DXT5: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
78541
+ "ATC ": GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ATC_WEBGL,
78542
+ ATCA: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
78543
+ ATCI: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL
78129
78544
  };
78130
78545
  var getATCLevelSize = getDxt1LevelSize;
78131
78546
  var getATCALevelSize = getDxtXLevelSize;
@@ -78192,33 +78607,75 @@ var PVR_CONSTANTS = {
78192
78607
  METADATA_SIZE_INDEX: 12
78193
78608
  };
78194
78609
  var PVR_PIXEL_FORMATS = {
78195
- 0: [GL3.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],
78196
- 1: [GL3.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],
78197
- 2: [GL3.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],
78198
- 3: [GL3.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],
78199
- 6: [GL3.COMPRESSED_RGB_ETC1_WEBGL],
78200
- 7: [GL3.COMPRESSED_RGB_S3TC_DXT1_EXT],
78201
- 9: [GL3.COMPRESSED_RGBA_S3TC_DXT3_EXT],
78202
- 11: [GL3.COMPRESSED_RGBA_S3TC_DXT5_EXT],
78203
- 22: [GL3.COMPRESSED_RGB8_ETC2],
78204
- 23: [GL3.COMPRESSED_RGBA8_ETC2_EAC],
78205
- 24: [GL3.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],
78206
- 25: [GL3.COMPRESSED_R11_EAC],
78207
- 26: [GL3.COMPRESSED_RG11_EAC],
78208
- 27: [GL3.COMPRESSED_RGBA_ASTC_4X4_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],
78209
- 28: [GL3.COMPRESSED_RGBA_ASTC_5X4_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],
78210
- 29: [GL3.COMPRESSED_RGBA_ASTC_5X5_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],
78211
- 30: [GL3.COMPRESSED_RGBA_ASTC_6X5_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],
78212
- 31: [GL3.COMPRESSED_RGBA_ASTC_6X6_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],
78213
- 32: [GL3.COMPRESSED_RGBA_ASTC_8X5_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],
78214
- 33: [GL3.COMPRESSED_RGBA_ASTC_8X6_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],
78215
- 34: [GL3.COMPRESSED_RGBA_ASTC_8X8_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],
78216
- 35: [GL3.COMPRESSED_RGBA_ASTC_10X5_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],
78217
- 36: [GL3.COMPRESSED_RGBA_ASTC_10X6_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],
78218
- 37: [GL3.COMPRESSED_RGBA_ASTC_10X8_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],
78219
- 38: [GL3.COMPRESSED_RGBA_ASTC_10X10_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],
78220
- 39: [GL3.COMPRESSED_RGBA_ASTC_12X10_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],
78221
- 40: [GL3.COMPRESSED_RGBA_ASTC_12X12_KHR, GL3.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]
78610
+ 0: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],
78611
+ 1: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],
78612
+ 2: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],
78613
+ 3: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],
78614
+ 6: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ETC1_WEBGL],
78615
+ 7: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT],
78616
+ 9: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT3_EXT],
78617
+ 11: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT],
78618
+ 22: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_ETC2],
78619
+ 23: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA8_ETC2_EAC],
78620
+ 24: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],
78621
+ 25: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_R11_EAC],
78622
+ 26: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RG11_EAC],
78623
+ 27: [
78624
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4X4_KHR,
78625
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR
78626
+ ],
78627
+ 28: [
78628
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5X4_KHR,
78629
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR
78630
+ ],
78631
+ 29: [
78632
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5X5_KHR,
78633
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR
78634
+ ],
78635
+ 30: [
78636
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6X5_KHR,
78637
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR
78638
+ ],
78639
+ 31: [
78640
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6X6_KHR,
78641
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR
78642
+ ],
78643
+ 32: [
78644
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8X5_KHR,
78645
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR
78646
+ ],
78647
+ 33: [
78648
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8X6_KHR,
78649
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR
78650
+ ],
78651
+ 34: [
78652
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8X8_KHR,
78653
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR
78654
+ ],
78655
+ 35: [
78656
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X5_KHR,
78657
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR
78658
+ ],
78659
+ 36: [
78660
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X6_KHR,
78661
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR
78662
+ ],
78663
+ 37: [
78664
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X8_KHR,
78665
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR
78666
+ ],
78667
+ 38: [
78668
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X10_KHR,
78669
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR
78670
+ ],
78671
+ 39: [
78672
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12X10_KHR,
78673
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR
78674
+ ],
78675
+ 40: [
78676
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12X12_KHR,
78677
+ GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR
78678
+ ]
78222
78679
  };
78223
78680
  var PVR_SIZE_FUNCTIONS = {
78224
78681
  0: pvrtc2bppSize,
@@ -78409,7 +78866,7 @@ async function encodeKTX2BasisTexture(image, options = {}) {
78409
78866
  basisEncoder.setUASTC(encodeUASTC);
78410
78867
  basisEncoder.setMipGen(mipmaps);
78411
78868
  const numOutputBytes = basisEncoder.encode(basisFileData);
78412
- const actualKTX2FileData = new Uint8Array(basisFileData.buffer, 0, numOutputBytes);
78869
+ const actualKTX2FileData = basisFileData.subarray(0, numOutputBytes).buffer;
78413
78870
  return actualKTX2FileData;
78414
78871
  } catch (error) {
78415
78872
  console.error("Basis Universal Supercompressed GPU Texture encoder Error: ", error);
@@ -80429,11 +80886,22 @@ var GLTFPostProcessor = class {
80429
80886
  const buffer = accessor.bufferView.buffer;
80430
80887
  const { ArrayType, byteLength } = getAccessorArrayTypeAndLength(accessor, accessor.bufferView);
80431
80888
  const byteOffset = (accessor.bufferView.byteOffset || 0) + (accessor.byteOffset || 0) + buffer.byteOffset;
80432
- const cutBufffer = buffer.arrayBuffer.slice(byteOffset, byteOffset + byteLength);
80433
- accessor.value = new ArrayType(cutBufffer);
80889
+ let cutBuffer = buffer.arrayBuffer.slice(byteOffset, byteOffset + byteLength);
80890
+ if (accessor.bufferView.byteStride) {
80891
+ cutBuffer = this._getValueFromInterleavedBuffer(buffer, byteOffset, accessor.bufferView.byteStride, accessor.bytesPerElement, accessor.count);
80892
+ }
80893
+ accessor.value = new ArrayType(cutBuffer);
80434
80894
  }
80435
80895
  return accessor;
80436
80896
  }
80897
+ _getValueFromInterleavedBuffer(buffer, byteOffset, byteStride, bytesPerElement, count) {
80898
+ const result = new Uint8Array(count * bytesPerElement);
80899
+ for (let i = 0; i < count; i++) {
80900
+ const elementOffset = byteOffset + i * byteStride;
80901
+ result.set(new Uint8Array(buffer.arrayBuffer.slice(elementOffset, elementOffset + bytesPerElement)), i * bytesPerElement);
80902
+ }
80903
+ return result.buffer;
80904
+ }
80437
80905
  _resolveTexture(texture, index) {
80438
80906
  texture.id = texture.id || `texture-${index}`;
80439
80907
  texture.sampler = "sampler" in texture ? this.getSampler(texture.sampler) : DEFAULT_SAMPLER;
@@ -80466,16 +80934,19 @@ var GLTFPostProcessor = class {
80466
80934
  return image;
80467
80935
  }
80468
80936
  _resolveBufferView(bufferView, index) {
80469
- bufferView.id = bufferView.id || `bufferView-${index}`;
80470
80937
  const bufferIndex = bufferView.buffer;
80471
- bufferView.buffer = this.buffers[bufferIndex];
80938
+ const result = {
80939
+ id: `bufferView-${index}`,
80940
+ ...bufferView,
80941
+ buffer: this.buffers[bufferIndex]
80942
+ };
80472
80943
  const arrayBuffer = this.buffers[bufferIndex].arrayBuffer;
80473
80944
  let byteOffset = this.buffers[bufferIndex].byteOffset || 0;
80474
80945
  if ("byteOffset" in bufferView) {
80475
80946
  byteOffset += bufferView.byteOffset;
80476
80947
  }
80477
- bufferView.data = new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);
80478
- return bufferView;
80948
+ result.data = new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);
80949
+ return result;
80479
80950
  }
80480
80951
  _resolveCamera(camera, index) {
80481
80952
  camera.id = camera.id || `camera-${index}`;
@@ -80698,7 +81169,7 @@ async function loadImage(gltf, image, index, options, context) {
80698
81169
  arrayBuffer = sliceArrayBuffer(array.buffer, array.byteOffset, array.byteLength);
80699
81170
  }
80700
81171
  assert6(arrayBuffer, "glTF image has no data");
80701
- let parsedImage = await parse9(arrayBuffer, [ImageLoader, BasisLoader], { mimeType: image.mimeType, basis: { format: selectSupportedBasisFormat() } }, context);
81172
+ let parsedImage = await parse9(arrayBuffer, [ImageLoader, BasisLoader], { mimeType: image.mimeType, basis: options.basis || { format: selectSupportedBasisFormat() } }, context);
80702
81173
  if (parsedImage && parsedImage[0]) {
80703
81174
  parsedImage = {
80704
81175
  compressed: true,
@@ -81066,6 +81537,14 @@ async function parseComposite3DTile(tile, arrayBuffer, byteOffset, options, cont
81066
81537
  return byteOffset;
81067
81538
  }
81068
81539
 
81540
+ // ../3d-tiles/src/lib/parsers/parse-3d-tile-gltf.js
81541
+ async function parseGltf3DTile(tile, arrayBuffer, options, context) {
81542
+ tile.rotateYtoZ = true;
81543
+ tile.gltfUpAxis = options["3d-tiles"] && options["3d-tiles"].assetGltfUpAxis ? options["3d-tiles"].assetGltfUpAxis : "Y";
81544
+ const { parse: parse9 } = context;
81545
+ tile.gltf = await parse9(arrayBuffer, GLTFLoader, options, context);
81546
+ }
81547
+
81069
81548
  // ../3d-tiles/src/lib/parsers/parse-3d-tile.ts
81070
81549
  async function parse3DTile(arrayBuffer, byteOffset = 0, options, context, tile = {}) {
81071
81550
  tile.byteOffset = byteOffset;
@@ -81075,6 +81554,8 @@ async function parse3DTile(arrayBuffer, byteOffset = 0, options, context, tile =
81075
81554
  return await parseComposite3DTile(tile, arrayBuffer, byteOffset, options, context, parse3DTile);
81076
81555
  case TILE3D_TYPE.BATCHED_3D_MODEL:
81077
81556
  return await parseBatchedModel3DTile(tile, arrayBuffer, byteOffset, options, context);
81557
+ case TILE3D_TYPE.GLTF:
81558
+ return await parseGltf3DTile(tile, arrayBuffer, options, context);
81078
81559
  case TILE3D_TYPE.INSTANCED_3D_MODEL:
81079
81560
  return await parseInstancedModel3DTile(tile, arrayBuffer, byteOffset, options, context);
81080
81561
  case TILE3D_TYPE.POINT_CLOUD:
@@ -81084,6 +81565,198 @@ async function parse3DTile(arrayBuffer, byteOffset = 0, options, context, tile =
81084
81565
  }
81085
81566
  }
81086
81567
 
81568
+ // ../3d-tiles/src/lib/parsers/helpers/parse-3d-tile-subtree.ts
81569
+ var SUBTREE_FILE_MAGIC = 1952609651;
81570
+ var SUBTREE_FILE_VERSION = 1;
81571
+ async function parse3DTilesSubtree(data) {
81572
+ const magic = new Uint32Array(data.slice(0, 4));
81573
+ if (magic[0] !== SUBTREE_FILE_MAGIC) {
81574
+ throw new Error("Wrong subtree file magic number");
81575
+ }
81576
+ const version2 = new Uint32Array(data.slice(4, 8));
81577
+ if (version2[0] !== SUBTREE_FILE_VERSION) {
81578
+ throw new Error("Wrong subtree file verson, must be 1");
81579
+ }
81580
+ const jsonByteLength = parseUint64Value(data.slice(8, 16));
81581
+ const stringAttribute = new Uint8Array(data, 24, jsonByteLength);
81582
+ const textDecoder = new TextDecoder("utf8");
81583
+ const string = textDecoder.decode(stringAttribute);
81584
+ const subtree = JSON.parse(string);
81585
+ const binaryByteLength = parseUint64Value(data.slice(16, 24));
81586
+ let internalBinaryBuffer = new ArrayBuffer(0);
81587
+ if (binaryByteLength) {
81588
+ internalBinaryBuffer = data.slice(24 + jsonByteLength);
81589
+ }
81590
+ if ("bufferView" in subtree.tileAvailability) {
81591
+ subtree.tileAvailability.explicitBitstream = await getExplicitBitstream(subtree, "tileAvailability", internalBinaryBuffer);
81592
+ }
81593
+ if ("bufferView" in subtree.contentAvailability) {
81594
+ subtree.contentAvailability.explicitBitstream = await getExplicitBitstream(subtree, "contentAvailability", internalBinaryBuffer);
81595
+ }
81596
+ if ("bufferView" in subtree.childSubtreeAvailability) {
81597
+ subtree.childSubtreeAvailability.explicitBitstream = await getExplicitBitstream(subtree, "childSubtreeAvailability", internalBinaryBuffer);
81598
+ }
81599
+ return subtree;
81600
+ }
81601
+ async function getExplicitBitstream(subtree, name8, internalBinaryBuffer) {
81602
+ const bufferViewIndex = subtree[name8].bufferView;
81603
+ const bufferView = subtree.bufferViews[bufferViewIndex];
81604
+ const buffer = subtree.buffers[bufferView.buffer];
81605
+ if (buffer.uri) {
81606
+ const response = await fetchFile(buffer.uri);
81607
+ const data = await response.arrayBuffer();
81608
+ return new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
81609
+ }
81610
+ return new Uint8Array(internalBinaryBuffer, bufferView.byteOffset, bufferView.byteLength);
81611
+ }
81612
+ function parseUint64Value(buffer) {
81613
+ const dataView = new DataView(buffer);
81614
+ const left = dataView.getUint32(0, true);
81615
+ const right = dataView.getUint32(4, true);
81616
+ return left + 2 ** 32 * right;
81617
+ }
81618
+
81619
+ // ../3d-tiles/src/tile-3d-subtree-loader.ts
81620
+ var Tile3DSubtreeLoader = {
81621
+ id: "3d-tiles-subtree",
81622
+ name: "3D Tiles Subtree",
81623
+ module: "3d-tiles",
81624
+ version: VERSION3,
81625
+ extensions: ["subtree"],
81626
+ mimeTypes: ["application/octet-stream"],
81627
+ tests: ["subtree"],
81628
+ parse: parse3DTilesSubtree,
81629
+ options: {}
81630
+ };
81631
+
81632
+ // ../3d-tiles/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts
81633
+ var QUADTREE_DEVISION_COUNT = 4;
81634
+ var OCTREE_DEVISION_COUNT = 8;
81635
+ var SUBDIVISION_COUNT_MAP = {
81636
+ QUADTREE: QUADTREE_DEVISION_COUNT,
81637
+ OCTREE: OCTREE_DEVISION_COUNT
81638
+ };
81639
+ async function parseImplicitTiles(subtree, options, parentData = {
81640
+ mortonIndex: 0,
81641
+ x: 0,
81642
+ y: 0,
81643
+ z: 0
81644
+ }, childIndex = 0, level = 0, globalData = {
81645
+ level: 0,
81646
+ mortonIndex: 0,
81647
+ x: 0,
81648
+ y: 0,
81649
+ z: 0
81650
+ }) {
81651
+ const {
81652
+ subdivisionScheme,
81653
+ subtreeLevels,
81654
+ maximumLevel,
81655
+ contentUrlTemplate,
81656
+ subtreesUriTemplate,
81657
+ basePath
81658
+ } = options;
81659
+ const tile = { children: [], lodMetricValue: 0, contentUrl: "" };
81660
+ const childrenPerTile = SUBDIVISION_COUNT_MAP[subdivisionScheme];
81661
+ const childX = childIndex & 1;
81662
+ const childY = childIndex >> 1 & 1;
81663
+ const childZ = childIndex >> 2 & 1;
81664
+ const levelOffset = (childrenPerTile ** level - 1) / (childrenPerTile - 1);
81665
+ let childTileMortonIndex = concatBits(parentData.mortonIndex, childIndex);
81666
+ let tileAvailabilityIndex = levelOffset + childTileMortonIndex;
81667
+ let childTileX = concatBits(parentData.x, childX);
81668
+ let childTileY = concatBits(parentData.y, childY);
81669
+ let childTileZ = concatBits(parentData.z, childZ);
81670
+ let isChildSubtreeAvailable = false;
81671
+ if (level + 1 > subtreeLevels) {
81672
+ isChildSubtreeAvailable = getAvailabilityResult(subtree.childSubtreeAvailability, childTileMortonIndex);
81673
+ }
81674
+ const x = concatBits(globalData.x, childTileX);
81675
+ const y = concatBits(globalData.y, childTileY);
81676
+ const z = concatBits(globalData.z, childTileZ);
81677
+ const lev = level + globalData.level;
81678
+ if (isChildSubtreeAvailable) {
81679
+ const subtreePath = `${basePath}/${subtreesUriTemplate}`;
81680
+ const childSubtreeUrl = replaceContentUrlTemplate(subtreePath, lev, x, y, z);
81681
+ const childSubtree = await load(childSubtreeUrl, Tile3DSubtreeLoader);
81682
+ subtree = childSubtree;
81683
+ globalData.mortonIndex = childTileMortonIndex;
81684
+ globalData.x = childTileX;
81685
+ globalData.y = childTileY;
81686
+ globalData.z = childTileZ;
81687
+ globalData.level = level;
81688
+ childTileMortonIndex = 0;
81689
+ tileAvailabilityIndex = 0;
81690
+ childTileX = 0;
81691
+ childTileY = 0;
81692
+ childTileZ = 0;
81693
+ level = 0;
81694
+ }
81695
+ const isTileAvailable = getAvailabilityResult(subtree.tileAvailability, tileAvailabilityIndex);
81696
+ if (!isTileAvailable || level > maximumLevel) {
81697
+ return tile;
81698
+ }
81699
+ const isContentAvailable = getAvailabilityResult(subtree.contentAvailability, tileAvailabilityIndex);
81700
+ if (isContentAvailable) {
81701
+ tile.contentUrl = replaceContentUrlTemplate(contentUrlTemplate, lev, x, y, z);
81702
+ }
81703
+ const childTileLevel = level + 1;
81704
+ const pData = { mortonIndex: childTileMortonIndex, x: childTileX, y: childTileY, z: childTileZ };
81705
+ for (let index = 0; index < childrenPerTile; index++) {
81706
+ const currentTile = await parseImplicitTiles(subtree, options, pData, index, childTileLevel, globalData);
81707
+ if (currentTile.contentUrl || currentTile.children.length) {
81708
+ const globalLevel = lev + 1;
81709
+ const formattedTile = formatTileData(currentTile, globalLevel, options);
81710
+ tile.children.push(formattedTile);
81711
+ }
81712
+ }
81713
+ return tile;
81714
+ }
81715
+ function getAvailabilityResult(availabilityData, index) {
81716
+ if ("constant" in availabilityData) {
81717
+ return Boolean(availabilityData.constant);
81718
+ }
81719
+ if (availabilityData.explicitBitstream) {
81720
+ return getBooleanValueFromBitstream(index, availabilityData.explicitBitstream);
81721
+ }
81722
+ return false;
81723
+ }
81724
+ function formatTileData(tile, level, options) {
81725
+ const { basePath, refine, getRefine: getRefine2, lodMetricType, getTileType: getTileType2, rootLodMetricValue } = options;
81726
+ const uri = tile.contentUrl && tile.contentUrl.replace(`${basePath}/`, "");
81727
+ const lodMetricValue = rootLodMetricValue / 2 ** level;
81728
+ return {
81729
+ children: tile.children,
81730
+ contentUrl: tile.contentUrl,
81731
+ content: { uri },
81732
+ id: tile.contentUrl,
81733
+ refine: getRefine2(refine),
81734
+ type: getTileType2(tile),
81735
+ lodMetricType,
81736
+ lodMetricValue
81737
+ };
81738
+ }
81739
+ function concatBits(first, second) {
81740
+ return parseInt(first.toString(2) + second.toString(2), 2);
81741
+ }
81742
+ function replaceContentUrlTemplate(templateUrl, level, x, y, z) {
81743
+ const mapUrl = generateMapUrl({ level, x, y, z });
81744
+ return templateUrl.replace(/{level}|{x}|{y}|{z}/gi, (matched) => mapUrl[matched]);
81745
+ }
81746
+ function generateMapUrl(items) {
81747
+ const mapUrl = {};
81748
+ for (const key in items) {
81749
+ mapUrl[`{${key}}`] = items[key];
81750
+ }
81751
+ return mapUrl;
81752
+ }
81753
+ function getBooleanValueFromBitstream(availabilityIndex, availabilityBuffer) {
81754
+ const byteIndex = Math.floor(availabilityIndex / 8);
81755
+ const bitIndex = availabilityIndex % 8;
81756
+ const bitValue = availabilityBuffer[byteIndex] >> bitIndex & 1;
81757
+ return bitValue === 1;
81758
+ }
81759
+
81087
81760
  // ../3d-tiles/src/lib/parsers/parse-3d-tile-header.ts
81088
81761
  function getTileType(tile) {
81089
81762
  if (!tile.contentUrl) {
@@ -81096,6 +81769,8 @@ function getTileType(tile) {
81096
81769
  return TILE_TYPE.POINTCLOUD;
81097
81770
  case "i3dm":
81098
81771
  case "b3dm":
81772
+ case "glb":
81773
+ case "gltf":
81099
81774
  return TILE_TYPE.SCENEGRAPH;
81100
81775
  default:
81101
81776
  return fileExtension;
@@ -81144,8 +81819,60 @@ function normalizeTileHeaders(tileset) {
81144
81819
  }
81145
81820
  return root;
81146
81821
  }
81822
+ async function normalizeImplicitTileHeaders(tileset) {
81823
+ if (!tileset.root) {
81824
+ return null;
81825
+ }
81826
+ const basePath = tileset.basePath;
81827
+ const implicitTilingExtension = tileset.root.extensions["3DTILES_implicit_tiling"];
81828
+ const {
81829
+ subdivisionScheme,
81830
+ maximumLevel,
81831
+ subtreeLevels,
81832
+ subtrees: { uri: subtreesUriTemplate }
81833
+ } = implicitTilingExtension;
81834
+ const subtreeUrl = replaceContentUrlTemplate(subtreesUriTemplate, 0, 0, 0, 0);
81835
+ const rootSubtreeUrl = `${basePath}/${subtreeUrl}`;
81836
+ const rootSubtree = await load(rootSubtreeUrl, Tile3DSubtreeLoader);
81837
+ const contentUrlTemplate = `${basePath}/${tileset.root.content.uri}`;
81838
+ const refine = tileset.root.refine;
81839
+ const rootLodMetricValue = tileset.root.geometricError;
81840
+ const options = {
81841
+ contentUrlTemplate,
81842
+ subtreesUriTemplate,
81843
+ subdivisionScheme,
81844
+ subtreeLevels,
81845
+ maximumLevel,
81846
+ refine,
81847
+ basePath,
81848
+ lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR,
81849
+ rootLodMetricValue,
81850
+ getTileType,
81851
+ getRefine
81852
+ };
81853
+ return await normalizeImplicitTileData(tileset.root, rootSubtree, options);
81854
+ }
81855
+ async function normalizeImplicitTileData(tile, rootSubtree, options) {
81856
+ if (!tile) {
81857
+ return null;
81858
+ }
81859
+ tile.lodMetricType = LOD_METRIC_TYPE.GEOMETRIC_ERROR;
81860
+ tile.lodMetricValue = tile.geometricError;
81861
+ tile.transformMatrix = tile.transform;
81862
+ const { children, contentUrl } = await parseImplicitTiles(rootSubtree, options);
81863
+ if (contentUrl) {
81864
+ tile.contentUrl = contentUrl;
81865
+ tile.content = { uri: contentUrl.replace(`${options.basePath}/`, "") };
81866
+ }
81867
+ tile.refine = getRefine(tile.refine);
81868
+ tile.type = getTileType(tile);
81869
+ tile.children = children;
81870
+ tile.id = tile.contentUrl;
81871
+ return tile;
81872
+ }
81147
81873
 
81148
81874
  // ../3d-tiles/src/tiles-3d-loader.ts
81875
+ var IMPLICIT_TILING_EXTENSION_NAME = "3DTILES_implicit_tiling";
81149
81876
  var Tiles3DLoader = {
81150
81877
  id: "3d-tiles",
81151
81878
  name: "3D Tiles",
@@ -81182,7 +81909,7 @@ async function parseTileset(data, options, context) {
81182
81909
  tilesetJson.loader = options.loader || Tiles3DLoader;
81183
81910
  tilesetJson.url = context.url;
81184
81911
  tilesetJson.basePath = getBaseUri(tilesetJson);
81185
- tilesetJson.root = normalizeTileHeaders(tilesetJson);
81912
+ tilesetJson.root = hasImplicitTilingExtension(tilesetJson) ? await normalizeImplicitTileHeaders(tilesetJson) : normalizeTileHeaders(tilesetJson);
81186
81913
  tilesetJson.type = TILESET_TYPE.TILES3D;
81187
81914
  tilesetJson.lodMetricType = LOD_METRIC_TYPE.GEOMETRIC_ERROR;
81188
81915
  tilesetJson.lodMetricValue = tilesetJson.root?.lodMetricValue || 0;
@@ -81203,8 +81930,11 @@ async function parse4(data, options, context) {
81203
81930
  }
81204
81931
  return data;
81205
81932
  }
81933
+ function hasImplicitTilingExtension(tilesetJson) {
81934
+ return tilesetJson?.extensionsRequired?.includes(IMPLICIT_TILING_EXTENSION_NAME) && tilesetJson?.extensionsUsed?.includes(IMPLICIT_TILING_EXTENSION_NAME);
81935
+ }
81206
81936
 
81207
- // ../3d-tiles/src/lib/ion/ion.js
81937
+ // ../3d-tiles/src/lib/ion/ion.ts
81208
81938
  var CESIUM_ION_URL = "https://api.cesium.com/v1/assets";
81209
81939
  async function getIonTilesetMetadata(accessToken, assetId) {
81210
81940
  if (!assetId) {
@@ -81475,12 +82205,12 @@ var import_process = __toModule(require("process"));
81475
82205
  var import_json_map_transform6 = __toModule(require_json_map_transform());
81476
82206
  var import_md52 = __toModule(require_md52());
81477
82207
 
81478
- // src/i3s-converter/helpers/node-pages.js
82208
+ // src/i3s-converter/helpers/node-pages.ts
81479
82209
  var import_path2 = __toModule(require("path"));
81480
82210
  var import_json_map_transform = __toModule(require_json_map_transform());
81481
82211
 
81482
- // src/i3s-converter/json-templates/metadata.js
81483
- var METADATA = {
82212
+ // src/i3s-converter/json-templates/metadata.ts
82213
+ var METADATA = () => ({
81484
82214
  folderPattern: {
81485
82215
  path: "folderPattern",
81486
82216
  default: "BASIC"
@@ -81500,9 +82230,9 @@ var METADATA = {
81500
82230
  nodeCount: {
81501
82231
  path: "nodeCount"
81502
82232
  }
81503
- };
82233
+ });
81504
82234
 
81505
- // src/i3s-converter/helpers/node-pages.js
82235
+ // src/i3s-converter/helpers/node-pages.ts
81506
82236
  var NodePages = class {
81507
82237
  constructor(writeFileFunc, nodesPerPage) {
81508
82238
  this.nodesPerPage = nodesPerPage;
@@ -81558,18 +82288,18 @@ var NodePages = class {
81558
82288
  node3.mesh.material.texelCountHint = texelCountHint;
81559
82289
  }
81560
82290
  addChildRelation(parentId, childId) {
81561
- if (parentId === null) {
82291
+ if (parentId === null || parentId === void 0) {
81562
82292
  return;
81563
82293
  }
81564
82294
  const parentNode = this.getNodeById(parentId);
81565
- parentNode.children.push(childId);
82295
+ parentNode.children?.push(childId);
81566
82296
  }
81567
82297
  updateResourceInMesh(node3) {
81568
82298
  if (node3.mesh) {
81569
82299
  node3.mesh.geometry.resource = node3.index;
81570
82300
  }
81571
82301
  }
81572
- push(node3, parentId = null) {
82302
+ push(node3, parentId) {
81573
82303
  let currentNodePage = this.nodePages[this.nodePages.length - 1];
81574
82304
  if (currentNodePage.nodes.length === this.nodesPerPage) {
81575
82305
  currentNodePage = { nodes: [] };
@@ -81590,7 +82320,7 @@ var NodePages = class {
81590
82320
  promises.push(this.writeFile(slpkPath, nodePageStr, `${index.toString()}.json`));
81591
82321
  fileMap[`nodePages/${index.toString()}.json.gz`] = `${slpkPath}.json.gz`;
81592
82322
  }
81593
- const metadata = (0, import_json_map_transform.default)({ nodeCount: this.nodesCounter }, METADATA);
82323
+ const metadata = (0, import_json_map_transform.default)({ nodeCount: this.nodesCounter }, METADATA());
81594
82324
  const compress = false;
81595
82325
  fileMap["metadata.json"] = await this.writeFile(layers0Path, JSON.stringify(metadata), "metadata.json", compress);
81596
82326
  } else {
@@ -81759,11 +82489,11 @@ async function getTotalFilesSize(dirPath) {
81759
82489
  }
81760
82490
 
81761
82491
  // src/i3s-converter/helpers/geometry-converter.js
81762
- var import_core17 = __toModule(require_es53());
81763
- var import_geospatial7 = __toModule(require_es54());
82492
+ var import_core21 = __toModule(require_es53());
82493
+ var import_geospatial8 = __toModule(require_es54());
81764
82494
  var import_md5 = __toModule(require_md52());
81765
82495
 
81766
- // src/i3s-converter/helpers/geometry-attributes.js
82496
+ // src/i3s-converter/helpers/geometry-attributes.ts
81767
82497
  var VALUES_PER_VERTEX = 3;
81768
82498
  var POSITIONS_AND_NORMALS_PER_TRIANGLE = 9;
81769
82499
  function generateAttributes(attributes) {
@@ -81903,6 +82633,84 @@ function groupAttributesAndRangesByFeatureId(unifiedObjects) {
81903
82633
  return { faceRange, featureIds, positions, normals, colors, texCoords };
81904
82634
  }
81905
82635
 
82636
+ // src/i3s-converter/helpers/coordinate-converter.ts
82637
+ var import_core20 = __toModule(require_es53());
82638
+ var import_geospatial7 = __toModule(require_es54());
82639
+ var import_culling4 = __toModule(require_es55());
82640
+ function createBoundingVolumes(tile, geoidHeightModel) {
82641
+ let radius;
82642
+ let halfSize;
82643
+ let quaternion;
82644
+ const boundingVolume = tile.boundingVolume;
82645
+ const cartographicCenter = import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(boundingVolume.center, new import_core20.Vector3());
82646
+ cartographicCenter[2] = cartographicCenter[2] - geoidHeightModel.getHeight(cartographicCenter[1], cartographicCenter[0]);
82647
+ if (boundingVolume instanceof import_culling4.OrientedBoundingBox) {
82648
+ halfSize = boundingVolume.halfSize;
82649
+ radius = new import_core20.Vector3(halfSize[0], halfSize[1], halfSize[2]).len();
82650
+ quaternion = boundingVolume.quaternion;
82651
+ } else {
82652
+ radius = tile.boundingVolume.radius;
82653
+ halfSize = [radius, radius, radius];
82654
+ quaternion = new import_core20.Quaternion().fromMatrix3(new import_core20.Matrix3([halfSize[0], 0, 0, 0, halfSize[1], 0, 0, 0, halfSize[2]])).normalize();
82655
+ }
82656
+ return {
82657
+ mbs: [cartographicCenter[0], cartographicCenter[1], cartographicCenter[2], radius],
82658
+ obb: {
82659
+ center: [cartographicCenter[0], cartographicCenter[1], cartographicCenter[2]],
82660
+ halfSize,
82661
+ quaternion
82662
+ }
82663
+ };
82664
+ }
82665
+ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel) {
82666
+ const positionVectors = convertPositionsToVectors(cartesianPositions);
82667
+ const geometryObb = (0, import_culling4.makeOrientedBoundingBoxFromPoints)(positionVectors);
82668
+ const geometryMbs = (0, import_culling4.makeBoundingSphereFromPoints)(positionVectors);
82669
+ let mbsCenter = import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new import_core20.Vector3());
82670
+ let obbCenter = import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new import_core20.Vector3());
82671
+ mbsCenter[2] = mbsCenter[2] - geoidHeightModel.getHeight(mbsCenter[1], mbsCenter[0]);
82672
+ obbCenter[2] = obbCenter[2] - geoidHeightModel.getHeight(obbCenter[1], obbCenter[0]);
82673
+ return {
82674
+ mbs: [mbsCenter[0], mbsCenter[1], mbsCenter[2], geometryMbs.radius],
82675
+ obb: {
82676
+ center: obbCenter,
82677
+ halfSize: geometryObb.halfSize,
82678
+ quaternion: geometryObb.quaternion
82679
+ }
82680
+ };
82681
+ }
82682
+ function convertPositionsToVectors(positions) {
82683
+ const result = [];
82684
+ for (let i = 0; i < positions.length; i += 3) {
82685
+ const positionVector = new import_core20.Vector3([positions[i], positions[i + 1], positions[i + 2]]);
82686
+ result.push(positionVector);
82687
+ }
82688
+ return result;
82689
+ }
82690
+ function convertCommonToI3SExtentCoordinate(tileset) {
82691
+ const cartesianCenter = tileset?.cartesianCenter;
82692
+ if (!cartesianCenter) {
82693
+ return null;
82694
+ }
82695
+ const radius = tileset?.lodMetricValue;
82696
+ const rightTop = import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(new import_core20.Vector3(cartesianCenter[0] + radius, cartesianCenter[1] + radius, cartesianCenter[2]), new import_core20.Vector3());
82697
+ const leftBottom = import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(new import_core20.Vector3(cartesianCenter[0] - radius, cartesianCenter[1] - radius, cartesianCenter[2]), new import_core20.Vector3());
82698
+ const isFirstRight = rightTop[0] < leftBottom[0];
82699
+ const isFirstTop = rightTop[1] < leftBottom[1];
82700
+ return [
82701
+ isFirstRight ? rightTop[0] : leftBottom[0],
82702
+ isFirstTop ? rightTop[1] : leftBottom[1],
82703
+ isFirstRight ? leftBottom[0] : rightTop[0],
82704
+ isFirstTop ? leftBottom[1] : rightTop[1]
82705
+ ];
82706
+ }
82707
+ function createObbFromMbs(mbs) {
82708
+ const radius = mbs[3];
82709
+ const center = new import_core20.Vector3(mbs[0], mbs[1], mbs[2]);
82710
+ const halfAxex = new import_core20.Matrix3([radius, 0, 0, 0, radius, 0, 0, 0, radius]);
82711
+ return new import_culling4.OrientedBoundingBox(center, halfAxex);
82712
+ }
82713
+
81906
82714
  // src/i3s-converter/helpers/geometry-converter.js
81907
82715
  var VALUES_PER_VERTEX2 = 3;
81908
82716
  var VALUES_PER_TEX_COORD = 2;
@@ -81912,9 +82720,14 @@ var SHORT_INT_TYPE = "Int32";
81912
82720
  var DOUBLE_TYPE = "Float64";
81913
82721
  var OBJECT_ID_TYPE = "Oid32";
81914
82722
  var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ["CUSTOM_ATTRIBUTE_2", "_BATCHID", "BATCHID"];
81915
- async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray, attributeStorageInfo, draco) {
82723
+ var scratchVector4 = new import_core21.Vector3();
82724
+ async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, geoidHeightModel) {
82725
+ const useCartesianPositions = generateBoundingVolumes;
81916
82726
  const materialAndTextureList = convertMaterials(tileContent);
81917
- const convertedAttributesMap = convertAttributes(tileContent);
82727
+ const convertedAttributesMap = convertAttributes(tileContent, useCartesianPositions);
82728
+ if (generateBoundingVolumes) {
82729
+ _generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeightModel);
82730
+ }
81918
82731
  if (convertedAttributesMap.has("default")) {
81919
82732
  materialAndTextureList.push({
81920
82733
  material: getDefaultMaterial()
@@ -81923,7 +82736,7 @@ async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray,
81923
82736
  const result = [];
81924
82737
  let nodesCounter = nodeId;
81925
82738
  let { materials = [] } = tileContent.gltf;
81926
- if (!materials.length === 0) {
82739
+ if (!materials?.length) {
81927
82740
  materials.push({ id: "default" });
81928
82741
  }
81929
82742
  for (let i = 0; i < materials.length; i++) {
@@ -81950,6 +82763,20 @@ async function convertB3dmToI3sGeometry(tileContent, nodeId, featuresHashArray,
81950
82763
  }
81951
82764
  return result;
81952
82765
  }
82766
+ function _generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeightModel) {
82767
+ for (const attributes of convertedAttributesMap.values()) {
82768
+ const boundingVolumes = createBoundingVolumesFromGeometry(attributes.positions, geoidHeightModel);
82769
+ attributes.boundingVolumes = boundingVolumes;
82770
+ const cartographicOrigin = boundingVolumes.obb.center;
82771
+ for (let index = 0; index < attributes.positions.length; index += VALUES_PER_VERTEX2) {
82772
+ const vertex = attributes.positions.subarray(index, index + VALUES_PER_VERTEX2);
82773
+ import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(Array.from(vertex), scratchVector4);
82774
+ scratchVector4[2] = scratchVector4[2] - geoidHeightModel.getHeight(scratchVector4[1], scratchVector4[0]);
82775
+ scratchVector4 = scratchVector4.subtract(cartographicOrigin);
82776
+ attributes.positions.set(scratchVector4, index);
82777
+ }
82778
+ }
82779
+ }
81953
82780
  async function _makeNodeResources({
81954
82781
  convertedAttributes,
81955
82782
  material,
@@ -81960,6 +82787,7 @@ async function _makeNodeResources({
81960
82787
  attributeStorageInfo,
81961
82788
  draco
81962
82789
  }) {
82790
+ const boundingVolumes = convertedAttributes.boundingVolumes;
81963
82791
  const vertexCount = convertedAttributes.positions.length / VALUES_PER_VERTEX2;
81964
82792
  const triangleCount = vertexCount / 3;
81965
82793
  const { faceRange, featureIds, positions, normals, colors, texCoords, featureCount } = generateAttributes({ triangleCount, ...convertedAttributes });
@@ -81987,10 +82815,11 @@ async function _makeNodeResources({
81987
82815
  meshMaterial: material,
81988
82816
  vertexCount,
81989
82817
  attributes,
81990
- featureCount
82818
+ featureCount,
82819
+ boundingVolumes
81991
82820
  };
81992
82821
  }
81993
- function convertAttributes(tileContent) {
82822
+ function convertAttributes(tileContent, useCartesianPositions) {
81994
82823
  const attributesMap = new Map();
81995
82824
  for (const material of tileContent.gltf.materials || [{ id: "default" }]) {
81996
82825
  attributesMap.set(material.id, {
@@ -81998,51 +82827,39 @@ function convertAttributes(tileContent) {
81998
82827
  normals: new Float32Array(0),
81999
82828
  texCoords: new Float32Array(0),
82000
82829
  colors: new Uint8Array(0),
82001
- featureIndices: []
82830
+ featureIndices: [],
82831
+ boundingVolumes: null
82002
82832
  });
82003
82833
  }
82004
82834
  const nodes = (tileContent.gltf.scene || tileContent.gltf.scenes?.[0] || tileContent.gltf).nodes;
82005
- convertNodes(nodes, tileContent, attributesMap);
82835
+ convertNodes(nodes, tileContent, attributesMap, useCartesianPositions);
82006
82836
  for (const attrKey of attributesMap.keys()) {
82007
82837
  const attributes = attributesMap.get(attrKey);
82008
82838
  if (attributes.positions.length === 0) {
82009
82839
  attributesMap.delete(attrKey);
82010
82840
  continue;
82011
82841
  }
82012
- const vertexCount = attributes.positions.length / VALUES_PER_VERTEX2;
82013
- if (!attributes.colors.length) {
82014
- attributes.colors = new Uint8Array(vertexCount * VALUES_PER_COLOR_ELEMENT);
82015
- for (let index = 0; index < attributes.colors.length; index += 4) {
82016
- attributes.colors.set([255, 255, 255, 255], index);
82017
- }
82018
- }
82019
- if (!attributes.texCoords.length) {
82020
- attributes.texCoords = new Float32Array(vertexCount * VALUES_PER_TEX_COORD);
82021
- for (let index = 0; index < attributes.texCoords.length; index += 2) {
82022
- attributes.texCoords.set([1, 1], index);
82023
- }
82024
- }
82025
82842
  attributes.featureIndices = attributes.featureIndices.reduce((acc, value) => acc.concat(value));
82026
82843
  }
82027
82844
  return attributesMap;
82028
82845
  }
82029
- function convertNodes(nodes, tileContent, attributesMap, matrix = new import_core17.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
82846
+ function convertNodes(nodes, tileContent, attributesMap, useCartesianPositions, matrix = new import_core21.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
82030
82847
  if (nodes) {
82031
82848
  for (const node3 of nodes) {
82032
- convertNode(node3, tileContent, attributesMap, matrix);
82849
+ convertNode(node3, tileContent, attributesMap, useCartesianPositions, matrix);
82033
82850
  }
82034
82851
  }
82035
82852
  }
82036
- function convertNode(node3, tileContent, attributesMap, matrix = new import_core17.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
82853
+ function convertNode(node3, tileContent, attributesMap, useCartesianPositions, matrix = new import_core21.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
82037
82854
  const nodeMatrix = node3.matrix;
82038
82855
  const compositeMatrix = nodeMatrix ? matrix.multiplyRight(nodeMatrix) : matrix;
82039
82856
  const mesh = node3.mesh;
82040
82857
  if (mesh) {
82041
- convertMesh(mesh, tileContent, attributesMap, compositeMatrix);
82858
+ convertMesh(mesh, tileContent, attributesMap, useCartesianPositions, compositeMatrix);
82042
82859
  }
82043
- convertNodes(node3.children, tileContent, attributesMap, compositeMatrix);
82860
+ convertNodes(node3.children, tileContent, attributesMap, useCartesianPositions, compositeMatrix);
82044
82861
  }
82045
- function convertMesh(mesh, content, attributesMap, matrix = new import_core17.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
82862
+ function convertMesh(mesh, content, attributesMap, useCartesianPositions = false, matrix = new import_core21.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])) {
82046
82863
  for (const primitive of mesh.primitives) {
82047
82864
  let outputAttributes = null;
82048
82865
  if (primitive.material) {
@@ -82058,7 +82875,8 @@ function convertMesh(mesh, content, attributesMap, matrix = new import_core17.Ma
82058
82875
  cartesianModelMatrix: content.cartesianModelMatrix,
82059
82876
  nodeMatrix: matrix,
82060
82877
  indices: primitive.indices.value,
82061
- attributeSpecificTransformation: transformVertexPositions
82878
+ attributeSpecificTransformation: transformVertexPositions,
82879
+ useCartesianPositions
82062
82880
  }));
82063
82881
  outputAttributes.normals = concatenateTypedArrays(outputAttributes.normals, transformVertexArray({
82064
82882
  vertices: attributes.NORMAL && attributes.NORMAL.value,
@@ -82066,7 +82884,8 @@ function convertMesh(mesh, content, attributesMap, matrix = new import_core17.Ma
82066
82884
  cartesianModelMatrix: content.cartesianModelMatrix,
82067
82885
  nodeMatrix: matrix,
82068
82886
  indices: primitive.indices.value,
82069
- attributeSpecificTransformation: transformVertexNormals
82887
+ attributeSpecificTransformation: transformVertexNormals,
82888
+ useCartesianPositions: false
82070
82889
  }));
82071
82890
  outputAttributes.texCoords = concatenateTypedArrays(outputAttributes.texCoords, flattenTexCoords(attributes.TEXCOORD_0 && attributes.TEXCOORD_0.value, primitive.indices.value));
82072
82891
  outputAttributes.colors = concatenateTypedArrays(outputAttributes.colors, flattenColors(attributes.COLOR_0, primitive.indices.value));
@@ -82082,7 +82901,7 @@ function transformVertexArray(args) {
82082
82901
  for (let i = 0; i < indices.length; i++) {
82083
82902
  const coordIndex = indices[i] * VALUES_PER_VERTEX2;
82084
82903
  const vertex = vertices.subarray(coordIndex, coordIndex + VALUES_PER_VERTEX2);
82085
- let vertexVector = new import_core17.Vector3(Array.from(vertex));
82904
+ let vertexVector = new import_core21.Vector3(Array.from(vertex));
82086
82905
  vertexVector = attributeSpecificTransformation(vertexVector, args);
82087
82906
  newVertices[i * VALUES_PER_VERTEX2] = vertexVector.x;
82088
82907
  newVertices[i * VALUES_PER_VERTEX2 + 1] = vertexVector.y;
@@ -82091,12 +82910,15 @@ function transformVertexArray(args) {
82091
82910
  return newVertices;
82092
82911
  }
82093
82912
  function transformVertexPositions(vertexVector, calleeArgs) {
82094
- const { cartesianModelMatrix, cartographicOrigin, nodeMatrix } = calleeArgs;
82913
+ const { cartesianModelMatrix, cartographicOrigin, nodeMatrix, useCartesianPositions } = calleeArgs;
82095
82914
  if (nodeMatrix) {
82096
82915
  vertexVector = vertexVector.transform(nodeMatrix);
82097
82916
  }
82098
82917
  vertexVector = vertexVector.transform(cartesianModelMatrix);
82099
- import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic([vertexVector[0], vertexVector[1], vertexVector[2]], vertexVector);
82918
+ if (useCartesianPositions) {
82919
+ return vertexVector;
82920
+ }
82921
+ import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic([vertexVector[0], vertexVector[1], vertexVector[2]], vertexVector);
82100
82922
  vertexVector = vertexVector.subtract(cartographicOrigin);
82101
82923
  return vertexVector;
82102
82924
  }
@@ -82111,6 +82933,7 @@ function transformVertexNormals(vertexVector, calleeArgs) {
82111
82933
  function flattenTexCoords(texCoords, indices) {
82112
82934
  const newTexCoords = new Float32Array(indices.length * VALUES_PER_TEX_COORD);
82113
82935
  if (!texCoords) {
82936
+ newTexCoords.fill(1);
82114
82937
  return newTexCoords;
82115
82938
  }
82116
82939
  for (let i = 0; i < indices.length; i++) {
@@ -82125,6 +82948,7 @@ function flattenColors(colorsAttribute, indices) {
82125
82948
  const components = colorsAttribute?.components || VALUES_PER_COLOR_ELEMENT;
82126
82949
  const newColors = new Uint8Array(indices.length * components);
82127
82950
  if (!colorsAttribute) {
82951
+ newColors.fill(255);
82128
82952
  return newColors;
82129
82953
  }
82130
82954
  const colors = colorsAttribute.value;
@@ -82239,10 +83063,10 @@ function convertGLTFMaterialToI3sSharedResources(gltfMaterial, nodeId) {
82239
83063
  }
82240
83064
  function extractSharedResourcesMaterialInfo(baseColorFactor, metallicFactor = 0) {
82241
83065
  const matDielectricColorComponent = 0.04 / 255;
82242
- const black = new import_core17.Vector4(0, 0, 0, 1);
82243
- const unitVector = new import_core17.Vector4(1, 1, 1, 1);
82244
- const dielectricSpecular = new import_core17.Vector4(matDielectricColorComponent, matDielectricColorComponent, matDielectricColorComponent, 0);
82245
- const baseColorVector = new import_core17.Vector4(baseColorFactor);
83066
+ const black = new import_core21.Vector4(0, 0, 0, 1);
83067
+ const unitVector = new import_core21.Vector4(1, 1, 1, 1);
83068
+ const dielectricSpecular = new import_core21.Vector4(matDielectricColorComponent, matDielectricColorComponent, matDielectricColorComponent, 0);
83069
+ const baseColorVector = new import_core21.Vector4(baseColorFactor);
82246
83070
  const firstOperand = unitVector.subtract(dielectricSpecular).multiply(baseColorVector);
82247
83071
  const diffuse = firstOperand.lerp(firstOperand, black, metallicFactor);
82248
83072
  dielectricSpecular[3] = 1;
@@ -82423,62 +83247,12 @@ function generateFeatureIndexAttribute(featureIndex, faceRange) {
82423
83247
  return orderedFeatureIndices;
82424
83248
  }
82425
83249
 
82426
- // src/i3s-converter/helpers/coordinate-converter.ts
82427
- var import_core19 = __toModule(require_es53());
82428
- var import_geospatial8 = __toModule(require_es54());
82429
- var import_culling4 = __toModule(require_es55());
82430
- function createBoundingVolumes(tile, geoidHeightModel) {
82431
- let radius;
82432
- let halfSize;
82433
- let quaternion;
82434
- const boundingVolume = tile.boundingVolume;
82435
- const cartographicCenter = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(boundingVolume.center, new import_core19.Vector3());
82436
- cartographicCenter[2] = cartographicCenter[2] - geoidHeightModel.getHeight(cartographicCenter[1], cartographicCenter[0]);
82437
- if (boundingVolume instanceof import_culling4.OrientedBoundingBox) {
82438
- halfSize = boundingVolume.halfSize;
82439
- radius = new import_core19.Vector3(halfSize[0], halfSize[1], halfSize[2]).len();
82440
- quaternion = boundingVolume.quaternion;
82441
- } else {
82442
- radius = tile.boundingVolume.radius;
82443
- halfSize = [radius, radius, radius];
82444
- quaternion = new import_core19.Quaternion().fromMatrix3(new import_core19.Matrix3([halfSize[0], 0, 0, 0, halfSize[1], 0, 0, 0, halfSize[2]])).normalize();
82445
- }
82446
- return {
82447
- mbs: [cartographicCenter[0], cartographicCenter[1], cartographicCenter[2], radius],
82448
- obb: {
82449
- center: [cartographicCenter[0], cartographicCenter[1], cartographicCenter[2]],
82450
- halfSize,
82451
- quaternion
82452
- }
82453
- };
82454
- }
82455
- function convertCommonToI3SExtentCoordinate(tileset) {
82456
- const cartesianCenter = tileset.cartesianCenter;
82457
- const radius = tileset.lodMetricValue;
82458
- const rightTop = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core19.Vector3(cartesianCenter[0] + radius, cartesianCenter[1] + radius, cartesianCenter[2]), new import_core19.Vector3());
82459
- const leftBottom = import_geospatial8.Ellipsoid.WGS84.cartesianToCartographic(new import_core19.Vector3(cartesianCenter[0] - radius, cartesianCenter[1] - radius, cartesianCenter[2]), new import_core19.Vector3());
82460
- const isFirstRight = rightTop[0] < leftBottom[0];
82461
- const isFirstTop = rightTop[1] < leftBottom[1];
82462
- return [
82463
- isFirstRight ? rightTop[0] : leftBottom[0],
82464
- isFirstTop ? rightTop[1] : leftBottom[1],
82465
- isFirstRight ? leftBottom[0] : rightTop[0],
82466
- isFirstTop ? leftBottom[1] : rightTop[1]
82467
- ];
82468
- }
82469
- function createObbFromMbs(mbs) {
82470
- const radius = mbs[3];
82471
- const center = new import_core19.Vector3(mbs[0], mbs[1], mbs[2]);
82472
- const halfAxex = new import_core19.Matrix3([radius, 0, 0, 0, radius, 0, 0, 0, radius]);
82473
- return new import_culling4.OrientedBoundingBox(center, halfAxex);
82474
- }
82475
-
82476
- // src/i3s-converter/helpers/create-scene-server-path.js
83250
+ // src/i3s-converter/helpers/create-scene-server-path.ts
82477
83251
  var import_json_map_transform2 = __toModule(require_json_map_transform());
82478
83252
  var import_path6 = __toModule(require("path"));
82479
83253
 
82480
- // src/i3s-converter/json-templates/scene-server.js
82481
- var SCENE_SERVER_TEMPLATE = {
83254
+ // src/i3s-converter/json-templates/scene-server.ts
83255
+ var SCENE_SERVER = () => ({
82482
83256
  serviceItemId: {
82483
83257
  path: "serviceItemId"
82484
83258
  },
@@ -82504,16 +83278,16 @@ var SCENE_SERVER_TEMPLATE = {
82504
83278
  path: "layers0",
82505
83279
  transform: (layers0) => [layers0]
82506
83280
  }
82507
- };
83281
+ });
82508
83282
 
82509
- // src/i3s-converter/helpers/create-scene-server-path.js
83283
+ // src/i3s-converter/helpers/create-scene-server-path.ts
82510
83284
  async function createSceneServerPath(layerName, layers0, rootPath) {
82511
83285
  const sceneServerData = {
82512
83286
  serviceItemId: v4().replace(/-/gi, ""),
82513
83287
  layerName,
82514
83288
  layers0
82515
83289
  };
82516
- const sceneServer = (0, import_json_map_transform2.default)(sceneServerData, SCENE_SERVER_TEMPLATE);
83290
+ const sceneServer = (0, import_json_map_transform2.default)(sceneServerData, SCENE_SERVER());
82517
83291
  const nodePagePath = (0, import_path6.join)(rootPath, "SceneServer");
82518
83292
  await writeFile3(nodePagePath, JSON.stringify(sceneServer));
82519
83293
  }
@@ -82556,644 +83330,8 @@ function convertScreenThresholdToGeometricError(node3) {
82556
83330
  return node3.header.mbs[3] * 2 * DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR / maxError;
82557
83331
  }
82558
83332
 
82559
- // src/lib/geoid-height-model.js
82560
- var c0_ = 240;
82561
- var c3_ = [
82562
- 9,
82563
- -18,
82564
- -88,
82565
- 0,
82566
- 96,
82567
- 90,
82568
- 0,
82569
- 0,
82570
- -60,
82571
- -20,
82572
- -9,
82573
- 18,
82574
- 8,
82575
- 0,
82576
- -96,
82577
- 30,
82578
- 0,
82579
- 0,
82580
- 60,
82581
- -20,
82582
- 9,
82583
- -88,
82584
- -18,
82585
- 90,
82586
- 96,
82587
- 0,
82588
- -20,
82589
- -60,
82590
- 0,
82591
- 0,
82592
- 186,
82593
- -42,
82594
- -42,
82595
- -150,
82596
- -96,
82597
- -150,
82598
- 60,
82599
- 60,
82600
- 60,
82601
- 60,
82602
- 54,
82603
- 162,
82604
- -78,
82605
- 30,
82606
- -24,
82607
- -90,
82608
- -60,
82609
- 60,
82610
- -60,
82611
- 60,
82612
- -9,
82613
- -32,
82614
- 18,
82615
- 30,
82616
- 24,
82617
- 0,
82618
- 20,
82619
- -60,
82620
- 0,
82621
- 0,
82622
- -9,
82623
- 8,
82624
- 18,
82625
- 30,
82626
- -96,
82627
- 0,
82628
- -20,
82629
- 60,
82630
- 0,
82631
- 0,
82632
- 54,
82633
- -78,
82634
- 162,
82635
- -90,
82636
- -24,
82637
- 30,
82638
- 60,
82639
- -60,
82640
- 60,
82641
- -60,
82642
- -54,
82643
- 78,
82644
- 78,
82645
- 90,
82646
- 144,
82647
- 90,
82648
- -60,
82649
- -60,
82650
- -60,
82651
- -60,
82652
- 9,
82653
- -8,
82654
- -18,
82655
- -30,
82656
- -24,
82657
- 0,
82658
- 20,
82659
- 60,
82660
- 0,
82661
- 0,
82662
- -9,
82663
- 18,
82664
- -32,
82665
- 0,
82666
- 24,
82667
- 30,
82668
- 0,
82669
- 0,
82670
- -60,
82671
- 20,
82672
- 9,
82673
- -18,
82674
- -8,
82675
- 0,
82676
- -24,
82677
- -30,
82678
- 0,
82679
- 0,
82680
- 60,
82681
- 20
82682
- ];
82683
- var c0n_ = 372;
82684
- var c3n_ = [
82685
- 0,
82686
- 0,
82687
- -131,
82688
- 0,
82689
- 138,
82690
- 144,
82691
- 0,
82692
- 0,
82693
- -102,
82694
- -31,
82695
- 0,
82696
- 0,
82697
- 7,
82698
- 0,
82699
- -138,
82700
- 42,
82701
- 0,
82702
- 0,
82703
- 102,
82704
- -31,
82705
- 62,
82706
- 0,
82707
- -31,
82708
- 0,
82709
- 0,
82710
- -62,
82711
- 0,
82712
- 0,
82713
- 0,
82714
- 31,
82715
- 124,
82716
- 0,
82717
- -62,
82718
- 0,
82719
- 0,
82720
- -124,
82721
- 0,
82722
- 0,
82723
- 0,
82724
- 62,
82725
- 124,
82726
- 0,
82727
- -62,
82728
- 0,
82729
- 0,
82730
- -124,
82731
- 0,
82732
- 0,
82733
- 0,
82734
- 62,
82735
- 62,
82736
- 0,
82737
- -31,
82738
- 0,
82739
- 0,
82740
- -62,
82741
- 0,
82742
- 0,
82743
- 0,
82744
- 31,
82745
- 0,
82746
- 0,
82747
- 45,
82748
- 0,
82749
- -183,
82750
- -9,
82751
- 0,
82752
- 93,
82753
- 18,
82754
- 0,
82755
- 0,
82756
- 0,
82757
- 216,
82758
- 0,
82759
- 33,
82760
- 87,
82761
- 0,
82762
- -93,
82763
- 12,
82764
- -93,
82765
- 0,
82766
- 0,
82767
- 156,
82768
- 0,
82769
- 153,
82770
- 99,
82771
- 0,
82772
- -93,
82773
- -12,
82774
- -93,
82775
- 0,
82776
- 0,
82777
- -45,
82778
- 0,
82779
- -3,
82780
- 9,
82781
- 0,
82782
- 93,
82783
- -18,
82784
- 0,
82785
- 0,
82786
- 0,
82787
- -55,
82788
- 0,
82789
- 48,
82790
- 42,
82791
- 0,
82792
- 0,
82793
- -84,
82794
- 31,
82795
- 0,
82796
- 0,
82797
- -7,
82798
- 0,
82799
- -48,
82800
- -42,
82801
- 0,
82802
- 0,
82803
- 84,
82804
- 31
82805
- ];
82806
- var c0s_ = 372;
82807
- var c3s_ = [
82808
- 18,
82809
- -36,
82810
- -122,
82811
- 0,
82812
- 120,
82813
- 135,
82814
- 0,
82815
- 0,
82816
- -84,
82817
- -31,
82818
- -18,
82819
- 36,
82820
- -2,
82821
- 0,
82822
- -120,
82823
- 51,
82824
- 0,
82825
- 0,
82826
- 84,
82827
- -31,
82828
- 36,
82829
- -165,
82830
- -27,
82831
- 93,
82832
- 147,
82833
- -9,
82834
- 0,
82835
- -93,
82836
- 18,
82837
- 0,
82838
- 210,
82839
- 45,
82840
- -111,
82841
- -93,
82842
- -57,
82843
- -192,
82844
- 0,
82845
- 93,
82846
- 12,
82847
- 93,
82848
- 162,
82849
- 141,
82850
- -75,
82851
- -93,
82852
- -129,
82853
- -180,
82854
- 0,
82855
- 93,
82856
- -12,
82857
- 93,
82858
- -36,
82859
- -21,
82860
- 27,
82861
- 93,
82862
- 39,
82863
- 9,
82864
- 0,
82865
- -93,
82866
- -18,
82867
- 0,
82868
- 0,
82869
- 0,
82870
- 62,
82871
- 0,
82872
- 0,
82873
- 31,
82874
- 0,
82875
- 0,
82876
- 0,
82877
- -31,
82878
- 0,
82879
- 0,
82880
- 124,
82881
- 0,
82882
- 0,
82883
- 62,
82884
- 0,
82885
- 0,
82886
- 0,
82887
- -62,
82888
- 0,
82889
- 0,
82890
- 124,
82891
- 0,
82892
- 0,
82893
- 62,
82894
- 0,
82895
- 0,
82896
- 0,
82897
- -62,
82898
- 0,
82899
- 0,
82900
- 62,
82901
- 0,
82902
- 0,
82903
- 31,
82904
- 0,
82905
- 0,
82906
- 0,
82907
- -31,
82908
- -18,
82909
- 36,
82910
- -64,
82911
- 0,
82912
- 66,
82913
- 51,
82914
- 0,
82915
- 0,
82916
- -102,
82917
- 31,
82918
- 18,
82919
- -36,
82920
- 2,
82921
- 0,
82922
- -66,
82923
- -51,
82924
- 0,
82925
- 0,
82926
- 102,
82927
- 31
82928
- ];
82929
- var stencilsize_ = 12;
82930
- var nterms_ = (3 + 1) * (3 + 2) / 2;
82931
- var PIXEL_SIZE = 2;
82932
- var GeoidHeightModel = class {
82933
- constructor(options) {
82934
- this.options = options;
82935
- this._v00 = 0;
82936
- this._v01 = 0;
82937
- this._v10 = 0;
82938
- this._v11 = 0;
82939
- this._t = [];
82940
- this._ix = this.options._width;
82941
- this._iy = this.options._height;
82942
- }
82943
- getHeight(lat, lon) {
82944
- lat = Math.abs(lat) > 90 ? NaN : lat;
82945
- if (isNaN(lat) || isNaN(lon)) {
82946
- return NaN;
82947
- }
82948
- const rem = _remainder(lon, 360);
82949
- lon = rem !== -180 ? rem : 180;
82950
- let fx = lon * this.options._rlonres;
82951
- let fy = -lat * this.options._rlatres;
82952
- let ix = Math.floor(fx);
82953
- let iy = Math.min(Math.round((this.options._height - 1) / 2 - 1), Math.floor(fy));
82954
- fx -= ix;
82955
- fy -= iy;
82956
- iy += (this.options._height - 1) / 2;
82957
- ix += ix < 0 ? this.options._width : ix >= this.options._width ? -this.options._width : 0;
82958
- let v00 = 0;
82959
- let v01 = 0;
82960
- let v10 = 0;
82961
- let v11 = 0;
82962
- let t = new Array(nterms_);
82963
- if (!(ix === this._ix && iy === this._iy)) {
82964
- if (!this.options.cubic) {
82965
- v00 = this._rawval(ix, iy);
82966
- v01 = this._rawval(ix + 1, iy);
82967
- v10 = this._rawval(ix, iy + 1);
82968
- v11 = this._rawval(ix + 1, iy + 1);
82969
- } else {
82970
- const v = [
82971
- this._rawval(ix, iy - 1),
82972
- this._rawval(ix + 1, iy - 1),
82973
- this._rawval(ix - 1, iy),
82974
- this._rawval(ix, iy),
82975
- this._rawval(ix + 1, iy),
82976
- this._rawval(ix + 2, iy),
82977
- this._rawval(ix - 1, iy + 1),
82978
- this._rawval(ix, iy + 1),
82979
- this._rawval(ix + 1, iy + 1),
82980
- this._rawval(ix + 2, iy + 1),
82981
- this._rawval(ix, iy + 2),
82982
- this._rawval(ix + 1, iy + 2)
82983
- ];
82984
- let c3x = c3n_;
82985
- if (iy !== 0) {
82986
- c3x = iy === this.options._height - 2 ? c3s_ : c3_;
82987
- }
82988
- let c0x = c0n_;
82989
- if (iy !== 0) {
82990
- c0x = iy === this.options._height - 2 ? c0s_ : c0_;
82991
- }
82992
- for (let i = 0; i < nterms_; ++i) {
82993
- t[i] = 0;
82994
- for (let j = 0; j < stencilsize_; ++j) {
82995
- t[i] += v[j] * c3x[nterms_ * j + i];
82996
- }
82997
- t[i] /= c0x;
82998
- }
82999
- }
83000
- } else if (!this.options.cubic) {
83001
- v00 = this._v00;
83002
- v01 = this._v01;
83003
- v10 = this._v10;
83004
- v11 = this._v11;
83005
- } else {
83006
- t = this._t;
83007
- }
83008
- if (!this.options.cubic) {
83009
- const a = (1 - fx) * v00 + fx * v01;
83010
- const b = (1 - fx) * v10 + fx * v11;
83011
- const c = (1 - fy) * a + fy * b;
83012
- const h2 = this.options._offset + this.options._scale * c;
83013
- this._ix = ix;
83014
- this._iy = iy;
83015
- this._v00 = v00;
83016
- this._v01 = v01;
83017
- this._v10 = v10;
83018
- this._v11 = v11;
83019
- return h2;
83020
- }
83021
- let h = t[0] + fx * (t[1] + fx * (t[3] + fx * t[6])) + fy * (t[2] + fx * (t[4] + fx * t[7]) + fy * (t[5] + fx * t[8] + fy * t[9]));
83022
- h = this.options._offset + this.options._scale * h;
83023
- this._ix = ix;
83024
- this._iy = iy;
83025
- this._t = t;
83026
- return h;
83027
- }
83028
- _rawval(ix, iy) {
83029
- if (ix < 0) {
83030
- ix += this.options._width;
83031
- } else if (ix >= this.options._width) {
83032
- ix -= this.options._width;
83033
- }
83034
- if (iy < 0 || iy >= this.options._height) {
83035
- iy = iy < 0 ? -iy : 2 * (this.options._height - 1) - iy;
83036
- ix += (ix < this.options._width / 2 ? 1 : -1) * this.options._width / 2;
83037
- }
83038
- const bufferPosition = this.options._datastart + PIXEL_SIZE * (iy * this.options._swidth + ix);
83039
- const a = this.options.data[bufferPosition];
83040
- const b = this.options.data[bufferPosition + 1];
83041
- const r = a << 8 | b;
83042
- return r;
83043
- }
83044
- };
83045
- function _remainder(x, y) {
83046
- y = Math.abs(y);
83047
- let z = _fmod(x, y);
83048
- if (2 * Math.abs(z) === y)
83049
- z -= _fmod(x, 2 * y) - z;
83050
- else if (2 * Math.abs(z) > y)
83051
- z += z < 0 ? y : -y;
83052
- return z;
83053
- }
83054
- function _fmod(x, y) {
83055
- return x - Math.floor(x / y) * y;
83056
- }
83057
-
83058
- // src/lib/pgm-parser.js
83059
- var ENDL = 10;
83060
- var PIXEL_MAX = 65535;
83061
- function parsePgm(data, options) {
83062
- const getline = _getLineGenerator(data);
83063
- let currentLine = getline.next();
83064
- if (currentLine.done || currentLine.value.line !== "P5") {
83065
- throw new Error("Geoid model file: File not in PGM format");
83066
- }
83067
- let _offset = Number.MAX_VALUE;
83068
- let _scale = 0;
83069
- let _maxerror = -1;
83070
- let _rmserror = -1;
83071
- let _description = "NONE";
83072
- let _datetime = "UNKNOWN";
83073
- let _width = 0;
83074
- let _height = 0;
83075
- let _datastart = null;
83076
- let _swidth = null;
83077
- do {
83078
- currentLine = getline.next();
83079
- const s = currentLine.value.line;
83080
- if (!s.length) {
83081
- continue;
83082
- }
83083
- if (s[0] === "#") {
83084
- const sArr = s.split(" ");
83085
- const commentId = sArr[0];
83086
- const key = sArr[1];
83087
- if (commentId !== "#" || !key) {
83088
- continue;
83089
- }
83090
- const infoArr = sArr.length > 2 ? sArr.slice(2) : [];
83091
- if (key === "Description") {
83092
- _description = infoArr.join(" ");
83093
- } else if (key === "DateTime") {
83094
- _datetime = infoArr.join(" ");
83095
- } else if (key === "Offset") {
83096
- if (!sArr[2]) {
83097
- throw new Error("Geoid model file: Error reading offset");
83098
- }
83099
- _offset = parseInt(sArr[2], 10);
83100
- } else if (key === "Scale") {
83101
- if (!sArr[2]) {
83102
- throw new Error("Geoid model file: Error reading scale");
83103
- }
83104
- _scale = parseFloat(sArr[2]);
83105
- } else if (key === (options.cubic ? "MaxCubicError" : "MaxBilinearError")) {
83106
- if (isFinite(parseFloat(sArr[2]))) {
83107
- _maxerror = parseFloat(sArr[2]);
83108
- }
83109
- } else if (key === (options.cubic ? "RMSCubicError" : "RMSBilinearError")) {
83110
- if (isFinite(parseFloat(sArr[2]))) {
83111
- _rmserror = parseFloat(sArr[2]);
83112
- }
83113
- }
83114
- } else {
83115
- let sArr = s.split(" ");
83116
- sArr = sArr.filter((testString) => testString !== "");
83117
- _width = parseInt(sArr[0], 10);
83118
- _height = parseInt(sArr[1], 10);
83119
- if (!(_width && _height)) {
83120
- throw new Error("Geoid model file: Error reading raster size");
83121
- }
83122
- break;
83123
- }
83124
- } while (!currentLine.done);
83125
- currentLine = getline.next();
83126
- const maxval = parseInt(currentLine.value.line, 10);
83127
- if (currentLine.done) {
83128
- throw new Error("Geoid model file: Error reading maxval");
83129
- }
83130
- if (maxval !== PIXEL_MAX) {
83131
- throw new Error("Geoid model file: Incorrect value of maxval");
83132
- }
83133
- _datastart = currentLine.value.offset;
83134
- _swidth = _width;
83135
- if (_offset === Number.MAX_VALUE) {
83136
- throw new Error("Geoid model file: Offset not set");
83137
- }
83138
- if (_scale === 0) {
83139
- throw new Error("Geoid model file: Scale not set");
83140
- }
83141
- if (_scale < 0) {
83142
- throw new Error("Geoid model file: Scale must be positive");
83143
- }
83144
- if (_height < 2 || _width < 2) {
83145
- throw new Error("Geoid model file: Raster size too small");
83146
- }
83147
- if (_width & 1) {
83148
- throw new Error("Geoid model file: Raster width is odd");
83149
- }
83150
- if (!(_height & 1)) {
83151
- throw new Error("Geoid model file: Raster height is even");
83152
- }
83153
- const _rlonres = _width / 360;
83154
- const _rlatres = (_height - 1) / 180;
83155
- return new GeoidHeightModel({
83156
- cubic: options.cubic,
83157
- _width,
83158
- _height,
83159
- _rlonres,
83160
- _rlatres,
83161
- _offset,
83162
- _scale,
83163
- _swidth,
83164
- _datastart,
83165
- _maxerror,
83166
- _rmserror,
83167
- _description,
83168
- _datetime,
83169
- data
83170
- });
83171
- }
83172
- function* _getLineGenerator(data) {
83173
- let offset = 0;
83174
- do {
83175
- const endLineIndex = data.indexOf(ENDL, offset);
83176
- if (endLineIndex !== -1) {
83177
- const line = data.subarray(offset, endLineIndex);
83178
- offset = endLineIndex + 1;
83179
- yield { offset, line: _getStringFromCharArray(line) };
83180
- } else {
83181
- const line = data.subarray(offset, data.length);
83182
- offset = data.length;
83183
- yield { offset, line: _getStringFromCharArray(line) };
83184
- }
83185
- } while (offset < data.length);
83186
- return { offset, line: "" };
83187
- }
83188
- function _getStringFromCharArray(array) {
83189
- let s = "";
83190
- for (const char of array) {
83191
- s += String.fromCharCode(char);
83192
- }
83193
- return s;
83194
- }
83195
-
83196
83333
  // src/pgm-loader.ts
83334
+ var import_geoid = __toModule(require_es56());
83197
83335
  var VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
83198
83336
  var PGMLoader = {
83199
83337
  name: "PGM - Netpbm grayscale image format",
@@ -83201,17 +83339,17 @@ var PGMLoader = {
83201
83339
  module: "tile-converter",
83202
83340
  version: VERSION9,
83203
83341
  mimeTypes: ["image/x-portable-graymap"],
83204
- parse: (arrayBuffer, options) => parsePgm(new Uint8Array(arrayBuffer), options),
83342
+ parse: async (arrayBuffer, options) => (0, import_geoid.parsePGM)(new Uint8Array(arrayBuffer), options),
83205
83343
  extensions: ["pgm"],
83206
83344
  options: {
83207
83345
  cubic: false
83208
83346
  }
83209
83347
  };
83210
83348
 
83211
- // src/i3s-converter/json-templates/layers.js
83349
+ // src/i3s-converter/json-templates/layers.ts
83212
83350
  var import_json_map_transform3 = __toModule(require_json_map_transform());
83213
83351
 
83214
- // src/i3s-converter/json-templates/store.js
83352
+ // src/i3s-converter/json-templates/store.ts
83215
83353
  var STORE = {
83216
83354
  id: {
83217
83355
  path: "id",
@@ -83313,8 +83451,8 @@ var STORE = {
83313
83451
  }
83314
83452
  };
83315
83453
 
83316
- // src/i3s-converter/json-templates/layers.js
83317
- var PLAIN_GEOMETRY_DEFINITION = {
83454
+ // src/i3s-converter/json-templates/layers.ts
83455
+ var PLAIN_GEOMETRY_DEFINITION = () => ({
83318
83456
  offset: 8,
83319
83457
  position: {
83320
83458
  type: "Float32",
@@ -83342,8 +83480,8 @@ var PLAIN_GEOMETRY_DEFINITION = {
83342
83480
  type: "UInt32",
83343
83481
  component: 2
83344
83482
  }
83345
- };
83346
- var PLAIN_GEOMETRY_DEFINITION_WITHOUT_UV0 = {
83483
+ });
83484
+ var PLAIN_GEOMETRY_DEFINITION_WITHOUT_UV0 = () => ({
83347
83485
  offset: 8,
83348
83486
  position: {
83349
83487
  type: "Float32",
@@ -83367,20 +83505,20 @@ var PLAIN_GEOMETRY_DEFINITION_WITHOUT_UV0 = {
83367
83505
  type: "UInt32",
83368
83506
  component: 2
83369
83507
  }
83370
- };
83371
- var COMPRESSED_GEOMETRY_DEFINITION = {
83508
+ });
83509
+ var COMPRESSED_GEOMETRY_DEFINITION = () => ({
83372
83510
  compressedAttributes: {
83373
83511
  encoding: "draco",
83374
83512
  attributes: ["position", "normal", "uv0", "color", "feature-index"]
83375
83513
  }
83376
- };
83377
- var COMPRESSED_GEOMETRY_DEFINITION_WITHOUT_UV0 = {
83514
+ });
83515
+ var COMPRESSED_GEOMETRY_DEFINITION_WITHOUT_UV0 = () => ({
83378
83516
  compressedAttributes: {
83379
83517
  encoding: "draco",
83380
83518
  attributes: ["position", "normal", "color", "feature-index"]
83381
83519
  }
83382
- };
83383
- var SPATIAL_REFERENCE = {
83520
+ });
83521
+ var SPATIAL_REFERENCE = () => ({
83384
83522
  wkid: {
83385
83523
  path: "wkid",
83386
83524
  default: 4326
@@ -83397,8 +83535,8 @@ var SPATIAL_REFERENCE = {
83397
83535
  path: "latestVcsWkid",
83398
83536
  default: 5773
83399
83537
  }
83400
- };
83401
- var HEIGHT_MODEL_INFO = {
83538
+ });
83539
+ var HEIGHT_MODEL_INFO = () => ({
83402
83540
  heightModel: {
83403
83541
  path: "heightModel",
83404
83542
  default: "gravity_related_height"
@@ -83411,8 +83549,8 @@ var HEIGHT_MODEL_INFO = {
83411
83549
  path: "heightUnit",
83412
83550
  default: "meter"
83413
83551
  }
83414
- };
83415
- var NODE_PAGES = {
83552
+ });
83553
+ var NODE_PAGES = () => ({
83416
83554
  nodesPerPage: {
83417
83555
  path: "nodesPerPage"
83418
83556
  },
@@ -83420,8 +83558,8 @@ var NODE_PAGES = {
83420
83558
  path: "lodSelectionMetricType",
83421
83559
  default: "maxScreenThresholdSQ"
83422
83560
  }
83423
- };
83424
- var LAYERS = {
83561
+ });
83562
+ var LAYERS = () => ({
83425
83563
  version: {
83426
83564
  path: "version",
83427
83565
  transform: (val) => val.toUpperCase()
@@ -83443,7 +83581,7 @@ var LAYERS = {
83443
83581
  },
83444
83582
  spatialReference: {
83445
83583
  path: "spatialReference",
83446
- transform: (val) => (0, import_json_map_transform3.default)(val, SPATIAL_REFERENCE)
83584
+ transform: (val) => (0, import_json_map_transform3.default)(val, SPATIAL_REFERENCE())
83447
83585
  },
83448
83586
  capabilities: {
83449
83587
  path: "capabilities",
@@ -83455,11 +83593,11 @@ var LAYERS = {
83455
83593
  },
83456
83594
  heightModelInfo: {
83457
83595
  path: "heightModelInfo",
83458
- transform: (val) => (0, import_json_map_transform3.default)(val, HEIGHT_MODEL_INFO)
83596
+ transform: (val) => (0, import_json_map_transform3.default)(val, HEIGHT_MODEL_INFO())
83459
83597
  },
83460
83598
  nodePages: {
83461
83599
  path: "nodePages",
83462
- transform: (val) => (0, import_json_map_transform3.default)(val, NODE_PAGES)
83600
+ transform: (val) => (0, import_json_map_transform3.default)(val, NODE_PAGES())
83463
83601
  },
83464
83602
  materialDefinitions: {
83465
83603
  path: "materialDefinitions",
@@ -83472,20 +83610,18 @@ var LAYERS = {
83472
83610
  geometryDefinitions: {
83473
83611
  path: "compressGeometry",
83474
83612
  transform: (val) => {
83475
- const result = [{}, {}];
83476
- result[0].geometryBuffers = [];
83477
- result[1].geometryBuffers = [];
83478
- result[0].geometryBuffers.push(PLAIN_GEOMETRY_DEFINITION);
83479
- result[1].geometryBuffers.push(PLAIN_GEOMETRY_DEFINITION_WITHOUT_UV0);
83613
+ const result = [{ geometryBuffers: [] }, { geometryBuffers: [] }];
83614
+ result[0].geometryBuffers.push(PLAIN_GEOMETRY_DEFINITION());
83615
+ result[1].geometryBuffers.push(PLAIN_GEOMETRY_DEFINITION_WITHOUT_UV0());
83480
83616
  if (val) {
83481
- result[0].geometryBuffers.push(COMPRESSED_GEOMETRY_DEFINITION);
83482
- result[1].geometryBuffers.push(COMPRESSED_GEOMETRY_DEFINITION_WITHOUT_UV0);
83617
+ result[0].geometryBuffers.push(COMPRESSED_GEOMETRY_DEFINITION());
83618
+ result[1].geometryBuffers.push(COMPRESSED_GEOMETRY_DEFINITION_WITHOUT_UV0());
83483
83619
  }
83484
83620
  return result;
83485
83621
  },
83486
83622
  default: [
83487
83623
  {
83488
- geometryBuffers: [PLAIN_GEOMETRY_DEFINITION, PLAIN_GEOMETRY_DEFINITION_WITHOUT_UV0]
83624
+ geometryBuffers: [PLAIN_GEOMETRY_DEFINITION(), PLAIN_GEOMETRY_DEFINITION_WITHOUT_UV0()]
83489
83625
  }
83490
83626
  ]
83491
83627
  },
@@ -83501,31 +83637,31 @@ var LAYERS = {
83501
83637
  path: "popupInfo",
83502
83638
  default: null
83503
83639
  }
83504
- };
83640
+ });
83505
83641
 
83506
- // src/i3s-converter/json-templates/node.js
83642
+ // src/i3s-converter/json-templates/node.ts
83507
83643
  var import_json_map_transform4 = __toModule(require_json_map_transform());
83508
- var COORDINATES = {
83644
+ var COORDINATES = () => ({
83509
83645
  mbs: {
83510
83646
  path: "mbs"
83511
83647
  },
83512
83648
  obb: {
83513
83649
  path: "obb"
83514
83650
  }
83515
- };
83516
- var _href = {
83651
+ });
83652
+ var HREF = () => ({
83517
83653
  href: {
83518
83654
  path: "href"
83519
83655
  }
83520
- };
83521
- var PARENT_NODE = {
83656
+ });
83657
+ var PARENT_NODE = () => ({
83522
83658
  id: {
83523
83659
  path: "id"
83524
83660
  },
83525
- ..._href,
83526
- ...COORDINATES
83527
- };
83528
- var NODE = {
83661
+ ...HREF(),
83662
+ ...COORDINATES()
83663
+ });
83664
+ var NODE = () => ({
83529
83665
  version: {
83530
83666
  path: "version"
83531
83667
  },
@@ -83538,7 +83674,7 @@ var NODE = {
83538
83674
  level: {
83539
83675
  path: "level"
83540
83676
  },
83541
- ...COORDINATES,
83677
+ ...COORDINATES(),
83542
83678
  lodSelection: {
83543
83679
  path: "lodSelection",
83544
83680
  default: [
@@ -83562,7 +83698,7 @@ var NODE = {
83562
83698
  },
83563
83699
  parentNode: {
83564
83700
  path: "parentNode",
83565
- transform: (val) => (0, import_json_map_transform4.default)(val, PARENT_NODE),
83701
+ transform: (val) => (0, import_json_map_transform4.default)(val, PARENT_NODE()),
83566
83702
  default: null
83567
83703
  },
83568
83704
  sharedResource: {
@@ -83585,11 +83721,11 @@ var NODE = {
83585
83721
  path: "attributeData",
83586
83722
  default: null
83587
83723
  }
83588
- };
83724
+ });
83589
83725
 
83590
- // src/i3s-converter/json-templates/shared-resources.js
83726
+ // src/i3s-converter/json-templates/shared-resources.ts
83591
83727
  var import_json_map_transform5 = __toModule(require_json_map_transform());
83592
- var MATERIAL_DEFINITION_INFO_PARAMS = {
83728
+ var MATERIAL_DEFINITION_INFO_PARAMS = () => ({
83593
83729
  renderMode: {
83594
83730
  path: "renderMode",
83595
83731
  default: "solid"
@@ -83626,8 +83762,8 @@ var MATERIAL_DEFINITION_INFO_PARAMS = {
83626
83762
  path: "vertexColors",
83627
83763
  default: true
83628
83764
  }
83629
- };
83630
- var MATERIAL_DEFINITION_INFO = {
83765
+ });
83766
+ var MATERIAL_DEFINITION_INFO = () => ({
83631
83767
  name: {
83632
83768
  path: "name",
83633
83769
  default: "standard"
@@ -83638,10 +83774,10 @@ var MATERIAL_DEFINITION_INFO = {
83638
83774
  },
83639
83775
  params: {
83640
83776
  path: "params",
83641
- transform: (val, thisObject, originalObject) => (0, import_json_map_transform5.default)(originalObject, MATERIAL_DEFINITION_INFO_PARAMS)
83777
+ transform: (val, thisObject, originalObject) => (0, import_json_map_transform5.default)(originalObject, MATERIAL_DEFINITION_INFO_PARAMS())
83642
83778
  }
83643
- };
83644
- var TEXTURE_DEFINITION_IMAGE = {
83779
+ });
83780
+ var TEXTURE_DEFINITION_IMAGE = () => ({
83645
83781
  id: {
83646
83782
  path: "id"
83647
83783
  },
@@ -83655,8 +83791,8 @@ var TEXTURE_DEFINITION_IMAGE = {
83655
83791
  length: {
83656
83792
  path: "length"
83657
83793
  }
83658
- };
83659
- var TEXTURE_DEFINITION_INFO = {
83794
+ });
83795
+ var TEXTURE_DEFINITION_INFO = () => ({
83660
83796
  encoding: {
83661
83797
  path: "encoding"
83662
83798
  },
@@ -83678,10 +83814,10 @@ var TEXTURE_DEFINITION_INFO = {
83678
83814
  },
83679
83815
  images: {
83680
83816
  path: "images",
83681
- transform: (val, thisObject, originalObject) => val.map((image) => (0, import_json_map_transform5.default)(image, TEXTURE_DEFINITION_IMAGE))
83817
+ transform: (val, thisObject, originalObject) => val.map((image) => (0, import_json_map_transform5.default)(image, TEXTURE_DEFINITION_IMAGE()))
83682
83818
  }
83683
- };
83684
- var SHARED_RESOURCES_TEMPLATE = {
83819
+ });
83820
+ var SHARED_RESOURCES = () => ({
83685
83821
  materialDefinitions: {
83686
83822
  path: "materialDefinitionInfos",
83687
83823
  transform: transfromMaterialDefinitions
@@ -83690,11 +83826,11 @@ var SHARED_RESOURCES_TEMPLATE = {
83690
83826
  path: "textureDefinitionInfos",
83691
83827
  transform: transfromTextureDefinitions
83692
83828
  }
83693
- };
83829
+ });
83694
83830
  function transfromMaterialDefinitions(materialDefinitionInfos, thisObject, originalObject) {
83695
83831
  const result = {};
83696
83832
  for (const [index, materialDefinitionInfo] of materialDefinitionInfos.entries()) {
83697
- result[`Mat${originalObject.nodePath}${index}`] = (0, import_json_map_transform5.default)(materialDefinitionInfo, MATERIAL_DEFINITION_INFO);
83833
+ result[`Mat${originalObject.nodePath}${index}`] = (0, import_json_map_transform5.default)(materialDefinitionInfo, MATERIAL_DEFINITION_INFO());
83698
83834
  }
83699
83835
  return result;
83700
83836
  }
@@ -83706,19 +83842,19 @@ function transfromTextureDefinitions(textureDefinitionInfos, thisObject, origina
83706
83842
  for (const [index, textureDefinitionInfo] of textureDefinitionInfos.entries()) {
83707
83843
  const imageIndex = `${originalObject.nodePath}${index}`;
83708
83844
  textureDefinitionInfo.imageIndex = imageIndex;
83709
- result[imageIndex] = (0, import_json_map_transform5.default)(textureDefinitionInfo, TEXTURE_DEFINITION_INFO);
83845
+ result[imageIndex] = (0, import_json_map_transform5.default)(textureDefinitionInfo, TEXTURE_DEFINITION_INFO());
83710
83846
  }
83711
83847
  return result;
83712
83848
  }
83713
83849
 
83714
- // src/i3s-converter/helpers/node-debug.js
83850
+ // src/i3s-converter/helpers/node-debug.ts
83715
83851
  var import_culling5 = __toModule(require_es55());
83716
- var import_engine = __toModule(require_es511());
83717
- var import_core20 = __toModule(require_es53());
83852
+ var import_engine = __toModule(require_es512());
83853
+ var import_core23 = __toModule(require_es53());
83718
83854
  var import_geospatial9 = __toModule(require_es54());
83719
83855
  function validateNodeBoundingVolumes(node3) {
83720
83856
  if (!node3.parentNode.obb || !node3.parentNode.mbs) {
83721
- return null;
83857
+ return [];
83722
83858
  }
83723
83859
  const tileWarnings = [];
83724
83860
  validateObb(tileWarnings, node3);
@@ -83754,12 +83890,12 @@ function createBoundingBoxFromTileObb(obb) {
83754
83890
  function getTileObbVertices(node3) {
83755
83891
  const geometry = new import_engine.CubeGeometry();
83756
83892
  const halfSize = node3.obb.halfSize;
83757
- const { attributes } = geometry;
83893
+ const attributes = geometry.getAttributes();
83758
83894
  const positions = new Float32Array(attributes.POSITION.value);
83759
83895
  const obbCenterCartesian = import_geospatial9.Ellipsoid.WGS84.cartographicToCartesian(node3.obb.center);
83760
83896
  let vertices = [];
83761
83897
  for (let i = 0; i < positions.length; i += 3) {
83762
- const positionsVector = new import_core20.Vector3(positions[i] *= halfSize[0], positions[i + 1] *= halfSize[1], positions[i + 2] *= halfSize[2]);
83898
+ const positionsVector = new import_core23.Vector3(positions[i] *= halfSize[0], positions[i + 1] *= halfSize[1], positions[i + 2] *= halfSize[2]);
83763
83899
  const rotatedPositions = positionsVector.transformByQuaternion(node3.obb.quaternion).add(obbCenterCartesian);
83764
83900
  vertices = vertices.concat(rotatedPositions);
83765
83901
  }
@@ -83792,6 +83928,11 @@ var REFRESH_TOKEN_TIMEOUT = 1800;
83792
83928
  var CESIUM_DATASET_PREFIX = "https://";
83793
83929
  var I3SConverter = class {
83794
83930
  constructor() {
83931
+ this.boundingVolumeWarnings = [];
83932
+ this.conversionStartTime = [0, 0];
83933
+ this.refreshTokenTime = [0, 0];
83934
+ this.sourceTileset = null;
83935
+ this.geoidHeightModel = null;
83795
83936
  this.Loader = Tiles3DLoader;
83796
83937
  this.nodePages = new NodePages(writeFile3, HARDCODED_NODES_PER_PAGE);
83797
83938
  this.fileMap = {};
@@ -83807,7 +83948,8 @@ var I3SConverter = class {
83807
83948
  tilesWithAddRefineCount: 0
83808
83949
  };
83809
83950
  this.validate = false;
83810
- this.boundingVolumeWarnings = null;
83951
+ this.generateTextures = false;
83952
+ this.generateBoundingVolumes = false;
83811
83953
  }
83812
83954
  async convert(options) {
83813
83955
  this.conversionStartTime = import_process.default.hrtime();
@@ -83821,11 +83963,15 @@ var I3SConverter = class {
83821
83963
  draco,
83822
83964
  sevenZipExe,
83823
83965
  maxDepth,
83824
- token
83966
+ token,
83967
+ generateTextures,
83968
+ generateBoundingVolumes
83825
83969
  } = options;
83826
83970
  this.options = { maxDepth, slpk, sevenZipExe, egmFilePath, draco, token, inputUrl };
83827
- this.validate = validate2;
83971
+ this.validate = Boolean(validate2);
83828
83972
  this.Loader = inputUrl.indexOf(CESIUM_DATASET_PREFIX) !== -1 ? CesiumIonLoader : Tiles3DLoader;
83973
+ this.generateTextures = Boolean(generateTextures);
83974
+ this.generateBoundingVolumes = Boolean(generateBoundingVolumes);
83829
83975
  console.log("Loading egm file...");
83830
83976
  this.geoidHeightModel = await load(egmFilePath, PGMLoader);
83831
83977
  console.log("Loading egm file completed!");
@@ -83833,7 +83979,7 @@ var I3SConverter = class {
83833
83979
  this.nodePages.useWriteFunction(writeFileForSlpk);
83834
83980
  }
83835
83981
  const preloadOptions = await this._fetchPreloadOptions();
83836
- const tilesetOptions = { loadOptions: {} };
83982
+ const tilesetOptions = { loadOptions: { basis: { format: "rgba32" } } };
83837
83983
  if (preloadOptions.headers) {
83838
83984
  tilesetOptions.loadOptions.fetch = { headers: preloadOptions.headers };
83839
83985
  }
@@ -83841,7 +83987,7 @@ var I3SConverter = class {
83841
83987
  const sourceTilesetJson = await load(inputUrl, this.Loader, tilesetOptions.loadOptions);
83842
83988
  this.sourceTileset = new Tileset3D(sourceTilesetJson, tilesetOptions);
83843
83989
  await this._createAndSaveTileset(outputPath, tilesetName);
83844
- await this._finishConversion({ slpk, outputPath, tilesetName });
83990
+ await this._finishConversion({ slpk: Boolean(slpk), outputPath, tilesetName });
83845
83991
  return sourceTilesetJson;
83846
83992
  }
83847
83993
  async _createAndSaveTileset(outputPath, tilesetName) {
@@ -83857,6 +84003,7 @@ var I3SConverter = class {
83857
84003
  const sourceRootTile = this.sourceTileset.root;
83858
84004
  const boundingVolumes = createBoundingVolumes(sourceRootTile, this.geoidHeightModel);
83859
84005
  const parentId = this.nodePages.push({
84006
+ index: 0,
83860
84007
  lodThreshold: 0,
83861
84008
  obb: boundingVolumes.obb,
83862
84009
  children: []
@@ -83887,7 +84034,7 @@ var I3SConverter = class {
83887
84034
  },
83888
84035
  compressGeometry: this.options.draco
83889
84036
  };
83890
- this.layers0 = (0, import_json_map_transform6.default)(layers0data, LAYERS);
84037
+ this.layers0 = (0, import_json_map_transform6.default)(layers0data, LAYERS());
83891
84038
  }
83892
84039
  _formRootNodeIndexDocument(boundingVolumes) {
83893
84040
  const root0data = {
@@ -83907,11 +84054,12 @@ var I3SConverter = class {
83907
84054
  ...boundingVolumes,
83908
84055
  children: []
83909
84056
  };
83910
- return (0, import_json_map_transform6.default)(root0data, NODE);
84057
+ return (0, import_json_map_transform6.default)(root0data, NODE());
83911
84058
  }
83912
84059
  async _convertNodesTree(root0, sourceRootTile, parentId, boundingVolumes) {
83913
84060
  await this.sourceTileset._loadTile(sourceRootTile);
83914
- if (sourceRootTile.content && sourceRootTile.content.type === "b3dm") {
84061
+ if (this.isContentSupported(sourceRootTile)) {
84062
+ root0.children = root0.children || [];
83915
84063
  root0.children.push({
83916
84064
  id: "1",
83917
84065
  href: "./1",
@@ -83981,13 +84129,14 @@ var I3SConverter = class {
83981
84129
  });
83982
84130
  await sourceTile.unloadContent();
83983
84131
  } else {
83984
- const boundingVolumes = createBoundingVolumes(sourceTile, this.geoidHeightModel);
83985
84132
  const children = await this._createNode(parentNode, sourceTile, parentId, level);
84133
+ parentNode.children = parentNode.children || [];
83986
84134
  for (const child of children) {
83987
84135
  parentNode.children.push({
83988
84136
  id: child.id,
83989
84137
  href: `../${child.path}`,
83990
- ...boundingVolumes
84138
+ obb: child.obb,
84139
+ mbs: child.mbs
83991
84140
  });
83992
84141
  childNodes.push(child);
83993
84142
  }
@@ -84002,12 +84151,14 @@ var I3SConverter = class {
84002
84151
  const childPath = (0, import_path7.join)(this.layers0Path, "nodes", node3.path);
84003
84152
  const nodePath = node3.path;
84004
84153
  delete node3.path;
84005
- if (parentNode.children.length < 1e3) {
84006
- for (const neighbor of parentNode.children) {
84154
+ if (Number(parentNode?.children?.length) < 1e3) {
84155
+ for (const neighbor of parentNode.children || []) {
84007
84156
  if (node3.id === neighbor.id) {
84008
84157
  continue;
84009
84158
  }
84010
- node3.neighbors.push({ ...neighbor });
84159
+ if (node3.neighbors) {
84160
+ node3.neighbors.push({ ...neighbor });
84161
+ }
84011
84162
  }
84012
84163
  } else {
84013
84164
  console.warn(`Node ${node3.id}: neighbors attribute is omited because of large number of neigbors`);
@@ -84023,15 +84174,14 @@ var I3SConverter = class {
84023
84174
  }
84024
84175
  await this._updateTilesetOptions();
84025
84176
  await this.sourceTileset._loadTile(sourceTile);
84026
- const boundingVolumes = createBoundingVolumes(sourceTile, this.geoidHeightModel);
84027
- const lodSelection = convertGeometricErrorToScreenThreshold(sourceTile, boundingVolumes);
84028
- const maxScreenThresholdSQ = lodSelection.find((val) => val.metricType === "maxScreenThresholdSQ") || { maxError: 0 };
84177
+ let boundingVolumes = createBoundingVolumes(sourceTile, this.geoidHeightModel);
84029
84178
  const batchTable = sourceTile?.content?.batchTableJson;
84030
84179
  if (batchTable) {
84031
84180
  this._convertAttributeStorageInfo(sourceTile.content);
84032
84181
  }
84033
84182
  const resourcesData = await this._convertResources(sourceTile);
84034
84183
  const nodes = [];
84184
+ const nodesInPage = [];
84035
84185
  const emptyResources = {
84036
84186
  geometry: null,
84037
84187
  compressedGeometry: null,
@@ -84040,9 +84190,15 @@ var I3SConverter = class {
84040
84190
  meshMaterial: null,
84041
84191
  vertexCount: null,
84042
84192
  attributes: null,
84043
- featureCount: null
84193
+ featureCount: null,
84194
+ boundingVolumes: null
84044
84195
  };
84045
84196
  for (const resources of resourcesData || [emptyResources]) {
84197
+ if (this.generateBoundingVolumes && resources.boundingVolumes) {
84198
+ boundingVolumes = resources.boundingVolumes;
84199
+ }
84200
+ const lodSelection = convertGeometricErrorToScreenThreshold(sourceTile, boundingVolumes);
84201
+ const maxScreenThresholdSQ = lodSelection.find((val) => val.metricType === "maxScreenThresholdSQ") || { maxError: 0 };
84046
84202
  const nodeInPage = this._createNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentId, resources);
84047
84203
  const node3 = this._createNodeIndexDocument(parentTile, boundingVolumes, lodSelection, nodeInPage, resources);
84048
84204
  if (nodeInPage.mesh) {
@@ -84055,44 +84211,50 @@ var I3SConverter = class {
84055
84211
  }
84056
84212
  }
84057
84213
  nodes.push(node3);
84214
+ nodesInPage.push(nodeInPage);
84058
84215
  }
84059
84216
  sourceTile.unloadContent();
84060
- const firstNode = nodes[0];
84061
84217
  await this._addChildrenWithNeighborsAndWriteFile({
84062
- parentNode: firstNode,
84218
+ parentNode: nodes[0],
84063
84219
  sourceTiles: sourceTile.children,
84064
- parentId: firstNode.id,
84220
+ parentId: nodesInPage[0].index,
84065
84221
  level: level + 1
84066
84222
  });
84067
84223
  return nodes;
84068
84224
  }
84069
84225
  _convertAttributeStorageInfo(sourceTileContent) {
84070
84226
  const batchTable = sourceTileContent && sourceTileContent.batchTableJson;
84071
- if (batchTable && !this.layers0.attributeStorageInfo.length) {
84227
+ if (batchTable && !this.layers0?.attributeStorageInfo?.length) {
84072
84228
  this._convertBatchTableInfoToNodeAttributes(batchTable);
84073
84229
  }
84074
84230
  }
84075
84231
  async _convertResources(sourceTile) {
84076
- if (!sourceTile.content || sourceTile.content.type !== "b3dm") {
84232
+ if (!this.isContentSupported(sourceTile)) {
84077
84233
  return null;
84078
84234
  }
84079
- const resourcesData = await convertB3dmToI3sGeometry(sourceTile.content, Number(this.nodePages.nodesCounter), this.featuresHashArray, this.layers0.attributeStorageInfo, this.options.draco);
84235
+ const resourcesData = await convertB3dmToI3sGeometry(sourceTile.content, Number(this.nodePages.nodesCounter), this.featuresHashArray, this.layers0?.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.geoidHeightModel);
84080
84236
  return resourcesData;
84081
84237
  }
84082
84238
  _createNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentId, resources) {
84083
84239
  const { meshMaterial, texture, vertexCount, featureCount, geometry } = resources;
84084
84240
  const nodeInPage = {
84241
+ index: 0,
84085
84242
  lodThreshold: maxScreenThresholdSQ.maxError,
84086
84243
  obb: boundingVolumes.obb,
84087
- children: [],
84088
- mesh: null
84244
+ children: []
84089
84245
  };
84090
- if (geometry && sourceTile.content && sourceTile.content.type === "b3dm") {
84246
+ if (geometry && this.isContentSupported(sourceTile)) {
84091
84247
  nodeInPage.mesh = {
84092
84248
  geometry: {
84093
- definition: texture ? 0 : 1
84249
+ definition: texture ? 0 : 1,
84250
+ resource: 0
84251
+ },
84252
+ attribute: {
84253
+ resource: 0
84094
84254
  },
84095
- attribute: {}
84255
+ material: {
84256
+ definition: 0
84257
+ }
84096
84258
  };
84097
84259
  }
84098
84260
  const nodeId = this.nodePages.push(nodeInPage, parentId);
@@ -84132,14 +84294,14 @@ var I3SConverter = class {
84132
84294
  children: [],
84133
84295
  neighbors: []
84134
84296
  };
84135
- const node3 = (0, import_json_map_transform6.default)(nodeData, NODE);
84297
+ const node3 = (0, import_json_map_transform6.default)(nodeData, NODE());
84136
84298
  if (nodeInPage.mesh) {
84137
84299
  node3.geometryData = [{ href: "./geometries/0" }];
84138
84300
  node3.sharedResource = { href: "./shared" };
84139
84301
  if (texture) {
84140
84302
  node3.textureData = [{ href: "./textures/0" }, { href: "./textures/1" }];
84141
84303
  }
84142
- if (attributes && attributes.length && this.layers0.attributeStorageInfo && this.layers0.attributeStorageInfo.length) {
84304
+ if (attributes && attributes.length && this.layers0?.attributeStorageInfo?.length) {
84143
84305
  node3.attributeData = [];
84144
84306
  for (let index = 0; index < attributes.length; index++) {
84145
84307
  const folderName = this.layers0.attributeStorageInfo[index].key;
@@ -84184,7 +84346,7 @@ var I3SConverter = class {
84184
84346
  }
84185
84347
  async _writeShared(sharedResources, childPath, slpkChildPath, nodePath) {
84186
84348
  sharedResources.nodePath = nodePath;
84187
- const sharedData = (0, import_json_map_transform6.default)(sharedResources, SHARED_RESOURCES_TEMPLATE);
84349
+ const sharedData = (0, import_json_map_transform6.default)(sharedResources, SHARED_RESOURCES());
84188
84350
  const sharedDataStr = JSON.stringify(sharedData);
84189
84351
  if (this.options.slpk) {
84190
84352
  const slpkSharedPath = (0, import_path7.join)(childPath, "shared");
@@ -84196,38 +84358,47 @@ var I3SConverter = class {
84196
84358
  }
84197
84359
  async _writeTexture(texture, childPath, slpkChildPath) {
84198
84360
  if (texture) {
84199
- const format = this._getFormatByMimeType(texture.mimeType);
84200
- if (!this.layers0.textureSetDefinitions.length) {
84201
- this.layers0.textureSetDefinitions.push({
84202
- formats: [
84203
- {
84204
- name: "0",
84205
- format
84206
- },
84207
- {
84208
- name: "1",
84209
- format: "ktx2"
84210
- }
84211
- ]
84212
- });
84213
- }
84361
+ const format = this._getFormatByMimeType(texture?.mimeType);
84362
+ const formats2 = [];
84214
84363
  const textureData = texture.bufferView.data;
84215
- const ktx2TextureData = await encode(texture.image, KTX2BasisUniversalTextureWriter);
84216
- if (this.options.slpk) {
84217
- const slpkTexturePath = (0, import_path7.join)(childPath, "textures");
84218
- const compress = false;
84219
- this.fileMap[`${slpkChildPath}/textures/0.${format}`] = await writeFileForSlpk(slpkTexturePath, textureData, `0.${format}`, compress);
84220
- this.fileMap[`${slpkChildPath}/textures/1.ktx2`] = await writeFileForSlpk(slpkTexturePath, ktx2TextureData, `1.ktx2`, compress);
84221
- } else {
84222
- const texturePath = (0, import_path7.join)(childPath, "textures/0/");
84223
- await writeFile3(texturePath, textureData, `index.${format}`);
84224
- const ktx2TexturePath = (0, import_path7.join)(childPath, "textures/1/");
84225
- await writeFile3(ktx2TexturePath, ktx2TextureData, `index.ktx2`);
84364
+ switch (format) {
84365
+ case "jpg":
84366
+ case "png": {
84367
+ formats2.push({ name: "0", format });
84368
+ await this.writeTextureFile(textureData, "0", format, childPath, slpkChildPath);
84369
+ if (this.generateTextures) {
84370
+ formats2.push({ name: "1", format: "ktx2" });
84371
+ const ktx2TextureData = new Uint8Array(await encode(texture.image, KTX2BasisUniversalTextureWriter));
84372
+ await this.writeTextureFile(ktx2TextureData, "1", "ktx2", childPath, slpkChildPath);
84373
+ }
84374
+ break;
84375
+ }
84376
+ case "ktx2": {
84377
+ formats2.push({ name: "1", format });
84378
+ await this.writeTextureFile(textureData, "1", format, childPath, slpkChildPath);
84379
+ if (this.generateTextures) {
84380
+ formats2.push({ name: "0", format: "jpg" });
84381
+ const decodedFromKTX2TextureData = new Uint8Array(await encode(texture.image.data[0], ImageWriter));
84382
+ await this.writeTextureFile(decodedFromKTX2TextureData, "0", "jpg", childPath, slpkChildPath);
84383
+ }
84384
+ }
84385
+ }
84386
+ if (!this.layers0.textureSetDefinitions.length) {
84387
+ this.layers0.textureSetDefinitions.push({ formats: formats2 });
84226
84388
  }
84227
84389
  }
84228
84390
  }
84391
+ async writeTextureFile(textureData, name8, format, childPath, slpkChildPath) {
84392
+ const texturePath = (0, import_path7.join)(childPath, `textures/${name8}/`);
84393
+ await writeFile3(texturePath, textureData, `index.${format}`);
84394
+ if (this.options.slpk) {
84395
+ const slpkTexturePath = (0, import_path7.join)(childPath, "textures");
84396
+ const compress = false;
84397
+ this.fileMap[`${slpkChildPath}/textures/${name8}.${format}`] = await writeFileForSlpk(slpkTexturePath, textureData, `${name8}.${format}`, compress);
84398
+ }
84399
+ }
84229
84400
  async _writeAttributes(attributes, childPath, slpkChildPath) {
84230
- if (attributes.length && this.layers0.attributeStorageInfo && this.layers0.attributeStorageInfo.length) {
84401
+ if (attributes.length && this.layers0?.attributeStorageInfo?.length) {
84231
84402
  for (let index = 0; index < attributes.length; index++) {
84232
84403
  const folderName = this.layers0.attributeStorageInfo[index].key;
84233
84404
  const fileBuffer = new Uint8Array(attributes[index]);
@@ -84247,6 +84418,8 @@ var I3SConverter = class {
84247
84418
  return "jpg";
84248
84419
  case "image/png":
84249
84420
  return "png";
84421
+ case "image/ktx2":
84422
+ return "ktx2";
84250
84423
  default:
84251
84424
  return "jpg";
84252
84425
  }
@@ -84437,6 +84610,9 @@ var I3SConverter = class {
84437
84610
  }
84438
84611
  this.refinementCounter.tilesCount += 1;
84439
84612
  }
84613
+ isContentSupported(sourceRootTile) {
84614
+ return ["b3dm", "glTF"].includes(sourceRootTile?.content?.type);
84615
+ }
84440
84616
  };
84441
84617
 
84442
84618
  // src/3d-tiles-converter/3d-tiles-converter.ts
@@ -84445,15 +84621,34 @@ var import_process2 = __toModule(require("process"));
84445
84621
  var import_json_map_transform8 = __toModule(require_json_map_transform());
84446
84622
 
84447
84623
  // ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
84448
- var import_core23 = __toModule(require_es53());
84624
+ var import_core26 = __toModule(require_es53());
84449
84625
  var import_geospatial10 = __toModule(require_es54());
84450
84626
 
84627
+ // ../i3s/src/types.ts
84628
+ var DATA_TYPE;
84629
+ (function(DATA_TYPE2) {
84630
+ DATA_TYPE2["UInt8"] = "UInt8";
84631
+ DATA_TYPE2["UInt16"] = "UInt16";
84632
+ DATA_TYPE2["UInt32"] = "UInt32";
84633
+ DATA_TYPE2["UInt64"] = "UInt64";
84634
+ DATA_TYPE2["Int16"] = "Int16";
84635
+ DATA_TYPE2["Int32"] = "Int32";
84636
+ DATA_TYPE2["Int64"] = "Int64";
84637
+ DATA_TYPE2["Float32"] = "Float32";
84638
+ DATA_TYPE2["Float64"] = "Float64";
84639
+ })(DATA_TYPE || (DATA_TYPE = {}));
84640
+ var HeaderAttributeProperty;
84641
+ (function(HeaderAttributeProperty2) {
84642
+ HeaderAttributeProperty2["vertexCount"] = "vertexCount";
84643
+ HeaderAttributeProperty2["featureCount"] = "featureCount";
84644
+ })(HeaderAttributeProperty || (HeaderAttributeProperty = {}));
84645
+
84451
84646
  // ../i3s/src/lib/utils/url-utils.ts
84452
84647
  function getUrlWithToken(url, token = null) {
84453
84648
  return token ? `${url}?token=${token}` : url;
84454
84649
  }
84455
- function generateTileAttributeUrls(tile) {
84456
- const { url, attributeData } = tile;
84650
+ function generateTileAttributeUrls(url, tile) {
84651
+ const { attributeData = [] } = tile;
84457
84652
  const attributeUrls = [];
84458
84653
  for (let index = 0; index < attributeData.length; index++) {
84459
84654
  const attributeUrl = attributeData[index].href.replace("./", "");
@@ -84472,23 +84667,7 @@ function generateTilesetAttributeUrls(tileset, resource) {
84472
84667
  }
84473
84668
 
84474
84669
  // ../i3s/src/lib/parsers/constants.ts
84475
- var import_constants14 = __toModule(require_es512());
84476
-
84477
- // ../i3s/src/types.ts
84478
- var DATA_TYPE;
84479
- (function(DATA_TYPE2) {
84480
- DATA_TYPE2["UInt8"] = "UInt8";
84481
- DATA_TYPE2["UInt16"] = "UInt16";
84482
- DATA_TYPE2["UInt32"] = "UInt32";
84483
- DATA_TYPE2["UInt64"] = "UInt64";
84484
- DATA_TYPE2["Int16"] = "Int16";
84485
- DATA_TYPE2["Int32"] = "Int32";
84486
- DATA_TYPE2["Int64"] = "Int64";
84487
- DATA_TYPE2["Float32"] = "Float32";
84488
- DATA_TYPE2["Float64"] = "Float64";
84489
- })(DATA_TYPE || (DATA_TYPE = {}));
84490
-
84491
- // ../i3s/src/lib/parsers/constants.ts
84670
+ var import_constants14 = __toModule(require_es513());
84492
84671
  function getConstructorForDataFormat(dataType) {
84493
84672
  switch (dataType) {
84494
84673
  case DATA_TYPE.UInt8:
@@ -84502,7 +84681,7 @@ function getConstructorForDataFormat(dataType) {
84502
84681
  case DATA_TYPE.UInt64:
84503
84682
  return Float64Array;
84504
84683
  default:
84505
- return null;
84684
+ throw new Error(`parse i3s tile content: unknown type of data: ${dataType}`);
84506
84685
  }
84507
84686
  }
84508
84687
  var GL_TYPE_MAP = {
@@ -84512,22 +84691,6 @@ var GL_TYPE_MAP = {
84512
84691
  UInt32: import_constants14.default.UNSIGNED_INT,
84513
84692
  UInt64: import_constants14.default.DOUBLE
84514
84693
  };
84515
- var I3S_NAMED_VERTEX_ATTRIBUTES = {
84516
- position: "position",
84517
- normal: "normal",
84518
- uv0: "uv0",
84519
- color: "color",
84520
- region: "region"
84521
- };
84522
- var I3S_NAMED_GEOMETRY_ATTRIBUTES = {
84523
- vertexAttributes: "vertexAttributes",
84524
- featureAttributeOrder: "featureAttributeOrder",
84525
- featureAttributes: "featureAttributes"
84526
- };
84527
- var I3S_NAMED_HEADER_ATTRIBUTES = {
84528
- vertexCount: "vertexCount",
84529
- featureCount: "featureCount"
84530
- };
84531
84694
  function sizeOf(dataType) {
84532
84695
  switch (dataType) {
84533
84696
  case DATA_TYPE.UInt8:
@@ -84544,7 +84707,7 @@ function sizeOf(dataType) {
84544
84707
  case DATA_TYPE.Float64:
84545
84708
  return 8;
84546
84709
  default:
84547
- return NaN;
84710
+ throw new Error(`parse i3s tile content: unknown size of data: ${dataType}`);
84548
84711
  }
84549
84712
  }
84550
84713
  var STRING_ATTRIBUTE_TYPE = "String";
@@ -84561,30 +84724,28 @@ var COORDINATE_SYSTEM;
84561
84724
  })(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
84562
84725
 
84563
84726
  // ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
84564
- var scratchVector4 = new import_core23.Vector3([0, 0, 0]);
84727
+ var scratchVector5 = new import_core26.Vector3([0, 0, 0]);
84565
84728
  function getLoaderForTextureFormat(textureFormat) {
84566
84729
  switch (textureFormat) {
84567
- case "jpeg":
84568
- case "png":
84569
- return ImageLoader;
84570
84730
  case "ktx-etc2":
84571
84731
  case "dds":
84572
84732
  return CompressedTextureLoader;
84573
84733
  case "ktx2":
84574
84734
  return BasisLoader;
84735
+ case "jpg":
84736
+ case "png":
84575
84737
  default:
84576
- return null;
84738
+ return ImageLoader;
84577
84739
  }
84578
84740
  }
84579
84741
  var I3S_ATTRIBUTE_TYPE = "i3s-attribute-type";
84580
84742
  async function parseI3STileContent(arrayBuffer, tile, tileset, options, context) {
84581
84743
  tile.content = tile.content || {};
84582
84744
  tile.content.featureIds = tile.content.featureIds || null;
84583
- tile.content.featureData = constructFeatureDataStruct(tileset);
84584
84745
  tile.content.attributes = {};
84585
84746
  if (tile.textureUrl) {
84586
84747
  const url = getUrlWithToken(tile.textureUrl, options?.i3s?.token);
84587
- const loader = getLoaderForTextureFormat(tile.textureFormat) || ImageLoader;
84748
+ const loader = getLoaderForTextureFormat(tile.textureFormat);
84588
84749
  const response = await fetch(url);
84589
84750
  const arrayBuffer2 = await response.arrayBuffer();
84590
84751
  if (options?.i3s.decodeTextures) {
@@ -84613,9 +84774,9 @@ async function parseI3STileContent(arrayBuffer, tile, tileset, options, context)
84613
84774
  if (tile.content.material) {
84614
84775
  tile.content.texture = null;
84615
84776
  }
84616
- return await parseI3SNodeGeometry(arrayBuffer, tile, options);
84777
+ return await parseI3SNodeGeometry(arrayBuffer, tile, tileset, options);
84617
84778
  }
84618
- async function parseI3SNodeGeometry(arrayBuffer, tile, options) {
84779
+ async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
84619
84780
  if (!tile.content) {
84620
84781
  return tile;
84621
84782
  }
@@ -84624,6 +84785,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, options) {
84624
84785
  let vertexCount;
84625
84786
  let byteOffset = 0;
84626
84787
  let featureCount = 0;
84788
+ let indices;
84627
84789
  if (tile.isDracoGeometry) {
84628
84790
  const decompressedGeometry = await parse(arrayBuffer, DracoLoader2, {
84629
84791
  draco: {
@@ -84631,7 +84793,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, options) {
84631
84793
  }
84632
84794
  });
84633
84795
  vertexCount = decompressedGeometry.header.vertexCount;
84634
- const indices = decompressedGeometry.indices.value;
84796
+ indices = decompressedGeometry.indices?.value;
84635
84797
  const {
84636
84798
  POSITION,
84637
84799
  NORMAL,
@@ -84646,8 +84808,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, options) {
84646
84808
  color: COLOR_0,
84647
84809
  uv0: TEXCOORD_0,
84648
84810
  uvRegion,
84649
- id: featureIndex,
84650
- indices
84811
+ id: featureIndex
84651
84812
  };
84652
84813
  updateAttributesMetadata(attributes, decompressedGeometry);
84653
84814
  const featureIds = getFeatureIdsFromFeatureIndexMetadata(featureIndex);
@@ -84655,8 +84816,13 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, options) {
84655
84816
  flattenFeatureIdsByFeatureIndices(attributes, featureIds);
84656
84817
  }
84657
84818
  } else {
84658
- const { vertexAttributes, attributesOrder, featureAttributes, featureAttributeOrder } = content.featureData;
84659
- const headers = parseHeaders(content, arrayBuffer);
84819
+ const {
84820
+ vertexAttributes,
84821
+ ordering: attributesOrder,
84822
+ featureAttributes,
84823
+ featureAttributeOrder
84824
+ } = tileset.store.defaultGeometrySchema;
84825
+ const headers = parseHeaders(tileset, arrayBuffer);
84660
84826
  byteOffset = headers.byteOffset;
84661
84827
  vertexCount = headers.vertexCount;
84662
84828
  featureCount = headers.featureCount;
@@ -84680,7 +84846,7 @@ async function parseI3SNodeGeometry(arrayBuffer, tile, options) {
84680
84846
  texCoords: attributes.uv0,
84681
84847
  uvRegions: normalizeAttribute(attributes.uvRegion)
84682
84848
  };
84683
- content.indices = attributes.indices || null;
84849
+ content.indices = indices || null;
84684
84850
  if (attributes.id && attributes.id.value) {
84685
84851
  tile.content.featureIds = attributes.id.value;
84686
84852
  }
@@ -84718,41 +84884,25 @@ function normalizeAttribute(attribute) {
84718
84884
  attribute.normalized = true;
84719
84885
  return attribute;
84720
84886
  }
84721
- function constructFeatureDataStruct(tileset) {
84722
- const defaultGeometrySchema = tileset.store.defaultGeometrySchema;
84723
- const featureData = defaultGeometrySchema;
84724
- for (const geometryAttribute in I3S_NAMED_GEOMETRY_ATTRIBUTES) {
84725
- for (const namedAttribute in I3S_NAMED_VERTEX_ATTRIBUTES) {
84726
- const attribute = defaultGeometrySchema[geometryAttribute][namedAttribute];
84727
- if (attribute) {
84728
- const { byteOffset = 0, count = 0, valueType, valuesPerElement } = attribute;
84729
- featureData[geometryAttribute][namedAttribute] = {
84730
- valueType,
84731
- valuesPerElement,
84732
- byteOffset,
84733
- count
84734
- };
84735
- }
84736
- }
84737
- }
84738
- featureData.attributesOrder = defaultGeometrySchema.ordering;
84739
- return featureData;
84740
- }
84741
- function parseHeaders(content, arrayBuffer) {
84887
+ function parseHeaders(tileset, arrayBuffer) {
84742
84888
  let byteOffset = 0;
84743
84889
  let vertexCount = 0;
84744
84890
  let featureCount = 0;
84745
- content.featureData.header.forEach(({ property, type }) => {
84891
+ for (const { property, type } of tileset.store.defaultGeometrySchema.header) {
84746
84892
  const TypedArrayTypeHeader = getConstructorForDataFormat(type);
84747
- if (property === I3S_NAMED_HEADER_ATTRIBUTES.vertexCount) {
84748
- vertexCount = new TypedArrayTypeHeader(arrayBuffer, 0, 4)[0];
84749
- byteOffset += sizeOf(type);
84750
- }
84751
- if (property === I3S_NAMED_HEADER_ATTRIBUTES.featureCount) {
84752
- featureCount = new TypedArrayTypeHeader(arrayBuffer, 4, 4)[0];
84753
- byteOffset += sizeOf(type);
84893
+ switch (property) {
84894
+ case HeaderAttributeProperty.vertexCount:
84895
+ vertexCount = new TypedArrayTypeHeader(arrayBuffer, 0, 4)[0];
84896
+ byteOffset += sizeOf(type);
84897
+ break;
84898
+ case HeaderAttributeProperty.featureCount:
84899
+ featureCount = new TypedArrayTypeHeader(arrayBuffer, 4, 4)[0];
84900
+ byteOffset += sizeOf(type);
84901
+ break;
84902
+ default:
84903
+ break;
84754
84904
  }
84755
- });
84905
+ }
84756
84906
  return {
84757
84907
  vertexCount,
84758
84908
  featureCount,
@@ -84769,7 +84919,7 @@ function normalizeAttributes(arrayBuffer, byteOffset, vertexAttributes, vertexCo
84769
84919
  break;
84770
84920
  }
84771
84921
  const buffer = arrayBuffer.slice(byteOffset);
84772
- let value = [];
84922
+ let value;
84773
84923
  if (valueType === "UInt64") {
84774
84924
  value = parseUint64Values(buffer, count * valuesPerElement, sizeOf(valueType));
84775
84925
  } else {
@@ -84806,15 +84956,15 @@ function parseUint64Values(buffer, elementsCount, attributeSize) {
84806
84956
  values.push(value);
84807
84957
  offset += attributeSize;
84808
84958
  }
84809
- return values;
84959
+ return new Uint32Array(values);
84810
84960
  }
84811
84961
  function parsePositions2(attribute, tile) {
84812
84962
  const mbs = tile.mbs;
84813
84963
  const value = attribute.value;
84814
84964
  const metadata = attribute.metadata;
84815
- const enuMatrix = new import_core23.Matrix4();
84816
- const cartographicOrigin = new import_core23.Vector3(mbs[0], mbs[1], mbs[2]);
84817
- const cartesianOrigin = new import_core23.Vector3();
84965
+ const enuMatrix = new import_core26.Matrix4();
84966
+ const cartographicOrigin = new import_core26.Vector3(mbs[0], mbs[1], mbs[2]);
84967
+ const cartesianOrigin = new import_core26.Vector3();
84818
84968
  import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(cartographicOrigin, cartesianOrigin);
84819
84969
  import_geospatial10.Ellipsoid.WGS84.eastNorthUpToFixedFrame(cartesianOrigin, enuMatrix);
84820
84970
  attribute.value = offsetsToCartesians(value, metadata, cartographicOrigin);
@@ -84830,10 +84980,10 @@ function offsetsToCartesians(vertices, metadata = {}, cartographicOrigin) {
84830
84980
  positions[i + 2] = vertices[i + 2] + cartographicOrigin.z;
84831
84981
  }
84832
84982
  for (let i = 0; i < positions.length; i += 3) {
84833
- import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3), scratchVector4);
84834
- positions[i] = scratchVector4.x;
84835
- positions[i + 1] = scratchVector4.y;
84836
- positions[i + 2] = scratchVector4.z;
84983
+ import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3), scratchVector5);
84984
+ positions[i] = scratchVector5.x;
84985
+ positions[i + 1] = scratchVector5.y;
84986
+ positions[i + 2] = scratchVector5.z;
84837
84987
  }
84838
84988
  return positions;
84839
84989
  }
@@ -84841,7 +84991,7 @@ function getModelMatrix(positions) {
84841
84991
  const metadata = positions.metadata;
84842
84992
  const scaleX = metadata?.["i3s-scale_x"]?.double || 1;
84843
84993
  const scaleY = metadata?.["i3s-scale_y"]?.double || 1;
84844
- const modelMatrix = new import_core23.Matrix4();
84994
+ const modelMatrix = new import_core26.Matrix4();
84845
84995
  modelMatrix[0] = scaleX;
84846
84996
  modelMatrix[5] = scaleY;
84847
84997
  return modelMatrix;
@@ -84873,7 +85023,9 @@ function makePbrMaterial(materialDefinition, texture) {
84873
85023
  if (pbrMaterial.pbrMetallicRoughness && pbrMaterial.pbrMetallicRoughness.baseColorFactor) {
84874
85024
  pbrMaterial.pbrMetallicRoughness.baseColorFactor = convertColorFormat(pbrMaterial.pbrMetallicRoughness.baseColorFactor);
84875
85025
  }
84876
- setMaterialTexture(pbrMaterial, texture);
85026
+ if (texture) {
85027
+ setMaterialTexture(pbrMaterial, texture);
85028
+ }
84877
85029
  return pbrMaterial;
84878
85030
  }
84879
85031
  function convertColorFormat(colorFactor) {
@@ -84935,7 +85087,7 @@ function flattenFeatureIdsByFeatureIndices(attributes, featureIds) {
84935
85087
  attributes.id.value = result;
84936
85088
  }
84937
85089
  function getFeatureIdsFromFeatureIndexMetadata(featureIndex) {
84938
- return featureIndex && featureIndex.metadata && featureIndex.metadata["i3s-feature-ids"] && featureIndex.metadata["i3s-feature-ids"].intArray;
85090
+ return featureIndex?.metadata?.["i3s-feature-ids"]?.intArray;
84939
85091
  }
84940
85092
 
84941
85093
  // ../i3s/src/i3s-content-loader.ts
@@ -84991,8 +85143,8 @@ var I3SNodePagesTiles = class {
84991
85143
  this.textureDefinitionsSelectedFormats = [];
84992
85144
  this.textureLoaderOptions = {};
84993
85145
  this.tileset = { ...tileset };
84994
- this.nodesPerPage = tileset.nodePages.nodesPerPage;
84995
- this.lodSelectionMetricType = tileset.nodePages.lodSelectionMetricType;
85146
+ this.nodesPerPage = tileset.nodePages?.nodesPerPage || 64;
85147
+ this.lodSelectionMetricType = tileset.nodePages?.lodSelectionMetricType;
84996
85148
  this.options = options;
84997
85149
  this.initSelectedFormatsForTextureDefinitions(tileset);
84998
85150
  }
@@ -85019,21 +85171,21 @@ var I3SNodePagesTiles = class {
85019
85171
  for (const child of node3.children || []) {
85020
85172
  const childNode = await this.getNodeById(child);
85021
85173
  children.push({
85022
- id: child,
85174
+ id: child.toString(),
85023
85175
  obb: childNode.obb
85024
85176
  });
85025
85177
  }
85026
- let contentUrl = null;
85027
- let textureUrl = null;
85028
- let materialDefinition = null;
85029
- let textureFormat = "jpeg";
85178
+ let contentUrl;
85179
+ let textureUrl;
85180
+ let materialDefinition;
85181
+ let textureFormat = "jpg";
85030
85182
  let attributeUrls = [];
85031
85183
  let isDracoGeometry = false;
85032
85184
  if (node3 && node3.mesh) {
85033
- const { url, isDracoGeometry: isDracoGeometryResult } = node3.mesh.geometry && this.getContentUrl(node3.mesh.geometry) || { url: null, isDracoGeometry: null };
85185
+ const { url, isDracoGeometry: isDracoGeometryResult } = node3.mesh.geometry && this.getContentUrl(node3.mesh.geometry) || { isDracoGeometry: false };
85034
85186
  contentUrl = url;
85035
85187
  isDracoGeometry = isDracoGeometryResult;
85036
- const [textureData, nodeMaterialDefinition] = this.getInformationFromMaterial(node3.mesh.material);
85188
+ const { textureData, materialDefinition: nodeMaterialDefinition } = this.getInformationFromMaterial(node3.mesh.material);
85037
85189
  materialDefinition = nodeMaterialDefinition;
85038
85190
  textureFormat = textureData.format || textureFormat;
85039
85191
  if (textureData.name) {
@@ -85045,7 +85197,7 @@ var I3SNodePagesTiles = class {
85045
85197
  }
85046
85198
  const lodSelection = this.getLodSelection(node3);
85047
85199
  return normalizeTileNonUrlData({
85048
- id,
85200
+ id: id.toString(),
85049
85201
  lodSelection,
85050
85202
  obb: node3.obb,
85051
85203
  contentUrl,
@@ -85059,7 +85211,7 @@ var I3SNodePagesTiles = class {
85059
85211
  });
85060
85212
  }
85061
85213
  getContentUrl(meshGeometryData) {
85062
- let result = {};
85214
+ let result = null;
85063
85215
  const geometryDefinition = this.tileset.geometryDefinitions[meshGeometryData.definition];
85064
85216
  let geometryIndex = -1;
85065
85217
  if (this.options.i3s && this.options.i3s.useDracoGeometry) {
@@ -85092,17 +85244,18 @@ var I3SNodePagesTiles = class {
85092
85244
  return lodSelection;
85093
85245
  }
85094
85246
  getInformationFromMaterial(material) {
85095
- const textureDataDefault = { name: null, format: null };
85247
+ const informationFromMaterial = { textureData: { name: null } };
85096
85248
  if (material) {
85097
- const materialDefinition = this.tileset.materialDefinitions[material.definition];
85098
- const textureSetDefinitionIndex = materialDefinition && materialDefinition.pbrMetallicRoughness && materialDefinition.pbrMetallicRoughness.baseColorTexture && materialDefinition.pbrMetallicRoughness.baseColorTexture.textureSetDefinitionId;
85099
- if (textureSetDefinitionIndex || textureSetDefinitionIndex === 0) {
85100
- const textureData = this.textureDefinitionsSelectedFormats[textureSetDefinitionIndex] || textureDataDefault;
85101
- return [textureData, materialDefinition];
85249
+ const materialDefinition = this.tileset.materialDefinitions?.[material.definition];
85250
+ if (materialDefinition) {
85251
+ informationFromMaterial.materialDefinition = materialDefinition;
85252
+ const textureSetDefinitionIndex = materialDefinition?.pbrMetallicRoughness?.baseColorTexture?.textureSetDefinitionId;
85253
+ if (typeof textureSetDefinitionIndex === "number") {
85254
+ informationFromMaterial.textureData = this.textureDefinitionsSelectedFormats[textureSetDefinitionIndex] || informationFromMaterial.textureData;
85255
+ }
85102
85256
  }
85103
- return [textureDataDefault, materialDefinition];
85104
85257
  }
85105
- return [textureDataDefault, null];
85258
+ return informationFromMaterial;
85106
85259
  }
85107
85260
  initSelectedFormatsForTextureDefinitions(tileset) {
85108
85261
  this.textureDefinitionsSelectedFormats = [];
@@ -85148,49 +85301,54 @@ var I3SNodePagesTiles = class {
85148
85301
 
85149
85302
  // ../i3s/src/lib/parsers/parse-i3s.ts
85150
85303
  function normalizeTileData2(tile, options, context) {
85151
- tile.url = context.url;
85152
- if (tile.featureData) {
85153
- tile.featureUrl = `${tile.url}/${tile.featureData[0].href}`;
85154
- }
85304
+ const url = context.url || "";
85305
+ let contentUrl;
85155
85306
  if (tile.geometryData) {
85156
- tile.contentUrl = `${tile.url}/${tile.geometryData[0].href}`;
85307
+ contentUrl = `${url}/${tile.geometryData[0].href}`;
85157
85308
  }
85309
+ let textureUrl;
85158
85310
  if (tile.textureData) {
85159
- tile.textureUrl = `${tile.url}/${tile.textureData[0].href}`;
85311
+ textureUrl = `${url}/${tile.textureData[0].href}`;
85160
85312
  }
85313
+ let attributeUrls;
85161
85314
  if (tile.attributeData) {
85162
- tile.attributeUrls = generateTileAttributeUrls(tile);
85163
- }
85164
- return normalizeTileNonUrlData(tile);
85315
+ attributeUrls = generateTileAttributeUrls(url, tile);
85316
+ }
85317
+ return normalizeTileNonUrlData({
85318
+ ...tile,
85319
+ url,
85320
+ contentUrl,
85321
+ textureUrl,
85322
+ attributeUrls,
85323
+ isDracoGeometry: false
85324
+ });
85165
85325
  }
85166
85326
  function normalizeTileNonUrlData(tile) {
85167
- const box = tile.obb ? [
85168
- ...import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(tile.obb.center),
85169
- ...tile.obb.halfSize,
85170
- ...tile.obb.quaternion
85171
- ] : void 0;
85172
- let sphere;
85327
+ const boundingVolume = {};
85328
+ let mbs = [0, 0, 0, 1];
85173
85329
  if (tile.mbs) {
85174
- sphere = [
85330
+ mbs = tile.mbs;
85331
+ boundingVolume.sphere = [
85175
85332
  ...import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(tile.mbs.slice(0, 3)),
85176
85333
  tile.mbs[3]
85177
85334
  ];
85178
- } else if (box) {
85179
- const obb = new import_culling6.OrientedBoundingBox().fromCenterHalfSizeQuaternion(box.slice(0, 3), tile.obb.halfSize, tile.obb.quaternion);
85335
+ } else if (tile.obb) {
85336
+ boundingVolume.box = [
85337
+ ...import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(tile.obb.center),
85338
+ ...tile.obb.halfSize,
85339
+ ...tile.obb.quaternion
85340
+ ];
85341
+ const obb = new import_culling6.OrientedBoundingBox().fromCenterHalfSizeQuaternion(boundingVolume.box.slice(0, 3), tile.obb.halfSize, tile.obb.quaternion);
85180
85342
  const boundingSphere = obb.getBoundingSphere();
85181
- sphere = [...boundingSphere.center, boundingSphere.radius];
85182
- tile.mbs = [...tile.obb.center, boundingSphere.radius];
85183
- }
85184
- tile.boundingVolume = {
85185
- sphere,
85186
- box
85187
- };
85188
- tile.lodMetricType = tile.lodSelection[0].metricType;
85189
- tile.lodMetricValue = tile.lodSelection[0].maxError;
85190
- tile.transformMatrix = tile.transform;
85191
- tile.type = TILE_TYPE.MESH;
85192
- tile.refine = TILE_REFINEMENT.REPLACE;
85193
- return tile;
85343
+ boundingVolume.sphere = [...boundingSphere.center, boundingSphere.radius];
85344
+ mbs = [...tile.obb.center, boundingSphere.radius];
85345
+ }
85346
+ const lodMetricType = tile.lodSelection?.[0].metricType;
85347
+ const lodMetricValue = tile.lodSelection?.[0].maxError;
85348
+ const transformMatrix = tile.transform;
85349
+ const type = TILE_TYPE.MESH;
85350
+ const refine = TILE_REFINEMENT.REPLACE;
85351
+ return { ...tile, mbs, boundingVolume, lodMetricType, lodMetricValue, transformMatrix, type, refine };
85194
85352
  }
85195
85353
  async function normalizeTilesetData(tileset, options, context) {
85196
85354
  tileset.url = context.url;
@@ -85364,8 +85522,8 @@ async function parse8(data, options) {
85364
85522
  return data;
85365
85523
  }
85366
85524
 
85367
- // src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js
85368
- var import_core27 = __toModule(require_es53());
85525
+ // src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.ts
85526
+ var import_core30 = __toModule(require_es53());
85369
85527
  var import_geospatial12 = __toModule(require_es54());
85370
85528
  var import_culling7 = __toModule(require_es55());
85371
85529
  function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
@@ -85374,20 +85532,20 @@ function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
85374
85532
  i3SObb.center[1],
85375
85533
  i3SObb.center[2] + geoidHeightModel.getHeight(i3SObb.center[1], i3SObb.center[0])
85376
85534
  ];
85377
- const cartesianCenter = import_geospatial12.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new import_core27.Vector3());
85535
+ const cartesianCenter = import_geospatial12.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new import_core30.Vector3());
85378
85536
  const tiles3DObb = new import_culling7.OrientedBoundingBox().fromCenterHalfSizeQuaternion(cartesianCenter, i3SObb.halfSize, i3SObb.quaternion);
85379
85537
  return [...tiles3DObb.center, ...tiles3DObb.halfAxes.toArray()];
85380
85538
  }
85381
85539
 
85382
- // src/3d-tiles-converter/json-templates/tileset.js
85540
+ // src/3d-tiles-converter/json-templates/tileset.ts
85383
85541
  var import_json_map_transform7 = __toModule(require_json_map_transform());
85384
- var ASSET = {
85542
+ var ASSET = () => ({
85385
85543
  version: {
85386
85544
  path: "version",
85387
85545
  default: "1.0"
85388
85546
  }
85389
- };
85390
- var TILE = {
85547
+ });
85548
+ var TILE = () => ({
85391
85549
  boundingVolume: {
85392
85550
  path: "boundingVolume"
85393
85551
  },
@@ -85399,13 +85557,13 @@ var TILE = {
85399
85557
  },
85400
85558
  children: {
85401
85559
  path: "children",
85402
- transform: (val) => val.map((tile) => (0, import_json_map_transform7.default)(tile, TILE))
85560
+ transform: (val) => val.map((tile) => (0, import_json_map_transform7.default)(tile, TILE()))
85403
85561
  }
85404
- };
85405
- var TILESET = {
85562
+ });
85563
+ var TILESET = () => ({
85406
85564
  asset: {
85407
85565
  path: "asset",
85408
- transform: (val) => (0, import_json_map_transform7.default)(val, ASSET)
85566
+ transform: (val) => (0, import_json_map_transform7.default)(val, ASSET())
85409
85567
  },
85410
85568
  geometricError: {
85411
85569
  path: "root",
@@ -85413,12 +85571,12 @@ var TILESET = {
85413
85571
  },
85414
85572
  root: {
85415
85573
  path: "root",
85416
- transform: (val) => (0, import_json_map_transform7.default)(val, TILE)
85574
+ transform: (val) => (0, import_json_map_transform7.default)(val, TILE())
85417
85575
  }
85418
- };
85576
+ });
85419
85577
 
85420
- // src/3d-tiles-converter/helpers/b3dm-converter.js
85421
- var import_core29 = __toModule(require_es53());
85578
+ // src/3d-tiles-converter/helpers/b3dm-converter.ts
85579
+ var import_core32 = __toModule(require_es53());
85422
85580
  var import_geospatial13 = __toModule(require_es54());
85423
85581
 
85424
85582
  // src/3d-tiles-converter/helpers/texture-atlas.ts
@@ -85428,7 +85586,7 @@ function convertTextureAtlas(texCoords, uvRegions) {
85428
85586
  for (let index = 0; index < texCoords.length; index += 2) {
85429
85587
  const uv = texCoords.subarray(index, index + 2);
85430
85588
  const regions = normalisedRegions.slice(index * 2, index * 2 + 4);
85431
- const fractatedUV = fract(uv);
85589
+ const fractatedUV = fract([uv[0], uv[1]]);
85432
85590
  const subtracted = [regions[2] - regions[0], regions[3] - regions[1]];
85433
85591
  const multiplicationResult = [fractatedUV[0] * subtracted[0], fractatedUV[1] * subtracted[1]];
85434
85592
  const convertedUV = [
@@ -85452,9 +85610,9 @@ function normalizeRegions(regions) {
85452
85610
  return normalizedRegions;
85453
85611
  }
85454
85612
 
85455
- // src/3d-tiles-converter/helpers/b3dm-converter.js
85456
- var Z_UP_TO_Y_UP_MATRIX = new import_core29.Matrix4([1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
85457
- var scratchVector5 = new import_core29.Vector3();
85613
+ // src/3d-tiles-converter/helpers/b3dm-converter.ts
85614
+ var Z_UP_TO_Y_UP_MATRIX = new import_core32.Matrix4([1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
85615
+ var scratchVector6 = new import_core32.Vector3();
85458
85616
  var B3dmConverter = class {
85459
85617
  async convert(i3sTile, attributes = null) {
85460
85618
  this.i3sTile = i3sTile;
@@ -85526,16 +85684,16 @@ var B3dmConverter = class {
85526
85684
  const newPositionsValue = new Float32Array(positionsValue.length);
85527
85685
  for (let index = 0; index < positionsValue.length; index += 3) {
85528
85686
  const vertex = positionsValue.subarray(index, index + 3);
85529
- const cartesianOriginVector = new import_core29.Vector3(cartesianOrigin);
85530
- let vertexVector = new import_core29.Vector3(Array.from(vertex)).transform(modelMatrix).add(cartographicOrigin);
85531
- import_geospatial13.Ellipsoid.WGS84.cartographicToCartesian(vertexVector, scratchVector5);
85532
- vertexVector = scratchVector5.subtract(cartesianOriginVector);
85687
+ const cartesianOriginVector = new import_core32.Vector3(cartesianOrigin);
85688
+ let vertexVector = new import_core32.Vector3(Array.from(vertex)).transform(modelMatrix).add(cartographicOrigin);
85689
+ import_geospatial13.Ellipsoid.WGS84.cartographicToCartesian(vertexVector, scratchVector6);
85690
+ vertexVector = scratchVector6.subtract(cartesianOriginVector);
85533
85691
  newPositionsValue.set(vertexVector, index);
85534
85692
  }
85535
85693
  return newPositionsValue;
85536
85694
  }
85537
85695
  _generateTransformMatrix(cartesianOrigin) {
85538
- const translateOriginMatrix = new import_core29.Matrix4().translate(cartesianOrigin);
85696
+ const translateOriginMatrix = new import_core32.Matrix4().translate(cartesianOrigin);
85539
85697
  const result = translateOriginMatrix.multiplyLeft(Z_UP_TO_Y_UP_MATRIX);
85540
85698
  return result;
85541
85699
  }
@@ -85665,8 +85823,9 @@ var Tiles3DConverter = class {
85665
85823
  this.sourceTileset = new Tileset3D(sourceTilesetJson, {
85666
85824
  loadOptions: { i3s: { coordinateSystem: COORDINATE_SYSTEM.LNGLAT_OFFSETS } }
85667
85825
  });
85668
- if (!this.sourceTileset.root.header.obb) {
85669
- this.sourceTileset.root.header.obb = createObbFromMbs(this.sourceTileset.root.header.mbs);
85826
+ const rootNode = this.sourceTileset.root;
85827
+ if (!rootNode.header.obb) {
85828
+ rootNode.header.obb = createObbFromMbs(rootNode.header.mbs);
85670
85829
  }
85671
85830
  this.tilesetPath = (0, import_path8.join)(`${outputPath}`, `${tilesetName}`);
85672
85831
  this.attributeStorageInfo = sourceTilesetJson.attributeStorageInfo;
@@ -85676,13 +85835,13 @@ var Tiles3DConverter = class {
85676
85835
  }
85677
85836
  const rootTile = {
85678
85837
  boundingVolume: {
85679
- box: i3sObbTo3dTilesObb(this.sourceTileset.root.header.obb, this.geoidHeightModel)
85838
+ box: i3sObbTo3dTilesObb(rootNode.header.obb, this.geoidHeightModel)
85680
85839
  },
85681
- geometricError: convertScreenThresholdToGeometricError(this.sourceTileset.root),
85840
+ geometricError: convertScreenThresholdToGeometricError(rootNode),
85682
85841
  children: []
85683
85842
  };
85684
- await this._addChildren(this.sourceTileset.root, rootTile, 1);
85685
- const tileset = (0, import_json_map_transform8.default)({ root: rootTile }, TILESET);
85843
+ await this._addChildren(rootNode, rootTile, 1);
85844
+ const tileset = (0, import_json_map_transform8.default)({ root: rootTile }, TILESET());
85686
85845
  await writeFile3(this.tilesetPath, JSON.stringify(tileset), "tileset.json");
85687
85846
  this._finishConversion({ slpk: false, outputPath, tilesetName });
85688
85847
  }
@@ -85853,11 +86012,11 @@ async function loadZipEntry(jsZip, subFilename, options = {}) {
85853
86012
 
85854
86013
  // src/deps-installer/deps-installer.js
85855
86014
  var import_path9 = __toModule(require("path"));
85856
- var PGM_LINK = "https://github.com/visgl/deck.gl-data/raw/master/egm/egm2008-5.zip";
86015
+ var PGM_LINK = "https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip";
85857
86016
  var DepsInstaller = class {
85858
86017
  async install(path2 = "") {
85859
86018
  console.log('Installing "EGM2008-5" model...');
85860
- const fileMap = await load(PGM_LINK, ZipLoader, { fetch: { followRedirect: true } });
86019
+ const fileMap = await load(PGM_LINK, ZipLoader, {});
85861
86020
  let depsPath = process.cwd();
85862
86021
  if (path2) {
85863
86022
  depsPath = (0, import_path9.join)(depsPath, path2);