@xeokit/xeokit-sdk 2.4.0-alpha-64 → 2.4.0-alpha-65
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/xeokit-sdk.cjs.js +66 -42
- package/dist/xeokit-sdk.es.js +66 -42
- package/dist/xeokit-sdk.es5.js +30 -30
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/dist/xeokit-sdk.min.es5.js +1 -1
- package/package.json +1 -1
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -118099,6 +118099,8 @@ function inflate$9(deflatedData) {
|
|
|
118099
118099
|
|
|
118100
118100
|
function load$9(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118101
118101
|
|
|
118102
|
+
manifestCtx.getNextId();
|
|
118103
|
+
|
|
118102
118104
|
sceneModel.positionsCompression = "precompressed";
|
|
118103
118105
|
sceneModel.normalsCompression = "precompressed";
|
|
118104
118106
|
|
|
@@ -118196,7 +118198,7 @@ const ParserV1 = {
|
|
|
118196
118198
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118197
118199
|
const deflatedData = extract$9(elements);
|
|
118198
118200
|
const inflatedData = inflate$9(deflatedData);
|
|
118199
|
-
load$9(viewer, options, inflatedData, sceneModel);
|
|
118201
|
+
load$9(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118200
118202
|
}
|
|
118201
118203
|
};
|
|
118202
118204
|
|
|
@@ -118276,6 +118278,8 @@ const decompressColor$8 = (function () {
|
|
|
118276
118278
|
|
|
118277
118279
|
function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118278
118280
|
|
|
118281
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118282
|
+
|
|
118279
118283
|
sceneModel.positionsCompression = "precompressed";
|
|
118280
118284
|
sceneModel.normalsCompression = "precompressed";
|
|
118281
118285
|
|
|
@@ -118345,7 +118349,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118345
118349
|
const jj = entityMeshIds [j];
|
|
118346
118350
|
|
|
118347
118351
|
const lastMesh = (jj === (numMeshes - 1));
|
|
118348
|
-
const meshId = manifestCtx.
|
|
118352
|
+
const meshId = manifestCtx.getNextId();
|
|
118349
118353
|
|
|
118350
118354
|
const color = decompressColor$8(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
|
118351
118355
|
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
|
@@ -118357,7 +118361,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118357
118361
|
|
|
118358
118362
|
if (entityUsesInstancing [i] === 1) {
|
|
118359
118363
|
|
|
118360
|
-
const geometryId =
|
|
118364
|
+
const geometryId = `${modelPartId}.geometry.${meshId}.${jj}`;
|
|
118361
118365
|
|
|
118362
118366
|
if (!(geometryId in alreadyCreatedGeometries)) {
|
|
118363
118367
|
|
|
@@ -118379,7 +118383,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118379
118383
|
color: color,
|
|
118380
118384
|
opacity: opacity,
|
|
118381
118385
|
matrix: entityMatrix,
|
|
118382
|
-
geometryId
|
|
118386
|
+
geometryId,
|
|
118383
118387
|
}));
|
|
118384
118388
|
|
|
118385
118389
|
meshIds.push(meshId);
|
|
@@ -118490,6 +118494,8 @@ const decompressColor$7 = (function () {
|
|
|
118490
118494
|
|
|
118491
118495
|
function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118492
118496
|
|
|
118497
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118498
|
+
|
|
118493
118499
|
sceneModel.positionsCompression = "precompressed";
|
|
118494
118500
|
sceneModel.normalsCompression = "precompressed";
|
|
118495
118501
|
|
|
@@ -118562,7 +118568,7 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118562
118568
|
var jj = entityMeshIds [j];
|
|
118563
118569
|
|
|
118564
118570
|
const lastMesh = (jj === (numMeshes - 1));
|
|
118565
|
-
const meshId = entityId
|
|
118571
|
+
const meshId = `${modelPartId}.${entityId}.mesh.${jj}`;
|
|
118566
118572
|
|
|
118567
118573
|
const color = decompressColor$7(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
|
118568
118574
|
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
|
@@ -118573,7 +118579,8 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118573
118579
|
var tmpEdgeIndices = edgeIndices.subarray(meshEdgesIndices [jj], lastMesh ? edgeIndices.length : meshEdgesIndices [jj + 1]);
|
|
118574
118580
|
|
|
118575
118581
|
if (entityUsesInstancing [i] === 1) {
|
|
118576
|
-
|
|
118582
|
+
|
|
118583
|
+
const geometryId = `${modelPartId}.geometry.${meshId}.${jj}`;
|
|
118577
118584
|
|
|
118578
118585
|
if (!(geometryId in _alreadyCreatedGeometries)) {
|
|
118579
118586
|
|
|
@@ -118595,7 +118602,7 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118595
118602
|
color: color,
|
|
118596
118603
|
opacity: opacity,
|
|
118597
118604
|
matrix: entityMatrix,
|
|
118598
|
-
geometryId
|
|
118605
|
+
geometryId,
|
|
118599
118606
|
}));
|
|
118600
118607
|
|
|
118601
118608
|
meshIds.push(meshId);
|
|
@@ -118634,7 +118641,7 @@ const ParserV3 = {
|
|
|
118634
118641
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118635
118642
|
const deflatedData = extract$7(elements);
|
|
118636
118643
|
const inflatedData = inflate$7(deflatedData);
|
|
118637
|
-
load$7(viewer, options, inflatedData, sceneModel);
|
|
118644
|
+
load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118638
118645
|
}
|
|
118639
118646
|
};
|
|
118640
118647
|
|
|
@@ -118704,6 +118711,8 @@ const decompressColor$6 = (function () {
|
|
|
118704
118711
|
|
|
118705
118712
|
function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118706
118713
|
|
|
118714
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118715
|
+
|
|
118707
118716
|
sceneModel.positionsCompression = "precompressed";
|
|
118708
118717
|
sceneModel.normalsCompression = "precompressed";
|
|
118709
118718
|
|
|
@@ -118809,7 +118818,7 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118809
118818
|
|
|
118810
118819
|
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
118811
118820
|
|
|
118812
|
-
|
|
118821
|
+
const geometryId = `${modelPartId}-geometry.${orderedPrimitiveIndex}`; // These IDs are local to the SceneModel
|
|
118813
118822
|
|
|
118814
118823
|
sceneModel.createGeometry({
|
|
118815
118824
|
id: geometryId,
|
|
@@ -118825,7 +118834,7 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118825
118834
|
|
|
118826
118835
|
// Primitive is used only by one entity, and has positions pre-transformed into World-space
|
|
118827
118836
|
|
|
118828
|
-
const meshId = orderedPrimitiveIndex
|
|
118837
|
+
const meshId = `${modelPartId}-${orderedPrimitiveIndex}`;
|
|
118829
118838
|
|
|
118830
118839
|
const entityIndex = batchedPrimitiveEntityIndexes[orderedPrimitiveIndex];
|
|
118831
118840
|
eachEntityId[entityIndex];
|
|
@@ -118868,8 +118877,9 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118868
118877
|
|
|
118869
118878
|
const meshDefaults = {}; // TODO: get from lookup from entity IDs
|
|
118870
118879
|
|
|
118871
|
-
const meshId =
|
|
118872
|
-
const geometryId =
|
|
118880
|
+
const meshId = `${modelPartId}-instance.${countInstances++}`;
|
|
118881
|
+
const geometryId = `${modelPartId}-geometry.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
118882
|
+
|
|
118873
118883
|
const matricesIndex = (eachEntityMatricesPortion [entityIndex]) * 16;
|
|
118874
118884
|
const matrix = matrices.subarray(matricesIndex, matricesIndex + 16);
|
|
118875
118885
|
|
|
@@ -118905,7 +118915,7 @@ const ParserV4 = {
|
|
|
118905
118915
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118906
118916
|
const deflatedData = extract$6(elements);
|
|
118907
118917
|
const inflatedData = inflate$6(deflatedData);
|
|
118908
|
-
load$6(viewer, options, inflatedData, sceneModel);
|
|
118918
|
+
load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118909
118919
|
}
|
|
118910
118920
|
};
|
|
118911
118921
|
|
|
@@ -118970,6 +118980,8 @@ const decompressColor$5 = (function () {
|
|
|
118970
118980
|
|
|
118971
118981
|
function load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118972
118982
|
|
|
118983
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118984
|
+
|
|
118973
118985
|
sceneModel.positionsCompression = "disabled"; // Positions in XKT V4 are floats, which we never quantize, for precision with big models
|
|
118974
118986
|
sceneModel.normalsCompression = "precompressed"; // Normals are oct-encoded though
|
|
118975
118987
|
|
|
@@ -119047,7 +119059,7 @@ function load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119047
119059
|
|
|
119048
119060
|
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
119049
119061
|
|
|
119050
|
-
|
|
119062
|
+
const geometryId = `${modelPartId}-geometry.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
119051
119063
|
|
|
119052
119064
|
sceneModel.createGeometry({
|
|
119053
119065
|
id: geometryId,
|
|
@@ -119141,7 +119153,7 @@ const ParserV5 = {
|
|
|
119141
119153
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
119142
119154
|
const deflatedData = extract$5(elements);
|
|
119143
119155
|
const inflatedData = inflate$5(deflatedData);
|
|
119144
|
-
load$5(viewer, options, inflatedData, sceneModel);
|
|
119156
|
+
load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
119145
119157
|
}
|
|
119146
119158
|
};
|
|
119147
119159
|
|
|
@@ -119216,6 +119228,8 @@ const decompressColor$4 = (function () {
|
|
|
119216
119228
|
|
|
119217
119229
|
function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119218
119230
|
|
|
119231
|
+
const modelPartId = manifestCtx.getNextId();
|
|
119232
|
+
|
|
119219
119233
|
const positions = inflatedData.positions;
|
|
119220
119234
|
const normals = inflatedData.normals;
|
|
119221
119235
|
const indices = inflatedData.indices;
|
|
@@ -119363,13 +119377,13 @@ function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119363
119377
|
const color = decompressColor$4(eachPrimitiveColorAndOpacity.subarray((primitiveIndex * 4), (primitiveIndex * 4) + 3));
|
|
119364
119378
|
const opacity = eachPrimitiveColorAndOpacity[(primitiveIndex * 4) + 3] / 255.0;
|
|
119365
119379
|
|
|
119366
|
-
const meshId = manifestCtx.
|
|
119380
|
+
const meshId = manifestCtx.getNextId();
|
|
119367
119381
|
|
|
119368
119382
|
if (isReusedPrimitive) {
|
|
119369
119383
|
|
|
119370
119384
|
// Create mesh for multi-use primitive - create (or reuse) geometry, create mesh using that geometry
|
|
119371
119385
|
|
|
119372
|
-
const geometryId =
|
|
119386
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
119373
119387
|
|
|
119374
119388
|
if (!geometryCreated[geometryId]) {
|
|
119375
119389
|
|
|
@@ -119555,6 +119569,8 @@ function convertColorsRGBToRGBA$1(colorsRGB) {
|
|
|
119555
119569
|
|
|
119556
119570
|
function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119557
119571
|
|
|
119572
|
+
const modelPartId = manifestCtx.getNextId();
|
|
119573
|
+
|
|
119558
119574
|
const positions = inflatedData.positions;
|
|
119559
119575
|
const normals = inflatedData.normals;
|
|
119560
119576
|
const colors = inflatedData.colors;
|
|
@@ -119707,7 +119723,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119707
119723
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
119708
119724
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
119709
119725
|
|
|
119710
|
-
const meshId = manifestCtx.
|
|
119726
|
+
const meshId = manifestCtx.getNextId();
|
|
119711
119727
|
|
|
119712
119728
|
if (isReusedGeometry) {
|
|
119713
119729
|
|
|
@@ -119716,7 +119732,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119716
119732
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
119717
119733
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
119718
119734
|
|
|
119719
|
-
const geometryId =
|
|
119735
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
119720
119736
|
|
|
119721
119737
|
if (!geometryCreated[geometryId]) {
|
|
119722
119738
|
|
|
@@ -119994,6 +120010,8 @@ function convertColorsRGBToRGBA(colorsRGB) {
|
|
|
119994
120010
|
|
|
119995
120011
|
function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119996
120012
|
|
|
120013
|
+
const modelPartId = manifestCtx.getNextId();
|
|
120014
|
+
|
|
119997
120015
|
const types = JSON.parse(inflatedData.types);
|
|
119998
120016
|
const eachMetaObjectId = JSON.parse(inflatedData.eachMetaObjectId);
|
|
119999
120017
|
const eachMetaObjectType = inflatedData.eachMetaObjectType;
|
|
@@ -120181,7 +120199,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120181
120199
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
120182
120200
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
120183
120201
|
|
|
120184
|
-
const meshId = manifestCtx.
|
|
120202
|
+
const meshId = manifestCtx.getNextId();
|
|
120185
120203
|
|
|
120186
120204
|
if (isReusedGeometry) {
|
|
120187
120205
|
|
|
@@ -120190,7 +120208,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120190
120208
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
120191
120209
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
120192
120210
|
|
|
120193
|
-
|
|
120211
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
120194
120212
|
|
|
120195
120213
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
120196
120214
|
|
|
@@ -120525,6 +120543,8 @@ const decompressColor$1 = (function () {
|
|
|
120525
120543
|
|
|
120526
120544
|
function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
120527
120545
|
|
|
120546
|
+
const modelPartId = manifestCtx.getNextId();
|
|
120547
|
+
|
|
120528
120548
|
const metadata = inflatedData.metadata;
|
|
120529
120549
|
|
|
120530
120550
|
const positions = inflatedData.positions;
|
|
@@ -120684,7 +120704,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120684
120704
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
120685
120705
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
120686
120706
|
|
|
120687
|
-
const meshId = manifestCtx.
|
|
120707
|
+
const meshId = manifestCtx.getNextId();
|
|
120688
120708
|
|
|
120689
120709
|
if (isReusedGeometry) {
|
|
120690
120710
|
|
|
@@ -120693,7 +120713,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120693
120713
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
120694
120714
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
120695
120715
|
|
|
120696
|
-
const geometryId =
|
|
120716
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
120697
120717
|
|
|
120698
120718
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
120699
120719
|
|
|
@@ -121029,6 +121049,8 @@ const decompressColor = (function () {
|
|
|
121029
121049
|
|
|
121030
121050
|
function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
121031
121051
|
|
|
121052
|
+
const modelPartId = manifestCtx.getNextId();
|
|
121053
|
+
|
|
121032
121054
|
const metadata = inflatedData.metadata;
|
|
121033
121055
|
const textureData = inflatedData.textureData;
|
|
121034
121056
|
const eachTextureDataPortion = inflatedData.eachTextureDataPortion;
|
|
@@ -121095,7 +121117,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121095
121117
|
|
|
121096
121118
|
const imageDataSubarray = new Uint8Array(textureData.subarray(textureDataPortionStart, textureDataPortionEnd));
|
|
121097
121119
|
const arrayBuffer = imageDataSubarray.buffer;
|
|
121098
|
-
const textureId =
|
|
121120
|
+
const textureId = `${modelPartId}-texture-${textureIndex}`;
|
|
121099
121121
|
|
|
121100
121122
|
if (compressed) {
|
|
121101
121123
|
|
|
@@ -121136,7 +121158,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121136
121158
|
|
|
121137
121159
|
for (let textureSetIndex = 0; textureSetIndex < numTextureSets; textureSetIndex++) {
|
|
121138
121160
|
const eachTextureSetTexturesIndex = textureSetIndex * 5;
|
|
121139
|
-
const textureSetId =
|
|
121161
|
+
const textureSetId = `${modelPartId}-textureSet-${textureSetIndex}`;
|
|
121140
121162
|
const colorTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 0];
|
|
121141
121163
|
const metallicRoughnessTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 1];
|
|
121142
121164
|
const normalsTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 2];
|
|
@@ -121144,11 +121166,11 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121144
121166
|
const occlusionTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 4];
|
|
121145
121167
|
sceneModel.createTextureSet({
|
|
121146
121168
|
id: textureSetId,
|
|
121147
|
-
colorTextureId: colorTextureIndex >= 0 ?
|
|
121148
|
-
normalsTextureId: normalsTextureIndex >= 0 ?
|
|
121149
|
-
metallicRoughnessTextureId: metallicRoughnessTextureIndex >= 0 ?
|
|
121150
|
-
emissiveTextureId: emissiveTextureIndex >= 0 ?
|
|
121151
|
-
occlusionTextureId: occlusionTextureIndex >= 0 ?
|
|
121169
|
+
colorTextureId: colorTextureIndex >= 0 ? `${modelPartId}-texture-${colorTextureIndex}` : null,
|
|
121170
|
+
normalsTextureId: normalsTextureIndex >= 0 ? `${modelPartId}-texture-${normalsTextureIndex}` : null,
|
|
121171
|
+
metallicRoughnessTextureId: metallicRoughnessTextureIndex >= 0 ? `${modelPartId}-texture-${metallicRoughnessTextureIndex}` : null,
|
|
121172
|
+
emissiveTextureId: emissiveTextureIndex >= 0 ? `${modelPartId}-texture-${emissiveTextureIndex}` : null,
|
|
121173
|
+
occlusionTextureId: occlusionTextureIndex >= 0 ? `${modelPartId}-texture-${occlusionTextureIndex}` : null
|
|
121152
121174
|
});
|
|
121153
121175
|
}
|
|
121154
121176
|
|
|
@@ -121271,14 +121293,14 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121271
121293
|
|
|
121272
121294
|
const textureSetIndex = eachMeshTextureSet[meshIndex];
|
|
121273
121295
|
|
|
121274
|
-
const textureSetId = (textureSetIndex >= 0) ?
|
|
121296
|
+
const textureSetId = (textureSetIndex >= 0) ? `${modelPartId}-textureSet-${textureSetIndex}` : null;
|
|
121275
121297
|
|
|
121276
121298
|
const meshColor = decompressColor(eachMeshMaterialAttributes.subarray((meshIndex * 6), (meshIndex * 6) + 3));
|
|
121277
121299
|
const meshOpacity = eachMeshMaterialAttributes[(meshIndex * 6) + 3] / 255.0;
|
|
121278
121300
|
const meshMetallic = eachMeshMaterialAttributes[(meshIndex * 6) + 4] / 255.0;
|
|
121279
121301
|
const meshRoughness = eachMeshMaterialAttributes[(meshIndex * 6) + 5] / 255.0;
|
|
121280
121302
|
|
|
121281
|
-
const meshId = manifestCtx.
|
|
121303
|
+
const meshId = manifestCtx.getNextId();
|
|
121282
121304
|
|
|
121283
121305
|
if (isReusedGeometry) {
|
|
121284
121306
|
|
|
@@ -121287,7 +121309,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121287
121309
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
121288
121310
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
121289
121311
|
|
|
121290
|
-
const geometryId =
|
|
121312
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
121291
121313
|
|
|
121292
121314
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
121293
121315
|
|
|
@@ -121386,7 +121408,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121386
121408
|
|
|
121387
121409
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121388
121410
|
id: meshId,
|
|
121389
|
-
textureSetId
|
|
121411
|
+
textureSetId,
|
|
121390
121412
|
origin: tileCenter,
|
|
121391
121413
|
primitive: geometryArrays.primitiveName,
|
|
121392
121414
|
positionsCompressed: transformedAndRecompressedPositions,
|
|
@@ -121425,8 +121447,8 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121425
121447
|
|
|
121426
121448
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121427
121449
|
id: meshId,
|
|
121428
|
-
geometryId
|
|
121429
|
-
textureSetId
|
|
121450
|
+
geometryId,
|
|
121451
|
+
textureSetId,
|
|
121430
121452
|
matrix: meshMatrix,
|
|
121431
121453
|
color: meshColor,
|
|
121432
121454
|
metallic: meshMetallic,
|
|
@@ -121501,7 +121523,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121501
121523
|
|
|
121502
121524
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121503
121525
|
id: meshId,
|
|
121504
|
-
textureSetId
|
|
121526
|
+
textureSetId,
|
|
121505
121527
|
origin: tileCenter,
|
|
121506
121528
|
primitive: primitiveName,
|
|
121507
121529
|
positionsCompressed: geometryPositions,
|
|
@@ -122443,8 +122465,11 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122443
122465
|
sceneModel.fire("error", errMsg);
|
|
122444
122466
|
};
|
|
122445
122467
|
|
|
122468
|
+
let nextId = 0;
|
|
122446
122469
|
const manifestCtx = {
|
|
122447
|
-
|
|
122470
|
+
getNextId: () => {
|
|
122471
|
+
return `${modelId}.${nextId++}`;
|
|
122472
|
+
}
|
|
122448
122473
|
};
|
|
122449
122474
|
|
|
122450
122475
|
if (params.metaModelSrc || params.metaModelData) {
|
|
@@ -122487,7 +122512,6 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122487
122512
|
}
|
|
122488
122513
|
|
|
122489
122514
|
|
|
122490
|
-
|
|
122491
122515
|
} else {
|
|
122492
122516
|
|
|
122493
122517
|
if (params.src) {
|
|
@@ -122559,9 +122583,9 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122559
122583
|
|
|
122560
122584
|
_loadModel(src, params, options, sceneModel, metaModel, manifestCtx, done, error) {
|
|
122561
122585
|
this._dataSource.getXKT(params.src, (arrayBuffer) => {
|
|
122562
|
-
|
|
122563
|
-
|
|
122564
|
-
|
|
122586
|
+
this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
|
|
122587
|
+
done();
|
|
122588
|
+
}, error);
|
|
122565
122589
|
}
|
|
122566
122590
|
|
|
122567
122591
|
_parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx) {
|