@loaders.gl/tiles-3d 5.0.0-beta.2 → 5.0.0-beta.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.
- package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
- package/dist/3d-tiles/dist.dev.js +502 -342
- package/dist/3d-tiles/dist.min.js +19 -19
- package/dist/3d-tiles/index.cjs +307 -183
- package/dist/3d-tiles/index.cjs.map +3 -3
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js +12 -8
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js.map +1 -1
- package/dist/3d-tiles/lib/utils/version.js +1 -1
- package/dist/3d-tiles-archive-writer.cjs +1 -1
- package/dist/cesium-ion-loader-with-parser.cjs +301 -177
- package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
- package/dist/copc/copc-source-loader.js +1 -1
- package/dist/copc/copc-writer.js +1 -1
- package/dist/copc/index.cjs +358 -9
- package/dist/copc/index.cjs.map +3 -3
- package/dist/dist.min.js +2 -2
- package/dist/i3s/arcgis-webscene-loader.js +1 -1
- package/dist/i3s/dist.dev.js +3731 -694
- package/dist/i3s/dist.min.js +43 -35
- package/dist/i3s/i3s-attribute-loader.js +1 -1
- package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s/i3s-content-loader.js +1 -1
- package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
- package/dist/i3s/i3s-loader.js +1 -1
- package/dist/i3s/i3s-node-page-loader.js +1 -1
- package/dist/i3s/i3s-slpk-loader.js +1 -1
- package/dist/i3s/i3s-slpk-writer.js +1 -1
- package/dist/i3s/index.cjs +2542 -373
- package/dist/i3s/index.cjs.map +3 -3
- package/dist/i3s-content-worker-node.js +11 -11
- package/dist/i3s-content-worker-node.js.map +4 -4
- package/dist/i3s-content-worker.js +392 -56
- package/dist/i3s-lepcc-worker-node.js +369 -37
- package/dist/i3s-lepcc-worker-node.js.map +4 -4
- package/dist/i3s-lepcc-worker.js +340 -33
- package/dist/i3s-mesh-writer.cjs +2464 -295
- package/dist/i3s-mesh-writer.cjs.map +3 -3
- package/dist/i3s-slpk-writer.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/point-cloud-tile-source-loader-types.js +1 -1
- package/dist/point-cloud-tile-source-loader.cjs +1 -1
- package/dist/potree/dist.dev.js +84 -28
- package/dist/potree/dist.min.js +26 -26
- package/dist/potree/index.cjs +11 -6
- package/dist/potree/index.cjs.map +1 -1
- package/dist/potree/potree-bin-loader.js +1 -1
- package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
- package/dist/potree/potree-loader-types.js +1 -1
- package/dist/potree/potree-source-loader.js +1 -1
- package/dist/potree/potree-writer.js +1 -1
- package/dist/potree-loader.cjs +1 -1
- package/package.json +13 -13
- package/src/3d-tiles/lib/classes/tile-3d-batch-table.ts +12 -8
package/dist/3d-tiles/index.cjs
CHANGED
|
@@ -14,8 +14,8 @@ var __esm = (fn, res, err) => function __init() {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
var __export = (target, all) => {
|
|
17
|
-
for (var
|
|
18
|
-
__defProp(target,
|
|
17
|
+
for (var name22 in all)
|
|
18
|
+
__defProp(target, name22, { get: all[name22], enumerable: true });
|
|
19
19
|
};
|
|
20
20
|
var __copyProps = (to, from, except, desc) => {
|
|
21
21
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -580,9 +580,9 @@ function registerJSModules(modules) {
|
|
|
580
580
|
globalThis.loaders.modules ||= {};
|
|
581
581
|
Object.assign(globalThis.loaders.modules, modules);
|
|
582
582
|
}
|
|
583
|
-
function getJSModuleOrNull(
|
|
583
|
+
function getJSModuleOrNull(name22) {
|
|
584
584
|
var _a, _b;
|
|
585
|
-
const module2 = (_b = (_a = globalThis.loaders) == null ? void 0 : _a.modules) == null ? void 0 : _b[
|
|
585
|
+
const module2 = (_b = (_a = globalThis.loaders) == null ? void 0 : _a.modules) == null ? void 0 : _b[name22];
|
|
586
586
|
return module2 || null;
|
|
587
587
|
}
|
|
588
588
|
var init_js_module_utils = __esm({
|
|
@@ -827,10 +827,12 @@ var init_library_utils = __esm({
|
|
|
827
827
|
});
|
|
828
828
|
|
|
829
829
|
// ../core/src/worker-utils/index.ts
|
|
830
|
+
var import_tasks;
|
|
830
831
|
var init_worker_utils = __esm({
|
|
831
832
|
"../core/src/worker-utils/index.ts"() {
|
|
832
833
|
"use strict";
|
|
833
834
|
init_globals2();
|
|
835
|
+
import_tasks = require("@math.gl/core/tasks");
|
|
834
836
|
init_library_utils();
|
|
835
837
|
}
|
|
836
838
|
});
|
|
@@ -1087,10 +1089,10 @@ function createAbortError() {
|
|
|
1087
1089
|
error.name = "AbortError";
|
|
1088
1090
|
return error;
|
|
1089
1091
|
}
|
|
1090
|
-
function validateLimit(value, fallback,
|
|
1092
|
+
function validateLimit(value, fallback, name22) {
|
|
1091
1093
|
const limit = value ?? fallback;
|
|
1092
1094
|
if (limit < 0 || Number.isNaN(limit)) {
|
|
1093
|
-
throw new Error(`${
|
|
1095
|
+
throw new Error(`${name22} must be a non-negative number`);
|
|
1094
1096
|
}
|
|
1095
1097
|
return limit;
|
|
1096
1098
|
}
|
|
@@ -4769,17 +4771,17 @@ var init_gltf_scenegraph = __esm({
|
|
|
4769
4771
|
return extras[key];
|
|
4770
4772
|
}
|
|
4771
4773
|
hasExtension(extensionName) {
|
|
4772
|
-
const isUsedExtension = this.getUsedExtensions().find((
|
|
4773
|
-
const isRequiredExtension = this.getRequiredExtensions().find((
|
|
4774
|
+
const isUsedExtension = this.getUsedExtensions().find((name22) => name22 === extensionName);
|
|
4775
|
+
const isRequiredExtension = this.getRequiredExtensions().find((name22) => name22 === extensionName);
|
|
4774
4776
|
return typeof isUsedExtension === "string" || typeof isRequiredExtension === "string";
|
|
4775
4777
|
}
|
|
4776
4778
|
getExtension(extensionName) {
|
|
4777
|
-
const isExtension = this.getUsedExtensions().find((
|
|
4779
|
+
const isExtension = this.getUsedExtensions().find((name22) => name22 === extensionName);
|
|
4778
4780
|
const extensions = this.json.extensions || {};
|
|
4779
4781
|
return isExtension ? extensions[extensionName] : null;
|
|
4780
4782
|
}
|
|
4781
4783
|
getRequiredExtension(extensionName) {
|
|
4782
|
-
const isRequired = this.getRequiredExtensions().find((
|
|
4784
|
+
const isRequired = this.getRequiredExtensions().find((name22) => name22 === extensionName);
|
|
4783
4785
|
return isRequired ? this.getExtension(extensionName) : null;
|
|
4784
4786
|
}
|
|
4785
4787
|
getRequiredExtensions() {
|
|
@@ -5181,8 +5183,8 @@ var init_gltf_scenegraph = __esm({
|
|
|
5181
5183
|
assert3(bufferOffset !== void 0);
|
|
5182
5184
|
bufferView.byteOffset = bufferOffset + (bufferView.byteOffset || 0);
|
|
5183
5185
|
bufferView.buffer = 0;
|
|
5184
|
-
for (const
|
|
5185
|
-
const extension = (_b = bufferView.extensions) == null ? void 0 : _b[
|
|
5186
|
+
for (const name22 of ["EXT_meshopt_compression", "KHR_meshopt_compression"]) {
|
|
5187
|
+
const extension = (_b = bufferView.extensions) == null ? void 0 : _b[name22];
|
|
5186
5188
|
if (extension) {
|
|
5187
5189
|
const extensionOffset = bufferOffsets[extension.buffer];
|
|
5188
5190
|
assert3(extensionOffset !== void 0);
|
|
@@ -5501,7 +5503,7 @@ function iterateObjectData(objects) {
|
|
|
5501
5503
|
})();
|
|
5502
5504
|
}
|
|
5503
5505
|
function mapObjectData(objects) {
|
|
5504
|
-
return new Map(Array.from(objects, ([
|
|
5506
|
+
return new Map(Array.from(objects, ([name22, object]) => [name22, object.data]));
|
|
5505
5507
|
}
|
|
5506
5508
|
function getCollectionName(type) {
|
|
5507
5509
|
switch (type) {
|
|
@@ -6379,7 +6381,7 @@ function getPrimitiveTextureData(scenegraph, textureInfo, primitive) {
|
|
|
6379
6381
|
if (typeof imageIndex !== "undefined") {
|
|
6380
6382
|
const mimeType = (_d = (_c = json.images) == null ? void 0 : _c[imageIndex]) == null ? void 0 : _d.mimeType;
|
|
6381
6383
|
const parsedImage = (_e = scenegraph.gltf.images) == null ? void 0 : _e[imageIndex];
|
|
6382
|
-
if (parsedImage && typeof parsedImage.width !== "undefined") {
|
|
6384
|
+
if (parsedImage && typeof parsedImage.width !== "undefined" && !("compressed" in parsedImage && parsedImage.compressed)) {
|
|
6383
6385
|
const textureData = [];
|
|
6384
6386
|
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
6385
6387
|
const value = getImageValueByCoordinates(
|
|
@@ -6953,13 +6955,17 @@ __export(KHR_gaussian_splatting_exports, {
|
|
|
6953
6955
|
getGaussianSplatPrimitives: () => getGaussianSplatPrimitives,
|
|
6954
6956
|
name: () => name6
|
|
6955
6957
|
});
|
|
6956
|
-
async function decode6(gltfData, options) {
|
|
6957
|
-
var _a, _b, _c, _d;
|
|
6958
|
+
async function decode6(gltfData, options, context) {
|
|
6959
|
+
var _a, _b, _c, _d, _e;
|
|
6960
|
+
const loader = (_a = context == null ? void 0 : context.loaders) == null ? void 0 : _a.find((candidate) => {
|
|
6961
|
+
var _a2;
|
|
6962
|
+
return (_a2 = candidate.extensions) == null ? void 0 : _a2.includes("spz");
|
|
6963
|
+
});
|
|
6958
6964
|
const descriptors = getGaussianSplatPrimitives(gltfData);
|
|
6959
6965
|
const iterator = new GLTFIterator(gltfData);
|
|
6960
6966
|
for (const [meshIndex, mesh] of (gltfData.json.meshes || []).entries()) {
|
|
6961
6967
|
for (const [primitiveIndex, primitive] of mesh.primitives.entries()) {
|
|
6962
|
-
const extension = (
|
|
6968
|
+
const extension = (_b = primitive.extensions) == null ? void 0 : _b[name6];
|
|
6963
6969
|
if (!extension) continue;
|
|
6964
6970
|
validateGaussianSplatPrimitive(
|
|
6965
6971
|
gltfData.json,
|
|
@@ -6969,22 +6975,29 @@ async function decode6(gltfData, options) {
|
|
|
6969
6975
|
primitiveIndex,
|
|
6970
6976
|
iterator
|
|
6971
6977
|
);
|
|
6972
|
-
const compression = (
|
|
6978
|
+
const compression = (_c = extension.extensions) == null ? void 0 : _c[SPZ_COMPRESSION_EXTENSION_NAME];
|
|
6973
6979
|
if (compression) {
|
|
6974
6980
|
const descriptor = descriptors.find(
|
|
6975
6981
|
(item) => item.meshIndex === meshIndex && item.primitiveIndex === primitiveIndex
|
|
6976
6982
|
);
|
|
6977
6983
|
if (descriptor) {
|
|
6978
|
-
const decoder = (
|
|
6979
|
-
const bufferView = (
|
|
6984
|
+
const decoder = (_d = options == null ? void 0 : options.gltf) == null ? void 0 : _d.splatDecoder;
|
|
6985
|
+
const bufferView = (_e = gltfData.json.bufferViews) == null ? void 0 : _e[compression.bufferView];
|
|
6980
6986
|
if (bufferView && gltfData.buffers[bufferView.buffer]) {
|
|
6981
6987
|
descriptor.compressedBytes = getBufferViewBytes(gltfData, compression.bufferView);
|
|
6982
|
-
} else if (decoder) {
|
|
6988
|
+
} else if (decoder || loader) {
|
|
6983
6989
|
throw new Error(
|
|
6984
6990
|
`KHR_gaussian_splatting: bufferView ${compression.bufferView} is not loaded for SPZ2 decoding.`
|
|
6985
6991
|
);
|
|
6986
6992
|
}
|
|
6987
|
-
if (
|
|
6993
|
+
if (loader && context && descriptor.compressedBytes) {
|
|
6994
|
+
descriptor.decoded = await parseFromContext(
|
|
6995
|
+
descriptor.compressedBytes.buffer,
|
|
6996
|
+
loader,
|
|
6997
|
+
{ ...options, splats: { ...options.splats, sourceCoordinateSystem: "LUF" } },
|
|
6998
|
+
context
|
|
6999
|
+
);
|
|
7000
|
+
} else if (decoder && descriptor.compressedBytes) {
|
|
6988
7001
|
descriptor.decoded = await decoder(descriptor.compressedBytes.buffer, {
|
|
6989
7002
|
sourceCoordinateSystem: "LUF"
|
|
6990
7003
|
});
|
|
@@ -7125,6 +7138,7 @@ var name6, SPZ_COMPRESSION_EXTENSION_NAME, REQUIRED_ATTRIBUTES;
|
|
|
7125
7138
|
var init_KHR_gaussian_splatting = __esm({
|
|
7126
7139
|
"../scene/src/gltf/lib/extensions/KHR_gaussian_splatting.ts"() {
|
|
7127
7140
|
"use strict";
|
|
7141
|
+
init_loader_utils();
|
|
7128
7142
|
init_gltf_iterator();
|
|
7129
7143
|
name6 = "KHR_gaussian_splatting";
|
|
7130
7144
|
SPZ_COMPRESSION_EXTENSION_NAME = "KHR_gaussian_splatting_compression_spz_2";
|
|
@@ -8682,6 +8696,33 @@ var init_resolve_gltf_file = __esm({
|
|
|
8682
8696
|
}
|
|
8683
8697
|
});
|
|
8684
8698
|
|
|
8699
|
+
// ../scene/src/gltf/lib/extensions/KHR_accessor_float64.ts
|
|
8700
|
+
var KHR_accessor_float64_exports = {};
|
|
8701
|
+
__export(KHR_accessor_float64_exports, {
|
|
8702
|
+
name: () => name10,
|
|
8703
|
+
preprocess: () => preprocess
|
|
8704
|
+
});
|
|
8705
|
+
function preprocess(gltf) {
|
|
8706
|
+
var _a, _b, _c, _d;
|
|
8707
|
+
const { json } = gltf;
|
|
8708
|
+
if (!((_a = json.extensionsUsed) == null ? void 0 : _a.includes(name10)) && !((_b = json.extensionsRequired) == null ? void 0 : _b.includes(name10))) return;
|
|
8709
|
+
if (!((_c = json.extensionsUsed) == null ? void 0 : _c.includes(name10)) || !((_d = json.extensionsRequired) == null ? void 0 : _d.includes(name10))) {
|
|
8710
|
+
throw new Error(`${name10}: must be declared in extensionsUsed and extensionsRequired.`);
|
|
8711
|
+
}
|
|
8712
|
+
for (const [index, accessor] of (json.accessors || []).entries()) {
|
|
8713
|
+
if (accessor.componentType === 5130 && accessor.normalized) {
|
|
8714
|
+
throw new Error(`${name10}: accessor ${index} must not be normalized.`);
|
|
8715
|
+
}
|
|
8716
|
+
}
|
|
8717
|
+
}
|
|
8718
|
+
var name10;
|
|
8719
|
+
var init_KHR_accessor_float64 = __esm({
|
|
8720
|
+
"../scene/src/gltf/lib/extensions/KHR_accessor_float64.ts"() {
|
|
8721
|
+
"use strict";
|
|
8722
|
+
name10 = "KHR_accessor_float64";
|
|
8723
|
+
}
|
|
8724
|
+
});
|
|
8725
|
+
|
|
8685
8726
|
// ../scene/src/gltf/libs/meshopt-decoder.mjs
|
|
8686
8727
|
var meshopt_decoder_exports = {};
|
|
8687
8728
|
__export(meshopt_decoder_exports, {
|
|
@@ -8832,7 +8873,7 @@ var init_meshopt_decoder = __esm({
|
|
|
8832
8873
|
}
|
|
8833
8874
|
return result.buffer.slice(0, write);
|
|
8834
8875
|
}
|
|
8835
|
-
function
|
|
8876
|
+
function decode18(instance2, fun, target, count, size, source, filter) {
|
|
8836
8877
|
var sbrk = instance2.exports.sbrk;
|
|
8837
8878
|
var count4 = count + 3 & ~3;
|
|
8838
8879
|
var tp = sbrk(count4 * size);
|
|
@@ -8878,7 +8919,7 @@ var init_meshopt_decoder = __esm({
|
|
|
8878
8919
|
return worker;
|
|
8879
8920
|
}
|
|
8880
8921
|
function initWorkers(count) {
|
|
8881
|
-
var source = "self.ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(wasm2) + "]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = " + workerProcess.name + ";" +
|
|
8922
|
+
var source = "self.ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(wasm2) + "]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = " + workerProcess.name + ";" + decode18.toString() + workerProcess.toString();
|
|
8882
8923
|
var blob = new Blob([source], { type: "text/javascript" });
|
|
8883
8924
|
var url = URL.createObjectURL(blob);
|
|
8884
8925
|
for (var i = workers.length; i < count; ++i) {
|
|
@@ -8913,7 +8954,7 @@ var init_meshopt_decoder = __esm({
|
|
|
8913
8954
|
}
|
|
8914
8955
|
try {
|
|
8915
8956
|
var target = new Uint8Array(data.count * data.size);
|
|
8916
|
-
|
|
8957
|
+
decode18(instance2, instance2.exports[data.mode], target, data.count, data.size, data.source, instance2.exports[data.filter]);
|
|
8917
8958
|
self.postMessage({ id: data.id, count: data.count, action: "resolve", value: target }, [target.buffer]);
|
|
8918
8959
|
} catch (error) {
|
|
8919
8960
|
self.postMessage({ id: data.id, count: data.count, action: "reject", value: error });
|
|
@@ -8927,16 +8968,16 @@ var init_meshopt_decoder = __esm({
|
|
|
8927
8968
|
initWorkers(count);
|
|
8928
8969
|
},
|
|
8929
8970
|
decodeVertexBuffer: function(target, count, size, source, filter) {
|
|
8930
|
-
|
|
8971
|
+
decode18(instance, instance.exports.meshopt_decodeVertexBuffer, target, count, size, source, instance.exports[filters[filter]]);
|
|
8931
8972
|
},
|
|
8932
8973
|
decodeIndexBuffer: function(target, count, size, source) {
|
|
8933
|
-
|
|
8974
|
+
decode18(instance, instance.exports.meshopt_decodeIndexBuffer, target, count, size, source);
|
|
8934
8975
|
},
|
|
8935
8976
|
decodeIndexSequence: function(target, count, size, source) {
|
|
8936
|
-
|
|
8977
|
+
decode18(instance, instance.exports.meshopt_decodeIndexSequence, target, count, size, source);
|
|
8937
8978
|
},
|
|
8938
8979
|
decodeGltfBuffer: function(target, count, size, source, mode, filter) {
|
|
8939
|
-
|
|
8980
|
+
decode18(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
|
|
8940
8981
|
},
|
|
8941
8982
|
decodeGltfBufferAsync: function(count, size, source, mode, filter) {
|
|
8942
8983
|
if (workers.length > 0) {
|
|
@@ -8944,7 +8985,7 @@ var init_meshopt_decoder = __esm({
|
|
|
8944
8985
|
}
|
|
8945
8986
|
return ready.then(function() {
|
|
8946
8987
|
var target = new Uint8Array(count * size);
|
|
8947
|
-
|
|
8988
|
+
decode18(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
|
|
8948
8989
|
return target;
|
|
8949
8990
|
});
|
|
8950
8991
|
}
|
|
@@ -9098,17 +9139,17 @@ var init_meshopt_compression = __esm({
|
|
|
9098
9139
|
var EXT_meshopt_compression_exports = {};
|
|
9099
9140
|
__export(EXT_meshopt_compression_exports, {
|
|
9100
9141
|
decode: () => decode10,
|
|
9101
|
-
name: () =>
|
|
9142
|
+
name: () => name11
|
|
9102
9143
|
});
|
|
9103
9144
|
async function decode10(gltfData, options) {
|
|
9104
|
-
await decodeMeshoptCompression(gltfData, options,
|
|
9145
|
+
await decodeMeshoptCompression(gltfData, options, name11);
|
|
9105
9146
|
}
|
|
9106
|
-
var
|
|
9147
|
+
var name11;
|
|
9107
9148
|
var init_EXT_meshopt_compression = __esm({
|
|
9108
9149
|
"../scene/src/gltf/lib/extensions/EXT_meshopt_compression.ts"() {
|
|
9109
9150
|
"use strict";
|
|
9110
9151
|
init_meshopt_compression();
|
|
9111
|
-
|
|
9152
|
+
name11 = "EXT_meshopt_compression";
|
|
9112
9153
|
}
|
|
9113
9154
|
});
|
|
9114
9155
|
|
|
@@ -9116,28 +9157,29 @@ var init_EXT_meshopt_compression = __esm({
|
|
|
9116
9157
|
var KHR_meshopt_compression_exports = {};
|
|
9117
9158
|
__export(KHR_meshopt_compression_exports, {
|
|
9118
9159
|
decode: () => decode11,
|
|
9119
|
-
name: () =>
|
|
9160
|
+
name: () => name12
|
|
9120
9161
|
});
|
|
9121
9162
|
async function decode11(gltfData, options) {
|
|
9122
|
-
await decodeMeshoptCompression(gltfData, options,
|
|
9163
|
+
await decodeMeshoptCompression(gltfData, options, name12);
|
|
9123
9164
|
}
|
|
9124
|
-
var
|
|
9165
|
+
var name12;
|
|
9125
9166
|
var init_KHR_meshopt_compression = __esm({
|
|
9126
9167
|
"../scene/src/gltf/lib/extensions/KHR_meshopt_compression.ts"() {
|
|
9127
9168
|
"use strict";
|
|
9128
9169
|
init_meshopt_compression();
|
|
9129
|
-
|
|
9170
|
+
name12 = "KHR_meshopt_compression";
|
|
9130
9171
|
}
|
|
9131
9172
|
});
|
|
9132
9173
|
|
|
9133
9174
|
// ../scene/src/gltf/lib/extensions/EXT_texture_webp.ts
|
|
9134
9175
|
var EXT_texture_webp_exports = {};
|
|
9135
9176
|
__export(EXT_texture_webp_exports, {
|
|
9136
|
-
name: () =>
|
|
9137
|
-
preprocess: () =>
|
|
9177
|
+
name: () => name13,
|
|
9178
|
+
preprocess: () => preprocess2
|
|
9138
9179
|
});
|
|
9139
|
-
function
|
|
9180
|
+
function preprocess2(gltfData, options) {
|
|
9140
9181
|
const iterator = new GLTFIterator(gltfData);
|
|
9182
|
+
if (!iterator.hasExtension(EXT_TEXTURE_WEBP)) return;
|
|
9141
9183
|
if (!isImageFormatSupported("image/webp")) {
|
|
9142
9184
|
if (iterator.isExtensionRequired(EXT_TEXTURE_WEBP)) {
|
|
9143
9185
|
throw new Error(`gltf: Required extension ${EXT_TEXTURE_WEBP} not supported by browser`);
|
|
@@ -9153,24 +9195,24 @@ function preprocess(gltfData, options) {
|
|
|
9153
9195
|
}
|
|
9154
9196
|
iterator.removeExtension(EXT_TEXTURE_WEBP);
|
|
9155
9197
|
}
|
|
9156
|
-
var EXT_TEXTURE_WEBP,
|
|
9198
|
+
var EXT_TEXTURE_WEBP, name13;
|
|
9157
9199
|
var init_EXT_texture_webp = __esm({
|
|
9158
9200
|
"../scene/src/gltf/lib/extensions/EXT_texture_webp.ts"() {
|
|
9159
9201
|
"use strict";
|
|
9160
9202
|
init_src();
|
|
9161
9203
|
init_gltf_iterator();
|
|
9162
9204
|
EXT_TEXTURE_WEBP = "EXT_texture_webp";
|
|
9163
|
-
|
|
9205
|
+
name13 = EXT_TEXTURE_WEBP;
|
|
9164
9206
|
}
|
|
9165
9207
|
});
|
|
9166
9208
|
|
|
9167
9209
|
// ../scene/src/gltf/lib/extensions/EXT_texture_avif.ts
|
|
9168
9210
|
var EXT_texture_avif_exports = {};
|
|
9169
9211
|
__export(EXT_texture_avif_exports, {
|
|
9170
|
-
name: () =>
|
|
9171
|
-
preprocess: () =>
|
|
9212
|
+
name: () => name14,
|
|
9213
|
+
preprocess: () => preprocess3
|
|
9172
9214
|
});
|
|
9173
|
-
async function
|
|
9215
|
+
async function preprocess3(gltfData, options) {
|
|
9174
9216
|
void options;
|
|
9175
9217
|
const iterator = new GLTFIterator(gltfData);
|
|
9176
9218
|
if (!iterator.hasExtension(EXT_TEXTURE_AVIF)) return;
|
|
@@ -9190,24 +9232,72 @@ async function preprocess2(gltfData, options) {
|
|
|
9190
9232
|
}
|
|
9191
9233
|
iterator.removeExtension(EXT_TEXTURE_AVIF);
|
|
9192
9234
|
}
|
|
9193
|
-
var EXT_TEXTURE_AVIF,
|
|
9235
|
+
var EXT_TEXTURE_AVIF, name14;
|
|
9194
9236
|
var init_EXT_texture_avif = __esm({
|
|
9195
9237
|
"../scene/src/gltf/lib/extensions/EXT_texture_avif.ts"() {
|
|
9196
9238
|
"use strict";
|
|
9197
9239
|
init_src();
|
|
9198
9240
|
init_gltf_iterator();
|
|
9199
9241
|
EXT_TEXTURE_AVIF = "EXT_texture_avif";
|
|
9200
|
-
|
|
9242
|
+
name14 = EXT_TEXTURE_AVIF;
|
|
9243
|
+
}
|
|
9244
|
+
});
|
|
9245
|
+
|
|
9246
|
+
// ../scene/src/gltf/lib/extensions/MSFT_texture_dds.ts
|
|
9247
|
+
var MSFT_texture_dds_exports = {};
|
|
9248
|
+
__export(MSFT_texture_dds_exports, {
|
|
9249
|
+
decode: () => decode12,
|
|
9250
|
+
getDDSLoader: () => getDDSLoader,
|
|
9251
|
+
name: () => name15,
|
|
9252
|
+
preprocess: () => preprocess4
|
|
9253
|
+
});
|
|
9254
|
+
function getDDSLoader(context) {
|
|
9255
|
+
var _a;
|
|
9256
|
+
return (_a = context == null ? void 0 : context.loaders) == null ? void 0 : _a.find(
|
|
9257
|
+
(loader) => {
|
|
9258
|
+
var _a2, _b;
|
|
9259
|
+
return ((_a2 = loader.extensions) == null ? void 0 : _a2.includes("dds")) || ((_b = loader.mimeTypes) == null ? void 0 : _b.includes("image/vnd-ms.dds"));
|
|
9260
|
+
}
|
|
9261
|
+
);
|
|
9262
|
+
}
|
|
9263
|
+
function preprocess4(gltf, _options, context) {
|
|
9264
|
+
const iterator = new GLTFIterator(gltf);
|
|
9265
|
+
if (!iterator.hasExtension(name15)) return;
|
|
9266
|
+
if (!getDDSLoader(context)) {
|
|
9267
|
+
if (iterator.isExtensionRequired(name15)) {
|
|
9268
|
+
throw new Error("gltf: Required extension MSFT_texture_dds needs a DDS parser");
|
|
9269
|
+
}
|
|
9270
|
+
return;
|
|
9271
|
+
}
|
|
9272
|
+
for (const texture of iterator.textures) {
|
|
9273
|
+
const extension = iterator.getExtension(texture, name15);
|
|
9274
|
+
if (extension) texture.source = extension.source;
|
|
9275
|
+
}
|
|
9276
|
+
}
|
|
9277
|
+
async function decode12(gltf, options, context) {
|
|
9278
|
+
var _a;
|
|
9279
|
+
if (!getDDSLoader(context) || ((_a = options.gltf) == null ? void 0 : _a.loadImages) === false) return;
|
|
9280
|
+
const iterator = new GLTFIterator(gltf);
|
|
9281
|
+
if (!iterator.hasExtension(name15)) return;
|
|
9282
|
+
for (const texture of iterator.textures) iterator.removeExtension(texture, name15);
|
|
9283
|
+
iterator.removeExtension(name15);
|
|
9284
|
+
}
|
|
9285
|
+
var name15;
|
|
9286
|
+
var init_MSFT_texture_dds = __esm({
|
|
9287
|
+
"../scene/src/gltf/lib/extensions/MSFT_texture_dds.ts"() {
|
|
9288
|
+
"use strict";
|
|
9289
|
+
init_gltf_iterator();
|
|
9290
|
+
name15 = "MSFT_texture_dds";
|
|
9201
9291
|
}
|
|
9202
9292
|
});
|
|
9203
9293
|
|
|
9204
9294
|
// ../scene/src/gltf/lib/extensions/KHR_texture_basisu.ts
|
|
9205
9295
|
var KHR_texture_basisu_exports = {};
|
|
9206
9296
|
__export(KHR_texture_basisu_exports, {
|
|
9207
|
-
name: () =>
|
|
9208
|
-
preprocess: () =>
|
|
9297
|
+
name: () => name16,
|
|
9298
|
+
preprocess: () => preprocess5
|
|
9209
9299
|
});
|
|
9210
|
-
function
|
|
9300
|
+
function preprocess5(gltfData, options) {
|
|
9211
9301
|
void options;
|
|
9212
9302
|
const iterator = new GLTFIterator(gltfData);
|
|
9213
9303
|
for (const texture of iterator.textures) {
|
|
@@ -9219,13 +9309,13 @@ function preprocess3(gltfData, options) {
|
|
|
9219
9309
|
}
|
|
9220
9310
|
iterator.removeExtension(KHR_TEXTURE_BASISU);
|
|
9221
9311
|
}
|
|
9222
|
-
var KHR_TEXTURE_BASISU,
|
|
9312
|
+
var KHR_TEXTURE_BASISU, name16;
|
|
9223
9313
|
var init_KHR_texture_basisu = __esm({
|
|
9224
9314
|
"../scene/src/gltf/lib/extensions/KHR_texture_basisu.ts"() {
|
|
9225
9315
|
"use strict";
|
|
9226
9316
|
init_gltf_iterator();
|
|
9227
9317
|
KHR_TEXTURE_BASISU = "KHR_texture_basisu";
|
|
9228
|
-
|
|
9318
|
+
name16 = KHR_TEXTURE_BASISU;
|
|
9229
9319
|
}
|
|
9230
9320
|
});
|
|
9231
9321
|
|
|
@@ -10122,7 +10212,7 @@ function validateDracoDecoderModule(module2) {
|
|
|
10122
10212
|
return typedModule;
|
|
10123
10213
|
}
|
|
10124
10214
|
function getLibraryCacheKey2(type, options) {
|
|
10125
|
-
const libraryOverrides = Object.entries(options.modules || {}).filter(([
|
|
10215
|
+
const libraryOverrides = Object.entries(options.modules || {}).filter(([name22]) => name22 !== "draco3d").map(([name22, value]) => `${name22}:${String(value)}`).sort().join("|");
|
|
10126
10216
|
return [
|
|
10127
10217
|
type,
|
|
10128
10218
|
options.useLocalLibraries ? "local" : "remote",
|
|
@@ -10572,12 +10662,12 @@ var init_convert_mesh_to_table = __esm({
|
|
|
10572
10662
|
});
|
|
10573
10663
|
|
|
10574
10664
|
// ../core/src/schema-utils/lib/mesh/deduce-mesh-schema.ts
|
|
10575
|
-
function deduceMeshField(
|
|
10665
|
+
function deduceMeshField(name22, attribute, optionalMetadata) {
|
|
10576
10666
|
const type = attribute.componentType || getDataTypeFromTypedArray(attribute.value);
|
|
10577
10667
|
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
|
|
10578
10668
|
const dataType = attribute.size === 1 ? type : { type: "fixed-size-list", listSize: attribute.size, children: [{ name: "value", type }] };
|
|
10579
10669
|
return {
|
|
10580
|
-
name:
|
|
10670
|
+
name: name22,
|
|
10581
10671
|
type: dataType,
|
|
10582
10672
|
nullable: false,
|
|
10583
10673
|
metadata
|
|
@@ -11462,11 +11552,11 @@ var init_draco_loader_types2 = __esm({
|
|
|
11462
11552
|
// ../scene/src/gltf/lib/gltf-utils/gltf-attribute-utils.ts
|
|
11463
11553
|
function getGLTFAccessors(attributes) {
|
|
11464
11554
|
const accessors = {};
|
|
11465
|
-
for (const
|
|
11466
|
-
const attribute = attributes[
|
|
11467
|
-
if (
|
|
11555
|
+
for (const name22 in attributes) {
|
|
11556
|
+
const attribute = attributes[name22];
|
|
11557
|
+
if (name22 !== "indices") {
|
|
11468
11558
|
const glTFAccessor = getGLTFAccessor(attribute);
|
|
11469
|
-
accessors[
|
|
11559
|
+
accessors[name22] = glTFAccessor;
|
|
11470
11560
|
}
|
|
11471
11561
|
}
|
|
11472
11562
|
return accessors;
|
|
@@ -11527,11 +11617,11 @@ var init_gltf_attribute_utils = __esm({
|
|
|
11527
11617
|
// ../scene/src/gltf/lib/extensions/KHR_draco_mesh_compression.ts
|
|
11528
11618
|
var KHR_draco_mesh_compression_exports = {};
|
|
11529
11619
|
__export(KHR_draco_mesh_compression_exports, {
|
|
11530
|
-
decode: () =>
|
|
11531
|
-
name: () =>
|
|
11532
|
-
preprocess: () =>
|
|
11620
|
+
decode: () => decode13,
|
|
11621
|
+
name: () => name17,
|
|
11622
|
+
preprocess: () => preprocess6
|
|
11533
11623
|
});
|
|
11534
|
-
function
|
|
11624
|
+
function preprocess6(gltfData, options, context) {
|
|
11535
11625
|
const iterator = new GLTFIterator(gltfData);
|
|
11536
11626
|
for (const mesh of iterator.meshes) {
|
|
11537
11627
|
for (const primitive of iterator.getReferences(mesh).primitives) {
|
|
@@ -11540,7 +11630,7 @@ function preprocess4(gltfData, options, context) {
|
|
|
11540
11630
|
}
|
|
11541
11631
|
}
|
|
11542
11632
|
}
|
|
11543
|
-
async function
|
|
11633
|
+
async function decode13(gltfData, options, context) {
|
|
11544
11634
|
var _a;
|
|
11545
11635
|
if (!((_a = options == null ? void 0 : options.gltf) == null ? void 0 : _a.decompressMeshes)) {
|
|
11546
11636
|
return;
|
|
@@ -11623,7 +11713,7 @@ function checkPrimitive(primitive) {
|
|
|
11623
11713
|
throw new Error("glTF: Empty primitive detected: Draco decompression failure?");
|
|
11624
11714
|
}
|
|
11625
11715
|
}
|
|
11626
|
-
var KHR_DRACO_MESH_COMPRESSION,
|
|
11716
|
+
var KHR_DRACO_MESH_COMPRESSION, name17;
|
|
11627
11717
|
var init_KHR_draco_mesh_compression = __esm({
|
|
11628
11718
|
"../scene/src/gltf/lib/extensions/KHR_draco_mesh_compression.ts"() {
|
|
11629
11719
|
"use strict";
|
|
@@ -11633,17 +11723,17 @@ var init_KHR_draco_mesh_compression = __esm({
|
|
|
11633
11723
|
init_gltf_attribute_utils();
|
|
11634
11724
|
init_get_typed_array();
|
|
11635
11725
|
KHR_DRACO_MESH_COMPRESSION = "KHR_draco_mesh_compression";
|
|
11636
|
-
|
|
11726
|
+
name17 = KHR_DRACO_MESH_COMPRESSION;
|
|
11637
11727
|
}
|
|
11638
11728
|
});
|
|
11639
11729
|
|
|
11640
11730
|
// ../scene/src/gltf/lib/extensions/KHR_texture_transform.ts
|
|
11641
11731
|
var KHR_texture_transform_exports = {};
|
|
11642
11732
|
__export(KHR_texture_transform_exports, {
|
|
11643
|
-
decode: () =>
|
|
11644
|
-
name: () =>
|
|
11733
|
+
decode: () => decode14,
|
|
11734
|
+
name: () => name18
|
|
11645
11735
|
});
|
|
11646
|
-
async function
|
|
11736
|
+
async function decode14(gltfData, options) {
|
|
11647
11737
|
var _a;
|
|
11648
11738
|
const iterator = new GLTFIterator(gltfData);
|
|
11649
11739
|
const hasExtension = iterator.hasExtension(KHR_TEXTURE_TRANSFORM);
|
|
@@ -11864,7 +11954,7 @@ function makeTransformationMatrix(extensionData) {
|
|
|
11864
11954
|
const scaleMatrix = scratchScaleMatrix.set(scale[0], 0, 0, 0, scale[1], 0, 0, 0, 1);
|
|
11865
11955
|
return translationMatrix.multiplyRight(rotationMatrix).multiplyRight(scaleMatrix);
|
|
11866
11956
|
}
|
|
11867
|
-
var import_core3, KHR_TEXTURE_TRANSFORM,
|
|
11957
|
+
var import_core3, KHR_TEXTURE_TRANSFORM, name18, scratchVector, scratchRotationMatrix, scratchScaleMatrix;
|
|
11868
11958
|
var init_KHR_texture_transform = __esm({
|
|
11869
11959
|
"../scene/src/gltf/lib/extensions/KHR_texture_transform.ts"() {
|
|
11870
11960
|
"use strict";
|
|
@@ -11874,7 +11964,7 @@ var init_KHR_texture_transform = __esm({
|
|
|
11874
11964
|
init_gltf_iterator();
|
|
11875
11965
|
init_loader_utils();
|
|
11876
11966
|
KHR_TEXTURE_TRANSFORM = "KHR_texture_transform";
|
|
11877
|
-
|
|
11967
|
+
name18 = KHR_TEXTURE_TRANSFORM;
|
|
11878
11968
|
scratchVector = new import_core3.Vector3();
|
|
11879
11969
|
scratchRotationMatrix = new import_core3.Matrix3();
|
|
11880
11970
|
scratchScaleMatrix = new import_core3.Matrix3();
|
|
@@ -11884,11 +11974,11 @@ var init_KHR_texture_transform = __esm({
|
|
|
11884
11974
|
// ../scene/src/gltf/lib/extensions/deprecated/KHR_lights_punctual.ts
|
|
11885
11975
|
var KHR_lights_punctual_exports = {};
|
|
11886
11976
|
__export(KHR_lights_punctual_exports, {
|
|
11887
|
-
decode: () =>
|
|
11977
|
+
decode: () => decode15,
|
|
11888
11978
|
encode: () => encode3,
|
|
11889
|
-
name: () =>
|
|
11979
|
+
name: () => name19
|
|
11890
11980
|
});
|
|
11891
|
-
async function
|
|
11981
|
+
async function decode15(gltfData) {
|
|
11892
11982
|
const iterator = new GLTFIterator(gltfData);
|
|
11893
11983
|
const extension = iterator.getExtension(KHR_LIGHTS_PUNCTUAL);
|
|
11894
11984
|
if (extension) {
|
|
@@ -11920,7 +12010,7 @@ async function encode3(gltfData) {
|
|
|
11920
12010
|
delete gltfScenegraph.json.lights;
|
|
11921
12011
|
}
|
|
11922
12012
|
}
|
|
11923
|
-
var KHR_LIGHTS_PUNCTUAL,
|
|
12013
|
+
var KHR_LIGHTS_PUNCTUAL, name19;
|
|
11924
12014
|
var init_KHR_lights_punctual = __esm({
|
|
11925
12015
|
"../scene/src/gltf/lib/extensions/deprecated/KHR_lights_punctual.ts"() {
|
|
11926
12016
|
"use strict";
|
|
@@ -11928,18 +12018,18 @@ var init_KHR_lights_punctual = __esm({
|
|
|
11928
12018
|
init_gltf_iterator();
|
|
11929
12019
|
init_gltf_scenegraph();
|
|
11930
12020
|
KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
|
|
11931
|
-
|
|
12021
|
+
name19 = KHR_LIGHTS_PUNCTUAL;
|
|
11932
12022
|
}
|
|
11933
12023
|
});
|
|
11934
12024
|
|
|
11935
12025
|
// ../scene/src/gltf/lib/extensions/deprecated/KHR_materials_unlit.ts
|
|
11936
12026
|
var KHR_materials_unlit_exports = {};
|
|
11937
12027
|
__export(KHR_materials_unlit_exports, {
|
|
11938
|
-
decode: () =>
|
|
12028
|
+
decode: () => decode16,
|
|
11939
12029
|
encode: () => encode4,
|
|
11940
|
-
name: () =>
|
|
12030
|
+
name: () => name20
|
|
11941
12031
|
});
|
|
11942
|
-
async function
|
|
12032
|
+
async function decode16(gltfData) {
|
|
11943
12033
|
const iterator = new GLTFIterator(gltfData);
|
|
11944
12034
|
for (const material of iterator.materials) {
|
|
11945
12035
|
const extension = iterator.getExtension(material, KHR_MATERIALS_UNLIT);
|
|
@@ -11964,25 +12054,25 @@ function encode4(gltfData) {
|
|
|
11964
12054
|
for (const field of ["extensionsUsed", "extensionsRequired"])
|
|
11965
12055
|
if (((_a = gltfData.json[field]) == null ? void 0 : _a.length) === 0) delete gltfData.json[field];
|
|
11966
12056
|
}
|
|
11967
|
-
var KHR_MATERIALS_UNLIT,
|
|
12057
|
+
var KHR_MATERIALS_UNLIT, name20;
|
|
11968
12058
|
var init_KHR_materials_unlit = __esm({
|
|
11969
12059
|
"../scene/src/gltf/lib/extensions/deprecated/KHR_materials_unlit.ts"() {
|
|
11970
12060
|
"use strict";
|
|
11971
12061
|
init_gltf_iterator();
|
|
11972
12062
|
init_gltf_scenegraph();
|
|
11973
12063
|
KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
|
|
11974
|
-
|
|
12064
|
+
name20 = KHR_MATERIALS_UNLIT;
|
|
11975
12065
|
}
|
|
11976
12066
|
});
|
|
11977
12067
|
|
|
11978
12068
|
// ../scene/src/gltf/lib/extensions/deprecated/KHR_techniques_webgl.ts
|
|
11979
12069
|
var KHR_techniques_webgl_exports = {};
|
|
11980
12070
|
__export(KHR_techniques_webgl_exports, {
|
|
11981
|
-
decode: () =>
|
|
12071
|
+
decode: () => decode17,
|
|
11982
12072
|
encode: () => encode5,
|
|
11983
|
-
name: () =>
|
|
12073
|
+
name: () => name21
|
|
11984
12074
|
});
|
|
11985
|
-
async function
|
|
12075
|
+
async function decode17(gltfData) {
|
|
11986
12076
|
const iterator = new GLTFIterator(gltfData);
|
|
11987
12077
|
const extension = iterator.getExtension(KHR_TECHNIQUES_WEBGL);
|
|
11988
12078
|
if (extension) {
|
|
@@ -12043,14 +12133,14 @@ function resolveValues(technique, iterator) {
|
|
|
12043
12133
|
});
|
|
12044
12134
|
return values;
|
|
12045
12135
|
}
|
|
12046
|
-
var KHR_TECHNIQUES_WEBGL,
|
|
12136
|
+
var KHR_TECHNIQUES_WEBGL, name21;
|
|
12047
12137
|
var init_KHR_techniques_webgl = __esm({
|
|
12048
12138
|
"../scene/src/gltf/lib/extensions/deprecated/KHR_techniques_webgl.ts"() {
|
|
12049
12139
|
"use strict";
|
|
12050
12140
|
init_gltf_iterator();
|
|
12051
12141
|
init_get_typed_array();
|
|
12052
12142
|
KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
|
|
12053
|
-
|
|
12143
|
+
name21 = KHR_TECHNIQUES_WEBGL;
|
|
12054
12144
|
}
|
|
12055
12145
|
});
|
|
12056
12146
|
|
|
@@ -12080,6 +12170,7 @@ var EXTENSIONS;
|
|
|
12080
12170
|
var init_gltf_extensions = __esm({
|
|
12081
12171
|
"../scene/src/gltf/lib/api/gltf-extensions.ts"() {
|
|
12082
12172
|
"use strict";
|
|
12173
|
+
init_KHR_accessor_float64();
|
|
12083
12174
|
init_EXT_mesh_features();
|
|
12084
12175
|
init_EXT_structural_metadata();
|
|
12085
12176
|
init_KHR_gaussian_splatting();
|
|
@@ -12091,6 +12182,7 @@ var init_gltf_extensions = __esm({
|
|
|
12091
12182
|
init_KHR_meshopt_compression();
|
|
12092
12183
|
init_EXT_texture_webp();
|
|
12093
12184
|
init_EXT_texture_avif();
|
|
12185
|
+
init_MSFT_texture_dds();
|
|
12094
12186
|
init_KHR_texture_basisu();
|
|
12095
12187
|
init_KHR_draco_mesh_compression();
|
|
12096
12188
|
init_KHR_texture_transform();
|
|
@@ -12100,6 +12192,7 @@ var init_gltf_extensions = __esm({
|
|
|
12100
12192
|
init_KHR_techniques_webgl();
|
|
12101
12193
|
init_EXT_feature_metadata();
|
|
12102
12194
|
EXTENSIONS = [
|
|
12195
|
+
KHR_accessor_float64_exports,
|
|
12103
12196
|
// 1.0
|
|
12104
12197
|
// KHR_binary_gltf is handled separately - must be processed before other parsing starts
|
|
12105
12198
|
// KHR_binary_gltf,
|
|
@@ -12118,9 +12211,11 @@ var init_gltf_extensions = __esm({
|
|
|
12118
12211
|
EXT_mesh_polygon_exports,
|
|
12119
12212
|
MPEG_audio_spatial_exports,
|
|
12120
12213
|
KHR_audio_emitter_exports,
|
|
12121
|
-
EXT_texture_avif_exports,
|
|
12122
12214
|
EXT_texture_webp_exports,
|
|
12123
|
-
|
|
12215
|
+
EXT_texture_avif_exports,
|
|
12216
|
+
// Compressed textures take precedence over browser image formats when available.
|
|
12217
|
+
MSFT_texture_dds_exports,
|
|
12218
|
+
// BasisU remains preferred when both compressed alternatives are provided.
|
|
12124
12219
|
KHR_texture_basisu_exports,
|
|
12125
12220
|
KHR_lights_punctual_exports,
|
|
12126
12221
|
KHR_materials_unlit_exports,
|
|
@@ -12132,7 +12227,7 @@ var init_gltf_extensions = __esm({
|
|
|
12132
12227
|
});
|
|
12133
12228
|
|
|
12134
12229
|
// ../scene/src/gltf/lib/extensions/KHR_binary_gltf.ts
|
|
12135
|
-
function
|
|
12230
|
+
function preprocess7(gltfData) {
|
|
12136
12231
|
const iterator = new GLTFIterator(gltfData);
|
|
12137
12232
|
for (const image of iterator.images) {
|
|
12138
12233
|
const extension = iterator.getExtension(image, KHR_BINARY_GLTF);
|
|
@@ -12274,7 +12369,7 @@ function convertGLTFV1Skins(json, resolveNodeId, reportUnsupported) {
|
|
|
12274
12369
|
for (let skinIndex = 0; skinIndex < originalSkinCount; skinIndex++) {
|
|
12275
12370
|
const skin = skins[skinIndex];
|
|
12276
12371
|
const jointNames = skin.jointNames;
|
|
12277
|
-
if (!Array.isArray(jointNames) || jointNames.length === 0 || jointNames.some((
|
|
12372
|
+
if (!Array.isArray(jointNames) || jointNames.length === 0 || jointNames.some((name22) => typeof name22 !== "string" || !name22) || new Set(jointNames).size !== jointNames.length) {
|
|
12278
12373
|
reportUnsupported(`skin ${skinIndex} has invalid joint names`);
|
|
12279
12374
|
hasUnconvertedSkin = true;
|
|
12280
12375
|
continue;
|
|
@@ -12858,7 +12953,7 @@ function hasOpaqueGLTFV1Consumers(json) {
|
|
|
12858
12953
|
for (const [field, value] of Object.entries(object)) {
|
|
12859
12954
|
if (field === "extras") continue;
|
|
12860
12955
|
if (field === "extensions" && value && typeof value === "object" && Object.keys(value).some(
|
|
12861
|
-
(
|
|
12956
|
+
(name22) => !["KHR_materials_unlit", "KHR_materials_common"].includes(name22)
|
|
12862
12957
|
))
|
|
12863
12958
|
return true;
|
|
12864
12959
|
pending.push(value);
|
|
@@ -12998,18 +13093,18 @@ function preserveLegacyFields(object, fields) {
|
|
|
12998
13093
|
function isRecord(value) {
|
|
12999
13094
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
13000
13095
|
}
|
|
13001
|
-
function convertGLTFV1AttributeName(
|
|
13002
|
-
const indexed = /^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(
|
|
13096
|
+
function convertGLTFV1AttributeName(name22) {
|
|
13097
|
+
const indexed = /^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(name22);
|
|
13003
13098
|
if (indexed) {
|
|
13004
13099
|
const semantic = indexed[1].startsWith("JOINT") ? "JOINTS" : indexed[1].startsWith("WEIGHT") ? "WEIGHTS" : indexed[1];
|
|
13005
13100
|
const index = Number(indexed[2] || 0);
|
|
13006
13101
|
if (!Number.isSafeInteger(index) || index > 999999999)
|
|
13007
|
-
throw new Error(`glTF v1: invalid attribute set index ${
|
|
13102
|
+
throw new Error(`glTF v1: invalid attribute set index ${name22}`);
|
|
13008
13103
|
return `${semantic}_${index}`;
|
|
13009
13104
|
}
|
|
13010
|
-
if (["POSITION", "NORMAL", "TANGENT"].includes(
|
|
13011
|
-
return
|
|
13012
|
-
return `_${
|
|
13105
|
+
if (["POSITION", "NORMAL", "TANGENT"].includes(name22) || name22.startsWith("_") || name22.includes(":"))
|
|
13106
|
+
return name22;
|
|
13107
|
+
return `_${name22}`;
|
|
13013
13108
|
}
|
|
13014
13109
|
var init_clean_gltf_v1_fields = __esm({
|
|
13015
13110
|
"../scene/src/gltf/lib/api/clean-gltf-v1-fields.ts"() {
|
|
@@ -13435,8 +13530,8 @@ function validateSkinInfluences(gltf, readAccessor, reportUnsupported) {
|
|
|
13435
13530
|
checkedBindings.add(binding);
|
|
13436
13531
|
for (const [primitiveIndex, primitive] of mesh.primitives.entries()) {
|
|
13437
13532
|
const label = `mesh ${node.mesh} primitive ${primitiveIndex} skin ${node.skin}`;
|
|
13438
|
-
const jointSets = Object.keys(primitive.attributes).filter((
|
|
13439
|
-
const weightSets = Object.keys(primitive.attributes).filter((
|
|
13533
|
+
const jointSets = Object.keys(primitive.attributes).filter((name22) => /^JOINTS_\d+$/.test(name22)).map((name22) => Number(name22.slice(7))).sort((first, second) => first - second);
|
|
13534
|
+
const weightSets = Object.keys(primitive.attributes).filter((name22) => /^WEIGHTS_\d+$/.test(name22)).map((name22) => Number(name22.slice(8))).sort((first, second) => first - second);
|
|
13440
13535
|
if (!jointSets.length && !weightSets.length) {
|
|
13441
13536
|
reportUnsupported(`${label} requires JOINTS_0 and WEIGHTS_0 skin influences`);
|
|
13442
13537
|
continue;
|
|
@@ -13887,7 +13982,7 @@ function collectExtensionNames(value) {
|
|
|
13887
13982
|
if (!object || typeof object !== "object" || visited.has(object)) continue;
|
|
13888
13983
|
visited.add(object);
|
|
13889
13984
|
if (isRecord2(object) && isRecord2(object.extensions))
|
|
13890
|
-
for (const
|
|
13985
|
+
for (const name22 of Object.keys(object.extensions)) names.add(name22);
|
|
13891
13986
|
for (const [field, child] of Object.entries(object))
|
|
13892
13987
|
if (field !== "extras") pending.push(child);
|
|
13893
13988
|
}
|
|
@@ -14045,7 +14140,7 @@ var init_normalize_gltf_v1 = __esm({
|
|
|
14045
14140
|
this._addAsset(json);
|
|
14046
14141
|
this._orderBinaryBufferPayloads(gltf);
|
|
14047
14142
|
this._convertTopLevelObjectsToArrays(json);
|
|
14048
|
-
|
|
14143
|
+
preprocess7(gltf);
|
|
14049
14144
|
this._convertObjectIdsToArrayIndices(json);
|
|
14050
14145
|
this._updateObjects(json);
|
|
14051
14146
|
for (const [bufferIndex, buffer] of (json.buffers || []).entries())
|
|
@@ -14634,6 +14729,7 @@ function getReferencesImageIndices(gltf) {
|
|
|
14634
14729
|
return Array.from(imageIndices).sort();
|
|
14635
14730
|
}
|
|
14636
14731
|
async function loadImage(gltf, image, index, options, context) {
|
|
14732
|
+
var _a, _b, _c;
|
|
14637
14733
|
let arrayBuffer;
|
|
14638
14734
|
if (image.uri && !image.hasOwnProperty("bufferView")) {
|
|
14639
14735
|
const uri = resolveUrl(image.uri, options, context);
|
|
@@ -14650,6 +14746,33 @@ async function loadImage(gltf, image, index, options, context) {
|
|
|
14650
14746
|
}
|
|
14651
14747
|
assert3(arrayBuffer, "glTF image has no data");
|
|
14652
14748
|
const gltfOptions = getGLTFImageOptions(options, image.mimeType);
|
|
14749
|
+
const ddsLoader = getDDSLoader(context);
|
|
14750
|
+
const ddsSelected = Boolean(
|
|
14751
|
+
ddsLoader && !((_b = (_a = options.gltf) == null ? void 0 : _a.excludeExtensions) == null ? void 0 : _b.includes("MSFT_texture_dds")) && ((_c = gltf.json.textures) == null ? void 0 : _c.some(
|
|
14752
|
+
(texture) => {
|
|
14753
|
+
var _a2, _b2;
|
|
14754
|
+
return texture.source === index && ((_b2 = (_a2 = texture.extensions) == null ? void 0 : _a2.MSFT_texture_dds) == null ? void 0 : _b2.source) === index;
|
|
14755
|
+
}
|
|
14756
|
+
))
|
|
14757
|
+
);
|
|
14758
|
+
if (ddsSelected) {
|
|
14759
|
+
const levels = await parseFromContext(
|
|
14760
|
+
arrayBuffer,
|
|
14761
|
+
ddsLoader,
|
|
14762
|
+
options,
|
|
14763
|
+
context
|
|
14764
|
+
);
|
|
14765
|
+
assert3(levels.length > 0, "MSFT_texture_dds parser returned no texture levels");
|
|
14766
|
+
gltf.images = gltf.images || [];
|
|
14767
|
+
gltf.images[index] = {
|
|
14768
|
+
compressed: true,
|
|
14769
|
+
mipmaps: true,
|
|
14770
|
+
width: levels[0].width,
|
|
14771
|
+
height: levels[0].height,
|
|
14772
|
+
data: levels
|
|
14773
|
+
};
|
|
14774
|
+
return;
|
|
14775
|
+
}
|
|
14653
14776
|
let parsedImage = await parseFromContext(
|
|
14654
14777
|
arrayBuffer,
|
|
14655
14778
|
[ImageLoader, BasisLoader],
|
|
@@ -14682,6 +14805,7 @@ var init_parse_gltf = __esm({
|
|
|
14682
14805
|
init_resolve_gltf_file();
|
|
14683
14806
|
init_get_typed_array();
|
|
14684
14807
|
init_gltf_extensions();
|
|
14808
|
+
init_MSFT_texture_dds();
|
|
14685
14809
|
init_normalize_gltf_v1();
|
|
14686
14810
|
PACKAGE_URL_PREFIX = "gltf-package://";
|
|
14687
14811
|
}
|
|
@@ -14890,7 +15014,7 @@ var VERSION5;
|
|
|
14890
15014
|
var init_version5 = __esm({
|
|
14891
15015
|
"dist/3d-tiles/lib/utils/version.js"() {
|
|
14892
15016
|
"use strict";
|
|
14893
|
-
VERSION5 = true ? "5.0.0-beta.
|
|
15017
|
+
VERSION5 = true ? "5.0.0-beta.4" : "latest";
|
|
14894
15018
|
}
|
|
14895
15019
|
});
|
|
14896
15020
|
|
|
@@ -17743,8 +17867,8 @@ var init_format_spatial_reference = __esm({
|
|
|
17743
17867
|
function getSpatialProjectionEngine() {
|
|
17744
17868
|
return spatialProjectionEngine;
|
|
17745
17869
|
}
|
|
17746
|
-
function getGeoidModel(
|
|
17747
|
-
return geoidModels.get(
|
|
17870
|
+
function getGeoidModel(name22) {
|
|
17871
|
+
return geoidModels.get(name22);
|
|
17748
17872
|
}
|
|
17749
17873
|
var import_earth, import_projection, geoidModels, spatialProjectionEngine;
|
|
17750
17874
|
var init_spatial_resource_registry = __esm({
|
|
@@ -20140,9 +20264,9 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20140
20264
|
this.binary = binary;
|
|
20141
20265
|
this.featureCount = featureCount;
|
|
20142
20266
|
this._extensions = ((_a = this.json) == null ? void 0 : _a.extensions) || {};
|
|
20143
|
-
this._properties =
|
|
20144
|
-
for (const propertyName
|
|
20145
|
-
if (!IGNORED_PROPERTY_FIELDS
|
|
20267
|
+
this._properties = /* @__PURE__ */ Object.create(null);
|
|
20268
|
+
for (const propertyName of Object.keys(this.json)) {
|
|
20269
|
+
if (!Object.hasOwn(IGNORED_PROPERTY_FIELDS, propertyName)) {
|
|
20146
20270
|
this._properties[propertyName] = this.json[propertyName];
|
|
20147
20271
|
}
|
|
20148
20272
|
}
|
|
@@ -20183,10 +20307,10 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20183
20307
|
}
|
|
20184
20308
|
return void 0;
|
|
20185
20309
|
}
|
|
20186
|
-
hasProperty(batchId,
|
|
20310
|
+
hasProperty(batchId, name22) {
|
|
20187
20311
|
this._checkBatchId(batchId);
|
|
20188
|
-
assert(typeof
|
|
20189
|
-
return defined4(this._properties[
|
|
20312
|
+
assert(typeof name22 === "string", name22);
|
|
20313
|
+
return defined4(this._properties[name22]) || this._hasPropertyInHierarchy(batchId, name22);
|
|
20190
20314
|
}
|
|
20191
20315
|
getPropertyNames(batchId, results) {
|
|
20192
20316
|
this._checkBatchId(batchId);
|
|
@@ -20199,47 +20323,47 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20199
20323
|
}
|
|
20200
20324
|
return results;
|
|
20201
20325
|
}
|
|
20202
|
-
getProperty(batchId,
|
|
20326
|
+
getProperty(batchId, name22) {
|
|
20203
20327
|
this._checkBatchId(batchId);
|
|
20204
|
-
assert(typeof
|
|
20328
|
+
assert(typeof name22 === "string", name22);
|
|
20205
20329
|
if (this._binaryProperties) {
|
|
20206
|
-
const binaryProperty = this._binaryProperties[
|
|
20330
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
20207
20331
|
if (defined4(binaryProperty)) {
|
|
20208
20332
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
20209
20333
|
}
|
|
20210
20334
|
}
|
|
20211
|
-
const propertyValues = this._properties[
|
|
20335
|
+
const propertyValues = this._properties[name22];
|
|
20212
20336
|
if (defined4(propertyValues)) {
|
|
20213
20337
|
return clone(propertyValues[batchId], true);
|
|
20214
20338
|
}
|
|
20215
20339
|
if (this._hierarchy) {
|
|
20216
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
20340
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name22);
|
|
20217
20341
|
if (defined4(hierarchyProperty)) {
|
|
20218
20342
|
return hierarchyProperty;
|
|
20219
20343
|
}
|
|
20220
20344
|
}
|
|
20221
20345
|
return void 0;
|
|
20222
20346
|
}
|
|
20223
|
-
setProperty(batchId,
|
|
20347
|
+
setProperty(batchId, name22, value) {
|
|
20224
20348
|
const featureCount = this.featureCount;
|
|
20225
20349
|
this._checkBatchId(batchId);
|
|
20226
|
-
assert(typeof
|
|
20350
|
+
assert(typeof name22 === "string", name22);
|
|
20227
20351
|
if (this._binaryProperties) {
|
|
20228
|
-
const binaryProperty = this._binaryProperties[
|
|
20352
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
20229
20353
|
if (binaryProperty) {
|
|
20230
20354
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
20231
20355
|
return;
|
|
20232
20356
|
}
|
|
20233
20357
|
}
|
|
20234
20358
|
if (this._hierarchy) {
|
|
20235
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
20359
|
+
if (this._setHierarchyProperty(this, batchId, name22, value)) {
|
|
20236
20360
|
return;
|
|
20237
20361
|
}
|
|
20238
20362
|
}
|
|
20239
|
-
let propertyValues = this._properties[
|
|
20363
|
+
let propertyValues = this._properties[name22];
|
|
20240
20364
|
if (!defined4(propertyValues)) {
|
|
20241
|
-
this._properties[
|
|
20242
|
-
propertyValues = this._properties[
|
|
20365
|
+
this._properties[name22] = new Array(featureCount);
|
|
20366
|
+
propertyValues = this._properties[name22];
|
|
20243
20367
|
}
|
|
20244
20368
|
propertyValues[batchId] = clone(value, true);
|
|
20245
20369
|
}
|
|
@@ -20258,21 +20382,21 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20258
20382
|
}
|
|
20259
20383
|
_initializeBinaryProperties() {
|
|
20260
20384
|
let binaryProperties = null;
|
|
20261
|
-
for (const
|
|
20262
|
-
const property = this._properties[
|
|
20263
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
20385
|
+
for (const name22 in this._properties) {
|
|
20386
|
+
const property = this._properties[name22];
|
|
20387
|
+
const binaryProperty = this._initializeBinaryProperty(name22, property);
|
|
20264
20388
|
if (binaryProperty) {
|
|
20265
|
-
binaryProperties
|
|
20266
|
-
binaryProperties[
|
|
20389
|
+
binaryProperties ??= /* @__PURE__ */ Object.create(null);
|
|
20390
|
+
binaryProperties[name22] = binaryProperty;
|
|
20267
20391
|
}
|
|
20268
20392
|
}
|
|
20269
20393
|
return binaryProperties;
|
|
20270
20394
|
}
|
|
20271
|
-
_initializeBinaryProperty(
|
|
20395
|
+
_initializeBinaryProperty(name22, property) {
|
|
20272
20396
|
if ("byteOffset" in property) {
|
|
20273
20397
|
const tile3DAccessor = property;
|
|
20274
|
-
assert(this.binary, `Property ${
|
|
20275
|
-
assert(tile3DAccessor.type, `Property ${
|
|
20398
|
+
assert(this.binary, `Property ${name22} requires a batch table binary.`);
|
|
20399
|
+
assert(tile3DAccessor.type, `Property ${name22} requires a type.`);
|
|
20276
20400
|
const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
|
|
20277
20401
|
return {
|
|
20278
20402
|
typedArray: accessor.values,
|
|
@@ -20284,14 +20408,14 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20284
20408
|
return null;
|
|
20285
20409
|
}
|
|
20286
20410
|
// EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy
|
|
20287
|
-
_hasPropertyInHierarchy(batchId,
|
|
20411
|
+
_hasPropertyInHierarchy(batchId, name22) {
|
|
20288
20412
|
if (!this._hierarchy) {
|
|
20289
20413
|
return false;
|
|
20290
20414
|
}
|
|
20291
20415
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
20292
20416
|
const classId = hierarchy.classIds[instanceIndex];
|
|
20293
20417
|
const instances = hierarchy.classes[classId].instances;
|
|
20294
|
-
return defined4(instances[
|
|
20418
|
+
return Object.hasOwn(instances, name22) && defined4(instances[name22]) ? true : void 0;
|
|
20295
20419
|
});
|
|
20296
20420
|
return defined4(result);
|
|
20297
20421
|
}
|
|
@@ -20299,21 +20423,21 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20299
20423
|
traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
20300
20424
|
const classId = hierarchy.classIds[instanceIndex];
|
|
20301
20425
|
const instances = hierarchy.classes[classId].instances;
|
|
20302
|
-
for (const
|
|
20303
|
-
if (
|
|
20304
|
-
if (results.indexOf(
|
|
20305
|
-
results.push(
|
|
20426
|
+
for (const name22 in instances) {
|
|
20427
|
+
if (Object.hasOwn(instances, name22)) {
|
|
20428
|
+
if (results.indexOf(name22) === -1) {
|
|
20429
|
+
results.push(name22);
|
|
20306
20430
|
}
|
|
20307
20431
|
}
|
|
20308
20432
|
}
|
|
20309
20433
|
});
|
|
20310
20434
|
}
|
|
20311
|
-
_getHierarchyProperty(batchId,
|
|
20435
|
+
_getHierarchyProperty(batchId, name22) {
|
|
20312
20436
|
return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
20313
20437
|
const classId = hierarchy.classIds[instanceIndex];
|
|
20314
20438
|
const instanceClass = hierarchy.classes[classId];
|
|
20315
20439
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
20316
|
-
const propertyValues = instanceClass.instances[
|
|
20440
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
20317
20441
|
if (defined4(propertyValues)) {
|
|
20318
20442
|
if (defined4(propertyValues.typedArray)) {
|
|
20319
20443
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -20323,14 +20447,14 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20323
20447
|
return void 0;
|
|
20324
20448
|
});
|
|
20325
20449
|
}
|
|
20326
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
20450
|
+
_setHierarchyProperty(batchTable, batchId, name22, value) {
|
|
20327
20451
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
20328
20452
|
const classId = hierarchy.classIds[instanceIndex];
|
|
20329
20453
|
const instanceClass = hierarchy.classes[classId];
|
|
20330
20454
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
20331
|
-
const propertyValues = instanceClass.instances[
|
|
20455
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
20332
20456
|
if (defined4(propertyValues)) {
|
|
20333
|
-
assert(instanceIndex === batchId, `Inherited property "${
|
|
20457
|
+
assert(instanceIndex === batchId, `Inherited property "${name22}" is read-only.`);
|
|
20334
20458
|
if (defined4(propertyValues.typedArray)) {
|
|
20335
20459
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
20336
20460
|
} else {
|
|
@@ -23453,9 +23577,9 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23453
23577
|
this.binary = binary;
|
|
23454
23578
|
this.featureCount = featureCount;
|
|
23455
23579
|
this._extensions = ((_a = this.json) == null ? void 0 : _a.extensions) || {};
|
|
23456
|
-
this._properties =
|
|
23457
|
-
for (const propertyName
|
|
23458
|
-
if (!IGNORED_PROPERTY_FIELDS2
|
|
23580
|
+
this._properties = /* @__PURE__ */ Object.create(null);
|
|
23581
|
+
for (const propertyName of Object.keys(this.json)) {
|
|
23582
|
+
if (!Object.hasOwn(IGNORED_PROPERTY_FIELDS2, propertyName)) {
|
|
23459
23583
|
this._properties[propertyName] = this.json[propertyName];
|
|
23460
23584
|
}
|
|
23461
23585
|
}
|
|
@@ -23496,10 +23620,10 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23496
23620
|
}
|
|
23497
23621
|
return void 0;
|
|
23498
23622
|
}
|
|
23499
|
-
hasProperty(batchId,
|
|
23623
|
+
hasProperty(batchId, name22) {
|
|
23500
23624
|
this._checkBatchId(batchId);
|
|
23501
|
-
assert(typeof
|
|
23502
|
-
return defined6(this._properties[
|
|
23625
|
+
assert(typeof name22 === "string", name22);
|
|
23626
|
+
return defined6(this._properties[name22]) || this._hasPropertyInHierarchy(batchId, name22);
|
|
23503
23627
|
}
|
|
23504
23628
|
getPropertyNames(batchId, results) {
|
|
23505
23629
|
this._checkBatchId(batchId);
|
|
@@ -23512,47 +23636,47 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23512
23636
|
}
|
|
23513
23637
|
return results;
|
|
23514
23638
|
}
|
|
23515
|
-
getProperty(batchId,
|
|
23639
|
+
getProperty(batchId, name22) {
|
|
23516
23640
|
this._checkBatchId(batchId);
|
|
23517
|
-
assert(typeof
|
|
23641
|
+
assert(typeof name22 === "string", name22);
|
|
23518
23642
|
if (this._binaryProperties) {
|
|
23519
|
-
const binaryProperty = this._binaryProperties[
|
|
23643
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
23520
23644
|
if (defined6(binaryProperty)) {
|
|
23521
23645
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
23522
23646
|
}
|
|
23523
23647
|
}
|
|
23524
|
-
const propertyValues = this._properties[
|
|
23648
|
+
const propertyValues = this._properties[name22];
|
|
23525
23649
|
if (defined6(propertyValues)) {
|
|
23526
23650
|
return clone2(propertyValues[batchId], true);
|
|
23527
23651
|
}
|
|
23528
23652
|
if (this._hierarchy) {
|
|
23529
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
23653
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name22);
|
|
23530
23654
|
if (defined6(hierarchyProperty)) {
|
|
23531
23655
|
return hierarchyProperty;
|
|
23532
23656
|
}
|
|
23533
23657
|
}
|
|
23534
23658
|
return void 0;
|
|
23535
23659
|
}
|
|
23536
|
-
setProperty(batchId,
|
|
23660
|
+
setProperty(batchId, name22, value) {
|
|
23537
23661
|
const featureCount = this.featureCount;
|
|
23538
23662
|
this._checkBatchId(batchId);
|
|
23539
|
-
assert(typeof
|
|
23663
|
+
assert(typeof name22 === "string", name22);
|
|
23540
23664
|
if (this._binaryProperties) {
|
|
23541
|
-
const binaryProperty = this._binaryProperties[
|
|
23665
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
23542
23666
|
if (binaryProperty) {
|
|
23543
23667
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
23544
23668
|
return;
|
|
23545
23669
|
}
|
|
23546
23670
|
}
|
|
23547
23671
|
if (this._hierarchy) {
|
|
23548
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
23672
|
+
if (this._setHierarchyProperty(this, batchId, name22, value)) {
|
|
23549
23673
|
return;
|
|
23550
23674
|
}
|
|
23551
23675
|
}
|
|
23552
|
-
let propertyValues = this._properties[
|
|
23676
|
+
let propertyValues = this._properties[name22];
|
|
23553
23677
|
if (!defined6(propertyValues)) {
|
|
23554
|
-
this._properties[
|
|
23555
|
-
propertyValues = this._properties[
|
|
23678
|
+
this._properties[name22] = new Array(featureCount);
|
|
23679
|
+
propertyValues = this._properties[name22];
|
|
23556
23680
|
}
|
|
23557
23681
|
propertyValues[batchId] = clone2(value, true);
|
|
23558
23682
|
}
|
|
@@ -23571,21 +23695,21 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23571
23695
|
}
|
|
23572
23696
|
_initializeBinaryProperties() {
|
|
23573
23697
|
let binaryProperties = null;
|
|
23574
|
-
for (const
|
|
23575
|
-
const property = this._properties[
|
|
23576
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
23698
|
+
for (const name22 in this._properties) {
|
|
23699
|
+
const property = this._properties[name22];
|
|
23700
|
+
const binaryProperty = this._initializeBinaryProperty(name22, property);
|
|
23577
23701
|
if (binaryProperty) {
|
|
23578
|
-
binaryProperties
|
|
23579
|
-
binaryProperties[
|
|
23702
|
+
binaryProperties ??= /* @__PURE__ */ Object.create(null);
|
|
23703
|
+
binaryProperties[name22] = binaryProperty;
|
|
23580
23704
|
}
|
|
23581
23705
|
}
|
|
23582
23706
|
return binaryProperties;
|
|
23583
23707
|
}
|
|
23584
|
-
_initializeBinaryProperty(
|
|
23708
|
+
_initializeBinaryProperty(name22, property) {
|
|
23585
23709
|
if ("byteOffset" in property) {
|
|
23586
23710
|
const tile3DAccessor = property;
|
|
23587
|
-
assert(this.binary, `Property ${
|
|
23588
|
-
assert(tile3DAccessor.type, `Property ${
|
|
23711
|
+
assert(this.binary, `Property ${name22} requires a batch table binary.`);
|
|
23712
|
+
assert(tile3DAccessor.type, `Property ${name22} requires a type.`);
|
|
23589
23713
|
const accessor = createTypedArrayFromAccessor2(
|
|
23590
23714
|
tile3DAccessor,
|
|
23591
23715
|
this.binary.buffer,
|
|
@@ -23602,14 +23726,14 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23602
23726
|
return null;
|
|
23603
23727
|
}
|
|
23604
23728
|
// EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy
|
|
23605
|
-
_hasPropertyInHierarchy(batchId,
|
|
23729
|
+
_hasPropertyInHierarchy(batchId, name22) {
|
|
23606
23730
|
if (!this._hierarchy) {
|
|
23607
23731
|
return false;
|
|
23608
23732
|
}
|
|
23609
23733
|
const result = traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
23610
23734
|
const classId = hierarchy.classIds[instanceIndex];
|
|
23611
23735
|
const instances = hierarchy.classes[classId].instances;
|
|
23612
|
-
return defined6(instances[
|
|
23736
|
+
return Object.hasOwn(instances, name22) && defined6(instances[name22]) ? true : void 0;
|
|
23613
23737
|
});
|
|
23614
23738
|
return defined6(result);
|
|
23615
23739
|
}
|
|
@@ -23617,21 +23741,21 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23617
23741
|
traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
23618
23742
|
const classId = hierarchy.classIds[instanceIndex];
|
|
23619
23743
|
const instances = hierarchy.classes[classId].instances;
|
|
23620
|
-
for (const
|
|
23621
|
-
if (
|
|
23622
|
-
if (results.indexOf(
|
|
23623
|
-
results.push(
|
|
23744
|
+
for (const name22 in instances) {
|
|
23745
|
+
if (Object.hasOwn(instances, name22)) {
|
|
23746
|
+
if (results.indexOf(name22) === -1) {
|
|
23747
|
+
results.push(name22);
|
|
23624
23748
|
}
|
|
23625
23749
|
}
|
|
23626
23750
|
}
|
|
23627
23751
|
});
|
|
23628
23752
|
}
|
|
23629
|
-
_getHierarchyProperty(batchId,
|
|
23753
|
+
_getHierarchyProperty(batchId, name22) {
|
|
23630
23754
|
return traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
23631
23755
|
const classId = hierarchy.classIds[instanceIndex];
|
|
23632
23756
|
const instanceClass = hierarchy.classes[classId];
|
|
23633
23757
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
23634
|
-
const propertyValues = instanceClass.instances[
|
|
23758
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
23635
23759
|
if (defined6(propertyValues)) {
|
|
23636
23760
|
if (defined6(propertyValues.typedArray)) {
|
|
23637
23761
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -23641,14 +23765,14 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23641
23765
|
return void 0;
|
|
23642
23766
|
});
|
|
23643
23767
|
}
|
|
23644
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
23768
|
+
_setHierarchyProperty(batchTable, batchId, name22, value) {
|
|
23645
23769
|
const result = traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
23646
23770
|
const classId = hierarchy.classIds[instanceIndex];
|
|
23647
23771
|
const instanceClass = hierarchy.classes[classId];
|
|
23648
23772
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
23649
|
-
const propertyValues = instanceClass.instances[
|
|
23773
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
23650
23774
|
if (defined6(propertyValues)) {
|
|
23651
|
-
assert(instanceIndex === batchId, `Inherited property "${
|
|
23775
|
+
assert(instanceIndex === batchId, `Inherited property "${name22}" is read-only.`);
|
|
23652
23776
|
if (defined6(propertyValues.typedArray)) {
|
|
23653
23777
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
23654
23778
|
} else {
|
|
@@ -28662,12 +28786,12 @@ var init_zip_archive = __esm({
|
|
|
28662
28786
|
maxDecodedBytes: options.maxDecodedBytes ?? DEFAULT_OPTIONS.maxDecodedBytes,
|
|
28663
28787
|
chunkBytes: options.chunkBytes ?? DEFAULT_OPTIONS.chunkBytes
|
|
28664
28788
|
};
|
|
28665
|
-
for (const [
|
|
28789
|
+
for (const [name22, value] of Object.entries(this.limits)) {
|
|
28666
28790
|
const bigintLimit = ["maxArchiveBytes", "maxCompressedBytes", "maxDecodedBytes"].includes(
|
|
28667
|
-
|
|
28791
|
+
name22
|
|
28668
28792
|
);
|
|
28669
28793
|
if (bigintLimit ? typeof value !== "bigint" || value < 0n : typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
|
|
28670
|
-
throw new RangeError(`Invalid ZIP ${
|
|
28794
|
+
throw new RangeError(`Invalid ZIP ${name22} limit`);
|
|
28671
28795
|
}
|
|
28672
28796
|
this.signal = options.signal ? AbortSignal.any([this.controller.signal, options.signal]) : this.controller.signal;
|
|
28673
28797
|
}
|
|
@@ -29348,7 +29472,7 @@ var init_d_tiles_archive_loader = __esm({
|
|
|
29348
29472
|
"dist/3d-tiles/3d-tiles-archive-loader.js"() {
|
|
29349
29473
|
"use strict";
|
|
29350
29474
|
init_tiles_3d_format();
|
|
29351
|
-
VERSION7 = true ? "5.0.0-beta.
|
|
29475
|
+
VERSION7 = true ? "5.0.0-beta.4" : "latest";
|
|
29352
29476
|
Tiles3DArchiveFileLoader = {
|
|
29353
29477
|
dataType: null,
|
|
29354
29478
|
batchType: null,
|