@loaders.gl/3d-tiles 4.0.4 → 4.1.0-alpha.10

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 (154) hide show
  1. package/dist/3d-tiles-archive/3d-tiles-archive-archive.d.ts.map +1 -1
  2. package/dist/3d-tiles-archive/3d-tiles-archive-archive.js.map +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 +2 -2
  5. package/dist/3d-tiles-archive/3d-tiles-archive-parser.js.map +1 -1
  6. package/dist/3d-tiles-archive-loader.d.ts.map +1 -1
  7. package/dist/3d-tiles-archive-loader.js +1 -1
  8. package/dist/3d-tiles-archive-loader.js.map +1 -1
  9. package/dist/cesium-ion-loader.d.ts.map +1 -1
  10. package/dist/cesium-ion-loader.js.map +1 -1
  11. package/dist/dist.dev.js +195 -58
  12. package/dist/index.cjs +31 -22
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/lib/classes/helpers/tile-3d-accessor-utils.d.ts.map +1 -1
  16. package/dist/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
  17. package/dist/lib/classes/tile-3d-batch-table-hierarchy.d.ts.map +1 -1
  18. package/dist/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
  19. package/dist/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
  20. package/dist/lib/classes/tile-3d-batch-table.js.map +1 -1
  21. package/dist/lib/classes/tile-3d-feature-table.d.ts.map +1 -1
  22. package/dist/lib/classes/tile-3d-feature-table.js.map +1 -1
  23. package/dist/lib/constants.d.ts.map +1 -1
  24. package/dist/lib/constants.js.map +1 -1
  25. package/dist/lib/encoders/encode-3d-tile-batched-model.d.ts.map +1 -1
  26. package/dist/lib/encoders/encode-3d-tile-batched-model.js.map +1 -1
  27. package/dist/lib/encoders/encode-3d-tile-composite.d.ts.map +1 -1
  28. package/dist/lib/encoders/encode-3d-tile-composite.js.map +1 -1
  29. package/dist/lib/encoders/encode-3d-tile-instanced-model.d.ts.map +1 -1
  30. package/dist/lib/encoders/encode-3d-tile-instanced-model.js.map +1 -1
  31. package/dist/lib/encoders/encode-3d-tile-point-cloud.d.ts.map +1 -1
  32. package/dist/lib/encoders/encode-3d-tile-point-cloud.js.map +1 -1
  33. package/dist/lib/encoders/encode-3d-tile.d.ts.map +1 -1
  34. package/dist/lib/encoders/encode-3d-tile.js.map +1 -1
  35. package/dist/lib/encoders/helpers/encode-3d-tile-header.d.ts.map +1 -1
  36. package/dist/lib/encoders/helpers/encode-3d-tile-header.js.map +1 -1
  37. package/dist/lib/filesystems/tiles-3d-archive-file-system.d.ts.map +1 -1
  38. package/dist/lib/filesystems/tiles-3d-archive-file-system.js +2 -2
  39. package/dist/lib/filesystems/tiles-3d-archive-file-system.js.map +1 -1
  40. package/dist/lib/ion/ion.d.ts.map +1 -1
  41. package/dist/lib/ion/ion.js.map +1 -1
  42. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.d.ts.map +1 -1
  43. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
  44. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.d.ts.map +1 -1
  45. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
  46. package/dist/lib/parsers/helpers/normalize-3d-tile-positions.d.ts.map +1 -1
  47. package/dist/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
  48. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
  49. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +21 -19
  50. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
  51. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.d.ts.map +1 -1
  52. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
  53. package/dist/lib/parsers/helpers/parse-3d-tile-header.d.ts.map +1 -1
  54. package/dist/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
  55. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts +9 -1
  56. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts.map +1 -1
  57. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js +3 -2
  58. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
  59. package/dist/lib/parsers/helpers/parse-3d-tile-tables.d.ts.map +1 -1
  60. package/dist/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
  61. package/dist/lib/parsers/helpers/parse-utils.d.ts.map +1 -1
  62. package/dist/lib/parsers/helpers/parse-utils.js.map +1 -1
  63. package/dist/lib/parsers/parse-3d-tile-batched-model.d.ts.map +1 -1
  64. package/dist/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
  65. package/dist/lib/parsers/parse-3d-tile-composite.d.ts.map +1 -1
  66. package/dist/lib/parsers/parse-3d-tile-composite.js.map +1 -1
  67. package/dist/lib/parsers/parse-3d-tile-gltf.d.ts.map +1 -1
  68. package/dist/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
  69. package/dist/lib/parsers/parse-3d-tile-header.d.ts.map +1 -1
  70. package/dist/lib/parsers/parse-3d-tile-header.js +6 -5
  71. package/dist/lib/parsers/parse-3d-tile-header.js.map +1 -1
  72. package/dist/lib/parsers/parse-3d-tile-instanced-model.d.ts.map +1 -1
  73. package/dist/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  74. package/dist/lib/parsers/parse-3d-tile-point-cloud.d.ts.map +1 -1
  75. package/dist/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
  76. package/dist/lib/parsers/parse-3d-tile.d.ts.map +1 -1
  77. package/dist/lib/parsers/parse-3d-tile.js.map +1 -1
  78. package/dist/lib/utils/obb/s2-corners-to-obb.d.ts.map +1 -1
  79. package/dist/lib/utils/obb/s2-corners-to-obb.js.map +1 -1
  80. package/dist/lib/utils/s2/converters/s2-to-boundary.d.ts.map +1 -1
  81. package/dist/lib/utils/s2/converters/s2-to-boundary.js.map +1 -1
  82. package/dist/lib/utils/s2/converters/s2-to-obb-points.d.ts.map +1 -1
  83. package/dist/lib/utils/s2/converters/s2-to-obb-points.js.map +1 -1
  84. package/dist/lib/utils/s2/converters/s2-to-region.d.ts.map +1 -1
  85. package/dist/lib/utils/s2/converters/s2-to-region.js.map +1 -1
  86. package/dist/lib/utils/s2/index.d.ts.map +1 -1
  87. package/dist/lib/utils/s2/index.js.map +1 -1
  88. package/dist/lib/utils/s2/s2-geometry-functions.d.ts.map +1 -1
  89. package/dist/lib/utils/s2/s2-geometry-functions.js.map +1 -1
  90. package/dist/lib/utils/s2/s2-token-functions.d.ts.map +1 -1
  91. package/dist/lib/utils/s2/s2-token-functions.js.map +1 -1
  92. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.d.ts.map +1 -1
  93. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.js.map +1 -1
  94. package/dist/lib/utils/s2/s2geometry/s2-geometry.d.ts.map +1 -1
  95. package/dist/lib/utils/s2/s2geometry/s2-geometry.js.map +1 -1
  96. package/dist/lib/utils/version.js +1 -1
  97. package/dist/lib/utils/version.js.map +1 -1
  98. package/dist/tile-3d-subtree-loader.d.ts.map +1 -1
  99. package/dist/tile-3d-subtree-loader.js.map +1 -1
  100. package/dist/tile-3d-writer.d.ts.map +1 -1
  101. package/dist/tile-3d-writer.js.map +1 -1
  102. package/dist/tiles-3d-loader.d.ts.map +1 -1
  103. package/dist/tiles-3d-loader.js.map +1 -1
  104. package/dist/types.d.ts +4 -4
  105. package/dist/types.d.ts.map +1 -1
  106. package/dist/types.js.map +1 -1
  107. package/package.json +15 -12
  108. package/src/3d-tiles-archive/3d-tiles-archive-archive.ts +4 -0
  109. package/src/3d-tiles-archive/3d-tiles-archive-parser.ts +6 -2
  110. package/src/3d-tiles-archive-loader.ts +4 -0
  111. package/src/cesium-ion-loader.ts +4 -0
  112. package/src/index.ts +4 -0
  113. package/src/lib/classes/helpers/tile-3d-accessor-utils.ts +4 -0
  114. package/src/lib/classes/tile-3d-batch-table-hierarchy.ts +4 -0
  115. package/src/lib/classes/tile-3d-batch-table.ts +4 -0
  116. package/src/lib/classes/tile-3d-feature-table.ts +4 -0
  117. package/src/lib/constants.ts +4 -0
  118. package/src/lib/encoders/encode-3d-tile-batched-model.ts +4 -0
  119. package/src/lib/encoders/encode-3d-tile-composite.ts +4 -0
  120. package/src/lib/encoders/encode-3d-tile-instanced-model.ts +4 -0
  121. package/src/lib/encoders/encode-3d-tile-point-cloud.ts +4 -0
  122. package/src/lib/encoders/encode-3d-tile.ts +4 -0
  123. package/src/lib/encoders/helpers/encode-3d-tile-header.ts +4 -0
  124. package/src/lib/filesystems/tiles-3d-archive-file-system.ts +6 -2
  125. package/src/lib/ion/ion.ts +4 -0
  126. package/src/lib/parsers/helpers/normalize-3d-tile-colors.ts +4 -0
  127. package/src/lib/parsers/helpers/normalize-3d-tile-normals.ts +4 -0
  128. package/src/lib/parsers/helpers/normalize-3d-tile-positions.ts +4 -0
  129. package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +25 -16
  130. package/src/lib/parsers/helpers/parse-3d-tile-gltf-view.ts +4 -0
  131. package/src/lib/parsers/helpers/parse-3d-tile-header.ts +4 -0
  132. package/src/lib/parsers/helpers/parse-3d-tile-subtree.ts +11 -2
  133. package/src/lib/parsers/helpers/parse-3d-tile-tables.ts +4 -0
  134. package/src/lib/parsers/helpers/parse-utils.ts +4 -0
  135. package/src/lib/parsers/parse-3d-tile-batched-model.ts +4 -0
  136. package/src/lib/parsers/parse-3d-tile-composite.ts +4 -0
  137. package/src/lib/parsers/parse-3d-tile-gltf.ts +2 -1
  138. package/src/lib/parsers/parse-3d-tile-header.ts +11 -3
  139. package/src/lib/parsers/parse-3d-tile-instanced-model.ts +4 -0
  140. package/src/lib/parsers/parse-3d-tile-point-cloud.ts +4 -0
  141. package/src/lib/parsers/parse-3d-tile.ts +4 -0
  142. package/src/lib/utils/obb/s2-corners-to-obb.ts +4 -0
  143. package/src/lib/utils/s2/converters/s2-to-boundary.ts +4 -0
  144. package/src/lib/utils/s2/converters/s2-to-obb-points.ts +4 -0
  145. package/src/lib/utils/s2/converters/s2-to-region.ts +4 -0
  146. package/src/lib/utils/s2/index.ts +3 -1
  147. package/src/lib/utils/s2/s2-geometry-functions.ts +3 -1
  148. package/src/lib/utils/s2/s2-token-functions.ts +3 -2
  149. package/src/lib/utils/s2/s2geometry/s2-cell-utils.ts +3 -1
  150. package/src/lib/utils/s2/s2geometry/s2-geometry.ts +4 -1
  151. package/src/tile-3d-subtree-loader.ts +4 -0
  152. package/src/tile-3d-writer.ts +4 -0
  153. package/src/tiles-3d-loader.ts +4 -0
  154. package/src/types.ts +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/3d-tiles",
3
- "version": "4.0.4",
3
+ "version": "4.1.0-alpha.10",
4
4
  "description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -12,23 +12,26 @@
12
12
  "url": "https://github.com/visgl/loaders.gl"
13
13
  },
14
14
  "keywords": [
15
- "webgl",
16
15
  "loader",
17
16
  "3d tile",
17
+ "3d tiles",
18
18
  "tile",
19
+ "massive 3D",
19
20
  "mesh",
20
21
  "gltf",
21
22
  "point cloud",
22
- "pointcloud"
23
+ "pointcloud",
24
+ "webgl",
25
+ "webgpu"
23
26
  ],
24
27
  "types": "dist/index.d.ts",
25
28
  "main": "dist/index.cjs",
26
29
  "module": "dist/index.js",
27
30
  "exports": {
28
31
  ".": {
32
+ "types": "./dist/index.d.ts",
29
33
  "import": "./dist/index.js",
30
- "require": "./dist/index.cjs",
31
- "types": "./dist/index.d.ts"
34
+ "require": "./dist/index.cjs"
32
35
  }
33
36
  },
34
37
  "sideEffects": false,
@@ -42,12 +45,12 @@
42
45
  "build-bundle": "ocular-bundle ./src/index.ts"
43
46
  },
44
47
  "dependencies": {
45
- "@loaders.gl/draco": "4.0.4",
46
- "@loaders.gl/gltf": "4.0.4",
47
- "@loaders.gl/loader-utils": "4.0.4",
48
- "@loaders.gl/math": "4.0.4",
49
- "@loaders.gl/tiles": "4.0.4",
50
- "@loaders.gl/zip": "4.0.4",
48
+ "@loaders.gl/draco": "4.1.0-alpha.10",
49
+ "@loaders.gl/gltf": "4.1.0-alpha.10",
50
+ "@loaders.gl/loader-utils": "4.1.0-alpha.10",
51
+ "@loaders.gl/math": "4.1.0-alpha.10",
52
+ "@loaders.gl/tiles": "4.1.0-alpha.10",
53
+ "@loaders.gl/zip": "4.1.0-alpha.10",
51
54
  "@math.gl/core": "^4.0.0",
52
55
  "@math.gl/geospatial": "^4.0.0",
53
56
  "@probe.gl/log": "^4.0.4",
@@ -56,5 +59,5 @@
56
59
  "peerDependencies": {
57
60
  "@loaders.gl/core": "^4.0.0"
58
61
  },
59
- "gitHead": "4dc810fa04bb400f4aedfef98a83c7ef882ed3d7"
62
+ "gitHead": "19f43c2d90d8b50860c3f8e487429779a386287d"
60
63
  }
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import {FileProvider} from '@loaders.gl/loader-utils';
2
6
  import {MD5Hash} from '@loaders.gl/crypto';
3
7
  import {DeflateCompression, NoCompression} from '@loaders.gl/compression';
@@ -1,6 +1,10 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import {FileProvider} from '@loaders.gl/loader-utils';
2
6
  import {
3
- cdSignature as cdHeaderSignature,
7
+ CD_HEADER_SIGNATURE,
4
8
  makeHashTableFromZipHeaders,
5
9
  parseHashTable,
6
10
  parseZipCDFileHeader,
@@ -19,7 +23,7 @@ export const parse3DTilesArchive = async (
19
23
  fileProvider: FileProvider,
20
24
  cb?: (msg: string) => void
21
25
  ): Promise<Tiles3DArchive> => {
22
- const hashCDOffset = await searchFromTheEnd(fileProvider, cdHeaderSignature);
26
+ const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);
23
27
 
24
28
  const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);
25
29
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';
2
6
  import {DataViewFile} from '@loaders.gl/loader-utils';
3
7
  import {parse3DTilesArchive as parse3DTilesArchiveFromProvider} from './3d-tiles-archive/3d-tiles-archive-parser';
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';
2
6
  import {Tiles3DLoader} from './tiles-3d-loader';
3
7
  import {getIonTilesetMetadata} from './lib/ion/ion';
package/src/index.ts CHANGED
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  // LOADERS
2
6
  export {Tiles3DLoader} from './tiles-3d-loader';
3
7
  export {CesiumIonLoader} from './cesium-ion-loader';
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import {GLType} from '@loaders.gl/math'; // '@math.gl/geometry';
2
6
  import {assert} from '@loaders.gl/loader-utils';
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  // TILE TYPES
2
6
 
3
7
  export const TILE3D_TYPE = {
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  // HELPER ENCODERS
2
6
  import {assert} from '@loaders.gl/loader-utils';
3
7
 
@@ -1,7 +1,11 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import {FileProvider} from '@loaders.gl/loader-utils';
2
6
  import {
3
7
  ZipFileSystem,
4
- cdSignature as cdHeaderSignature,
8
+ CD_HEADER_SIGNATURE,
5
9
  searchFromTheEnd,
6
10
  parseZipCDFileHeader,
7
11
  parseHashTable,
@@ -66,7 +70,7 @@ export class Tiles3DArchiveFileSystem extends ZipFileSystem {
66
70
  throw new Error('No data detected in the zip archive');
67
71
  }
68
72
 
69
- const hashCDOffset = await searchFromTheEnd(fileProvider, cdHeaderSignature);
73
+ const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);
70
74
 
71
75
  const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);
72
76
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  // Minimal support to load tilsets from the Cesium ION services
2
6
 
3
7
  import {fetchFile} from '@loaders.gl/core';
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import {Tile3DBatchTable} from '@loaders.gl/3d-tiles';
2
6
  import {decodeRGB565, GL} from '@loaders.gl/math';
3
7
  import {Tiles3DTileContent} from '../../../types';
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import {Vector3} from '@math.gl/core';
2
6
  import {GL, octDecode} from '@loaders.gl/math';
3
7
  import {Tiles3DTileContent} from '../../../types';
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import {Vector3} from '@math.gl/core';
2
6
  import {GL} from '@loaders.gl/math';
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {Availability, Tile3DBoundingVolume, Subtree} from '../../../types';
2
6
  import {Tile3DSubtreeLoader} from '../../../tile-3d-subtree-loader';
3
7
  import {load} from '@loaders.gl/core';
@@ -10,12 +14,12 @@ import Long from 'long';
10
14
  import {Tiles3DLoaderOptions} from '../../../tiles-3d-loader';
11
15
  import {ImplicitOptions} from '../parse-3d-tile-header';
12
16
 
13
- const QUADTREE_DEVISION_COUNT = 4;
14
- const OCTREE_DEVISION_COUNT = 8;
17
+ const QUADTREE_DIVISION_COUNT = 4;
18
+ const OCTREE_DIVISION_COUNT = 8;
15
19
 
16
20
  const SUBDIVISION_COUNT_MAP = {
17
- QUADTREE: QUADTREE_DEVISION_COUNT,
18
- OCTREE: OCTREE_DEVISION_COUNT
21
+ QUADTREE: QUADTREE_DIVISION_COUNT,
22
+ OCTREE: OCTREE_DIVISION_COUNT
19
23
  };
20
24
 
21
25
  /**
@@ -103,17 +107,20 @@ export async function parseImplicitTiles(params: {
103
107
  z: 0
104
108
  },
105
109
  childIndex = 0,
110
+ s2VolumeBox,
111
+ loaderOptions
112
+ } = params;
113
+ let {
114
+ subtree,
115
+ level = 0,
106
116
  globalData = {
107
117
  level: 0,
108
118
  mortonIndex: 0,
109
119
  x: 0,
110
120
  y: 0,
111
121
  z: 0
112
- },
113
- s2VolumeBox,
114
- loaderOptions
122
+ }
115
123
  } = params;
116
- let {subtree, level = 0} = params;
117
124
  const {
118
125
  subdivisionScheme,
119
126
  subtreeLevels,
@@ -163,9 +170,9 @@ export async function parseImplicitTiles(params: {
163
170
  );
164
171
  }
165
172
 
166
- const x = concatBits(globalData.x, childTileX, level * bitsPerTile);
167
- const y = concatBits(globalData.y, childTileY, level * bitsPerTile);
168
- const z = concatBits(globalData.z, childTileZ, level * bitsPerTile);
173
+ const x = concatBits(globalData.x, childTileX, level);
174
+ const y = concatBits(globalData.y, childTileY, level);
175
+ const z = concatBits(globalData.z, childTileZ, level);
169
176
 
170
177
  if (isChildSubtreeAvailable) {
171
178
  const subtreePath = `${basePath}/${subtreesUriTemplate}`;
@@ -174,11 +181,13 @@ export async function parseImplicitTiles(params: {
174
181
 
175
182
  subtree = childSubtree;
176
183
 
177
- globalData.mortonIndex = childTileMortonIndex;
178
- globalData.x = childTileX;
179
- globalData.y = childTileY;
180
- globalData.z = childTileZ;
181
- globalData.level = level;
184
+ globalData = {
185
+ mortonIndex: childTileMortonIndex,
186
+ x: childTileX,
187
+ y: childTileY,
188
+ z: childTileZ,
189
+ level
190
+ };
182
191
 
183
192
  childTileMortonIndex = 0;
184
193
  tileAvailabilityIndex = 0;
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {Subtree, Availability} from '../../../types';
2
6
  import type {LoaderContext, LoaderOptions} from '@loaders.gl/loader-utils';
3
7
 
@@ -72,7 +76,7 @@ export default async function parse3DTilesSubtree(
72
76
  * @param internalBinaryBuffer - subtree binary buffer
73
77
  * @param context - loaders.gl context
74
78
  */
75
- async function loadExplicitBitstream(
79
+ export async function loadExplicitBitstream(
76
80
  subtree: Subtree,
77
81
  availabilityObject: Availability,
78
82
  internalBinaryBuffer: ArrayBuffer,
@@ -109,8 +113,13 @@ async function loadExplicitBitstream(
109
113
  );
110
114
  return;
111
115
  }
116
+
117
+ const bufferStart = subtree.buffers
118
+ .slice(0, bufferView.buffer)
119
+ .reduce((offset, buf) => offset + buf.byteLength, 0);
120
+
112
121
  availabilityObject.explicitBitstream = new Uint8Array(
113
- internalBinaryBuffer,
122
+ internalBinaryBuffer.slice(bufferStart, bufferStart + buffer.byteLength),
114
123
  bufferView.byteOffset,
115
124
  bufferView.byteLength
116
125
  );
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,4 +1,5 @@
1
- // loaders.gl, MIT license
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT license
2
3
  // Copyright (c) vis.gl contributors
3
4
 
4
5
  import {parseFromContext, LoaderContext} from '@loaders.gl/loader-utils';
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {Tiles3DLoaderOptions} from '../../tiles-3d-loader';
2
6
  import type {LoaderOptions} from '@loaders.gl/loader-utils';
3
7
  import {path} from '@loaders.gl/loader-utils';
@@ -79,7 +83,7 @@ function getRefine(refine?: string): TILE_REFINEMENT | string | undefined {
79
83
  }
80
84
  }
81
85
 
82
- function resolveUri(uri: string = '', basePath: string): string {
86
+ function resolveUri(uri: string, basePath: string): string {
83
87
  // url scheme per RFC3986
84
88
  const urlSchemeRegex = /^[a-z][0-9a-z+.-]*:/i;
85
89
 
@@ -103,7 +107,10 @@ export function normalizeTileData(
103
107
  let tileContentUrl: string | undefined;
104
108
  if (tile.content) {
105
109
  const contentUri = tile.content.uri || tile.content?.url;
106
- tileContentUrl = resolveUri(contentUri, basePath);
110
+ if (typeof contentUri !== 'undefined') {
111
+ // sparse implicit tilesets may not define content for all nodes
112
+ tileContentUrl = resolveUri(contentUri, basePath);
113
+ }
107
114
  }
108
115
  const tilePostprocessed: Tiles3DTileJSONPostprocessed = {
109
116
  ...tile,
@@ -195,7 +202,8 @@ export async function normalizeImplicitTileHeaders(
195
202
  const replacedUrlTemplate = replaceContentUrlTemplate(subtreesUriTemplate, 0, 0, 0, 0);
196
203
  const subtreeUrl = resolveUri(replacedUrlTemplate, basePath);
197
204
  const subtree = await load(subtreeUrl, Tile3DSubtreeLoader, options);
198
- const contentUrlTemplate = resolveUri(tile.content?.uri, basePath);
205
+ const tileContentUri = tile.content?.uri;
206
+ const contentUrlTemplate = tileContentUri ? resolveUri(tileContentUri, basePath) : '';
199
207
  const refine = tileset?.root?.refine;
200
208
  // @ts-ignore
201
209
  const rootLodMetricValue = tile.geometricError;
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+
1
5
  // This file is derived from the Cesium code base under Apache 2 license
2
6
  // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import {Vector3} from '@math.gl/core';
2
6
  import {OrientedBoundingBox, makeOrientedBoundingBoxFromPoints} from '@math.gl/culling';
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {S2Cell} from '../s2geometry/s2-geometry';
2
6
  import {IJToST, STToUV, FaceUVToXYZ, XYZToLngLat} from '../s2geometry/s2-geometry';
3
7
 
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import {getS2Cell} from '../s2geometry/s2-cell-utils';
2
6
  import {getS2Region} from './s2-to-region';
3
7
  import {Vector3} from '@math.gl/core';
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {S2Cell} from '../s2geometry/s2-geometry';
2
6
  import {getS2BoundaryFlatFromS2Cell} from './s2-to-boundary';
3
7
  import {getS2Cell} from '../s2geometry/s2-cell-utils';
@@ -1,4 +1,6 @@
1
- // math.gl MIT license
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
2
4
 
3
5
  export {getS2CellIdFromToken, getS2TokenFromCellId, getS2ChildCellId} from './s2-token-functions';
4
6
  export {getS2BoundaryFlat, getS2LngLat} from './s2-geometry-functions';
@@ -1,4 +1,6 @@
1
- // math.gl, MIT license
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
2
4
 
3
5
  import {getS2BoundaryFlatFromS2Cell} from './converters/s2-to-boundary';
4
6
  import {getS2LngLatFromS2Cell} from './s2geometry/s2-geometry';
@@ -1,5 +1,6 @@
1
- // loaders.gl, MIT license
2
- // Copyright (c) vis.gl contributors
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
3
4
 
4
5
  import Long from 'long';
5
6
 
@@ -1,4 +1,6 @@
1
- // math.gl, MIT license
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
2
4
 
3
5
  import type {S2Cell} from './s2-geometry';
4
6
  import {getS2CellFromQuadKey, getS2QuadkeyFromCellId} from './s2-geometry';
@@ -1,4 +1,7 @@
1
- // math.gl, MIT license
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND ISC
3
+ // Copyright vis.gl contributors
4
+
2
5
  /*
3
6
  Adapted from s2-geometry under ISC License (ISC)
4
7
  Copyright (c) 2012-2016, Jon Atkins <github@jonatkins.com>
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';
2
6
  import type {Subtree} from './types';
3
7
  import parse3DTilesSubtree from './lib/parsers/helpers/parse-3d-tile-subtree';
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';
2
6
  import {VERSION} from './lib/utils/version';
3
7
  import encode3DTile from './lib/encoders/encode-3d-tile';
@@ -1,3 +1,7 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+
1
5
  import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';
2
6
  // / import type { GLTFLoaderOptions } from '@loaders.gl/gltf';
3
7
  import type {DracoLoaderOptions} from '@loaders.gl/draco';