@loaders.gl/3d-tiles 3.3.0-alpha.13 → 3.3.0-alpha.14
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 +100 -107
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/package.json +7 -7
package/dist/dist.min.js
CHANGED
|
@@ -751,46 +751,7 @@
|
|
|
751
751
|
}
|
|
752
752
|
});
|
|
753
753
|
|
|
754
|
-
// ../loader-utils/src/lib/binary-utils/buffer-utils.ts
|
|
755
|
-
function isBuffer(value) {
|
|
756
|
-
return value && typeof value === "object" && value.isBuffer;
|
|
757
|
-
}
|
|
758
|
-
function bufferToArrayBuffer(buffer) {
|
|
759
|
-
if (isBuffer(buffer)) {
|
|
760
|
-
const typedArray = new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.length);
|
|
761
|
-
return typedArray.slice().buffer;
|
|
762
|
-
}
|
|
763
|
-
return buffer;
|
|
764
|
-
}
|
|
765
|
-
var init_buffer_utils = __esm({
|
|
766
|
-
"../loader-utils/src/lib/binary-utils/buffer-utils.ts"() {
|
|
767
|
-
}
|
|
768
|
-
});
|
|
769
|
-
|
|
770
754
|
// ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts
|
|
771
|
-
function toArrayBuffer(data) {
|
|
772
|
-
if (isBuffer(data)) {
|
|
773
|
-
return bufferToArrayBuffer(data);
|
|
774
|
-
}
|
|
775
|
-
if (data instanceof ArrayBuffer) {
|
|
776
|
-
return data;
|
|
777
|
-
}
|
|
778
|
-
if (ArrayBuffer.isView(data)) {
|
|
779
|
-
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
780
|
-
return data.buffer;
|
|
781
|
-
}
|
|
782
|
-
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
783
|
-
}
|
|
784
|
-
if (typeof data === "string") {
|
|
785
|
-
const text = data;
|
|
786
|
-
const uint8Array = new TextEncoder().encode(text);
|
|
787
|
-
return uint8Array.buffer;
|
|
788
|
-
}
|
|
789
|
-
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
790
|
-
return data._toArrayBuffer();
|
|
791
|
-
}
|
|
792
|
-
throw new Error("toArrayBuffer");
|
|
793
|
-
}
|
|
794
755
|
function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) {
|
|
795
756
|
byteLength = byteLength || arrayBuffer1.byteLength;
|
|
796
757
|
if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {
|
|
@@ -823,7 +784,6 @@
|
|
|
823
784
|
}
|
|
824
785
|
var init_array_buffer_utils = __esm({
|
|
825
786
|
"../loader-utils/src/lib/binary-utils/array-buffer-utils.ts"() {
|
|
826
|
-
init_buffer_utils();
|
|
827
787
|
}
|
|
828
788
|
});
|
|
829
789
|
|
|
@@ -851,34 +811,7 @@
|
|
|
851
811
|
}
|
|
852
812
|
});
|
|
853
813
|
|
|
854
|
-
// ../loader-utils/src/lib/binary-utils/
|
|
855
|
-
function copyPaddedArrayBufferToDataView(dataView, byteOffset, sourceBuffer, padding) {
|
|
856
|
-
const paddedLength = padToNBytes(sourceBuffer.byteLength, padding);
|
|
857
|
-
const padLength = paddedLength - sourceBuffer.byteLength;
|
|
858
|
-
if (dataView) {
|
|
859
|
-
const targetArray = new Uint8Array(dataView.buffer, dataView.byteOffset + byteOffset, sourceBuffer.byteLength);
|
|
860
|
-
const sourceArray = new Uint8Array(sourceBuffer);
|
|
861
|
-
targetArray.set(sourceArray);
|
|
862
|
-
for (let i2 = 0; i2 < padLength; ++i2) {
|
|
863
|
-
dataView.setUint8(byteOffset + sourceBuffer.byteLength + i2, 32);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
byteOffset += paddedLength;
|
|
867
|
-
return byteOffset;
|
|
868
|
-
}
|
|
869
|
-
function copyPaddedStringToDataView(dataView, byteOffset, string, padding) {
|
|
870
|
-
const textEncoder = new TextEncoder();
|
|
871
|
-
const stringBuffer = textEncoder.encode(string);
|
|
872
|
-
byteOffset = copyPaddedArrayBufferToDataView(dataView, byteOffset, stringBuffer, padding);
|
|
873
|
-
return byteOffset;
|
|
874
|
-
}
|
|
875
|
-
var init_binary_copy_utils = __esm({
|
|
876
|
-
"../loader-utils/src/lib/binary-utils/binary-copy-utils.ts"() {
|
|
877
|
-
init_memory_copy_utils();
|
|
878
|
-
}
|
|
879
|
-
});
|
|
880
|
-
|
|
881
|
-
// ../loader-utils/src/lib/binary-utils/encode-utils.ts
|
|
814
|
+
// ../loader-utils/src/lib/binary-utils/dataview-copy-utils.ts
|
|
882
815
|
function padStringToByteAlignment(string, byteAlignment) {
|
|
883
816
|
const length4 = string.length;
|
|
884
817
|
const paddedLength = Math.ceil(length4 / byteAlignment) * byteAlignment;
|
|
@@ -905,8 +838,29 @@
|
|
|
905
838
|
}
|
|
906
839
|
return byteOffset + byteLength;
|
|
907
840
|
}
|
|
908
|
-
|
|
909
|
-
|
|
841
|
+
function copyPaddedArrayBufferToDataView(dataView, byteOffset, sourceBuffer, padding) {
|
|
842
|
+
const paddedLength = padToNBytes(sourceBuffer.byteLength, padding);
|
|
843
|
+
const padLength = paddedLength - sourceBuffer.byteLength;
|
|
844
|
+
if (dataView) {
|
|
845
|
+
const targetArray = new Uint8Array(dataView.buffer, dataView.byteOffset + byteOffset, sourceBuffer.byteLength);
|
|
846
|
+
const sourceArray = new Uint8Array(sourceBuffer);
|
|
847
|
+
targetArray.set(sourceArray);
|
|
848
|
+
for (let i2 = 0; i2 < padLength; ++i2) {
|
|
849
|
+
dataView.setUint8(byteOffset + sourceBuffer.byteLength + i2, 32);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
byteOffset += paddedLength;
|
|
853
|
+
return byteOffset;
|
|
854
|
+
}
|
|
855
|
+
function copyPaddedStringToDataView(dataView, byteOffset, string, padding) {
|
|
856
|
+
const textEncoder = new TextEncoder();
|
|
857
|
+
const stringBuffer = textEncoder.encode(string);
|
|
858
|
+
byteOffset = copyPaddedArrayBufferToDataView(dataView, byteOffset, stringBuffer, padding);
|
|
859
|
+
return byteOffset;
|
|
860
|
+
}
|
|
861
|
+
var init_dataview_copy_utils = __esm({
|
|
862
|
+
"../loader-utils/src/lib/binary-utils/dataview-copy-utils.ts"() {
|
|
863
|
+
init_memory_copy_utils();
|
|
910
864
|
}
|
|
911
865
|
});
|
|
912
866
|
|
|
@@ -964,6 +918,45 @@
|
|
|
964
918
|
}
|
|
965
919
|
});
|
|
966
920
|
|
|
921
|
+
// (disabled):../loader-utils/src/lib/node/buffer
|
|
922
|
+
var init_buffer = __esm({
|
|
923
|
+
"(disabled):../loader-utils/src/lib/node/buffer"() {
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
|
|
927
|
+
// ../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts
|
|
928
|
+
function isBuffer(value) {
|
|
929
|
+
return value && typeof value === "object" && value.isBuffer;
|
|
930
|
+
}
|
|
931
|
+
function toArrayBuffer2(data) {
|
|
932
|
+
if (isBuffer(data)) {
|
|
933
|
+
return node2.toArrayBuffer(data);
|
|
934
|
+
}
|
|
935
|
+
if (data instanceof ArrayBuffer) {
|
|
936
|
+
return data;
|
|
937
|
+
}
|
|
938
|
+
if (ArrayBuffer.isView(data)) {
|
|
939
|
+
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
940
|
+
return data.buffer;
|
|
941
|
+
}
|
|
942
|
+
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
943
|
+
}
|
|
944
|
+
if (typeof data === "string") {
|
|
945
|
+
const text = data;
|
|
946
|
+
const uint8Array = new TextEncoder().encode(text);
|
|
947
|
+
return uint8Array.buffer;
|
|
948
|
+
}
|
|
949
|
+
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
950
|
+
return data._toArrayBuffer();
|
|
951
|
+
}
|
|
952
|
+
throw new Error("toArrayBuffer");
|
|
953
|
+
}
|
|
954
|
+
var init_memory_conversion_utils = __esm({
|
|
955
|
+
"../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts"() {
|
|
956
|
+
init_buffer();
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
|
|
967
960
|
// ../loader-utils/src/lib/path-utils/path.ts
|
|
968
961
|
var path_exports = {};
|
|
969
962
|
__export(path_exports, {
|
|
@@ -1006,10 +999,10 @@
|
|
|
1006
999
|
init_parse_json();
|
|
1007
1000
|
init_array_buffer_utils();
|
|
1008
1001
|
init_memory_copy_utils();
|
|
1009
|
-
|
|
1010
|
-
init_encode_utils();
|
|
1002
|
+
init_dataview_copy_utils();
|
|
1011
1003
|
init_async_iteration();
|
|
1012
1004
|
init_file_aliases();
|
|
1005
|
+
init_memory_conversion_utils();
|
|
1013
1006
|
init_path();
|
|
1014
1007
|
}
|
|
1015
1008
|
});
|
|
@@ -5770,7 +5763,7 @@
|
|
|
5770
5763
|
if (done) {
|
|
5771
5764
|
return;
|
|
5772
5765
|
}
|
|
5773
|
-
yield
|
|
5766
|
+
yield toArrayBuffer2(value);
|
|
5774
5767
|
}
|
|
5775
5768
|
} catch (error) {
|
|
5776
5769
|
reader.releaseLock();
|
|
@@ -5778,7 +5771,7 @@
|
|
|
5778
5771
|
}
|
|
5779
5772
|
async function* makeNodeStreamIterator(stream, options) {
|
|
5780
5773
|
for await (const chunk of stream) {
|
|
5781
|
-
yield
|
|
5774
|
+
yield toArrayBuffer2(chunk);
|
|
5782
5775
|
}
|
|
5783
5776
|
}
|
|
5784
5777
|
var init_make_stream_iterator = __esm({
|
|
@@ -9638,8 +9631,8 @@
|
|
|
9638
9631
|
this.json.scenes.push({ nodes: nodeIndices });
|
|
9639
9632
|
return this.json.scenes.length - 1;
|
|
9640
9633
|
}
|
|
9641
|
-
addNode(
|
|
9642
|
-
const { meshIndex, matrix } =
|
|
9634
|
+
addNode(node3) {
|
|
9635
|
+
const { meshIndex, matrix } = node3;
|
|
9643
9636
|
this.json.nodes = this.json.nodes || [];
|
|
9644
9637
|
const nodeData = { mesh: meshIndex };
|
|
9645
9638
|
if (matrix) {
|
|
@@ -10509,12 +10502,12 @@
|
|
|
10509
10502
|
gltfScenegraph.json.lights = extension.lights;
|
|
10510
10503
|
gltfScenegraph.removeExtension(KHR_LIGHTS_PUNCTUAL);
|
|
10511
10504
|
}
|
|
10512
|
-
for (const
|
|
10513
|
-
const nodeExtension = gltfScenegraph.getObjectExtension(
|
|
10505
|
+
for (const node3 of json.nodes || []) {
|
|
10506
|
+
const nodeExtension = gltfScenegraph.getObjectExtension(node3, KHR_LIGHTS_PUNCTUAL);
|
|
10514
10507
|
if (nodeExtension) {
|
|
10515
|
-
|
|
10508
|
+
node3.light = nodeExtension.light;
|
|
10516
10509
|
}
|
|
10517
|
-
gltfScenegraph.removeObjectExtension(
|
|
10510
|
+
gltfScenegraph.removeObjectExtension(node3, KHR_LIGHTS_PUNCTUAL);
|
|
10518
10511
|
}
|
|
10519
10512
|
}
|
|
10520
10513
|
async function encode2(gltfData) {
|
|
@@ -10528,8 +10521,8 @@
|
|
|
10528
10521
|
}
|
|
10529
10522
|
if (gltfScenegraph.json.lights) {
|
|
10530
10523
|
for (const light of gltfScenegraph.json.lights) {
|
|
10531
|
-
const
|
|
10532
|
-
gltfScenegraph.addObjectExtension(
|
|
10524
|
+
const node3 = light.node;
|
|
10525
|
+
gltfScenegraph.addObjectExtension(node3, KHR_LIGHTS_PUNCTUAL, light);
|
|
10533
10526
|
}
|
|
10534
10527
|
delete gltfScenegraph.json.lights;
|
|
10535
10528
|
}
|
|
@@ -10920,11 +10913,11 @@
|
|
|
10920
10913
|
for (const mesh of json.meshes) {
|
|
10921
10914
|
this._convertMeshIds(mesh);
|
|
10922
10915
|
}
|
|
10923
|
-
for (const
|
|
10924
|
-
this._convertNodeIds(
|
|
10916
|
+
for (const node3 of json.nodes) {
|
|
10917
|
+
this._convertNodeIds(node3);
|
|
10925
10918
|
}
|
|
10926
|
-
for (const
|
|
10927
|
-
this._convertSceneIds(
|
|
10919
|
+
for (const node3 of json.scenes) {
|
|
10920
|
+
this._convertSceneIds(node3);
|
|
10928
10921
|
}
|
|
10929
10922
|
}
|
|
10930
10923
|
_convertTextureIds(texture) {
|
|
@@ -10946,17 +10939,17 @@
|
|
|
10946
10939
|
}
|
|
10947
10940
|
}
|
|
10948
10941
|
}
|
|
10949
|
-
_convertNodeIds(
|
|
10950
|
-
if (
|
|
10951
|
-
|
|
10942
|
+
_convertNodeIds(node3) {
|
|
10943
|
+
if (node3.children) {
|
|
10944
|
+
node3.children = node3.children.map((child) => this._convertIdToIndex(child, "node"));
|
|
10952
10945
|
}
|
|
10953
|
-
if (
|
|
10954
|
-
|
|
10946
|
+
if (node3.meshes) {
|
|
10947
|
+
node3.meshes = node3.meshes.map((mesh) => this._convertIdToIndex(mesh, "mesh"));
|
|
10955
10948
|
}
|
|
10956
10949
|
}
|
|
10957
10950
|
_convertSceneIds(scene) {
|
|
10958
10951
|
if (scene.nodes) {
|
|
10959
|
-
scene.nodes = scene.nodes.map((
|
|
10952
|
+
scene.nodes = scene.nodes.map((node3) => this._convertIdToIndex(node3, "node"));
|
|
10960
10953
|
}
|
|
10961
10954
|
}
|
|
10962
10955
|
_convertIdsToIndices(json, topLevelArrayName) {
|
|
@@ -11099,7 +11092,7 @@
|
|
|
11099
11092
|
json.meshes = json.meshes.map((mesh, i2) => this._resolveMesh(mesh, i2));
|
|
11100
11093
|
}
|
|
11101
11094
|
if (json.nodes) {
|
|
11102
|
-
json.nodes = json.nodes.map((
|
|
11095
|
+
json.nodes = json.nodes.map((node3, i2) => this._resolveNode(node3, i2));
|
|
11103
11096
|
}
|
|
11104
11097
|
if (json.skins) {
|
|
11105
11098
|
json.skins = json.skins.map((skin, i2) => this._resolveSkin(skin, i2));
|
|
@@ -11159,31 +11152,31 @@
|
|
|
11159
11152
|
}
|
|
11160
11153
|
_resolveScene(scene, index) {
|
|
11161
11154
|
scene.id = scene.id || `scene-${index}`;
|
|
11162
|
-
scene.nodes = (scene.nodes || []).map((
|
|
11155
|
+
scene.nodes = (scene.nodes || []).map((node3) => this.getNode(node3));
|
|
11163
11156
|
return scene;
|
|
11164
11157
|
}
|
|
11165
|
-
_resolveNode(
|
|
11166
|
-
|
|
11167
|
-
if (
|
|
11168
|
-
|
|
11158
|
+
_resolveNode(node3, index) {
|
|
11159
|
+
node3.id = node3.id || `node-${index}`;
|
|
11160
|
+
if (node3.children) {
|
|
11161
|
+
node3.children = node3.children.map((child) => this.getNode(child));
|
|
11169
11162
|
}
|
|
11170
|
-
if (
|
|
11171
|
-
|
|
11172
|
-
} else if (
|
|
11173
|
-
|
|
11163
|
+
if (node3.mesh !== void 0) {
|
|
11164
|
+
node3.mesh = this.getMesh(node3.mesh);
|
|
11165
|
+
} else if (node3.meshes !== void 0 && node3.meshes.length) {
|
|
11166
|
+
node3.mesh = node3.meshes.reduce((accum, meshIndex) => {
|
|
11174
11167
|
const mesh = this.getMesh(meshIndex);
|
|
11175
11168
|
accum.id = mesh.id;
|
|
11176
11169
|
accum.primitives = accum.primitives.concat(mesh.primitives);
|
|
11177
11170
|
return accum;
|
|
11178
11171
|
}, { primitives: [] });
|
|
11179
11172
|
}
|
|
11180
|
-
if (
|
|
11181
|
-
|
|
11173
|
+
if (node3.camera !== void 0) {
|
|
11174
|
+
node3.camera = this.getCamera(node3.camera);
|
|
11182
11175
|
}
|
|
11183
|
-
if (
|
|
11184
|
-
|
|
11176
|
+
if (node3.skin !== void 0) {
|
|
11177
|
+
node3.skin = this.getSkin(node3.skin);
|
|
11185
11178
|
}
|
|
11186
|
-
return
|
|
11179
|
+
return node3;
|
|
11187
11180
|
}
|
|
11188
11181
|
_resolveSkin(skin, index) {
|
|
11189
11182
|
skin.id = skin.id || `skin-${index}`;
|
|
@@ -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.3.0-alpha.
|
|
7
|
+
var VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'latest';
|
|
8
8
|
exports.VERSION = VERSION;
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/3d-tiles",
|
|
3
|
-
"version": "3.3.0-alpha.
|
|
3
|
+
"version": "3.3.0-alpha.14",
|
|
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.3.0-alpha.
|
|
38
|
-
"@loaders.gl/gltf": "3.3.0-alpha.
|
|
39
|
-
"@loaders.gl/loader-utils": "3.3.0-alpha.
|
|
40
|
-
"@loaders.gl/math": "3.3.0-alpha.
|
|
41
|
-
"@loaders.gl/tiles": "3.3.0-alpha.
|
|
37
|
+
"@loaders.gl/draco": "3.3.0-alpha.14",
|
|
38
|
+
"@loaders.gl/gltf": "3.3.0-alpha.14",
|
|
39
|
+
"@loaders.gl/loader-utils": "3.3.0-alpha.14",
|
|
40
|
+
"@loaders.gl/math": "3.3.0-alpha.14",
|
|
41
|
+
"@loaders.gl/tiles": "3.3.0-alpha.14",
|
|
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": "
|
|
48
|
+
"gitHead": "cc91201ca3c0581a5c9edf7a8bc0fc230212bf3d"
|
|
49
49
|
}
|