@loaders.gl/3d-tiles 3.1.0-beta.2 → 3.1.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -6283,11 +6283,11 @@
6283
6283
  }
6284
6284
  });
6285
6285
 
6286
- // ../textures/src/lib/gl-constants.ts
6287
- var GL3;
6288
- var init_gl_constants = __esm({
6289
- "../textures/src/lib/gl-constants.ts"() {
6290
- GL3 = {
6286
+ // ../textures/src/lib/gl-extensions.ts
6287
+ var GL_EXTENSIONS_CONSTANTS;
6288
+ var init_gl_extensions = __esm({
6289
+ "../textures/src/lib/gl-extensions.ts"() {
6290
+ GL_EXTENSIONS_CONSTANTS = {
6291
6291
  COMPRESSED_RGB_S3TC_DXT1_EXT: 33776,
6292
6292
  COMPRESSED_RGBA_S3TC_DXT1_EXT: 33777,
6293
6293
  COMPRESSED_RGBA_S3TC_DXT3_EXT: 33778,
@@ -6582,21 +6582,45 @@
6582
6582
  var init_parse_basis = __esm({
6583
6583
  "../textures/src/lib/parsers/parse-basis.js"() {
6584
6584
  init_basis_module_loader();
6585
- init_gl_constants();
6585
+ init_gl_extensions();
6586
6586
  init_texture_formats();
6587
6587
  init_parse_ktx();
6588
6588
  OutputFormat = {
6589
- etc1: { basisFormat: 0, compressed: true, format: GL3.COMPRESSED_RGB_ETC1_WEBGL },
6589
+ etc1: {
6590
+ basisFormat: 0,
6591
+ compressed: true,
6592
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ETC1_WEBGL
6593
+ },
6590
6594
  etc2: { basisFormat: 1, compressed: true },
6591
- bc1: { basisFormat: 2, compressed: true, format: GL3.COMPRESSED_RGB_S3TC_DXT1_EXT },
6592
- bc3: { basisFormat: 3, compressed: true, format: GL3.COMPRESSED_RGBA_S3TC_DXT5_EXT },
6595
+ bc1: {
6596
+ basisFormat: 2,
6597
+ compressed: true,
6598
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT
6599
+ },
6600
+ bc3: {
6601
+ basisFormat: 3,
6602
+ compressed: true,
6603
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT
6604
+ },
6593
6605
  bc4: { basisFormat: 4, compressed: true },
6594
6606
  bc5: { basisFormat: 5, compressed: true },
6595
6607
  "bc7-m6-opaque-only": { basisFormat: 6, compressed: true },
6596
6608
  "bc7-m5": { basisFormat: 7, compressed: true },
6597
- "pvrtc1-4-rgb": { basisFormat: 8, compressed: true, format: GL3.COMPRESSED_RGB_PVRTC_4BPPV1_IMG },
6598
- "pvrtc1-4-rgba": { basisFormat: 9, compressed: true, format: GL3.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG },
6599
- "astc-4x4": { basisFormat: 10, compressed: true, format: GL3.COMPRESSED_RGBA_ASTC_4X4_KHR },
6609
+ "pvrtc1-4-rgb": {
6610
+ basisFormat: 8,
6611
+ compressed: true,
6612
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
6613
+ },
6614
+ "pvrtc1-4-rgba": {
6615
+ basisFormat: 9,
6616
+ compressed: true,
6617
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
6618
+ },
6619
+ "astc-4x4": {
6620
+ basisFormat: 10,
6621
+ compressed: true,
6622
+ format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4X4_KHR
6623
+ },
6600
6624
  "atc-rgb": { basisFormat: 11, compressed: true },
6601
6625
  "atc-rgba-interpolated-alpha": { basisFormat: 12, compressed: true },
6602
6626
  rgba32: { basisFormat: 13, compressed: false },
@@ -8761,11 +8785,22 @@
8761
8785
  const buffer = accessor.bufferView.buffer;
8762
8786
  const { ArrayType, byteLength } = getAccessorArrayTypeAndLength(accessor, accessor.bufferView);
8763
8787
  const byteOffset = (accessor.bufferView.byteOffset || 0) + (accessor.byteOffset || 0) + buffer.byteOffset;
8764
- const cutBufffer = buffer.arrayBuffer.slice(byteOffset, byteOffset + byteLength);
8765
- accessor.value = new ArrayType(cutBufffer);
8788
+ let cutBuffer = buffer.arrayBuffer.slice(byteOffset, byteOffset + byteLength);
8789
+ if (accessor.bufferView.byteStride) {
8790
+ cutBuffer = this._getValueFromInterleavedBuffer(buffer, byteOffset, accessor.bufferView.byteStride, accessor.bytesPerElement, accessor.count);
8791
+ }
8792
+ accessor.value = new ArrayType(cutBuffer);
8766
8793
  }
8767
8794
  return accessor;
8768
8795
  }
8796
+ _getValueFromInterleavedBuffer(buffer, byteOffset, byteStride, bytesPerElement, count) {
8797
+ const result = new Uint8Array(count * bytesPerElement);
8798
+ for (let i2 = 0; i2 < count; i2++) {
8799
+ const elementOffset = byteOffset + i2 * byteStride;
8800
+ result.set(new Uint8Array(buffer.arrayBuffer.slice(elementOffset, elementOffset + bytesPerElement)), i2 * bytesPerElement);
8801
+ }
8802
+ return result.buffer;
8803
+ }
8769
8804
  _resolveTexture(texture, index) {
8770
8805
  texture.id = texture.id || `texture-${index}`;
8771
8806
  texture.sampler = "sampler" in texture ? this.getSampler(texture.sampler) : DEFAULT_SAMPLER;
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VERSION = void 0;
7
- const VERSION = typeof "3.1.0-beta.2" !== 'undefined' ? "3.1.0-beta.2" : 'latest';
7
+ const VERSION = typeof "3.1.0-beta.5" !== 'undefined' ? "3.1.0-beta.5" : 'latest';
8
8
  exports.VERSION = VERSION;
9
9
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export const VERSION = typeof "3.1.0-beta.2" !== 'undefined' ? "3.1.0-beta.2" : 'latest';
1
+ export const VERSION = typeof "3.1.0-beta.5" !== 'undefined' ? "3.1.0-beta.5" : 'latest';
2
2
  //# sourceMappingURL=version.js.map
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.parseBatchedModel3DTile = void 0;
9
9
  const math_1 = require("@loaders.gl/math"); // math.gl/geometry;
10
10
  const tile_3d_feature_table_1 = __importDefault(require("../classes/tile-3d-feature-table"));
11
- // import Tile3DBatchTable from '../classes/tile-3d-batch-table.js';
11
+ // import Tile3DBatchTable from '../classes/tile-3d-batch-table';
12
12
  const parse_3d_tile_header_1 = require("./helpers/parse-3d-tile-header");
13
13
  const parse_3d_tile_tables_1 = require("./helpers/parse-3d-tile-tables");
14
14
  const parse_3d_tile_gltf_view_1 = require("./helpers/parse-3d-tile-gltf-view");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/3d-tiles",
3
- "version": "3.1.0-beta.2",
3
+ "version": "3.1.0-beta.5",
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/bundle.js"
35
35
  },
36
36
  "dependencies": {
37
- "@loaders.gl/draco": "3.1.0-beta.2",
38
- "@loaders.gl/gltf": "3.1.0-beta.2",
39
- "@loaders.gl/loader-utils": "3.1.0-beta.2",
40
- "@loaders.gl/math": "3.1.0-beta.2",
41
- "@loaders.gl/tiles": "3.1.0-beta.2",
37
+ "@loaders.gl/draco": "3.1.0-beta.5",
38
+ "@loaders.gl/gltf": "3.1.0-beta.5",
39
+ "@loaders.gl/loader-utils": "3.1.0-beta.5",
40
+ "@loaders.gl/math": "3.1.0-beta.5",
41
+ "@loaders.gl/tiles": "3.1.0-beta.5",
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.1.0-beta.1"
47
47
  },
48
- "gitHead": "90f487e7b3f15c554d57c92497d3a12d71676818"
48
+ "gitHead": "5d66468457cc878d2dbff3d7807d737ceb181c9a"
49
49
  }