@loaders.gl/3d-tiles 4.2.0-alpha.3 → 4.2.0-alpha.5

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 (141) hide show
  1. package/dist/3d-tiles-archive/3d-tiles-archive-archive.js +66 -41
  2. package/dist/3d-tiles-archive/3d-tiles-archive-parser.d.ts +1 -1
  3. package/dist/3d-tiles-archive/3d-tiles-archive-parser.d.ts.map +1 -1
  4. package/dist/3d-tiles-archive/3d-tiles-archive-parser.js +26 -16
  5. package/dist/3d-tiles-archive-loader.js +26 -15
  6. package/dist/cesium-ion-loader.js +34 -30
  7. package/dist/dist.dev.js +1963 -1037
  8. package/dist/dist.min.js +32 -0
  9. package/dist/index.cjs +122 -337
  10. package/dist/index.cjs.map +7 -0
  11. package/dist/index.d.ts +13 -13
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +7 -1
  14. package/dist/lib/classes/helpers/tile-3d-accessor-utils.js +103 -87
  15. package/dist/lib/classes/tile-3d-batch-table-hierarchy.js +179 -155
  16. package/dist/lib/classes/tile-3d-batch-table.js +232 -217
  17. package/dist/lib/classes/tile-3d-feature-table.js +62 -59
  18. package/dist/lib/constants.js +19 -15
  19. package/dist/lib/encoders/encode-3d-tile-batched-model.js +40 -35
  20. package/dist/lib/encoders/encode-3d-tile-composite.js +19 -17
  21. package/dist/lib/encoders/encode-3d-tile-instanced-model.js +32 -31
  22. package/dist/lib/encoders/encode-3d-tile-point-cloud.js +31 -32
  23. package/dist/lib/encoders/encode-3d-tile.js +23 -19
  24. package/dist/lib/encoders/helpers/encode-3d-tile-header.js +23 -23
  25. package/dist/lib/ion/ion.js +55 -54
  26. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.d.ts +1 -1
  27. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.d.ts.map +1 -1
  28. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.js +57 -51
  29. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.d.ts +1 -1
  30. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.d.ts.map +1 -1
  31. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.js +21 -18
  32. package/dist/lib/parsers/helpers/normalize-3d-tile-positions.js +35 -20
  33. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts +4 -4
  34. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
  35. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +269 -234
  36. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.d.ts +2 -2
  37. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.d.ts.map +1 -1
  38. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.js +83 -55
  39. package/dist/lib/parsers/helpers/parse-3d-tile-header.d.ts +1 -1
  40. package/dist/lib/parsers/helpers/parse-3d-tile-header.d.ts.map +1 -1
  41. package/dist/lib/parsers/helpers/parse-3d-tile-header.js +23 -14
  42. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts +1 -1
  43. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts.map +1 -1
  44. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js +82 -54
  45. package/dist/lib/parsers/helpers/parse-3d-tile-tables.d.ts +2 -2
  46. package/dist/lib/parsers/helpers/parse-3d-tile-tables.d.ts.map +1 -1
  47. package/dist/lib/parsers/helpers/parse-3d-tile-tables.js +79 -68
  48. package/dist/lib/parsers/helpers/parse-utils.js +19 -14
  49. package/dist/lib/parsers/parse-3d-tile-batched-model.d.ts +2 -2
  50. package/dist/lib/parsers/parse-3d-tile-batched-model.d.ts.map +1 -1
  51. package/dist/lib/parsers/parse-3d-tile-batched-model.js +21 -17
  52. package/dist/lib/parsers/parse-3d-tile-composite.d.ts +2 -2
  53. package/dist/lib/parsers/parse-3d-tile-composite.d.ts.map +1 -1
  54. package/dist/lib/parsers/parse-3d-tile-composite.js +18 -14
  55. package/dist/lib/parsers/parse-3d-tile-gltf.d.ts +2 -2
  56. package/dist/lib/parsers/parse-3d-tile-gltf.d.ts.map +1 -1
  57. package/dist/lib/parsers/parse-3d-tile-gltf.js +22 -14
  58. package/dist/lib/parsers/parse-3d-tile-header.d.ts +2 -2
  59. package/dist/lib/parsers/parse-3d-tile-header.d.ts.map +1 -1
  60. package/dist/lib/parsers/parse-3d-tile-header.js +168 -159
  61. package/dist/lib/parsers/parse-3d-tile-instanced-model.d.ts +2 -2
  62. package/dist/lib/parsers/parse-3d-tile-instanced-model.d.ts.map +1 -1
  63. package/dist/lib/parsers/parse-3d-tile-instanced-model.js +153 -123
  64. package/dist/lib/parsers/parse-3d-tile-point-cloud.d.ts +2 -2
  65. package/dist/lib/parsers/parse-3d-tile-point-cloud.d.ts.map +1 -1
  66. package/dist/lib/parsers/parse-3d-tile-point-cloud.js +380 -174
  67. package/dist/lib/parsers/parse-3d-tile.d.ts +2 -2
  68. package/dist/lib/parsers/parse-3d-tile.d.ts.map +1 -1
  69. package/dist/lib/parsers/parse-3d-tile.js +24 -24
  70. package/dist/lib/utils/obb/s2-corners-to-obb.js +29 -16
  71. package/dist/lib/utils/s2/converters/s2-to-boundary.d.ts +1 -1
  72. package/dist/lib/utils/s2/converters/s2-to-boundary.d.ts.map +1 -1
  73. package/dist/lib/utils/s2/converters/s2-to-boundary.js +55 -35
  74. package/dist/lib/utils/s2/converters/s2-to-obb-points.js +31 -20
  75. package/dist/lib/utils/s2/converters/s2-to-region.d.ts +1 -1
  76. package/dist/lib/utils/s2/converters/s2-to-region.d.ts.map +1 -1
  77. package/dist/lib/utils/s2/converters/s2-to-region.js +51 -35
  78. package/dist/lib/utils/s2/index.d.ts +7 -7
  79. package/dist/lib/utils/s2/index.d.ts.map +1 -1
  80. package/dist/lib/utils/s2/index.js +3 -1
  81. package/dist/lib/utils/s2/s2-geometry-functions.js +19 -5
  82. package/dist/lib/utils/s2/s2-token-functions.js +51 -22
  83. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.d.ts +1 -1
  84. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.d.ts.map +1 -1
  85. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.js +23 -9
  86. package/dist/lib/utils/s2/s2geometry/s2-geometry.js +218 -157
  87. package/dist/lib/utils/version.js +4 -2
  88. package/dist/tile-3d-subtree-loader.d.ts +1 -1
  89. package/dist/tile-3d-subtree-loader.d.ts.map +1 -1
  90. package/dist/tile-3d-subtree-loader.js +15 -10
  91. package/dist/tile-3d-writer.js +19 -14
  92. package/dist/tiles-3d-loader.js +65 -55
  93. package/dist/types.js +3 -1
  94. package/package.json +11 -10
  95. package/dist/3d-tiles-archive/3d-tiles-archive-archive.js.map +0 -1
  96. package/dist/3d-tiles-archive/3d-tiles-archive-parser.js.map +0 -1
  97. package/dist/3d-tiles-archive-loader.js.map +0 -1
  98. package/dist/cesium-ion-loader.js.map +0 -1
  99. package/dist/index.js.map +0 -1
  100. package/dist/lib/classes/helpers/tile-3d-accessor-utils.js.map +0 -1
  101. package/dist/lib/classes/tile-3d-batch-table-hierarchy.js.map +0 -1
  102. package/dist/lib/classes/tile-3d-batch-table.js.map +0 -1
  103. package/dist/lib/classes/tile-3d-feature-table.js.map +0 -1
  104. package/dist/lib/constants.js.map +0 -1
  105. package/dist/lib/encoders/encode-3d-tile-batched-model.js.map +0 -1
  106. package/dist/lib/encoders/encode-3d-tile-composite.js.map +0 -1
  107. package/dist/lib/encoders/encode-3d-tile-instanced-model.js.map +0 -1
  108. package/dist/lib/encoders/encode-3d-tile-point-cloud.js.map +0 -1
  109. package/dist/lib/encoders/encode-3d-tile.js.map +0 -1
  110. package/dist/lib/encoders/helpers/encode-3d-tile-header.js.map +0 -1
  111. package/dist/lib/ion/ion.js.map +0 -1
  112. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.js.map +0 -1
  113. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.js.map +0 -1
  114. package/dist/lib/parsers/helpers/normalize-3d-tile-positions.js.map +0 -1
  115. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +0 -1
  116. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +0 -1
  117. package/dist/lib/parsers/helpers/parse-3d-tile-header.js.map +0 -1
  118. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js.map +0 -1
  119. package/dist/lib/parsers/helpers/parse-3d-tile-tables.js.map +0 -1
  120. package/dist/lib/parsers/helpers/parse-utils.js.map +0 -1
  121. package/dist/lib/parsers/parse-3d-tile-batched-model.js.map +0 -1
  122. package/dist/lib/parsers/parse-3d-tile-composite.js.map +0 -1
  123. package/dist/lib/parsers/parse-3d-tile-gltf.js.map +0 -1
  124. package/dist/lib/parsers/parse-3d-tile-header.js.map +0 -1
  125. package/dist/lib/parsers/parse-3d-tile-instanced-model.js.map +0 -1
  126. package/dist/lib/parsers/parse-3d-tile-point-cloud.js.map +0 -1
  127. package/dist/lib/parsers/parse-3d-tile.js.map +0 -1
  128. package/dist/lib/utils/obb/s2-corners-to-obb.js.map +0 -1
  129. package/dist/lib/utils/s2/converters/s2-to-boundary.js.map +0 -1
  130. package/dist/lib/utils/s2/converters/s2-to-obb-points.js.map +0 -1
  131. package/dist/lib/utils/s2/converters/s2-to-region.js.map +0 -1
  132. package/dist/lib/utils/s2/index.js.map +0 -1
  133. package/dist/lib/utils/s2/s2-geometry-functions.js.map +0 -1
  134. package/dist/lib/utils/s2/s2-token-functions.js.map +0 -1
  135. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.js.map +0 -1
  136. package/dist/lib/utils/s2/s2geometry/s2-geometry.js.map +0 -1
  137. package/dist/lib/utils/version.js.map +0 -1
  138. package/dist/tile-3d-subtree-loader.js.map +0 -1
  139. package/dist/tile-3d-writer.js.map +0 -1
  140. package/dist/tiles-3d-loader.js.map +0 -1
  141. package/dist/types.js.map +0 -1
@@ -1,66 +1,94 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+ // This file is derived from the Cesium code base under Apache 2 license
5
+ // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
6
+ // TODO - should we automatically parse the embedded glTF or leave it to the app?
7
+ // - I.e. some apps might work directly on a GLB, in that case no need for us to decode...
8
+ // - And if we decode, do we still keep the GLB in case it is needed?
9
+ // - Do we add an option to control this?
10
+ // - Also, should we have hard dependency on gltf module or use injection or auto-discovery for gltf parser?
1
11
  import { GLTFLoader, postProcessGLTF, _getMemoryUsageGLTF } from '@loaders.gl/gltf';
2
12
  import { sliceArrayBuffer, parseFromContext } from '@loaders.gl/loader-utils';
3
13
  export const GLTF_FORMAT = {
4
- URI: 0,
5
- EMBEDDED: 1
14
+ URI: 0,
15
+ EMBEDDED: 1
6
16
  };
7
17
  export function parse3DTileGLTFViewSync(tile, arrayBuffer, byteOffset, options) {
8
- tile.rotateYtoZ = true;
9
- const gltfByteLength = (tile.byteOffset || 0) + (tile.byteLength || 0) - byteOffset;
10
- if (gltfByteLength === 0) {
11
- throw new Error('glTF byte length must be greater than 0.');
12
- }
13
- tile.gltfUpAxis = options !== null && options !== void 0 && options['3d-tiles'] && options['3d-tiles'].assetGltfUpAxis ? options['3d-tiles'].assetGltfUpAxis : 'Y';
14
- tile.gltfArrayBuffer = sliceArrayBuffer(arrayBuffer, byteOffset, gltfByteLength);
15
- tile.gltfByteOffset = 0;
16
- tile.gltfByteLength = gltfByteLength;
17
- if (byteOffset % 4 === 0) {} else {
18
- console.warn(`${tile.type}: embedded glb is not aligned to a 4-byte boundary.`);
19
- }
20
- return (tile.byteOffset || 0) + (tile.byteLength || 0);
21
- }
22
- export async function extractGLTF(tile, gltfFormat, options, context) {
23
- const tile3DOptions = (options === null || options === void 0 ? void 0 : options['3d-tiles']) || {};
24
- extractGLTFBufferOrURL(tile, gltfFormat, options);
25
- if (tile3DOptions.loadGLTF) {
26
- if (!context) {
27
- return;
18
+ // Set flags
19
+ // glTF models need to be rotated from Y to Z up
20
+ // https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#y-up-to-z-up
21
+ tile.rotateYtoZ = true;
22
+ // Assume glTF consumes rest of tile
23
+ const gltfByteLength = (tile.byteOffset || 0) + (tile.byteLength || 0) - byteOffset;
24
+ if (gltfByteLength === 0) {
25
+ throw new Error('glTF byte length must be greater than 0.');
26
+ }
27
+ // Save gltf up axis
28
+ tile.gltfUpAxis =
29
+ options?.['3d-tiles'] && options['3d-tiles'].assetGltfUpAxis
30
+ ? options['3d-tiles'].assetGltfUpAxis
31
+ : 'Y';
32
+ // TODO - We can avoid copy if already 4-byte aligned...
33
+ // However the rest of the code may not be able to accept byteOffsets, so copy anyway
34
+ tile.gltfArrayBuffer = sliceArrayBuffer(arrayBuffer, byteOffset, gltfByteLength);
35
+ tile.gltfByteOffset = 0;
36
+ tile.gltfByteLength = gltfByteLength;
37
+ if (byteOffset % 4 === 0) {
38
+ // tile.gltfArrayBuffer = arrayBuffer;
39
+ // tile.gltfByteOffset = byteOffset;
40
+ // tile.gltfByteLength = gltfByteLength;
28
41
  }
29
- if (tile.gltfUrl) {
30
- const {
31
- fetch
32
- } = context;
33
- const response = await fetch(tile.gltfUrl, options);
34
- tile.gltfArrayBuffer = await response.arrayBuffer();
35
- tile.gltfByteOffset = 0;
42
+ else {
43
+ // Create a copy of the glb so that it is 4-byte aligned
44
+ // eslint-disable-next-line
45
+ console.warn(`${tile.type}: embedded glb is not aligned to a 4-byte boundary.`);
36
46
  }
37
- if (tile.gltfArrayBuffer) {
38
- const gltfWithBuffers = await parseFromContext(tile.gltfArrayBuffer, GLTFLoader, options, context);
39
- tile.gltf = postProcessGLTF(gltfWithBuffers);
40
- tile.gpuMemoryUsageInBytes = _getMemoryUsageGLTF(tile.gltf);
41
- delete tile.gltfArrayBuffer;
42
- delete tile.gltfByteOffset;
43
- delete tile.gltfByteLength;
47
+ // Entire tile is consumed
48
+ return (tile.byteOffset || 0) + (tile.byteLength || 0);
49
+ }
50
+ export async function extractGLTF(tile, gltfFormat, options, context) {
51
+ const tile3DOptions = options?.['3d-tiles'] || {};
52
+ extractGLTFBufferOrURL(tile, gltfFormat, options);
53
+ if (tile3DOptions.loadGLTF) {
54
+ if (!context) {
55
+ return;
56
+ }
57
+ if (tile.gltfUrl) {
58
+ const { fetch } = context;
59
+ const response = await fetch(tile.gltfUrl, options);
60
+ tile.gltfArrayBuffer = await response.arrayBuffer();
61
+ tile.gltfByteOffset = 0;
62
+ }
63
+ if (tile.gltfArrayBuffer) {
64
+ // TODO - Should handle byteOffset... However, not used now...
65
+ const gltfWithBuffers = await parseFromContext(tile.gltfArrayBuffer, GLTFLoader, options, context);
66
+ tile.gltf = postProcessGLTF(gltfWithBuffers);
67
+ tile.gpuMemoryUsageInBytes = _getMemoryUsageGLTF(tile.gltf);
68
+ delete tile.gltfArrayBuffer;
69
+ delete tile.gltfByteOffset;
70
+ delete tile.gltfByteLength;
71
+ }
44
72
  }
45
- }
46
73
  }
47
74
  function extractGLTFBufferOrURL(tile, gltfFormat, options) {
48
- switch (gltfFormat) {
49
- case GLTF_FORMAT.URI:
50
- if (tile.gltfArrayBuffer) {
51
- const gltfUrlBytes = new Uint8Array(tile.gltfArrayBuffer, tile.gltfByteOffset);
52
- const textDecoder = new TextDecoder();
53
- const gltfUrl = textDecoder.decode(gltfUrlBytes);
54
- tile.gltfUrl = gltfUrl.replace(/[\s\0]+$/, '');
55
- }
56
- delete tile.gltfArrayBuffer;
57
- delete tile.gltfByteOffset;
58
- delete tile.gltfByteLength;
59
- break;
60
- case GLTF_FORMAT.EMBEDDED:
61
- break;
62
- default:
63
- throw new Error('b3dm: Illegal glTF format field');
64
- }
75
+ switch (gltfFormat) {
76
+ case GLTF_FORMAT.URI:
77
+ // We need to remove padding from the end of the model URL in case this tile was part of a composite tile.
78
+ // This removes all white space and null characters from the end of the string.
79
+ if (tile.gltfArrayBuffer) {
80
+ const gltfUrlBytes = new Uint8Array(tile.gltfArrayBuffer, tile.gltfByteOffset);
81
+ const textDecoder = new TextDecoder();
82
+ const gltfUrl = textDecoder.decode(gltfUrlBytes);
83
+ tile.gltfUrl = gltfUrl.replace(/[\s\0]+$/, '');
84
+ }
85
+ delete tile.gltfArrayBuffer;
86
+ delete tile.gltfByteOffset;
87
+ delete tile.gltfByteLength;
88
+ break;
89
+ case GLTF_FORMAT.EMBEDDED:
90
+ break;
91
+ default:
92
+ throw new Error('b3dm: Illegal glTF format field');
93
+ }
65
94
  }
66
- //# sourceMappingURL=parse-3d-tile-gltf-view.js.map
@@ -1,3 +1,3 @@
1
- import { Tiles3DTileContent } from '../../../types';
1
+ import { Tiles3DTileContent } from "../../../types.js";
2
2
  export declare function parse3DTileHeaderSync(tile: Tiles3DTileContent, arrayBuffer: ArrayBuffer, byteOffset?: number): number;
3
3
  //# sourceMappingURL=parse-3d-tile-header.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-3d-tile-header.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/helpers/parse-3d-tile-header.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAWlD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,GAAE,MAAU,UAmBvB"}
1
+ {"version":3,"file":"parse-3d-tile-header.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/helpers/parse-3d-tile-header.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,kBAAkB,EAAC,0BAAuB;AAWlD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,GAAE,MAAU,UAmBvB"}
@@ -1,16 +1,25 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
1
4
  const SIZEOF_UINT32 = 4;
2
- export function parse3DTileHeaderSync(tile, arrayBuffer) {
3
- let byteOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
4
- const view = new DataView(arrayBuffer);
5
- tile.magic = view.getUint32(byteOffset, true);
6
- byteOffset += SIZEOF_UINT32;
7
- tile.version = view.getUint32(byteOffset, true);
8
- byteOffset += SIZEOF_UINT32;
9
- tile.byteLength = view.getUint32(byteOffset, true);
10
- byteOffset += SIZEOF_UINT32;
11
- if (tile.version !== 1) {
12
- throw new Error(`3D Tile Version ${tile.version} not supported`);
13
- }
14
- return byteOffset;
5
+ /* PARSE FIXED HEADER:
6
+ Populates
7
+ magic, // identifies type of tile
8
+ type, // String version of magic
9
+ version,
10
+ byteLength
11
+ */
12
+ export function parse3DTileHeaderSync(tile, arrayBuffer, byteOffset = 0) {
13
+ const view = new DataView(arrayBuffer);
14
+ tile.magic = view.getUint32(byteOffset, true);
15
+ byteOffset += SIZEOF_UINT32;
16
+ tile.version = view.getUint32(byteOffset, true);
17
+ byteOffset += SIZEOF_UINT32;
18
+ tile.byteLength = view.getUint32(byteOffset, true);
19
+ byteOffset += SIZEOF_UINT32;
20
+ // TODO - move version check into each tile parser?
21
+ if (tile.version !== 1) {
22
+ throw new Error(`3D Tile Version ${tile.version} not supported`);
23
+ }
24
+ return byteOffset; // Indicates where the parsing ended
15
25
  }
16
- //# sourceMappingURL=parse-3d-tile-header.js.map
@@ -1,4 +1,4 @@
1
- import type { Subtree, Availability } from '../../../types';
1
+ import type { Subtree, Availability } from "../../../types.js";
2
2
  import type { LoaderContext, LoaderOptions } from '@loaders.gl/loader-utils';
3
3
  /**
4
4
  * Parse subtree file
@@ -1 +1 @@
1
- {"version":3,"file":"parse-3d-tile-subtree.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/helpers/parse-3d-tile-subtree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAK3E;;;;;GAKG;AAEH,wBAA8B,mBAAmB,CAC/C,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,OAAO,EAAE,aAAa,GAAG,SAAS,GACjC,OAAO,CAAC,OAAO,CAAC,CAgDlB;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,YAAY,EAChC,oBAAoB,EAAE,WAAW,EACjC,OAAO,EAAE,aAAa,GAAG,SAAS,GACjC,OAAO,CAAC,IAAI,CAAC,CA0Cf"}
1
+ {"version":3,"file":"parse-3d-tile-subtree.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/helpers/parse-3d-tile-subtree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAE,YAAY,EAAC,0BAAuB;AAC1D,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAK3E;;;;;GAKG;AAEH,wBAA8B,mBAAmB,CAC/C,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,OAAO,EAAE,aAAa,GAAG,SAAS,GACjC,OAAO,CAAC,OAAO,CAAC,CAgDlB;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,YAAY,EAChC,oBAAoB,EAAE,WAAW,EACjC,OAAO,EAAE,aAAa,GAAG,SAAS,GACjC,OAAO,CAAC,IAAI,CAAC,CA0Cf"}
@@ -1,62 +1,90 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
1
4
  const SUBTREE_FILE_MAGIC = 0x74627573;
2
5
  const SUBTREE_FILE_VERSION = 1;
6
+ /**
7
+ * Parse subtree file
8
+ * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subtree-file-format
9
+ * @param data
10
+ * @returns
11
+ */
12
+ // eslint-disable-next-line max-statements
3
13
  export default async function parse3DTilesSubtree(data, options, context) {
4
- const magic = new Uint32Array(data.slice(0, 4));
5
- if (magic[0] !== SUBTREE_FILE_MAGIC) {
6
- throw new Error('Wrong subtree file magic number');
7
- }
8
- const version = new Uint32Array(data.slice(4, 8));
9
- if (version[0] !== SUBTREE_FILE_VERSION) {
10
- throw new Error('Wrong subtree file verson, must be 1');
11
- }
12
- const jsonByteLength = parseUint64Value(data.slice(8, 16));
13
- const stringAttribute = new Uint8Array(data, 24, jsonByteLength);
14
- const textDecoder = new TextDecoder('utf8');
15
- const string = textDecoder.decode(stringAttribute);
16
- const subtree = JSON.parse(string);
17
- const binaryByteLength = parseUint64Value(data.slice(16, 24));
18
- let internalBinaryBuffer = new ArrayBuffer(0);
19
- if (binaryByteLength) {
20
- internalBinaryBuffer = data.slice(24 + jsonByteLength);
21
- }
22
- await loadExplicitBitstream(subtree, subtree.tileAvailability, internalBinaryBuffer, context);
23
- if (Array.isArray(subtree.contentAvailability)) {
24
- for (const contentAvailability of subtree.contentAvailability) {
25
- await loadExplicitBitstream(subtree, contentAvailability, internalBinaryBuffer, context);
26
- }
27
- } else {
28
- await loadExplicitBitstream(subtree, subtree.contentAvailability, internalBinaryBuffer, context);
29
- }
30
- await loadExplicitBitstream(subtree, subtree.childSubtreeAvailability, internalBinaryBuffer, context);
31
- return subtree;
14
+ const magic = new Uint32Array(data.slice(0, 4));
15
+ if (magic[0] !== SUBTREE_FILE_MAGIC) {
16
+ throw new Error('Wrong subtree file magic number');
17
+ }
18
+ const version = new Uint32Array(data.slice(4, 8));
19
+ if (version[0] !== SUBTREE_FILE_VERSION) {
20
+ throw new Error('Wrong subtree file verson, must be 1');
21
+ }
22
+ const jsonByteLength = parseUint64Value(data.slice(8, 16));
23
+ const stringAttribute = new Uint8Array(data, 24, jsonByteLength);
24
+ const textDecoder = new TextDecoder('utf8');
25
+ const string = textDecoder.decode(stringAttribute);
26
+ const subtree = JSON.parse(string);
27
+ const binaryByteLength = parseUint64Value(data.slice(16, 24));
28
+ let internalBinaryBuffer = new ArrayBuffer(0);
29
+ if (binaryByteLength) {
30
+ internalBinaryBuffer = data.slice(24 + jsonByteLength);
31
+ }
32
+ await loadExplicitBitstream(subtree, subtree.tileAvailability, internalBinaryBuffer, context);
33
+ if (Array.isArray(subtree.contentAvailability)) {
34
+ for (const contentAvailability of subtree.contentAvailability) {
35
+ await loadExplicitBitstream(subtree, contentAvailability, internalBinaryBuffer, context);
36
+ }
37
+ }
38
+ else {
39
+ await loadExplicitBitstream(subtree, subtree.contentAvailability, internalBinaryBuffer, context);
40
+ }
41
+ await loadExplicitBitstream(subtree, subtree.childSubtreeAvailability, internalBinaryBuffer, context);
42
+ return subtree;
32
43
  }
44
+ /**
45
+ * Load explicit bitstream for subtree availability data.
46
+ * @param subtree - subtree data
47
+ * @param availabilityObject - tileAvailability / contentAvailability / childSubtreeAvailability object
48
+ * @param internalBinaryBuffer - subtree binary buffer
49
+ * @param context - loaders.gl context
50
+ */
33
51
  export async function loadExplicitBitstream(subtree, availabilityObject, internalBinaryBuffer, context) {
34
- const bufferViewIndex = Number.isFinite(availabilityObject.bitstream) ? availabilityObject.bitstream : availabilityObject.bufferView;
35
- if (typeof bufferViewIndex !== 'number') {
36
- return;
37
- }
38
- const bufferView = subtree.bufferViews[bufferViewIndex];
39
- const buffer = subtree.buffers[bufferView.buffer];
40
- if (!(context !== null && context !== void 0 && context.baseUrl)) {
41
- throw new Error('Url is not provided');
42
- }
43
- if (!context.fetch) {
44
- throw new Error('fetch is not provided');
45
- }
46
- if (buffer.uri) {
47
- const bufferUri = `${(context === null || context === void 0 ? void 0 : context.baseUrl) || ''}/${buffer.uri}`;
48
- const response = await context.fetch(bufferUri);
49
- const data = await response.arrayBuffer();
50
- availabilityObject.explicitBitstream = new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
51
- return;
52
- }
53
- const bufferStart = subtree.buffers.slice(0, bufferView.buffer).reduce((offset, buf) => offset + buf.byteLength, 0);
54
- availabilityObject.explicitBitstream = new Uint8Array(internalBinaryBuffer.slice(bufferStart, bufferStart + buffer.byteLength), bufferView.byteOffset, bufferView.byteLength);
52
+ const bufferViewIndex = Number.isFinite(availabilityObject.bitstream)
53
+ ? availabilityObject.bitstream
54
+ : availabilityObject.bufferView;
55
+ if (typeof bufferViewIndex !== 'number') {
56
+ return;
57
+ }
58
+ const bufferView = subtree.bufferViews[bufferViewIndex];
59
+ const buffer = subtree.buffers[bufferView.buffer];
60
+ if (!context?.baseUrl) {
61
+ throw new Error('Url is not provided');
62
+ }
63
+ if (!context.fetch) {
64
+ throw new Error('fetch is not provided');
65
+ }
66
+ // External bitstream loading
67
+ if (buffer.uri) {
68
+ const bufferUri = `${context?.baseUrl || ''}/${buffer.uri}`;
69
+ const response = await context.fetch(bufferUri);
70
+ const data = await response.arrayBuffer();
71
+ availabilityObject.explicitBitstream = new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
72
+ return;
73
+ }
74
+ const bufferStart = subtree.buffers
75
+ .slice(0, bufferView.buffer)
76
+ .reduce((offset, buf) => offset + buf.byteLength, 0);
77
+ availabilityObject.explicitBitstream = new Uint8Array(internalBinaryBuffer.slice(bufferStart, bufferStart + buffer.byteLength), bufferView.byteOffset, bufferView.byteLength);
55
78
  }
79
+ /**
80
+ * Parse buffer to return uint64 value
81
+ * @param buffer
82
+ * @returns 64-bit value until precision is lost after Number.MAX_SAFE_INTEGER
83
+ */
56
84
  function parseUint64Value(buffer) {
57
- const dataView = new DataView(buffer);
58
- const left = dataView.getUint32(0, true);
59
- const right = dataView.getUint32(4, true);
60
- return left + 2 ** 32 * right;
85
+ const dataView = new DataView(buffer);
86
+ const left = dataView.getUint32(0, true);
87
+ const right = dataView.getUint32(4, true);
88
+ // combine the two 32-bit values
89
+ return left + 2 ** 32 * right;
61
90
  }
62
- //# sourceMappingURL=parse-3d-tile-subtree.js.map
@@ -1,5 +1,5 @@
1
- import { Tiles3DLoaderOptions } from '../../../tiles-3d-loader';
2
- import { Tiles3DTileContent } from '../../../types';
1
+ import { Tiles3DLoaderOptions } from "../../../tiles-3d-loader.js";
2
+ import { Tiles3DTileContent } from "../../../types.js";
3
3
  export declare function parse3DTileTablesHeaderSync(tile: Tiles3DTileContent, arrayBuffer: ArrayBuffer, byteOffset: number): number;
4
4
  export declare function parse3DTileTablesSync(tile: Tiles3DTileContent, arrayBuffer: ArrayBuffer, byteOffset: number, options?: Tiles3DLoaderOptions): number;
5
5
  //# sourceMappingURL=parse-3d-tile-tables.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-3d-tile-tables.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/helpers/parse-3d-tile-tables.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAC,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAMlD,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,UAkDnB;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,oBAAoB,UAK/B"}
1
+ {"version":3,"file":"parse-3d-tile-tables.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/helpers/parse-3d-tile-tables.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,oBAAoB,EAAC,oCAAiC;AAC9D,OAAO,EAAC,kBAAkB,EAAC,0BAAuB;AAMlD,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,UAkDnB;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,oBAAoB,UAK/B"}
@@ -1,80 +1,91 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+ // This file is derived from the Cesium code base under Apache 2 license
5
+ // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
1
6
  import { getStringFromArrayBuffer } from "./parse-utils.js";
2
7
  const SIZEOF_UINT32 = 4;
3
8
  const DEPRECATION_WARNING = 'b3dm tile in legacy format.';
9
+ // eslint-disable-next-line max-statements
4
10
  export function parse3DTileTablesHeaderSync(tile, arrayBuffer, byteOffset) {
5
- const view = new DataView(arrayBuffer);
6
- let batchLength;
7
- tile.header = tile.header || {};
8
- let featureTableJsonByteLength = view.getUint32(byteOffset, true);
9
- byteOffset += SIZEOF_UINT32;
10
- let featureTableBinaryByteLength = view.getUint32(byteOffset, true);
11
- byteOffset += SIZEOF_UINT32;
12
- let batchTableJsonByteLength = view.getUint32(byteOffset, true);
13
- byteOffset += SIZEOF_UINT32;
14
- let batchTableBinaryByteLength = view.getUint32(byteOffset, true);
15
- byteOffset += SIZEOF_UINT32;
16
- if (batchTableJsonByteLength >= 570425344) {
17
- byteOffset -= SIZEOF_UINT32 * 2;
18
- batchLength = featureTableJsonByteLength;
19
- batchTableJsonByteLength = featureTableBinaryByteLength;
20
- batchTableBinaryByteLength = 0;
21
- featureTableJsonByteLength = 0;
22
- featureTableBinaryByteLength = 0;
23
- console.warn(DEPRECATION_WARNING);
24
- } else if (batchTableBinaryByteLength >= 570425344) {
25
- byteOffset -= SIZEOF_UINT32;
26
- batchLength = batchTableJsonByteLength;
27
- batchTableJsonByteLength = featureTableJsonByteLength;
28
- batchTableBinaryByteLength = featureTableBinaryByteLength;
29
- featureTableJsonByteLength = 0;
30
- featureTableBinaryByteLength = 0;
31
- console.warn(DEPRECATION_WARNING);
32
- }
33
- tile.header.featureTableJsonByteLength = featureTableJsonByteLength;
34
- tile.header.featureTableBinaryByteLength = featureTableBinaryByteLength;
35
- tile.header.batchTableJsonByteLength = batchTableJsonByteLength;
36
- tile.header.batchTableBinaryByteLength = batchTableBinaryByteLength;
37
- tile.header.batchLength = batchLength;
38
- return byteOffset;
11
+ const view = new DataView(arrayBuffer);
12
+ let batchLength;
13
+ tile.header = tile.header || {};
14
+ let featureTableJsonByteLength = view.getUint32(byteOffset, true);
15
+ byteOffset += SIZEOF_UINT32;
16
+ let featureTableBinaryByteLength = view.getUint32(byteOffset, true);
17
+ byteOffset += SIZEOF_UINT32;
18
+ let batchTableJsonByteLength = view.getUint32(byteOffset, true);
19
+ byteOffset += SIZEOF_UINT32;
20
+ let batchTableBinaryByteLength = view.getUint32(byteOffset, true);
21
+ byteOffset += SIZEOF_UINT32;
22
+ // First legacy header format - [batchLength] [batchTableByteLength] ('batchTableJsonByteLength': JSON starts with a quotation mark or the glTF magic)
23
+ // Second legacy format - [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength] (Second legacy format is similar as first but here we check 'batchTableBinaryByteLength' instead)
24
+ // Current header format - [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength]
25
+ // First byte will be 0x22 or 0x67. The minimum uint32 expected is 0x22000000 = 570425344 = 570MB.
26
+ if (batchTableJsonByteLength >= 570425344) {
27
+ byteOffset -= SIZEOF_UINT32 * 2;
28
+ batchLength = featureTableJsonByteLength;
29
+ batchTableJsonByteLength = featureTableBinaryByteLength;
30
+ batchTableBinaryByteLength = 0;
31
+ featureTableJsonByteLength = 0;
32
+ featureTableBinaryByteLength = 0;
33
+ console.warn(DEPRECATION_WARNING); // eslint-disable-line
34
+ }
35
+ else if (batchTableBinaryByteLength >= 570425344) {
36
+ byteOffset -= SIZEOF_UINT32;
37
+ batchLength = batchTableJsonByteLength;
38
+ batchTableJsonByteLength = featureTableJsonByteLength;
39
+ batchTableBinaryByteLength = featureTableBinaryByteLength;
40
+ featureTableJsonByteLength = 0;
41
+ featureTableBinaryByteLength = 0;
42
+ console.warn(DEPRECATION_WARNING); // eslint-disable-line
43
+ }
44
+ tile.header.featureTableJsonByteLength = featureTableJsonByteLength;
45
+ tile.header.featureTableBinaryByteLength = featureTableBinaryByteLength;
46
+ tile.header.batchTableJsonByteLength = batchTableJsonByteLength;
47
+ tile.header.batchTableBinaryByteLength = batchTableBinaryByteLength;
48
+ tile.header.batchLength = batchLength;
49
+ return byteOffset;
39
50
  }
40
51
  export function parse3DTileTablesSync(tile, arrayBuffer, byteOffset, options) {
41
- byteOffset = parse3DTileFeatureTable(tile, arrayBuffer, byteOffset, options);
42
- byteOffset = parse3DTileBatchTable(tile, arrayBuffer, byteOffset, options);
43
- return byteOffset;
52
+ byteOffset = parse3DTileFeatureTable(tile, arrayBuffer, byteOffset, options);
53
+ byteOffset = parse3DTileBatchTable(tile, arrayBuffer, byteOffset, options);
54
+ return byteOffset;
44
55
  }
45
56
  function parse3DTileFeatureTable(tile, arrayBuffer, byteOffset, options) {
46
- const {
47
- featureTableJsonByteLength,
48
- featureTableBinaryByteLength,
49
- batchLength
50
- } = tile.header || {};
51
- tile.featureTableJson = {
52
- BATCH_LENGTH: batchLength || 0
53
- };
54
- if (featureTableJsonByteLength && featureTableJsonByteLength > 0) {
55
- const featureTableString = getStringFromArrayBuffer(arrayBuffer, byteOffset, featureTableJsonByteLength);
56
- tile.featureTableJson = JSON.parse(featureTableString);
57
- }
58
- byteOffset += featureTableJsonByteLength || 0;
59
- tile.featureTableBinary = new Uint8Array(arrayBuffer, byteOffset, featureTableBinaryByteLength);
60
- byteOffset += featureTableBinaryByteLength || 0;
61
- return byteOffset;
57
+ const { featureTableJsonByteLength, featureTableBinaryByteLength, batchLength } = tile.header || {};
58
+ tile.featureTableJson = {
59
+ BATCH_LENGTH: batchLength || 0
60
+ };
61
+ if (featureTableJsonByteLength && featureTableJsonByteLength > 0) {
62
+ const featureTableString = getStringFromArrayBuffer(arrayBuffer, byteOffset, featureTableJsonByteLength);
63
+ tile.featureTableJson = JSON.parse(featureTableString);
64
+ }
65
+ byteOffset += featureTableJsonByteLength || 0;
66
+ tile.featureTableBinary = new Uint8Array(arrayBuffer, byteOffset, featureTableBinaryByteLength);
67
+ byteOffset += featureTableBinaryByteLength || 0;
68
+ /*
69
+ const featureTable = parseFeatureTable(featureTableJson, featureTableBinary);
70
+
71
+ const batchLength = featureTable.getGlobalProperty('BATCH_LENGTH');
72
+ featureTable.featuresLength = batchLength;
73
+ */
74
+ return byteOffset;
62
75
  }
63
76
  function parse3DTileBatchTable(tile, arrayBuffer, byteOffset, options) {
64
- const {
65
- batchTableJsonByteLength,
66
- batchTableBinaryByteLength
67
- } = tile.header || {};
68
- if (batchTableJsonByteLength && batchTableJsonByteLength > 0) {
69
- const batchTableString = getStringFromArrayBuffer(arrayBuffer, byteOffset, batchTableJsonByteLength);
70
- tile.batchTableJson = JSON.parse(batchTableString);
71
- byteOffset += batchTableJsonByteLength;
72
- if (batchTableBinaryByteLength && batchTableBinaryByteLength > 0) {
73
- tile.batchTableBinary = new Uint8Array(arrayBuffer, byteOffset, batchTableBinaryByteLength);
74
- tile.batchTableBinary = new Uint8Array(tile.batchTableBinary);
75
- byteOffset += batchTableBinaryByteLength;
77
+ const { batchTableJsonByteLength, batchTableBinaryByteLength } = tile.header || {};
78
+ if (batchTableJsonByteLength && batchTableJsonByteLength > 0) {
79
+ const batchTableString = getStringFromArrayBuffer(arrayBuffer, byteOffset, batchTableJsonByteLength);
80
+ tile.batchTableJson = JSON.parse(batchTableString);
81
+ byteOffset += batchTableJsonByteLength;
82
+ if (batchTableBinaryByteLength && batchTableBinaryByteLength > 0) {
83
+ // Has a batch table binary
84
+ tile.batchTableBinary = new Uint8Array(arrayBuffer, byteOffset, batchTableBinaryByteLength);
85
+ // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed
86
+ tile.batchTableBinary = new Uint8Array(tile.batchTableBinary);
87
+ byteOffset += batchTableBinaryByteLength;
88
+ }
76
89
  }
77
- }
78
- return byteOffset;
90
+ return byteOffset;
79
91
  }
80
- //# sourceMappingURL=parse-3d-tile-tables.js.map
@@ -1,24 +1,29 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+ // This file is derived from the Cesium code base under Apache 2 license
5
+ // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
1
6
  import { assert } from '@loaders.gl/loader-utils';
7
+ // Decode the JSON binary array into clear text
2
8
  export function getStringFromArrayBuffer(arrayBuffer, byteOffset, byteLength) {
3
- assert(arrayBuffer instanceof ArrayBuffer);
4
- const textDecoder = new TextDecoder('utf8');
5
- const typedArray = new Uint8Array(arrayBuffer, byteOffset, byteLength);
6
- const string = textDecoder.decode(typedArray);
7
- return string;
9
+ assert(arrayBuffer instanceof ArrayBuffer);
10
+ const textDecoder = new TextDecoder('utf8');
11
+ const typedArray = new Uint8Array(arrayBuffer, byteOffset, byteLength);
12
+ const string = textDecoder.decode(typedArray);
13
+ return string;
8
14
  }
15
+ // Decode the JSON binary array into clear text
9
16
  export function getStringFromTypedArray(typedArray) {
10
- assert(ArrayBuffer.isView(typedArray));
11
- const textDecoder = new TextDecoder('utf8');
12
- const string = textDecoder.decode(typedArray);
13
- return string;
17
+ assert(ArrayBuffer.isView(typedArray));
18
+ const textDecoder = new TextDecoder('utf8');
19
+ const string = textDecoder.decode(typedArray);
20
+ return string;
14
21
  }
15
- export function getMagicString(arrayBuffer) {
16
- let byteOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
17
- const dataView = new DataView(arrayBuffer);
18
- return `\
22
+ export function getMagicString(arrayBuffer, byteOffset = 0) {
23
+ const dataView = new DataView(arrayBuffer);
24
+ return `\
19
25
  ${String.fromCharCode(dataView.getUint8(byteOffset + 0))}\
20
26
  ${String.fromCharCode(dataView.getUint8(byteOffset + 1))}\
21
27
  ${String.fromCharCode(dataView.getUint8(byteOffset + 2))}\
22
28
  ${String.fromCharCode(dataView.getUint8(byteOffset + 3))}`;
23
29
  }
24
- //# sourceMappingURL=parse-utils.js.map
@@ -1,5 +1,5 @@
1
- import { Tiles3DTileContent } from '../../types';
2
- import { Tiles3DLoaderOptions } from '../../tiles-3d-loader';
1
+ import { Tiles3DTileContent } from "../../types.js";
2
+ import { Tiles3DLoaderOptions } from "../../tiles-3d-loader.js";
3
3
  import { LoaderContext } from '@loaders.gl/loader-utils';
4
4
  export declare function parseBatchedModel3DTile(tile: Tiles3DTileContent, arrayBuffer: ArrayBuffer, byteOffset: number, options?: Tiles3DLoaderOptions, context?: LoaderContext): Promise<number>;
5
5
  //# sourceMappingURL=parse-3d-tile-batched-model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-3d-tile-batched-model.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-3d-tile-batched-model.ts"],"names":[],"mappings":"AAcA,OAAO,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAC,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAEvD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,aAAa,mBAWxB"}
1
+ {"version":3,"file":"parse-3d-tile-batched-model.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-3d-tile-batched-model.ts"],"names":[],"mappings":"AAcA,OAAO,EAAC,kBAAkB,EAAC,uBAAoB;AAC/C,OAAO,EAAC,oBAAoB,EAAC,iCAA8B;AAC3D,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAEvD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,aAAa,mBAWxB"}