@loaders.gl/3d-tiles 3.2.7 → 3.3.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.min.js CHANGED
@@ -14,8 +14,8 @@
14
14
  };
15
15
  var __export = (target, all) => {
16
16
  __markAsModule(target);
17
- for (var name8 in all)
18
- __defProp(target, name8, { get: all[name8], enumerable: true });
17
+ for (var name10 in all)
18
+ __defProp(target, name10, { get: all[name10], enumerable: true });
19
19
  };
20
20
  var __reExport = (target, module2, desc) => {
21
21
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
@@ -64,7 +64,7 @@
64
64
  var DEFAULT_VERSION, VERSION;
65
65
  var init_version = __esm({
66
66
  "../worker-utils/src/lib/env-utils/version.ts"() {
67
- DEFAULT_VERSION = "latest";
67
+ DEFAULT_VERSION = "beta";
68
68
  VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
69
69
  if (typeof __VERSION__ === "undefined") {
70
70
  console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
@@ -252,9 +252,9 @@
252
252
  constructor(props) {
253
253
  this.terminated = false;
254
254
  this._loadableURL = "";
255
- const { name: name8, source, url } = props;
255
+ const { name: name10, source, url } = props;
256
256
  assert3(source || url);
257
- this.name = name8;
257
+ this.name = name10;
258
258
  this.source = source;
259
259
  this.url = url;
260
260
  this.onMessage = NOOP;
@@ -262,7 +262,7 @@
262
262
  this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
263
263
  }
264
264
  static isSupported() {
265
- return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== void 0;
265
+ return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== "undefined" && !isBrowser2;
266
266
  }
267
267
  destroy() {
268
268
  this.onMessage = NOOP;
@@ -379,9 +379,9 @@
379
379
  this.onDebug = props.onDebug;
380
380
  }
381
381
  }
382
- async startJob(name8, onMessage2 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
382
+ async startJob(name10, onMessage2 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
383
383
  const startPromise = new Promise((onStart) => {
384
- this.jobQueue.push({ name: name8, onMessage: onMessage2, onError, onStart });
384
+ this.jobQueue.push({ name: name10, onMessage: onMessage2, onError, onStart });
385
385
  return this;
386
386
  });
387
387
  this._startQueuedJob();
@@ -432,8 +432,8 @@
432
432
  }
433
433
  if (this.count < this._getMaxConcurrency()) {
434
434
  this.count++;
435
- const name8 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
436
- return new WorkerThread({ name: name8, source: this.source, url: this.url });
435
+ const name10 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
436
+ return new WorkerThread({ name: name10, source: this.source, url: this.url });
437
437
  }
438
438
  return null;
439
439
  }
@@ -485,16 +485,16 @@
485
485
  }
486
486
  }
487
487
  getWorkerPool(options) {
488
- const { name: name8, source, url } = options;
489
- let workerPool = this.workerPools.get(name8);
488
+ const { name: name10, source, url } = options;
489
+ let workerPool = this.workerPools.get(name10);
490
490
  if (!workerPool) {
491
491
  workerPool = new WorkerPool({
492
- name: name8,
492
+ name: name10,
493
493
  source,
494
494
  url
495
495
  });
496
496
  workerPool.setProps(this._getWorkerPoolProps());
497
- this.workerPools.set(name8, workerPool);
497
+ this.workerPools.set(name10, workerPool);
498
498
  }
499
499
  return workerPool;
500
500
  }
@@ -536,7 +536,7 @@
536
536
  var init_get_worker_url = __esm({
537
537
  "../worker-utils/src/lib/worker-api/get-worker-url.ts"() {
538
538
  init_assert2();
539
- NPM_TAG = "latest";
539
+ NPM_TAG = "beta";
540
540
  }
541
541
  });
542
542
 
@@ -634,7 +634,7 @@
634
634
  node = __toModule(require_require_utils());
635
635
  init_assert2();
636
636
  init_version();
637
- LATEST = "latest";
637
+ LATEST = "beta";
638
638
  VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
639
639
  loadLibraryPromises = {};
640
640
  }
@@ -663,10 +663,10 @@
663
663
  return loader.worker && options?.worker;
664
664
  }
665
665
  async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
666
- const name8 = loader.id;
666
+ const name10 = loader.id;
667
667
  const url = getWorkerURL(loader, options);
668
668
  const workerFarm = WorkerFarm.getWorkerFarm(options);
669
- const workerPool = workerFarm.getWorkerPool({ name: name8, url });
669
+ const workerPool = workerFarm.getWorkerPool({ name: name10, url });
670
670
  options = JSON.parse(JSON.stringify(options));
671
671
  context = JSON.parse(JSON.stringify(context || {}));
672
672
  const job = await workerPool.startJob("process-on-worker", onMessage.bind(null, parseOnMainThread));
@@ -4670,7 +4670,7 @@
4670
4670
  const propNames = Object.getOwnPropertyNames(proto);
4671
4671
  for (const key of propNames) {
4672
4672
  if (typeof obj[key] === "function") {
4673
- if (!predefined.find((name8) => key === name8)) {
4673
+ if (!predefined.find((name10) => key === name10)) {
4674
4674
  obj[key] = obj[key].bind(obj);
4675
4675
  }
4676
4676
  }
@@ -5564,7 +5564,7 @@
5564
5564
  const propNames = Object.getOwnPropertyNames(proto);
5565
5565
  for (const key of propNames) {
5566
5566
  if (typeof obj[key] === "function") {
5567
- if (!predefined.find((name8) => key === name8)) {
5567
+ if (!predefined.find((name10) => key === name10)) {
5568
5568
  obj[key] = obj[key].bind(obj);
5569
5569
  }
5570
5570
  }
@@ -6585,6 +6585,7 @@
6585
6585
  var DEFAULT_DRACO_OPTIONS, DracoLoader;
6586
6586
  var init_draco_loader = __esm({
6587
6587
  "../draco/src/draco-loader.ts"() {
6588
+ init_src();
6588
6589
  init_version3();
6589
6590
  DEFAULT_DRACO_OPTIONS = {
6590
6591
  draco: {
@@ -6596,7 +6597,7 @@
6596
6597
  };
6597
6598
  DracoLoader = {
6598
6599
  name: "Draco",
6599
- id: "draco",
6600
+ id: isBrowser2 ? "draco" : "draco-nodejs",
6600
6601
  module: "draco",
6601
6602
  shapes: ["mesh"],
6602
6603
  version: VERSION6,
@@ -6692,8 +6693,8 @@
6692
6693
  }
6693
6694
  select(...columnNames) {
6694
6695
  const nameMap = Object.create(null);
6695
- for (const name8 of columnNames) {
6696
- nameMap[name8] = true;
6696
+ for (const name10 of columnNames) {
6697
+ nameMap[name10] = true;
6697
6698
  }
6698
6699
  const selectedFields = this.fields.filter((field) => nameMap[field.name]);
6699
6700
  return new Schema(selectedFields, this.metadata);
@@ -6731,8 +6732,8 @@
6731
6732
  var init_field = __esm({
6732
6733
  "../schema/src/lib/schema/impl/field.ts"() {
6733
6734
  Field = class {
6734
- constructor(name8, type, nullable = false, metadata = new Map()) {
6735
- this.name = name8;
6735
+ constructor(name10, type, nullable = false, metadata = new Map()) {
6736
+ this.name = name10;
6736
6737
  this.type = type;
6737
6738
  this.nullable = nullable;
6738
6739
  this.metadata = metadata;
@@ -7719,8 +7720,8 @@
7719
7720
  }
7720
7721
  throw new Error(ERR_TYPE_CONVERSION);
7721
7722
  }
7722
- static fromName(name8) {
7723
- const glType = NAME_TO_GL_TYPE[name8];
7723
+ static fromName(name10) {
7724
+ const glType = NAME_TO_GL_TYPE[name10];
7724
7725
  if (!glType) {
7725
7726
  throw new Error(ERR_TYPE_CONVERSION);
7726
7727
  }
@@ -8279,10 +8280,10 @@
8279
8280
  }
8280
8281
  return void 0;
8281
8282
  }
8282
- hasProperty(batchId, name8) {
8283
+ hasProperty(batchId, name10) {
8283
8284
  this._checkBatchId(batchId);
8284
- assert2(typeof name8 === "string", name8);
8285
- return defined2(this._properties[name8]) || this._hasPropertyInHierarchy(batchId, name8);
8285
+ assert2(typeof name10 === "string", name10);
8286
+ return defined2(this._properties[name10]) || this._hasPropertyInHierarchy(batchId, name10);
8286
8287
  }
8287
8288
  getPropertyNames(batchId, results) {
8288
8289
  this._checkBatchId(batchId);
@@ -8295,47 +8296,47 @@
8295
8296
  }
8296
8297
  return results;
8297
8298
  }
8298
- getProperty(batchId, name8) {
8299
+ getProperty(batchId, name10) {
8299
8300
  this._checkBatchId(batchId);
8300
- assert2(typeof name8 === "string", name8);
8301
+ assert2(typeof name10 === "string", name10);
8301
8302
  if (this._binaryProperties) {
8302
- const binaryProperty = this._binaryProperties[name8];
8303
+ const binaryProperty = this._binaryProperties[name10];
8303
8304
  if (defined2(binaryProperty)) {
8304
8305
  return this._getBinaryProperty(binaryProperty, batchId);
8305
8306
  }
8306
8307
  }
8307
- const propertyValues = this._properties[name8];
8308
+ const propertyValues = this._properties[name10];
8308
8309
  if (defined2(propertyValues)) {
8309
8310
  return clone3(propertyValues[batchId], true);
8310
8311
  }
8311
8312
  if (this._hierarchy) {
8312
- const hierarchyProperty = this._getHierarchyProperty(batchId, name8);
8313
+ const hierarchyProperty = this._getHierarchyProperty(batchId, name10);
8313
8314
  if (defined2(hierarchyProperty)) {
8314
8315
  return hierarchyProperty;
8315
8316
  }
8316
8317
  }
8317
8318
  return void 0;
8318
8319
  }
8319
- setProperty(batchId, name8, value) {
8320
+ setProperty(batchId, name10, value) {
8320
8321
  const featureCount = this.featureCount;
8321
8322
  this._checkBatchId(batchId);
8322
- assert2(typeof name8 === "string", name8);
8323
+ assert2(typeof name10 === "string", name10);
8323
8324
  if (this._binaryProperties) {
8324
- const binaryProperty = this._binaryProperties[name8];
8325
+ const binaryProperty = this._binaryProperties[name10];
8325
8326
  if (binaryProperty) {
8326
8327
  this._setBinaryProperty(binaryProperty, batchId, value);
8327
8328
  return;
8328
8329
  }
8329
8330
  }
8330
8331
  if (this._hierarchy) {
8331
- if (this._setHierarchyProperty(this, batchId, name8, value)) {
8332
+ if (this._setHierarchyProperty(this, batchId, name10, value)) {
8332
8333
  return;
8333
8334
  }
8334
8335
  }
8335
- let propertyValues = this._properties[name8];
8336
+ let propertyValues = this._properties[name10];
8336
8337
  if (!defined2(propertyValues)) {
8337
- this._properties[name8] = new Array(featureCount);
8338
- propertyValues = this._properties[name8];
8338
+ this._properties[name10] = new Array(featureCount);
8339
+ propertyValues = this._properties[name10];
8339
8340
  }
8340
8341
  propertyValues[batchId] = clone3(value, true);
8341
8342
  }
@@ -8353,21 +8354,21 @@
8353
8354
  }
8354
8355
  _initializeBinaryProperties() {
8355
8356
  let binaryProperties = null;
8356
- for (const name8 in this._properties) {
8357
- const property = this._properties[name8];
8358
- const binaryProperty = this._initializeBinaryProperty(name8, property);
8357
+ for (const name10 in this._properties) {
8358
+ const property = this._properties[name10];
8359
+ const binaryProperty = this._initializeBinaryProperty(name10, property);
8359
8360
  if (binaryProperty) {
8360
8361
  binaryProperties = binaryProperties || {};
8361
- binaryProperties[name8] = binaryProperty;
8362
+ binaryProperties[name10] = binaryProperty;
8362
8363
  }
8363
8364
  }
8364
8365
  return binaryProperties;
8365
8366
  }
8366
- _initializeBinaryProperty(name8, property) {
8367
+ _initializeBinaryProperty(name10, property) {
8367
8368
  if ("byteOffset" in property) {
8368
8369
  const tile3DAccessor = property;
8369
- assert2(this.binary, `Property ${name8} requires a batch table binary.`);
8370
- assert2(tile3DAccessor.type, `Property ${name8} requires a type.`);
8370
+ assert2(this.binary, `Property ${name10} requires a batch table binary.`);
8371
+ assert2(tile3DAccessor.type, `Property ${name10} requires a type.`);
8371
8372
  const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
8372
8373
  return {
8373
8374
  typedArray: accessor.values,
@@ -8378,14 +8379,14 @@
8378
8379
  }
8379
8380
  return null;
8380
8381
  }
8381
- _hasPropertyInHierarchy(batchId, name8) {
8382
+ _hasPropertyInHierarchy(batchId, name10) {
8382
8383
  if (!this._hierarchy) {
8383
8384
  return false;
8384
8385
  }
8385
8386
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
8386
8387
  const classId = hierarchy.classIds[instanceIndex];
8387
8388
  const instances = hierarchy.classes[classId].instances;
8388
- return defined2(instances[name8]);
8389
+ return defined2(instances[name10]);
8389
8390
  });
8390
8391
  return defined2(result);
8391
8392
  }
@@ -8393,21 +8394,21 @@
8393
8394
  traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
8394
8395
  const classId = hierarchy.classIds[instanceIndex];
8395
8396
  const instances = hierarchy.classes[classId].instances;
8396
- for (const name8 in instances) {
8397
- if (instances.hasOwnProperty(name8)) {
8398
- if (results.indexOf(name8) === -1) {
8399
- results.push(name8);
8397
+ for (const name10 in instances) {
8398
+ if (instances.hasOwnProperty(name10)) {
8399
+ if (results.indexOf(name10) === -1) {
8400
+ results.push(name10);
8400
8401
  }
8401
8402
  }
8402
8403
  }
8403
8404
  });
8404
8405
  }
8405
- _getHierarchyProperty(batchId, name8) {
8406
+ _getHierarchyProperty(batchId, name10) {
8406
8407
  return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
8407
8408
  const classId = hierarchy.classIds[instanceIndex];
8408
8409
  const instanceClass = hierarchy.classes[classId];
8409
8410
  const indexInClass = hierarchy.classIndexes[instanceIndex];
8410
- const propertyValues = instanceClass.instances[name8];
8411
+ const propertyValues = instanceClass.instances[name10];
8411
8412
  if (defined2(propertyValues)) {
8412
8413
  if (defined2(propertyValues.typedArray)) {
8413
8414
  return this._getBinaryProperty(propertyValues, indexInClass);
@@ -8417,14 +8418,14 @@
8417
8418
  return null;
8418
8419
  });
8419
8420
  }
8420
- _setHierarchyProperty(batchTable, batchId, name8, value) {
8421
+ _setHierarchyProperty(batchTable, batchId, name10, value) {
8421
8422
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
8422
8423
  const classId = hierarchy.classIds[instanceIndex];
8423
8424
  const instanceClass = hierarchy.classes[classId];
8424
8425
  const indexInClass = hierarchy.classIndexes[instanceIndex];
8425
- const propertyValues = instanceClass.instances[name8];
8426
+ const propertyValues = instanceClass.instances[name10];
8426
8427
  if (defined2(propertyValues)) {
8427
- assert2(instanceIndex === batchId, `Inherited property "${name8}" is read-only.`);
8428
+ assert2(instanceIndex === batchId, `Inherited property "${name10}" is read-only.`);
8428
8429
  if (defined2(propertyValues.typedArray)) {
8429
8430
  this._setBinaryProperty(propertyValues, indexInClass, value);
8430
8431
  } else {
@@ -8876,7 +8877,7 @@
8876
8877
  var VERSION8;
8877
8878
  var init_version5 = __esm({
8878
8879
  "../textures/src/lib/utils/version.ts"() {
8879
- VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
8880
+ VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
8880
8881
  }
8881
8882
  });
8882
8883
 
@@ -9305,11 +9306,12 @@
9305
9306
  var BasisWorkerLoader, BasisLoader;
9306
9307
  var init_basis_loader = __esm({
9307
9308
  "../textures/src/basis-loader.ts"() {
9309
+ init_src();
9308
9310
  init_version5();
9309
9311
  init_parse_basis();
9310
9312
  BasisWorkerLoader = {
9311
9313
  name: "Basis",
9312
- id: "basis",
9314
+ id: isBrowser2 ? "basis" : "basis-nodejs",
9313
9315
  module: "textures",
9314
9316
  version: VERSION8,
9315
9317
  worker: true,
@@ -9948,12 +9950,12 @@
9948
9950
  return extras[key];
9949
9951
  }
9950
9952
  getExtension(extensionName) {
9951
- const isExtension = this.getUsedExtensions().find((name8) => name8 === extensionName);
9953
+ const isExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
9952
9954
  const extensions = this.json.extensions || {};
9953
9955
  return isExtension ? extensions[extensionName] || true : null;
9954
9956
  }
9955
9957
  getRequiredExtension(extensionName) {
9956
- const isRequired = this.getRequiredExtensions().find((name8) => name8 === extensionName);
9958
+ const isRequired = this.getRequiredExtensions().find((name10) => name10 === extensionName);
9957
9959
  return isRequired ? this.getExtension(extensionName) : null;
9958
9960
  }
9959
9961
  getRequiredExtensions() {
@@ -10607,11 +10609,11 @@
10607
10609
  // ../gltf/src/lib/gltf-utils/gltf-attribute-utils.ts
10608
10610
  function getGLTFAccessors(attributes) {
10609
10611
  const accessors = {};
10610
- for (const name8 in attributes) {
10611
- const attribute = attributes[name8];
10612
- if (name8 !== "indices") {
10612
+ for (const name10 in attributes) {
10613
+ const attribute = attributes[name10];
10614
+ if (name10 !== "indices") {
10613
10615
  const glTFAccessor = getGLTFAccessor(attribute);
10614
- accessors[name8] = glTFAccessor;
10616
+ accessors[name10] = glTFAccessor;
10615
10617
  }
10616
10618
  }
10617
10619
  return accessors;
@@ -10774,14 +10776,201 @@
10774
10776
  }
10775
10777
  });
10776
10778
 
10779
+ // ../gltf/src/lib/gltf-utils/gltf-constants.ts
10780
+ var COMPONENTS, BYTES;
10781
+ var init_gltf_constants = __esm({
10782
+ "../gltf/src/lib/gltf-utils/gltf-constants.ts"() {
10783
+ COMPONENTS = {
10784
+ SCALAR: 1,
10785
+ VEC2: 2,
10786
+ VEC3: 3,
10787
+ VEC4: 4,
10788
+ MAT2: 4,
10789
+ MAT3: 9,
10790
+ MAT4: 16
10791
+ };
10792
+ BYTES = {
10793
+ 5120: 1,
10794
+ 5121: 1,
10795
+ 5122: 2,
10796
+ 5123: 2,
10797
+ 5125: 4,
10798
+ 5126: 4
10799
+ };
10800
+ }
10801
+ });
10802
+
10803
+ // ../gltf/src/lib/extensions/KHR_texture_transform.ts
10804
+ var KHR_texture_transform_exports = {};
10805
+ __export(KHR_texture_transform_exports, {
10806
+ decode: () => decode4,
10807
+ name: () => name5
10808
+ });
10809
+ async function decode4(gltfData, options) {
10810
+ const gltfScenegraph = new GLTFScenegraph(gltfData);
10811
+ const extension = gltfScenegraph.getExtension(EXT_MESHOPT_TRANSFORM);
10812
+ if (!extension) {
10813
+ return;
10814
+ }
10815
+ const materials = gltfData.json.materials || [];
10816
+ for (let i2 = 0; i2 < materials.length; i2++) {
10817
+ transformTexCoords(i2, gltfData);
10818
+ }
10819
+ }
10820
+ function transformTexCoords(materialIndex, gltfData) {
10821
+ const processedTexCoords = [];
10822
+ const material = gltfData.json.materials?.[materialIndex];
10823
+ const baseColorTexture = material?.pbrMetallicRoughness?.baseColorTexture;
10824
+ if (baseColorTexture) {
10825
+ transformPrimitives(gltfData, materialIndex, baseColorTexture, processedTexCoords);
10826
+ }
10827
+ const emisiveTexture = material?.emissiveTexture;
10828
+ if (emisiveTexture) {
10829
+ transformPrimitives(gltfData, materialIndex, emisiveTexture, processedTexCoords);
10830
+ }
10831
+ const normalTexture = material?.normalTexture;
10832
+ if (normalTexture) {
10833
+ transformPrimitives(gltfData, materialIndex, normalTexture, processedTexCoords);
10834
+ }
10835
+ const occlusionTexture = material?.occlusionTexture;
10836
+ if (occlusionTexture) {
10837
+ transformPrimitives(gltfData, materialIndex, occlusionTexture, processedTexCoords);
10838
+ }
10839
+ const metallicRoughnessTexture = material?.pbrMetallicRoughness?.metallicRoughnessTexture;
10840
+ if (metallicRoughnessTexture) {
10841
+ transformPrimitives(gltfData, materialIndex, metallicRoughnessTexture, processedTexCoords);
10842
+ }
10843
+ }
10844
+ function transformPrimitives(gltfData, materialIndex, texture, processedTexCoords) {
10845
+ const transformParameters = getTransformParameters(texture, processedTexCoords);
10846
+ if (!transformParameters) {
10847
+ return;
10848
+ }
10849
+ const meshes = gltfData.json.meshes || [];
10850
+ for (const mesh of meshes) {
10851
+ for (const primitive of mesh.primitives) {
10852
+ const material = primitive.material;
10853
+ if (Number.isFinite(material) && materialIndex === material) {
10854
+ transformPrimitive(gltfData, primitive, transformParameters);
10855
+ }
10856
+ }
10857
+ }
10858
+ }
10859
+ function getTransformParameters(texture, processedTexCoords) {
10860
+ const textureInfo = texture.extensions?.[EXT_MESHOPT_TRANSFORM];
10861
+ const { texCoord: originalTexCoord = 0 } = texture;
10862
+ const { texCoord = originalTexCoord } = textureInfo;
10863
+ const isProcessed = processedTexCoords.findIndex(([original, newTexCoord]) => original === originalTexCoord && newTexCoord === texCoord) !== -1;
10864
+ if (!isProcessed) {
10865
+ const matrix = makeTransformationMatrix(textureInfo);
10866
+ if (originalTexCoord !== texCoord) {
10867
+ texture.texCoord = texCoord;
10868
+ }
10869
+ processedTexCoords.push([originalTexCoord, texCoord]);
10870
+ return { originalTexCoord, texCoord, matrix };
10871
+ }
10872
+ return null;
10873
+ }
10874
+ function transformPrimitive(gltfData, primitive, transformParameters) {
10875
+ const { originalTexCoord, texCoord, matrix } = transformParameters;
10876
+ const texCoordAccessor = primitive.attributes[`TEXCOORD_${originalTexCoord}`];
10877
+ if (Number.isFinite(texCoordAccessor)) {
10878
+ const accessor = gltfData.json.accessors?.[texCoordAccessor];
10879
+ if (accessor && accessor.bufferView) {
10880
+ const bufferView = gltfData.json.bufferViews?.[accessor.bufferView];
10881
+ if (bufferView) {
10882
+ const { arrayBuffer, byteOffset: bufferByteOffset } = gltfData.buffers[bufferView.buffer];
10883
+ const byteOffset = (bufferByteOffset || 0) + (accessor.byteOffset || 0) + (bufferView.byteOffset || 0);
10884
+ const { ArrayType, length: length4 } = getAccessorArrayTypeAndLength(accessor, bufferView);
10885
+ const bytes = BYTES[accessor.componentType];
10886
+ const components = COMPONENTS[accessor.type];
10887
+ const elementAddressScale = bufferView.byteStride || bytes * components;
10888
+ const result = new Float32Array(length4);
10889
+ for (let i2 = 0; i2 < accessor.count; i2++) {
10890
+ const uv = new ArrayType(arrayBuffer, byteOffset + i2 * elementAddressScale, 2);
10891
+ scratchVector5.set(uv[0], uv[1], 1);
10892
+ scratchVector5.transformByMatrix3(matrix);
10893
+ result.set([scratchVector5[0], scratchVector5[1]], i2 * components);
10894
+ }
10895
+ if (originalTexCoord === texCoord) {
10896
+ updateGltf(accessor, bufferView, gltfData.buffers, result);
10897
+ } else {
10898
+ createAttribute(texCoord, accessor, primitive, gltfData, result);
10899
+ }
10900
+ }
10901
+ }
10902
+ }
10903
+ }
10904
+ function updateGltf(accessor, bufferView, buffers, newTexCoordArray) {
10905
+ accessor.componentType = 5126;
10906
+ buffers.push({
10907
+ arrayBuffer: newTexCoordArray.buffer,
10908
+ byteOffset: 0,
10909
+ byteLength: newTexCoordArray.buffer.byteLength
10910
+ });
10911
+ bufferView.buffer = buffers.length - 1;
10912
+ bufferView.byteLength = newTexCoordArray.buffer.byteLength;
10913
+ bufferView.byteOffset = 0;
10914
+ delete bufferView.byteStride;
10915
+ }
10916
+ function createAttribute(newTexCoord, originalAccessor, primitive, gltfData, newTexCoordArray) {
10917
+ gltfData.buffers.push({
10918
+ arrayBuffer: newTexCoordArray.buffer,
10919
+ byteOffset: 0,
10920
+ byteLength: newTexCoordArray.buffer.byteLength
10921
+ });
10922
+ const bufferViews = gltfData.json.bufferViews;
10923
+ if (!bufferViews) {
10924
+ return;
10925
+ }
10926
+ bufferViews.push({
10927
+ buffer: gltfData.buffers.length - 1,
10928
+ byteLength: newTexCoordArray.buffer.byteLength,
10929
+ byteOffset: 0
10930
+ });
10931
+ const accessors = gltfData.json.accessors;
10932
+ if (!accessors) {
10933
+ return;
10934
+ }
10935
+ accessors.push({
10936
+ bufferView: bufferViews?.length - 1,
10937
+ byteOffset: 0,
10938
+ componentType: 5126,
10939
+ count: originalAccessor.count,
10940
+ type: "VEC2"
10941
+ });
10942
+ primitive.attributes[`TEXCOORD_${newTexCoord}`] = accessors.length - 1;
10943
+ }
10944
+ function makeTransformationMatrix(extensionData) {
10945
+ const { offset = [0, 0], rotation = 0, scale: scale5 = [1, 1] } = extensionData;
10946
+ const translationMatirx = new Matrix3().set(1, 0, 0, 0, 1, 0, offset[0], offset[1], 1);
10947
+ const rotationMatirx = scratchRotationMatrix.set(Math.cos(rotation), Math.sin(rotation), 0, -Math.sin(rotation), Math.cos(rotation), 0, 0, 0, 1);
10948
+ const scaleMatrix = scratchScaleMatrix.set(scale5[0], 0, 0, 0, scale5[1], 0, 0, 0, 1);
10949
+ return translationMatirx.multiplyRight(rotationMatirx).multiplyRight(scaleMatrix);
10950
+ }
10951
+ var EXT_MESHOPT_TRANSFORM, name5, scratchVector5, scratchRotationMatrix, scratchScaleMatrix;
10952
+ var init_KHR_texture_transform = __esm({
10953
+ "../gltf/src/lib/extensions/KHR_texture_transform.ts"() {
10954
+ init_esm();
10955
+ init_gltf_utils();
10956
+ init_gltf_constants();
10957
+ init_gltf_scenegraph();
10958
+ EXT_MESHOPT_TRANSFORM = "KHR_texture_transform";
10959
+ name5 = EXT_MESHOPT_TRANSFORM;
10960
+ scratchVector5 = new Vector3();
10961
+ scratchRotationMatrix = new Matrix3();
10962
+ scratchScaleMatrix = new Matrix3();
10963
+ }
10964
+ });
10965
+
10777
10966
  // ../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts
10778
10967
  var KHR_lights_punctual_exports = {};
10779
10968
  __export(KHR_lights_punctual_exports, {
10780
- decode: () => decode4,
10969
+ decode: () => decode5,
10781
10970
  encode: () => encode2,
10782
- name: () => name5
10971
+ name: () => name6
10783
10972
  });
10784
- async function decode4(gltfData) {
10973
+ async function decode5(gltfData) {
10785
10974
  const gltfScenegraph = new GLTFScenegraph(gltfData);
10786
10975
  const { json } = gltfScenegraph;
10787
10976
  const extension = gltfScenegraph.getExtension(KHR_LIGHTS_PUNCTUAL);
@@ -10814,24 +11003,24 @@
10814
11003
  delete gltfScenegraph.json.lights;
10815
11004
  }
10816
11005
  }
10817
- var KHR_LIGHTS_PUNCTUAL, name5;
11006
+ var KHR_LIGHTS_PUNCTUAL, name6;
10818
11007
  var init_KHR_lights_punctual = __esm({
10819
11008
  "../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts"() {
10820
11009
  init_assert8();
10821
11010
  init_gltf_scenegraph();
10822
11011
  KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
10823
- name5 = KHR_LIGHTS_PUNCTUAL;
11012
+ name6 = KHR_LIGHTS_PUNCTUAL;
10824
11013
  }
10825
11014
  });
10826
11015
 
10827
11016
  // ../gltf/src/lib/extensions/deprecated/KHR_materials_unlit.ts
10828
11017
  var KHR_materials_unlit_exports = {};
10829
11018
  __export(KHR_materials_unlit_exports, {
10830
- decode: () => decode5,
11019
+ decode: () => decode6,
10831
11020
  encode: () => encode3,
10832
- name: () => name6
11021
+ name: () => name7
10833
11022
  });
10834
- async function decode5(gltfData) {
11023
+ async function decode6(gltfData) {
10835
11024
  const gltfScenegraph = new GLTFScenegraph(gltfData);
10836
11025
  const { json } = gltfScenegraph;
10837
11026
  gltfScenegraph.removeExtension(KHR_MATERIALS_UNLIT);
@@ -10856,23 +11045,23 @@
10856
11045
  }
10857
11046
  }
10858
11047
  }
10859
- var KHR_MATERIALS_UNLIT, name6;
11048
+ var KHR_MATERIALS_UNLIT, name7;
10860
11049
  var init_KHR_materials_unlit = __esm({
10861
11050
  "../gltf/src/lib/extensions/deprecated/KHR_materials_unlit.ts"() {
10862
11051
  init_gltf_scenegraph();
10863
11052
  KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
10864
- name6 = KHR_MATERIALS_UNLIT;
11053
+ name7 = KHR_MATERIALS_UNLIT;
10865
11054
  }
10866
11055
  });
10867
11056
 
10868
11057
  // ../gltf/src/lib/extensions/deprecated/KHR_techniques_webgl.ts
10869
11058
  var KHR_techniques_webgl_exports = {};
10870
11059
  __export(KHR_techniques_webgl_exports, {
10871
- decode: () => decode6,
11060
+ decode: () => decode7,
10872
11061
  encode: () => encode4,
10873
- name: () => name7
11062
+ name: () => name8
10874
11063
  });
10875
- async function decode6(gltfData) {
11064
+ async function decode7(gltfData) {
10876
11065
  const gltfScenegraph = new GLTFScenegraph(gltfData);
10877
11066
  const { json } = gltfScenegraph;
10878
11067
  const extension = gltfScenegraph.getExtension(KHR_TECHNIQUES_WEBGL);
@@ -10924,12 +11113,97 @@
10924
11113
  });
10925
11114
  return values;
10926
11115
  }
10927
- var KHR_TECHNIQUES_WEBGL, name7;
11116
+ var KHR_TECHNIQUES_WEBGL, name8;
10928
11117
  var init_KHR_techniques_webgl = __esm({
10929
11118
  "../gltf/src/lib/extensions/deprecated/KHR_techniques_webgl.ts"() {
10930
11119
  init_gltf_scenegraph();
10931
11120
  KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
10932
- name7 = KHR_TECHNIQUES_WEBGL;
11121
+ name8 = KHR_TECHNIQUES_WEBGL;
11122
+ }
11123
+ });
11124
+
11125
+ // ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
11126
+ var EXT_feature_metadata_exports = {};
11127
+ __export(EXT_feature_metadata_exports, {
11128
+ decode: () => decode8,
11129
+ name: () => name9
11130
+ });
11131
+ async function decode8(gltfData) {
11132
+ const scenegraph = new GLTFScenegraph(gltfData);
11133
+ decodeExtFeatureMetadata(scenegraph);
11134
+ }
11135
+ function decodeExtFeatureMetadata(scenegraph) {
11136
+ const extension = scenegraph.getExtension(EXT_FEATURE_METADATA);
11137
+ const schemaClasses = extension?.schema?.classes;
11138
+ const featureTables = extension?.featureTables;
11139
+ const featureTextures = extension?.featureTextures;
11140
+ if (featureTextures) {
11141
+ console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');
11142
+ }
11143
+ if (schemaClasses && featureTables) {
11144
+ for (const schemaName in schemaClasses) {
11145
+ const schemaClass = schemaClasses[schemaName];
11146
+ const featureTable = findFeatureTableByName(featureTables, schemaName);
11147
+ if (featureTable) {
11148
+ handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
11149
+ }
11150
+ }
11151
+ }
11152
+ }
11153
+ function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
11154
+ for (const propertyName in schemaClass.properties) {
11155
+ const schemaProperty = schemaClass.properties[propertyName];
11156
+ const featureTableProperty = featureTable?.properties?.[propertyName];
11157
+ const numberOfFeatures = featureTable.count;
11158
+ if (featureTableProperty) {
11159
+ const data = getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
11160
+ featureTableProperty.data = data;
11161
+ }
11162
+ }
11163
+ }
11164
+ function getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
11165
+ const bufferView = featureTableProperty.bufferView;
11166
+ let data = scenegraph.getTypedArrayForBufferView(bufferView);
11167
+ switch (schemaProperty.type) {
11168
+ case "STRING": {
11169
+ const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView;
11170
+ const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);
11171
+ data = getStringAttributes(data, offsetsData, numberOfFeatures);
11172
+ break;
11173
+ }
11174
+ default:
11175
+ }
11176
+ return data;
11177
+ }
11178
+ function findFeatureTableByName(featureTables, schemaClassName) {
11179
+ for (const featureTableName in featureTables) {
11180
+ const featureTable = featureTables[featureTableName];
11181
+ if (featureTable.class === schemaClassName) {
11182
+ return featureTable;
11183
+ }
11184
+ }
11185
+ return null;
11186
+ }
11187
+ function getStringAttributes(data, offsetsData, stringsCount) {
11188
+ const stringsArray = [];
11189
+ const textDecoder = new TextDecoder("utf8");
11190
+ let stringOffset = 0;
11191
+ const bytesPerStringSize = 4;
11192
+ for (let index = 0; index < stringsCount; index++) {
11193
+ const stringByteSize = offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];
11194
+ const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
11195
+ const stringAttribute = textDecoder.decode(stringData);
11196
+ stringsArray.push(stringAttribute);
11197
+ stringOffset += stringByteSize;
11198
+ }
11199
+ return stringsArray;
11200
+ }
11201
+ var EXT_FEATURE_METADATA, name9;
11202
+ var init_EXT_feature_metadata = __esm({
11203
+ "../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts"() {
11204
+ init_gltf_scenegraph();
11205
+ EXT_FEATURE_METADATA = "EXT_feature_metadata";
11206
+ name9 = EXT_FEATURE_METADATA;
10933
11207
  }
10934
11208
  });
10935
11209
 
@@ -10958,9 +11232,11 @@
10958
11232
  init_EXT_texture_webp();
10959
11233
  init_KHR_texture_basisu();
10960
11234
  init_KHR_draco_mesh_compression();
11235
+ init_KHR_texture_transform();
10961
11236
  init_KHR_lights_punctual();
10962
11237
  init_KHR_materials_unlit();
10963
11238
  init_KHR_techniques_webgl();
11239
+ init_EXT_feature_metadata();
10964
11240
  EXTENSIONS2 = [
10965
11241
  EXT_meshopt_compression_exports,
10966
11242
  EXT_texture_webp_exports,
@@ -10968,7 +11244,9 @@
10968
11244
  KHR_draco_mesh_compression_exports,
10969
11245
  KHR_lights_punctual_exports,
10970
11246
  KHR_materials_unlit_exports,
10971
- KHR_techniques_webgl_exports
11247
+ KHR_techniques_webgl_exports,
11248
+ KHR_texture_transform_exports,
11249
+ EXT_feature_metadata_exports
10972
11250
  ];
10973
11251
  }
10974
11252
  });
@@ -11199,20 +11477,20 @@
11199
11477
 
11200
11478
  // ../gltf/src/lib/api/post-process-gltf.ts
11201
11479
  function getBytesFromComponentType(componentType) {
11202
- return BYTES[componentType];
11480
+ return BYTES2[componentType];
11203
11481
  }
11204
11482
  function getSizeFromAccessorType(type) {
11205
- return COMPONENTS[type];
11483
+ return COMPONENTS2[type];
11206
11484
  }
11207
11485
  function postProcessGLTF(gltf, options) {
11208
11486
  return new GLTFPostProcessor().postProcess(gltf, options);
11209
11487
  }
11210
- var COMPONENTS, BYTES, GL_SAMPLER, SAMPLER_PARAMETER_GLTF_TO_GL, DEFAULT_SAMPLER, GLTFPostProcessor;
11488
+ var COMPONENTS2, BYTES2, GL_SAMPLER, SAMPLER_PARAMETER_GLTF_TO_GL, DEFAULT_SAMPLER, GLTFPostProcessor;
11211
11489
  var init_post_process_gltf = __esm({
11212
11490
  "../gltf/src/lib/api/post-process-gltf.ts"() {
11213
11491
  init_assert8();
11214
11492
  init_gltf_utils();
11215
- COMPONENTS = {
11493
+ COMPONENTS2 = {
11216
11494
  SCALAR: 1,
11217
11495
  VEC2: 2,
11218
11496
  VEC3: 3,
@@ -11221,7 +11499,7 @@
11221
11499
  MAT3: 9,
11222
11500
  MAT4: 16
11223
11501
  };
11224
- BYTES = {
11502
+ BYTES2 = {
11225
11503
  5120: 1,
11226
11504
  5121: 1,
11227
11505
  5122: 2,
@@ -12160,8 +12438,8 @@
12160
12438
  }
12161
12439
  return subtree;
12162
12440
  }
12163
- async function getExplicitBitstream(subtree, name8, internalBinaryBuffer) {
12164
- const bufferViewIndex = subtree[name8].bufferView;
12441
+ async function getExplicitBitstream(subtree, name10, internalBinaryBuffer) {
12442
+ const bufferViewIndex = subtree[name10].bufferView;
12165
12443
  const bufferView = subtree.bufferViews[bufferViewIndex];
12166
12444
  const buffer = subtree.buffers[bufferView.buffer];
12167
12445
  if (buffer.uri) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAGA;;AAGA;;AACA;;AAGA;;AACA","sourcesContent":["// LOADERS\nexport {Tiles3DLoader} from './tiles-3d-loader';\nexport {CesiumIonLoader} from './cesium-ion-loader';\nexport {Tile3DSubtreeLoader} from './tile-3d-subtree-loader';\n\n// WRITERS\nexport {Tile3DWriter} from './tile-3d-writer';\n\n// CLASSES\nexport {default as Tile3DFeatureTable} from './lib/classes/tile-3d-feature-table';\nexport {default as Tile3DBatchTable} from './lib/classes/tile-3d-batch-table';\n\n// EXPERIMENTAL\nexport {TILE3D_TYPE} from './lib/constants';\nexport {getIonTilesetMetadata as _getIonTilesetMetadata} from './lib/ion/ion';\nexport type {BatchTableJson, B3DMContent, Node3D} from './types';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAGA;;AAGA;;AACA;;AAGA;;AACA","sourcesContent":["// LOADERS\nexport {Tiles3DLoader} from './tiles-3d-loader';\nexport {CesiumIonLoader} from './cesium-ion-loader';\nexport {Tile3DSubtreeLoader} from './tile-3d-subtree-loader';\n\n// WRITERS\nexport {Tile3DWriter} from './tile-3d-writer';\n\n// CLASSES\nexport {default as Tile3DFeatureTable} from './lib/classes/tile-3d-feature-table';\nexport {default as Tile3DBatchTable} from './lib/classes/tile-3d-batch-table';\n\n// EXPERIMENTAL\nexport {TILE3D_TYPE} from './lib/constants';\nexport {getIonTilesetMetadata as _getIonTilesetMetadata} from './lib/ion/ion';\nexport type {FeatureTableJson, B3DMContent, Node3D} from './types';\n"],"file":"index.js"}
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VERSION = void 0;
7
- var VERSION = typeof "3.2.7" !== 'undefined' ? "3.2.7" : 'latest';
7
+ var VERSION = typeof "3.3.0-alpha.3" !== 'undefined' ? "3.3.0-alpha.3" : 'latest';
8
8
  exports.VERSION = VERSION;
9
9
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/utils/version.ts"],"names":["VERSION"],"mappings":";;;;;;AAGO,IAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE","sourcesContent":["// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n"],"file":"version.js"}
1
+ {"version":3,"sources":["../../../../src/lib/utils/version.ts"],"names":["VERSION"],"mappings":";;;;;;AAGO,IAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE","sourcesContent":["// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n"],"file":"version.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":["Tiles3DLoader","CesiumIonLoader","Tile3DSubtreeLoader","Tile3DWriter","default","Tile3DFeatureTable","Tile3DBatchTable","TILE3D_TYPE","getIonTilesetMetadata","_getIonTilesetMetadata"],"mappings":"AACA,SAAQA,aAAR,QAA4B,mBAA5B;AACA,SAAQC,eAAR,QAA8B,qBAA9B;AACA,SAAQC,mBAAR,QAAkC,0BAAlC;AAGA,SAAQC,YAAR,QAA2B,kBAA3B;AAGA,SAAQC,OAAO,IAAIC,kBAAnB,QAA4C,qCAA5C;AACA,SAAQD,OAAO,IAAIE,gBAAnB,QAA0C,mCAA1C;AAGA,SAAQC,WAAR,QAA0B,iBAA1B;AACA,SAAQC,qBAAqB,IAAIC,sBAAjC,QAA8D,eAA9D","sourcesContent":["// LOADERS\nexport {Tiles3DLoader} from './tiles-3d-loader';\nexport {CesiumIonLoader} from './cesium-ion-loader';\nexport {Tile3DSubtreeLoader} from './tile-3d-subtree-loader';\n\n// WRITERS\nexport {Tile3DWriter} from './tile-3d-writer';\n\n// CLASSES\nexport {default as Tile3DFeatureTable} from './lib/classes/tile-3d-feature-table';\nexport {default as Tile3DBatchTable} from './lib/classes/tile-3d-batch-table';\n\n// EXPERIMENTAL\nexport {TILE3D_TYPE} from './lib/constants';\nexport {getIonTilesetMetadata as _getIonTilesetMetadata} from './lib/ion/ion';\nexport type {BatchTableJson, B3DMContent, Node3D} from './types';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":["Tiles3DLoader","CesiumIonLoader","Tile3DSubtreeLoader","Tile3DWriter","default","Tile3DFeatureTable","Tile3DBatchTable","TILE3D_TYPE","getIonTilesetMetadata","_getIonTilesetMetadata"],"mappings":"AACA,SAAQA,aAAR,QAA4B,mBAA5B;AACA,SAAQC,eAAR,QAA8B,qBAA9B;AACA,SAAQC,mBAAR,QAAkC,0BAAlC;AAGA,SAAQC,YAAR,QAA2B,kBAA3B;AAGA,SAAQC,OAAO,IAAIC,kBAAnB,QAA4C,qCAA5C;AACA,SAAQD,OAAO,IAAIE,gBAAnB,QAA0C,mCAA1C;AAGA,SAAQC,WAAR,QAA0B,iBAA1B;AACA,SAAQC,qBAAqB,IAAIC,sBAAjC,QAA8D,eAA9D","sourcesContent":["// LOADERS\nexport {Tiles3DLoader} from './tiles-3d-loader';\nexport {CesiumIonLoader} from './cesium-ion-loader';\nexport {Tile3DSubtreeLoader} from './tile-3d-subtree-loader';\n\n// WRITERS\nexport {Tile3DWriter} from './tile-3d-writer';\n\n// CLASSES\nexport {default as Tile3DFeatureTable} from './lib/classes/tile-3d-feature-table';\nexport {default as Tile3DBatchTable} from './lib/classes/tile-3d-batch-table';\n\n// EXPERIMENTAL\nexport {TILE3D_TYPE} from './lib/constants';\nexport {getIonTilesetMetadata as _getIonTilesetMetadata} from './lib/ion/ion';\nexport type {FeatureTableJson, B3DMContent, Node3D} from './types';\n"],"file":"index.js"}
@@ -1,2 +1,2 @@
1
- export const VERSION = typeof "3.2.7" !== 'undefined' ? "3.2.7" : 'latest';
1
+ export const VERSION = typeof "3.3.0-alpha.3" !== 'undefined' ? "3.3.0-alpha.3" : 'latest';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/utils/version.ts"],"names":["VERSION"],"mappings":"AAGA,OAAO,MAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE","sourcesContent":["// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n"],"file":"version.js"}
1
+ {"version":3,"sources":["../../../../src/lib/utils/version.ts"],"names":["VERSION"],"mappings":"AAGA,OAAO,MAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE","sourcesContent":["// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n"],"file":"version.js"}
package/dist/index.d.ts CHANGED
@@ -6,5 +6,5 @@ export { default as Tile3DFeatureTable } from './lib/classes/tile-3d-feature-tab
6
6
  export { default as Tile3DBatchTable } from './lib/classes/tile-3d-batch-table';
7
7
  export { TILE3D_TYPE } from './lib/constants';
8
8
  export { getIonTilesetMetadata as _getIonTilesetMetadata } from './lib/ion/ion';
9
- export type { BatchTableJson, B3DMContent, Node3D } from './types';
9
+ export type { FeatureTableJson, B3DMContent, Node3D } from './types';
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AAG9E,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,qBAAqB,IAAI,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAC9E,YAAY,EAAC,cAAc,EAAE,WAAW,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AAG9E,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,qBAAqB,IAAI,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAC9E,YAAY,EAAC,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { GLTFPostprocessed } from '@loaders.gl/gltf';
2
2
  import { Matrix4, Vector3 } from '@math.gl/core';
3
- export declare type BatchTableJson = {
3
+ export declare type FeatureTableJson = {
4
4
  [key: string]: any[];
5
5
  };
6
6
  export declare type B3DMContent = {
7
- batchTableJson?: BatchTableJson;
7
+ batchTableJson?: FeatureTableJson;
8
8
  byteLength: number;
9
9
  byteOffset: number;
10
10
  cartesianModelMatrix: Matrix4;
@@ -13,7 +13,7 @@ export declare type B3DMContent = {
13
13
  cartographicOrigin: Vector3;
14
14
  featureIds?: number[] | null;
15
15
  featureTableBinary?: Uint8Array;
16
- featureTableJson?: BatchTableJson;
16
+ featureTableJson?: FeatureTableJson;
17
17
  gltf?: GLTFPostprocessed;
18
18
  gltfUpAxis: string;
19
19
  header: GLTFHeader;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE/C,oBAAY,cAAc,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;CACtB,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7B,kBAAkB,CAAC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AEF,oBAAY,iBAAiB,GAAG,UAAU,CAAC;AAE3C;;GAEG;AACH,oBAAY,iBAAiB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEtD,aAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,aAAK,UAAU,GAAG;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/3d-tiles",
3
- "version": "3.2.7",
3
+ "version": "3.3.0-alpha.3",
4
4
  "description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -34,16 +34,16 @@
34
34
  "build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
35
35
  },
36
36
  "dependencies": {
37
- "@loaders.gl/draco": "3.2.7",
38
- "@loaders.gl/gltf": "3.2.7",
39
- "@loaders.gl/loader-utils": "3.2.7",
40
- "@loaders.gl/math": "3.2.7",
41
- "@loaders.gl/tiles": "3.2.7",
37
+ "@loaders.gl/draco": "3.3.0-alpha.3",
38
+ "@loaders.gl/gltf": "3.3.0-alpha.3",
39
+ "@loaders.gl/loader-utils": "3.3.0-alpha.3",
40
+ "@loaders.gl/math": "3.3.0-alpha.3",
41
+ "@loaders.gl/tiles": "3.3.0-alpha.3",
42
42
  "@math.gl/core": "^3.5.1",
43
43
  "@math.gl/geospatial": "^3.5.1"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@loaders.gl/core": "^3.2.0"
47
47
  },
48
- "gitHead": "78b3cc95d3159ac4fc99bd1474ab67008175f2f8"
48
+ "gitHead": "232fdc52fcbee10d8322fd8a4589680943f10517"
49
49
  }
package/src/index.ts CHANGED
@@ -13,4 +13,4 @@ export {default as Tile3DBatchTable} from './lib/classes/tile-3d-batch-table';
13
13
  // EXPERIMENTAL
14
14
  export {TILE3D_TYPE} from './lib/constants';
15
15
  export {getIonTilesetMetadata as _getIonTilesetMetadata} from './lib/ion/ion';
16
- export type {BatchTableJson, B3DMContent, Node3D} from './types';
16
+ export type {FeatureTableJson, B3DMContent, Node3D} from './types';
package/src/types.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import type {GLTFPostprocessed} from '@loaders.gl/gltf';
2
2
  import {Matrix4, Vector3} from '@math.gl/core';
3
3
 
4
- export type BatchTableJson = {
4
+ export type FeatureTableJson = {
5
5
  [key: string]: any[];
6
6
  };
7
7
 
8
8
  export type B3DMContent = {
9
- batchTableJson?: BatchTableJson;
9
+ batchTableJson?: FeatureTableJson;
10
10
  byteLength: number;
11
11
  byteOffset: number;
12
12
  cartesianModelMatrix: Matrix4;
@@ -15,7 +15,7 @@ export type B3DMContent = {
15
15
  cartographicOrigin: Vector3;
16
16
  featureIds?: number[] | null;
17
17
  featureTableBinary?: Uint8Array;
18
- featureTableJson?: BatchTableJson;
18
+ featureTableJson?: FeatureTableJson;
19
19
  gltf?: GLTFPostprocessed;
20
20
  gltfUpAxis: string;
21
21
  header: GLTFHeader;