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

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.
@@ -1,6 +1,6 @@
1
1
  import { DataViewFile } from '@loaders.gl/loader-utils';
2
2
  import { parse3DTilesArchive as parse3DTilesArchiveFromProvider } from "./3d-tiles-archive/3d-tiles-archive-parser.js";
3
- const VERSION = typeof "4.1.0-alpha.3" !== 'undefined' ? "4.1.0-alpha.3" : 'latest';
3
+ const VERSION = typeof "4.1.0-alpha.4" !== 'undefined' ? "4.1.0-alpha.4" : 'latest';
4
4
  export const Tiles3DArchiveFileLoader = {
5
5
  name: '3tz',
6
6
  id: '3tz',
package/dist/dist.dev.js CHANGED
@@ -4309,7 +4309,7 @@ var __exports__ = (() => {
4309
4309
  console.warn("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
4310
4310
  globalThis._loadersgl_.version = NPM_TAG;
4311
4311
  } else {
4312
- globalThis._loadersgl_.version = "4.1.0-alpha.3";
4312
+ globalThis._loadersgl_.version = "4.1.0-alpha.4";
4313
4313
  }
4314
4314
  }
4315
4315
  return globalThis._loadersgl_.version;
@@ -10083,7 +10083,7 @@ var __exports__ = (() => {
10083
10083
  }({});
10084
10084
 
10085
10085
  // src/lib/utils/version.ts
10086
- var VERSION2 = true ? "4.1.0-alpha.3" : "latest";
10086
+ var VERSION2 = true ? "4.1.0-alpha.4" : "latest";
10087
10087
 
10088
10088
  // src/lib/constants.ts
10089
10089
  var TILE3D_TYPE = {
@@ -10117,7 +10117,7 @@ var __exports__ = (() => {
10117
10117
  }
10118
10118
 
10119
10119
  // ../draco/src/lib/utils/version.ts
10120
- var VERSION3 = true ? "4.1.0-alpha.3" : "latest";
10120
+ var VERSION3 = true ? "4.1.0-alpha.4" : "latest";
10121
10121
 
10122
10122
  // ../draco/src/draco-loader.ts
10123
10123
  var DracoLoader = {
@@ -11819,7 +11819,7 @@ var __exports__ = (() => {
11819
11819
  });
11820
11820
 
11821
11821
  // ../images/src/lib/utils/version.ts
11822
- var VERSION4 = true ? "4.1.0-alpha.3" : "latest";
11822
+ var VERSION4 = true ? "4.1.0-alpha.4" : "latest";
11823
11823
 
11824
11824
  // ../images/src/lib/category-api/image-type.ts
11825
11825
  var parseImageNode = globalThis.loaders?.parseImageNode;
@@ -13528,10 +13528,10 @@ var __exports__ = (() => {
13528
13528
  }
13529
13529
 
13530
13530
  // ../gltf/src/lib/utils/version.ts
13531
- var VERSION5 = true ? "4.1.0-alpha.3" : "latest";
13531
+ var VERSION5 = true ? "4.1.0-alpha.4" : "latest";
13532
13532
 
13533
13533
  // ../textures/src/lib/utils/version.ts
13534
- var VERSION6 = true ? "4.1.0-alpha.3" : "latest";
13534
+ var VERSION6 = true ? "4.1.0-alpha.4" : "latest";
13535
13535
 
13536
13536
  // ../textures/src/lib/parsers/basis-module-loader.ts
13537
13537
  var BASIS_EXTERNAL_LIBRARIES = {
@@ -15916,7 +15916,8 @@ var __exports__ = (() => {
15916
15916
  availabilityObject.explicitBitstream = new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
15917
15917
  return;
15918
15918
  }
15919
- availabilityObject.explicitBitstream = new Uint8Array(internalBinaryBuffer, bufferView.byteOffset, bufferView.byteLength);
15919
+ const bufferStart = subtree.buffers.slice(0, bufferView.buffer).reduce((offset, buf) => offset + buf.byteLength, 0);
15920
+ availabilityObject.explicitBitstream = new Uint8Array(internalBinaryBuffer.slice(bufferStart, bufferStart + buffer.byteLength), bufferView.byteOffset, bufferView.byteLength);
15920
15921
  }
15921
15922
  function parseUint64Value(buffer) {
15922
15923
  const dataView = new DataView(buffer);
@@ -18295,23 +18296,28 @@ var __exports__ = (() => {
18295
18296
  const zipEoCDOffset = await searchFromTheEnd(file, eoCDSignature);
18296
18297
  let cdRecordsNumber = BigInt(await file.getUint16(zipEoCDOffset + CD_RECORDS_NUMBER_OFFSET));
18297
18298
  let cdStartOffset = BigInt(await file.getUint32(zipEoCDOffset + CD_START_OFFSET_OFFSET));
18298
- if (cdStartOffset === BigInt(4294967295) || cdRecordsNumber === BigInt(4294967295)) {
18299
- const zip64EoCDLocatorOffset = zipEoCDOffset - 20n;
18300
- const magicBytes = await file.slice(zip64EoCDLocatorOffset, zip64EoCDLocatorOffset + 4n);
18301
- if (!compareArrayBuffers(magicBytes, zip64EoCDLocatorSignature)) {
18302
- throw new Error("zip64 EoCD locator not found");
18303
- }
18304
- const zip64EoCDOffset = await file.getBigUint64(zip64EoCDLocatorOffset + ZIP64_EOCD_START_OFFSET_OFFSET);
18299
+ let zip64EoCDLocatorOffset = zipEoCDOffset - 20n;
18300
+ let zip64EoCDOffset = 0n;
18301
+ const magicBytes = await file.slice(zip64EoCDLocatorOffset, zip64EoCDLocatorOffset + 4n);
18302
+ if (compareArrayBuffers(magicBytes, zip64EoCDLocatorSignature)) {
18303
+ zip64EoCDOffset = await file.getBigUint64(zip64EoCDLocatorOffset + ZIP64_EOCD_START_OFFSET_OFFSET);
18305
18304
  const endOfCDMagicBytes = await file.slice(zip64EoCDOffset, zip64EoCDOffset + 4n);
18306
18305
  if (!compareArrayBuffers(endOfCDMagicBytes, zip64EoCDSignature.buffer)) {
18307
18306
  throw new Error("zip64 EoCD not found");
18308
18307
  }
18309
18308
  cdRecordsNumber = await file.getBigUint64(zip64EoCDOffset + ZIP64_CD_RECORDS_NUMBER_OFFSET);
18310
18309
  cdStartOffset = await file.getBigUint64(zip64EoCDOffset + ZIP64_CD_START_OFFSET_OFFSET);
18310
+ } else {
18311
+ zip64EoCDLocatorOffset = 0n;
18311
18312
  }
18312
18313
  return {
18313
18314
  cdRecordsNumber,
18314
- cdStartOffset
18315
+ cdStartOffset,
18316
+ offsets: {
18317
+ zip64EoCDOffset,
18318
+ zip64EoCDLocatorOffset,
18319
+ zipEoCDOffset
18320
+ }
18315
18321
  };
18316
18322
  };
18317
18323
 
@@ -19440,7 +19446,7 @@ var __exports__ = (() => {
19440
19446
  };
19441
19447
 
19442
19448
  // src/3d-tiles-archive-loader.ts
19443
- var VERSION8 = true ? "4.1.0-alpha.3" : "latest";
19449
+ var VERSION8 = true ? "4.1.0-alpha.4" : "latest";
19444
19450
  var Tiles3DArchiveFileLoader = {
19445
19451
  name: "3tz",
19446
19452
  id: "3tz",
package/dist/index.cjs CHANGED
@@ -1548,8 +1548,9 @@ async function loadExplicitBitstream(subtree, availabilityObject, internalBinary
1548
1548
  );
1549
1549
  return;
1550
1550
  }
1551
+ const bufferStart = subtree.buffers.slice(0, bufferView.buffer).reduce((offset, buf) => offset + buf.byteLength, 0);
1551
1552
  availabilityObject.explicitBitstream = new Uint8Array(
1552
- internalBinaryBuffer,
1553
+ internalBinaryBuffer.slice(bufferStart, bufferStart + buffer.byteLength),
1553
1554
  bufferView.byteOffset,
1554
1555
  bufferView.byteLength
1555
1556
  );
@@ -1,4 +1,4 @@
1
- import type { Subtree } from '../../../types';
1
+ import type { Subtree, Availability } from '../../../types';
2
2
  import type { LoaderContext, LoaderOptions } from '@loaders.gl/loader-utils';
3
3
  /**
4
4
  * Parse subtree file
@@ -7,4 +7,12 @@ import type { LoaderContext, LoaderOptions } from '@loaders.gl/loader-utils';
7
7
  * @returns
8
8
  */
9
9
  export default function parse3DTilesSubtree(data: ArrayBuffer, options: LoaderOptions | undefined, context: LoaderContext | undefined): Promise<Subtree>;
10
+ /**
11
+ * Load explicit bitstream for subtree availability data.
12
+ * @param subtree - subtree data
13
+ * @param availabilityObject - tileAvailability / contentAvailability / childSubtreeAvailability object
14
+ * @param internalBinaryBuffer - subtree binary buffer
15
+ * @param context - loaders.gl context
16
+ */
17
+ export declare function loadExplicitBitstream(subtree: Subtree, availabilityObject: Availability, internalBinaryBuffer: ArrayBuffer, context: LoaderContext | undefined): Promise<void>;
10
18
  //# sourceMappingURL=parse-3d-tile-subtree.d.ts.map
@@ -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,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"}
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"}
@@ -30,7 +30,7 @@ export default async function parse3DTilesSubtree(data, options, context) {
30
30
  await loadExplicitBitstream(subtree, subtree.childSubtreeAvailability, internalBinaryBuffer, context);
31
31
  return subtree;
32
32
  }
33
- async function loadExplicitBitstream(subtree, availabilityObject, internalBinaryBuffer, context) {
33
+ export async function loadExplicitBitstream(subtree, availabilityObject, internalBinaryBuffer, context) {
34
34
  const bufferViewIndex = Number.isFinite(availabilityObject.bitstream) ? availabilityObject.bitstream : availabilityObject.bufferView;
35
35
  if (typeof bufferViewIndex !== 'number') {
36
36
  return;
@@ -50,7 +50,8 @@ async function loadExplicitBitstream(subtree, availabilityObject, internalBinary
50
50
  availabilityObject.explicitBitstream = new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
51
51
  return;
52
52
  }
53
- availabilityObject.explicitBitstream = new Uint8Array(internalBinaryBuffer, bufferView.byteOffset, bufferView.byteLength);
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);
54
55
  }
55
56
  function parseUint64Value(buffer) {
56
57
  const dataView = new DataView(buffer);
@@ -1 +1 @@
1
- {"version":3,"file":"parse-3d-tile-subtree.js","names":["SUBTREE_FILE_MAGIC","SUBTREE_FILE_VERSION","parse3DTilesSubtree","data","options","context","magic","Uint32Array","slice","Error","version","jsonByteLength","parseUint64Value","stringAttribute","Uint8Array","textDecoder","TextDecoder","string","decode","subtree","JSON","parse","binaryByteLength","internalBinaryBuffer","ArrayBuffer","loadExplicitBitstream","tileAvailability","Array","isArray","contentAvailability","childSubtreeAvailability","availabilityObject","bufferViewIndex","Number","isFinite","bitstream","bufferView","bufferViews","buffer","buffers","baseUrl","fetch","uri","bufferUri","response","arrayBuffer","explicitBitstream","byteOffset","byteLength","dataView","DataView","left","getUint32","right"],"sources":["../../../../src/lib/parsers/helpers/parse-3d-tile-subtree.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright vis.gl contributors\n\nimport type {Subtree, Availability} from '../../../types';\nimport type {LoaderContext, LoaderOptions} from '@loaders.gl/loader-utils';\n\nconst SUBTREE_FILE_MAGIC = 0x74627573;\nconst SUBTREE_FILE_VERSION = 1;\n\n/**\n * Parse subtree file\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subtree-file-format\n * @param data\n * @returns\n */\n// eslint-disable-next-line max-statements\nexport default async function parse3DTilesSubtree(\n data: ArrayBuffer,\n options: LoaderOptions | undefined,\n context: LoaderContext | undefined\n): Promise<Subtree> {\n const magic = new Uint32Array(data.slice(0, 4));\n\n if (magic[0] !== SUBTREE_FILE_MAGIC) {\n throw new Error('Wrong subtree file magic number');\n }\n\n const version = new Uint32Array(data.slice(4, 8));\n\n if (version[0] !== SUBTREE_FILE_VERSION) {\n throw new Error('Wrong subtree file verson, must be 1');\n }\n\n const jsonByteLength = parseUint64Value(data.slice(8, 16));\n const stringAttribute = new Uint8Array(data, 24, jsonByteLength);\n\n const textDecoder = new TextDecoder('utf8');\n const string = textDecoder.decode(stringAttribute);\n const subtree = JSON.parse(string);\n\n const binaryByteLength = parseUint64Value(data.slice(16, 24));\n let internalBinaryBuffer = new ArrayBuffer(0);\n\n if (binaryByteLength) {\n internalBinaryBuffer = data.slice(24 + jsonByteLength);\n }\n\n await loadExplicitBitstream(subtree, subtree.tileAvailability, internalBinaryBuffer, context);\n if (Array.isArray(subtree.contentAvailability)) {\n for (const contentAvailability of subtree.contentAvailability) {\n await loadExplicitBitstream(subtree, contentAvailability, internalBinaryBuffer, context);\n }\n } else {\n await loadExplicitBitstream(\n subtree,\n subtree.contentAvailability,\n internalBinaryBuffer,\n context\n );\n }\n await loadExplicitBitstream(\n subtree,\n subtree.childSubtreeAvailability,\n internalBinaryBuffer,\n context\n );\n\n return subtree;\n}\n\n/**\n * Load explicit bitstream for subtree availability data.\n * @param subtree - subtree data\n * @param availabilityObject - tileAvailability / contentAvailability / childSubtreeAvailability object\n * @param internalBinaryBuffer - subtree binary buffer\n * @param context - loaders.gl context\n */\nasync function loadExplicitBitstream(\n subtree: Subtree,\n availabilityObject: Availability,\n internalBinaryBuffer: ArrayBuffer,\n context: LoaderContext | undefined\n): Promise<void> {\n const bufferViewIndex = Number.isFinite(availabilityObject.bitstream)\n ? availabilityObject.bitstream\n : availabilityObject.bufferView;\n\n if (typeof bufferViewIndex !== 'number') {\n return;\n }\n\n const bufferView = subtree.bufferViews[bufferViewIndex];\n const buffer = subtree.buffers[bufferView.buffer];\n\n if (!context?.baseUrl) {\n throw new Error('Url is not provided');\n }\n\n if (!context.fetch) {\n throw new Error('fetch is not provided');\n }\n\n // External bitstream loading\n if (buffer.uri) {\n const bufferUri = `${context?.baseUrl || ''}/${buffer.uri}`;\n const response = await context.fetch(bufferUri);\n const data = await response.arrayBuffer();\n availabilityObject.explicitBitstream = new Uint8Array(\n data,\n bufferView.byteOffset,\n bufferView.byteLength\n );\n return;\n }\n availabilityObject.explicitBitstream = new Uint8Array(\n internalBinaryBuffer,\n bufferView.byteOffset,\n bufferView.byteLength\n );\n}\n\n/**\n * Parse buffer to return uint64 value\n * @param buffer\n * @returns 64-bit value until precision is lost after Number.MAX_SAFE_INTEGER\n */\nfunction parseUint64Value(buffer: ArrayBuffer): number {\n const dataView = new DataView(buffer);\n const left = dataView.getUint32(0, true);\n const right = dataView.getUint32(4, true);\n // combine the two 32-bit values\n return left + 2 ** 32 * right;\n}\n"],"mappings":"AAOA,MAAMA,kBAAkB,GAAG,UAAU;AACrC,MAAMC,oBAAoB,GAAG,CAAC;AAS9B,eAAe,eAAeC,mBAAmBA,CAC/CC,IAAiB,EACjBC,OAAkC,EAClCC,OAAkC,EAChB;EAClB,MAAMC,KAAK,GAAG,IAAIC,WAAW,CAACJ,IAAI,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAE/C,IAAIF,KAAK,CAAC,CAAC,CAAC,KAAKN,kBAAkB,EAAE;IACnC,MAAM,IAAIS,KAAK,CAAC,iCAAiC,CAAC;EACpD;EAEA,MAAMC,OAAO,GAAG,IAAIH,WAAW,CAACJ,IAAI,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAEjD,IAAIE,OAAO,CAAC,CAAC,CAAC,KAAKT,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AAC;AACH;AAOA,SAASpC,gBAAgBA,CAAC0B,MAAmB,EAAU;EACrD,MAAMW,QAAQ,GAAG,IAAIC,QAAQ,CAACZ,MAAM,CAAC;EACrC,MAAMa,IAAI,GAAGF,QAAQ,CAACG,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;EACxC,MAAMC,KAAK,GAAGJ,QAAQ,CAACG,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;EAEzC,OAAOD,IAAI,GAAG,CAAC,IAAI,EAAE,GAAGE,KAAK;AAC/B"}
1
+ {"version":3,"file":"parse-3d-tile-subtree.js","names":["SUBTREE_FILE_MAGIC","SUBTREE_FILE_VERSION","parse3DTilesSubtree","data","options","context","magic","Uint32Array","slice","Error","version","jsonByteLength","parseUint64Value","stringAttribute","Uint8Array","textDecoder","TextDecoder","string","decode","subtree","JSON","parse","binaryByteLength","internalBinaryBuffer","ArrayBuffer","loadExplicitBitstream","tileAvailability","Array","isArray","contentAvailability","childSubtreeAvailability","availabilityObject","bufferViewIndex","Number","isFinite","bitstream","bufferView","bufferViews","buffer","buffers","baseUrl","fetch","uri","bufferUri","response","arrayBuffer","explicitBitstream","byteOffset","byteLength","bufferStart","reduce","offset","buf","dataView","DataView","left","getUint32","right"],"sources":["../../../../src/lib/parsers/helpers/parse-3d-tile-subtree.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright vis.gl contributors\n\nimport type {Subtree, Availability} from '../../../types';\nimport type {LoaderContext, LoaderOptions} from '@loaders.gl/loader-utils';\n\nconst SUBTREE_FILE_MAGIC = 0x74627573;\nconst SUBTREE_FILE_VERSION = 1;\n\n/**\n * Parse subtree file\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subtree-file-format\n * @param data\n * @returns\n */\n// eslint-disable-next-line max-statements\nexport default async function parse3DTilesSubtree(\n data: ArrayBuffer,\n options: LoaderOptions | undefined,\n context: LoaderContext | undefined\n): Promise<Subtree> {\n const magic = new Uint32Array(data.slice(0, 4));\n\n if (magic[0] !== SUBTREE_FILE_MAGIC) {\n throw new Error('Wrong subtree file magic number');\n }\n\n const version = new Uint32Array(data.slice(4, 8));\n\n if (version[0] !== SUBTREE_FILE_VERSION) {\n throw new Error('Wrong subtree file verson, must be 1');\n }\n\n const jsonByteLength = parseUint64Value(data.slice(8, 16));\n const stringAttribute = new Uint8Array(data, 24, jsonByteLength);\n\n const textDecoder = new TextDecoder('utf8');\n const string = textDecoder.decode(stringAttribute);\n const subtree = JSON.parse(string);\n\n const binaryByteLength = parseUint64Value(data.slice(16, 24));\n let internalBinaryBuffer = new ArrayBuffer(0);\n\n if (binaryByteLength) {\n internalBinaryBuffer = data.slice(24 + jsonByteLength);\n }\n\n await loadExplicitBitstream(subtree, subtree.tileAvailability, internalBinaryBuffer, context);\n if (Array.isArray(subtree.contentAvailability)) {\n for (const contentAvailability of subtree.contentAvailability) {\n await loadExplicitBitstream(subtree, contentAvailability, internalBinaryBuffer, context);\n }\n } else {\n await loadExplicitBitstream(\n subtree,\n subtree.contentAvailability,\n internalBinaryBuffer,\n context\n );\n }\n await loadExplicitBitstream(\n subtree,\n subtree.childSubtreeAvailability,\n internalBinaryBuffer,\n context\n );\n\n return subtree;\n}\n\n/**\n * Load explicit bitstream for subtree availability data.\n * @param subtree - subtree data\n * @param availabilityObject - tileAvailability / contentAvailability / childSubtreeAvailability object\n * @param internalBinaryBuffer - subtree binary buffer\n * @param context - loaders.gl context\n */\nexport async function loadExplicitBitstream(\n subtree: Subtree,\n availabilityObject: Availability,\n internalBinaryBuffer: ArrayBuffer,\n context: LoaderContext | undefined\n): Promise<void> {\n const bufferViewIndex = Number.isFinite(availabilityObject.bitstream)\n ? availabilityObject.bitstream\n : availabilityObject.bufferView;\n\n if (typeof bufferViewIndex !== 'number') {\n return;\n }\n\n const bufferView = subtree.bufferViews[bufferViewIndex];\n const buffer = subtree.buffers[bufferView.buffer];\n\n if (!context?.baseUrl) {\n throw new Error('Url is not provided');\n }\n\n if (!context.fetch) {\n throw new Error('fetch is not provided');\n }\n\n // External bitstream loading\n if (buffer.uri) {\n const bufferUri = `${context?.baseUrl || ''}/${buffer.uri}`;\n const response = await context.fetch(bufferUri);\n const data = await response.arrayBuffer();\n availabilityObject.explicitBitstream = new Uint8Array(\n data,\n bufferView.byteOffset,\n bufferView.byteLength\n );\n return;\n }\n\n const bufferStart = subtree.buffers\n .slice(0, bufferView.buffer)\n .reduce((offset, buf) => offset + buf.byteLength, 0);\n\n availabilityObject.explicitBitstream = new Uint8Array(\n internalBinaryBuffer.slice(bufferStart, bufferStart + buffer.byteLength),\n bufferView.byteOffset,\n bufferView.byteLength\n );\n}\n\n/**\n * Parse buffer to return uint64 value\n * @param buffer\n * @returns 64-bit value until precision is lost after Number.MAX_SAFE_INTEGER\n */\nfunction parseUint64Value(buffer: ArrayBuffer): number {\n const dataView = new DataView(buffer);\n const left = dataView.getUint32(0, true);\n const right = dataView.getUint32(4, true);\n // combine the two 32-bit values\n return left + 2 ** 32 * right;\n}\n"],"mappings":"AAOA,MAAMA,kBAAkB,GAAG,UAAU;AACrC,MAAMC,oBAAoB,GAAG,CAAC;AAS9B,eAAe,eAAeC,mBAAmBA,CAC/CC,IAAiB,EACjBC,OAAkC,EAClCC,OAAkC,EAChB;EAClB,MAAMC,KAAK,GAAG,IAAIC,WAAW,CAACJ,IAAI,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAE/C,IAAIF,KAAK,CAAC,CAAC,CAAC,KAAKN,kBAAkB,EAAE;IACnC,MAAM,IAAIS,KAAK,CAAC,iCAAiC,CAAC;EACpD;EAEA,MAAMC,OAAO,GAAG,IAAIH,WAAW,CAACJ,IAAI,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAEjD,IAAIE,OAAO,CAAC,CAAC,CAAC,KAAKT,oBAAoB,EAAE;IACvC,MAAM,IAAIQ,KAAK,CAAC,sCAAsC,CAAC;EACzD;EAEA,MAA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AU,EAAE,CAAC,CAAC;EAEtDjB,kBAAkB,CAACe,iBAAiB,GAAG,IAAIhC,UAAU,CACnDS,oBAAoB,CAACf,KAAK,CAACyC,WAAW,EAAEA,WAAW,GAAGX,MAAM,CAACU,UAAU,CAAC,EACxEZ,UAAU,CAACW,UAAU,EACrBX,UAAU,CAACY,UACb,CAAC;AACH;AAOA,SAASpC,gBAAgBA,CAAC0B,MAAmB,EAAU;EACrD,MAAMe,QAAQ,GAAG,IAAIC,QAAQ,CAAChB,MAAM,CAAC;EACrC,MAAMiB,IAAI,GAAGF,QAAQ,CAACG,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;EACxC,MAAMC,KAAK,GAAGJ,QAAQ,CAACG,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;EAEzC,OAAOD,IAAI,GAAG,CAAC,IAAI,EAAE,GAAGE,KAAK;AAC/B"}
@@ -1,2 +1,2 @@
1
- export const VERSION = typeof "4.1.0-alpha.3" !== 'undefined' ? "4.1.0-alpha.3" : 'latest';
1
+ export const VERSION = typeof "4.1.0-alpha.4" !== 'undefined' ? "4.1.0-alpha.4" : 'latest';
2
2
  //# sourceMappingURL=version.js.map
package/dist/types.d.ts CHANGED
@@ -302,10 +302,10 @@ export type Subtree = {
302
302
  * then the tileset does not subdivide further.
303
303
  */
304
304
  childSubtreeAvailability: Availability;
305
- propertyTables: unknown;
306
- tileMetadata: unknown;
307
- contentMetadata: unknown;
308
- subtreeMetadata: unknown;
305
+ propertyTables?: unknown;
306
+ tileMetadata?: unknown;
307
+ contentMetadata?: unknown;
308
+ subtreeMetadata?: unknown;
309
309
  };
310
310
  export type Availability = {
311
311
  /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAC1E,YAAY,EAAC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iBAAiB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEtD,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,0BAA0B;AAC1B,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,GAAG;IAC5D;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,yBAAyB;AAEzB;;;KAGK;AACL,KAAK,kBAAkB,GAAG;IACxB,0EAA0E;IAC1E,iBAAiB,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,iKAAiK;IACjK,aAAa,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,EAAE;QACR;0MACkM;QAClM,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright vis.gl contributors\n\nimport type {GLTFPostprocessed, FeatureTableJson} from '@loaders.gl/gltf';\nexport type {FeatureTableJson};\n\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT} from '@loaders.gl/tiles';\n\nexport type B3DMContent = {\n batchTableJson?: FeatureTableJson;\n byteLength: number;\n byteOffset: number;\n cartesianModelMatrix: Matrix4;\n cartesianOrigin: Vector3;\n cartographicModelMatrix: Matrix4;\n cartographicOrigin: Vector3;\n featureIds?: number[] | null;\n featureTableBinary?: Uint8Array;\n featureTableJson?: FeatureTableJson;\n gltf?: GLTFPostprocessed;\n gltfUpAxis: string;\n header: GLTFHeader;\n magic: number;\n modelMatrix: Matrix4;\n rotateYtoZ: boolean;\n rtcCenter: [number, number, number];\n type: string;\n version: number;\n};\n\nexport type GLTFHeader = {\n batchLength?: number;\n batchTableBinaryByteLength: number;\n batchTableJsonByteLength: number;\n featureTableBinaryByteLength: number;\n featureTableJsonByteLength: number;\n};\n\n/**\n * A 3D Tiles tileset JSON\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#property-reference\n */\nexport type Tiles3DTilesetJSON = {\n shape: 'tileset3d';\n /** Metadata about the entire tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#asset\n */\n asset: {\n /** The 3D Tiles version. The version defines the JSON schema for the tileset JSON and the base set of tile formats. */\n version: string;\n /** Application-specific version of this tileset, e.g., for when an existing tileset is updated. */\n tilesetVersion?: string;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n /** Not mentioned in 1.0 spec but some tilesets contain this option */\n gltfUpAxis?: string;\n };\n /** A dictionary object of metadata about per-feature properties. */\n properties?: Record<string, TilesetProperty>;\n /** The error, in meters, introduced if this tileset is not rendered. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /** A tile in a 3D Tiles tileset. */\n root: Tiles3DTileJSON;\n /** Names of 3D Tiles extensions used somewhere in this tileset. */\n extensionsUsed?: string[];\n /** Names of 3D Tiles extensions required to properly load this tileset. */\n extensionsRequired?: string[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** TilesetJSON postprocessed by Tiles3DLoader */\nexport type Tiles3DTilesetJSONPostprocessed = Omit<Tiles3DTilesetJSON, 'root'> & {\n /** @deprecated Loader used */\n loader: LoaderWithParser;\n /** URL used to load a tileset resource */\n url: string;\n /** HTTP request query string */\n queryString: string;\n /** base path that non-absolute paths in tileset are relative to. */\n basePath: string;\n /** tileset type */\n type: TILESET_TYPE.TILES3D;\n /** LOD metric type */\n lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue: number;\n /** Postprocessed root */\n root: Tiles3DTileJSONPostprocessed;\n};\n\n/**\n * A tile in a 3D Tiles tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#tile\n */\nexport type Tiles3DTileJSON = {\n /** A bounding volume that encloses a tile or its content. */\n boundingVolume: Tile3DBoundingVolume;\n /** A bounding volume that encloses a tile or its content. */\n viewerRequestVolume?: object;\n /** The error, in meters, introduced if this tile is rendered and its children are not. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: string;\n /** A floating-point 4x4 affine transformation matrix, stored in column-major order, that transforms the tile's content */\n transform?: number[];\n /** Metadata about the tile's content and a link to the content. */\n content?: Tiles3DTileContentJSON;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSON[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n\n /** 3DTiles v1.1 properties\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.schema.json\n */\n /** This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally. */\n implicitTiling?: ImplicitTilingData;\n};\n\nexport type Tiles3DTileJSONPostprocessed = Omit<Tiles3DTileJSON, 'refine' | 'children'> & {\n /** Unique ID */\n id?: string;\n /** Content full URL */\n contentUrl?: string;\n /** LOD metric type */\n lodMetricType?: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Duplicate of transform */\n transformMatrix?: number[];\n /** Type of tile */\n type?: TILE_TYPE | string;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: TILE_REFINEMENT | string;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSONPostprocessed[];\n};\n\n/** Metadata about the tile's content and a link to the content. */\nexport type Tiles3DTileContentJSON = {\n /** A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file. */\n uri: string;\n /** url doesn't allign the spec but we support it same way as uri */\n url?: string;\n /** A bounding volume that encloses a tile or its content. At least one bounding volume property is required. Bounding volumes include box, region, or sphere. */\n boundingVolume?: Tile3DBoundingVolume;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** A bounding volume that encloses a tile or its content.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#bounding-volume\n */\nexport type Tile3DBoundingVolume = {\n /** An array of 12 numbers that define an oriented bounding box. The first three elements define the x, y, and z values for the center of the box.\n * The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length. The next three elements (indices 6, 7, and 8) define\n * the y axis direction and half-length. The last three elements (indices 9, 10, and 11) define the z axis direction and half-length. */\n box?: number[];\n /** An array of four numbers that define a bounding sphere. The first three elements define the x, y, and z values for the center of the sphere.\n * The last element (with index 3) defines the radius in meters. */\n sphere?: number[];\n /** An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height].\n * Longitudes and latitudes are in radians, and heights are in meters above (or below) the WGS84 ellipsoid. */\n region?: number[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/**\n * A dictionary object of metadata about per-feature properties.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#properties\n */\nexport type TilesetProperty = {\n /** The maximum value of this property of all the features in the tileset. */\n maximum: number;\n /** The minimum value of this property of all the features in the tileset. */\n minimum: number;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\nexport type Tiles3DTileContent = {\n shape: 'tile3d';\n\n /** Common properties */\n byteOffset?: number;\n type?: string;\n featureIds?: null;\n\n /** 3DTile header */\n magic?: number;\n version?: number;\n byteLength?: number;\n\n /** 3DTile tables header */\n header?: {\n featureTableJsonByteLength?: number;\n featureTableBinaryByteLength?: number;\n batchTableJsonByteLength?: number;\n batchTableBinaryByteLength?: number;\n batchLength?: number;\n };\n\n /** 3DTile tables */\n featureTableJson?:\n | {\n BATCH_LENGTH?: number;\n }\n | Record<string, any>;\n featureTableBinary?: Uint8Array;\n batchTableJson?: Record<string, (string | number)[]>;\n batchTableBinary?: Uint8Array;\n rtcCenter?: number[];\n\n /** 3DTile glTF */\n gltfArrayBuffer?: ArrayBuffer;\n gltfByteOffset?: number;\n gltfByteLength?: number;\n rotateYtoZ?: boolean;\n gltfUpAxis?: 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z';\n gltfUrl?: string;\n gpuMemoryUsageInBytes?: number;\n gltf?: GLTFPostprocessed;\n\n /** For Composite tiles */\n tilesLength?: number;\n tiles?: Tiles3DTileContent[];\n\n /** For Instances model and Pointcloud tiles */\n featuresLength?: number;\n\n /** For Instanced model tiles */\n gltfFormat?: number;\n eastNorthUp?: boolean;\n normalUp?: number[];\n normalRight?: number[];\n hasCustomOrientation?: boolean;\n octNormalUp?: number[];\n octNormalRight?: number[];\n instances?: {\n modelMatrix: Matrix4;\n batchId: number;\n }[];\n\n /** For Pointcloud tiles */\n attributes?: {\n positions: null | number[];\n colors:\n | null\n | number[]\n | {type: number; value: Uint8ClampedArray; size: number; normalized: boolean};\n normals: null | number[] | {type: number; size: number; value: Float32Array};\n batchIds: null | number[];\n };\n constantRGBA?: number[];\n isQuantized?: boolean;\n isTranslucent?: boolean;\n isRGB565?: boolean;\n isOctEncoded16P?: boolean;\n pointsLength?: number;\n pointCount?: number;\n batchIds?: number[];\n hasPositions?: boolean;\n hasColors?: boolean;\n hasNormals?: boolean;\n hasBatchIds?: boolean;\n quantizedVolumeScale?: Vector3;\n quantizedVolumeOffset?: Vector3;\n quantizedRange?: number;\n isQuantizedDraco?: boolean;\n octEncodedRange?: number;\n isOctEncodedDraco?: boolean;\n};\n\n/**\n * 3DTILES_implicit_tiling types\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n * JSON Schema v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/subtree.schema.json\n * JSON Schema vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/subtree.schema.json\n */\nexport type Subtree = {\n /** An array of buffers. */\n buffers: GLTFStyleBuffer[];\n /** An array of buffer views. */\n bufferViews: GLTFStyleBufferView[];\n /** The availability of tiles in the subtree. The availability bitstream is a 1D boolean array where tiles are ordered by their level in the subtree and Morton index\n * within that level. A tile's availability is determined by a single bit, 1 meaning a tile exists at that spatial index, and 0 meaning it does not.\n * The number of elements in the array is `(N^subtreeLevels - 1)/(N - 1)` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all tiles. If a non-root tile's availability is 1 its parent\n * tile's availability shall also be 1. `tileAvailability.constant: 0` is disallowed, as subtrees shall have at least one tile.\n */\n tileAvailability: Availability;\n /** It is array by spec but there are tiles that has a single object\n * An array of content availability objects. If the tile has a single content this array will have one element; if the tile has multiple contents -\n * as supported by 3DTILES_multiple_contents and 3D Tiles 1.1 - this array will have multiple elements.\n */\n contentAvailability: Availability | Availability[];\n /** The availability of children subtrees. The availability bitstream is a 1D boolean array where subtrees are ordered by their Morton index in the level of the tree\n * immediately below the bottom row of the subtree. A child subtree's availability is determined by a single bit, 1 meaning a subtree exists at that spatial index,\n * and 0 meaning it does not. The number of elements in the array is `N^subtreeLevels` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all child subtrees. If availability is 0 for all child subtrees,\n * then the tileset does not subdivide further.\n */\n childSubtreeAvailability: Availability;\n // TODO: These are unused properties. Improve types when they are required\n propertyTables: unknown;\n tileMetadata: unknown;\n contentMetadata: unknown;\n subtreeMetadata: unknown;\n};\n\nexport type Availability = {\n /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */\n constant?: 0 | 1;\n /** Index of a buffer view that indicates whether each element is available. The bitstream conforms to the boolean array encoding described\n * in the 3D Metadata specification. If an element is available, its bit is 1, and if it is unavailable, its bit is 0. */\n bitstream?: number;\n /**\n * v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/availability.schema.json\n * vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/availability.schema.json\n * The schemas of vNext and 1.1 are same but there are tiles with `bufferView` property instead of `bitstream`\n */\n bufferView?: number;\n /**\n * Postprocessing property\n * contain availability bits loaded from the bufferView\n */\n explicitBitstream?: ExplicitBitstream;\n};\n\nexport type ExplicitBitstream = Uint8Array;\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subdivision-scheme\n */\nexport type SubdivisionScheme = 'QUADTREE' | 'OCTREE';\n\ntype GLTFStyleBuffer = {\n name: string;\n uri?: string;\n byteLength: number;\n};\n\n/** Subtree buffer view */\nexport type GLTFStyleBufferView = {\n buffer: number;\n byteOffset: number;\n byteLength: number;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n */\nexport type ImplicitTilingExensionData = ImplicitTilingData & {\n /** This property is not part of the schema\n * https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_implicit_tiling/schema/tile.3DTILES_implicit_tiling.schema.json\n * But it can be seen in some test datasets. It is handled as substitute of `availableLevels`\n */\n maximumLevel?: number;\n};\n\n/** 3DTiles v1.1 types */\n\n/**\n * This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally.\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.implicitTiling.schema.json\n * */\ntype ImplicitTilingData = {\n /** A string describing the subdivision scheme used within the tileset. */\n subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;\n /** The number of distinct levels in each subtree. For example, a quadtree with `subtreeLevels = 2` will have subtrees with 5 nodes (one root and 4 children). */\n subtreeLevels: number;\n /** The numbers of the levels in the tree with available tiles. */\n availableLevels: number;\n /** An object describing the location of subtree files. */\n subtrees: {\n /** A template URI pointing to subtree files. A subtree is a fixed-depth (defined by `subtreeLevels`) portion of the tree to keep memory use bounded.\n * The URI of each file is substituted with the subtree root's global level, x, and y. For subdivision scheme `OCTREE`, z shall also be given. Relative paths are relative to the tileset JSON. */\n uri: string;\n };\n};\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright vis.gl contributors\n\nimport type {GLTFPostprocessed, FeatureTableJson} from '@loaders.gl/gltf';\nexport type {FeatureTableJson};\n\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT} from '@loaders.gl/tiles';\n\nexport type B3DMContent = {\n batchTableJson?: FeatureTableJson;\n byteLength: number;\n byteOffset: number;\n cartesianModelMatrix: Matrix4;\n cartesianOrigin: Vector3;\n cartographicModelMatrix: Matrix4;\n cartographicOrigin: Vector3;\n featureIds?: number[] | null;\n featureTableBinary?: Uint8Array;\n featureTableJson?: FeatureTableJson;\n gltf?: GLTFPostprocessed;\n gltfUpAxis: string;\n header: GLTFHeader;\n magic: number;\n modelMatrix: Matrix4;\n rotateYtoZ: boolean;\n rtcCenter: [number, number, number];\n type: string;\n version: number;\n};\n\nexport type GLTFHeader = {\n batchLength?: number;\n batchTableBinaryByteLength: number;\n batchTableJsonByteLength: number;\n featureTableBinaryByteLength: number;\n featureTableJsonByteLength: number;\n};\n\n/**\n * A 3D Tiles tileset JSON\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#property-reference\n */\nexport type Tiles3DTilesetJSON = {\n shape: 'tileset3d';\n /** Metadata about the entire tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#asset\n */\n asset: {\n /** The 3D Tiles version. The version defines the JSON schema for the tileset JSON and the base set of tile formats. */\n version: string;\n /** Application-specific version of this tileset, e.g., for when an existing tileset is updated. */\n tilesetVersion?: string;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n /** Not mentioned in 1.0 spec but some tilesets contain this option */\n gltfUpAxis?: string;\n };\n /** A dictionary object of metadata about per-feature properties. */\n properties?: Record<string, TilesetProperty>;\n /** The error, in meters, introduced if this tileset is not rendered. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /** A tile in a 3D Tiles tileset. */\n root: Tiles3DTileJSON;\n /** Names of 3D Tiles extensions used somewhere in this tileset. */\n extensionsUsed?: string[];\n /** Names of 3D Tiles extensions required to properly load this tileset. */\n extensionsRequired?: string[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** TilesetJSON postprocessed by Tiles3DLoader */\nexport type Tiles3DTilesetJSONPostprocessed = Omit<Tiles3DTilesetJSON, 'root'> & {\n /** @deprecated Loader used */\n loader: LoaderWithParser;\n /** URL used to load a tileset resource */\n url: string;\n /** HTTP request query string */\n queryString: string;\n /** base path that non-absolute paths in tileset are relative to. */\n basePath: string;\n /** tileset type */\n type: TILESET_TYPE.TILES3D;\n /** LOD metric type */\n lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue: number;\n /** Postprocessed root */\n root: Tiles3DTileJSONPostprocessed;\n};\n\n/**\n * A tile in a 3D Tiles tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#tile\n */\nexport type Tiles3DTileJSON = {\n /** A bounding volume that encloses a tile or its content. */\n boundingVolume: Tile3DBoundingVolume;\n /** A bounding volume that encloses a tile or its content. */\n viewerRequestVolume?: object;\n /** The error, in meters, introduced if this tile is rendered and its children are not. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: string;\n /** A floating-point 4x4 affine transformation matrix, stored in column-major order, that transforms the tile's content */\n transform?: number[];\n /** Metadata about the tile's content and a link to the content. */\n content?: Tiles3DTileContentJSON;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSON[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n\n /** 3DTiles v1.1 properties\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.schema.json\n */\n /** This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally. */\n implicitTiling?: ImplicitTilingData;\n};\n\nexport type Tiles3DTileJSONPostprocessed = Omit<Tiles3DTileJSON, 'refine' | 'children'> & {\n /** Unique ID */\n id?: string;\n /** Content full URL */\n contentUrl?: string;\n /** LOD metric type */\n lodMetricType?: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Duplicate of transform */\n transformMatrix?: number[];\n /** Type of tile */\n type?: TILE_TYPE | string;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: TILE_REFINEMENT | string;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSONPostprocessed[];\n};\n\n/** Metadata about the tile's content and a link to the content. */\nexport type Tiles3DTileContentJSON = {\n /** A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file. */\n uri: string;\n /** url doesn't allign the spec but we support it same way as uri */\n url?: string;\n /** A bounding volume that encloses a tile or its content. At least one bounding volume property is required. Bounding volumes include box, region, or sphere. */\n boundingVolume?: Tile3DBoundingVolume;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** A bounding volume that encloses a tile or its content.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#bounding-volume\n */\nexport type Tile3DBoundingVolume = {\n /** An array of 12 numbers that define an oriented bounding box. The first three elements define the x, y, and z values for the center of the box.\n * The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length. The next three elements (indices 6, 7, and 8) define\n * the y axis direction and half-length. The last three elements (indices 9, 10, and 11) define the z axis direction and half-length. */\n box?: number[];\n /** An array of four numbers that define a bounding sphere. The first three elements define the x, y, and z values for the center of the sphere.\n * The last element (with index 3) defines the radius in meters. */\n sphere?: number[];\n /** An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height].\n * Longitudes and latitudes are in radians, and heights are in meters above (or below) the WGS84 ellipsoid. */\n region?: number[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/**\n * A dictionary object of metadata about per-feature properties.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#properties\n */\nexport type TilesetProperty = {\n /** The maximum value of this property of all the features in the tileset. */\n maximum: number;\n /** The minimum value of this property of all the features in the tileset. */\n minimum: number;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\nexport type Tiles3DTileContent = {\n shape: 'tile3d';\n\n /** Common properties */\n byteOffset?: number;\n type?: string;\n featureIds?: null;\n\n /** 3DTile header */\n magic?: number;\n version?: number;\n byteLength?: number;\n\n /** 3DTile tables header */\n header?: {\n featureTableJsonByteLength?: number;\n featureTableBinaryByteLength?: number;\n batchTableJsonByteLength?: number;\n batchTableBinaryByteLength?: number;\n batchLength?: number;\n };\n\n /** 3DTile tables */\n featureTableJson?:\n | {\n BATCH_LENGTH?: number;\n }\n | Record<string, any>;\n featureTableBinary?: Uint8Array;\n batchTableJson?: Record<string, (string | number)[]>;\n batchTableBinary?: Uint8Array;\n rtcCenter?: number[];\n\n /** 3DTile glTF */\n gltfArrayBuffer?: ArrayBuffer;\n gltfByteOffset?: number;\n gltfByteLength?: number;\n rotateYtoZ?: boolean;\n gltfUpAxis?: 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z';\n gltfUrl?: string;\n gpuMemoryUsageInBytes?: number;\n gltf?: GLTFPostprocessed;\n\n /** For Composite tiles */\n tilesLength?: number;\n tiles?: Tiles3DTileContent[];\n\n /** For Instances model and Pointcloud tiles */\n featuresLength?: number;\n\n /** For Instanced model tiles */\n gltfFormat?: number;\n eastNorthUp?: boolean;\n normalUp?: number[];\n normalRight?: number[];\n hasCustomOrientation?: boolean;\n octNormalUp?: number[];\n octNormalRight?: number[];\n instances?: {\n modelMatrix: Matrix4;\n batchId: number;\n }[];\n\n /** For Pointcloud tiles */\n attributes?: {\n positions: null | number[];\n colors:\n | null\n | number[]\n | {type: number; value: Uint8ClampedArray; size: number; normalized: boolean};\n normals: null | number[] | {type: number; size: number; value: Float32Array};\n batchIds: null | number[];\n };\n constantRGBA?: number[];\n isQuantized?: boolean;\n isTranslucent?: boolean;\n isRGB565?: boolean;\n isOctEncoded16P?: boolean;\n pointsLength?: number;\n pointCount?: number;\n batchIds?: number[];\n hasPositions?: boolean;\n hasColors?: boolean;\n hasNormals?: boolean;\n hasBatchIds?: boolean;\n quantizedVolumeScale?: Vector3;\n quantizedVolumeOffset?: Vector3;\n quantizedRange?: number;\n isQuantizedDraco?: boolean;\n octEncodedRange?: number;\n isOctEncodedDraco?: boolean;\n};\n\n/**\n * 3DTILES_implicit_tiling types\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n * JSON Schema v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/subtree.schema.json\n * JSON Schema vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/subtree.schema.json\n */\nexport type Subtree = {\n /** An array of buffers. */\n buffers: GLTFStyleBuffer[];\n /** An array of buffer views. */\n bufferViews: GLTFStyleBufferView[];\n /** The availability of tiles in the subtree. The availability bitstream is a 1D boolean array where tiles are ordered by their level in the subtree and Morton index\n * within that level. A tile's availability is determined by a single bit, 1 meaning a tile exists at that spatial index, and 0 meaning it does not.\n * The number of elements in the array is `(N^subtreeLevels - 1)/(N - 1)` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all tiles. If a non-root tile's availability is 1 its parent\n * tile's availability shall also be 1. `tileAvailability.constant: 0` is disallowed, as subtrees shall have at least one tile.\n */\n tileAvailability: Availability;\n /** It is array by spec but there are tiles that has a single object\n * An array of content availability objects. If the tile has a single content this array will have one element; if the tile has multiple contents -\n * as supported by 3DTILES_multiple_contents and 3D Tiles 1.1 - this array will have multiple elements.\n */\n contentAvailability: Availability | Availability[];\n /** The availability of children subtrees. The availability bitstream is a 1D boolean array where subtrees are ordered by their Morton index in the level of the tree\n * immediately below the bottom row of the subtree. A child subtree's availability is determined by a single bit, 1 meaning a subtree exists at that spatial index,\n * and 0 meaning it does not. The number of elements in the array is `N^subtreeLevels` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all child subtrees. If availability is 0 for all child subtrees,\n * then the tileset does not subdivide further.\n */\n childSubtreeAvailability: Availability;\n // TODO: These are unused properties. Improve types when they are required\n propertyTables?: unknown;\n tileMetadata?: unknown;\n contentMetadata?: unknown;\n subtreeMetadata?: unknown;\n};\n\nexport type Availability = {\n /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */\n constant?: 0 | 1;\n /** Index of a buffer view that indicates whether each element is available. The bitstream conforms to the boolean array encoding described\n * in the 3D Metadata specification. If an element is available, its bit is 1, and if it is unavailable, its bit is 0. */\n bitstream?: number;\n /**\n * v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/availability.schema.json\n * vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/availability.schema.json\n * The schemas of vNext and 1.1 are same but there are tiles with `bufferView` property instead of `bitstream`\n */\n bufferView?: number;\n /**\n * Postprocessing property\n * contain availability bits loaded from the bufferView\n */\n explicitBitstream?: ExplicitBitstream;\n};\n\nexport type ExplicitBitstream = Uint8Array;\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subdivision-scheme\n */\nexport type SubdivisionScheme = 'QUADTREE' | 'OCTREE';\n\ntype GLTFStyleBuffer = {\n name: string;\n uri?: string;\n byteLength: number;\n};\n\n/** Subtree buffer view */\nexport type GLTFStyleBufferView = {\n buffer: number;\n byteOffset: number;\n byteLength: number;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n */\nexport type ImplicitTilingExensionData = ImplicitTilingData & {\n /** This property is not part of the schema\n * https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_implicit_tiling/schema/tile.3DTILES_implicit_tiling.schema.json\n * But it can be seen in some test datasets. It is handled as substitute of `availableLevels`\n */\n maximumLevel?: number;\n};\n\n/** 3DTiles v1.1 types */\n\n/**\n * This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally.\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.implicitTiling.schema.json\n * */\ntype ImplicitTilingData = {\n /** A string describing the subdivision scheme used within the tileset. */\n subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;\n /** The number of distinct levels in each subtree. For example, a quadtree with `subtreeLevels = 2` will have subtrees with 5 nodes (one root and 4 children). */\n subtreeLevels: number;\n /** The numbers of the levels in the tree with available tiles. */\n availableLevels: number;\n /** An object describing the location of subtree files. */\n subtrees: {\n /** A template URI pointing to subtree files. A subtree is a fixed-depth (defined by `subtreeLevels`) portion of the tree to keep memory use bounded.\n * The URI of each file is substituted with the subtree root's global level, x, and y. For subdivision scheme `OCTREE`, z shall also be given. Relative paths are relative to the tileset JSON. */\n uri: string;\n };\n};\n"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/3d-tiles",
3
- "version": "4.1.0-alpha.3",
3
+ "version": "4.1.0-alpha.4",
4
4
  "description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,12 +45,12 @@
45
45
  "build-bundle": "ocular-bundle ./src/index.ts"
46
46
  },
47
47
  "dependencies": {
48
- "@loaders.gl/draco": "4.1.0-alpha.3",
49
- "@loaders.gl/gltf": "4.1.0-alpha.3",
50
- "@loaders.gl/loader-utils": "4.1.0-alpha.3",
51
- "@loaders.gl/math": "4.1.0-alpha.3",
52
- "@loaders.gl/tiles": "4.1.0-alpha.3",
53
- "@loaders.gl/zip": "4.1.0-alpha.3",
48
+ "@loaders.gl/draco": "4.1.0-alpha.4",
49
+ "@loaders.gl/gltf": "4.1.0-alpha.4",
50
+ "@loaders.gl/loader-utils": "4.1.0-alpha.4",
51
+ "@loaders.gl/math": "4.1.0-alpha.4",
52
+ "@loaders.gl/tiles": "4.1.0-alpha.4",
53
+ "@loaders.gl/zip": "4.1.0-alpha.4",
54
54
  "@math.gl/core": "^4.0.0",
55
55
  "@math.gl/geospatial": "^4.0.0",
56
56
  "@probe.gl/log": "^4.0.4",
@@ -59,5 +59,5 @@
59
59
  "peerDependencies": {
60
60
  "@loaders.gl/core": "^4.0.0"
61
61
  },
62
- "gitHead": "b78075a7cb8d4ecd4aac84805ce74b8ceb400cf7"
62
+ "gitHead": "b18ba1d63be704fd021e4470e8ab84175621e62d"
63
63
  }
@@ -76,7 +76,7 @@ export default async function parse3DTilesSubtree(
76
76
  * @param internalBinaryBuffer - subtree binary buffer
77
77
  * @param context - loaders.gl context
78
78
  */
79
- async function loadExplicitBitstream(
79
+ export async function loadExplicitBitstream(
80
80
  subtree: Subtree,
81
81
  availabilityObject: Availability,
82
82
  internalBinaryBuffer: ArrayBuffer,
@@ -113,8 +113,13 @@ async function loadExplicitBitstream(
113
113
  );
114
114
  return;
115
115
  }
116
+
117
+ const bufferStart = subtree.buffers
118
+ .slice(0, bufferView.buffer)
119
+ .reduce((offset, buf) => offset + buf.byteLength, 0);
120
+
116
121
  availabilityObject.explicitBitstream = new Uint8Array(
117
- internalBinaryBuffer,
122
+ internalBinaryBuffer.slice(bufferStart, bufferStart + buffer.byteLength),
118
123
  bufferView.byteOffset,
119
124
  bufferView.byteLength
120
125
  );
package/src/types.ts CHANGED
@@ -325,10 +325,10 @@ export type Subtree = {
325
325
  */
326
326
  childSubtreeAvailability: Availability;
327
327
  // TODO: These are unused properties. Improve types when they are required
328
- propertyTables: unknown;
329
- tileMetadata: unknown;
330
- contentMetadata: unknown;
331
- subtreeMetadata: unknown;
328
+ propertyTables?: unknown;
329
+ tileMetadata?: unknown;
330
+ contentMetadata?: unknown;
331
+ subtreeMetadata?: unknown;
332
332
  };
333
333
 
334
334
  export type Availability = {