@xeokit/xeokit-sdk 2.4.0-alpha-64 → 2.4.0-alpha-66
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 +77 -46
- package/dist/xeokit-sdk.es.js +77 -46
- package/dist/xeokit-sdk.es5.js +64 -61
- package/dist/xeokit-sdk.min.cjs.js +3 -3
- package/dist/xeokit-sdk.min.es.js +3 -3
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -90806,6 +90806,12 @@ class MetaObject {
|
|
|
90806
90806
|
*/
|
|
90807
90807
|
this.propertySets = [];
|
|
90808
90808
|
|
|
90809
|
+
/**
|
|
90810
|
+
* The attributes of this MetaObject.
|
|
90811
|
+
* @type {{}}
|
|
90812
|
+
*/
|
|
90813
|
+
this.attributes = params.attributes || {};
|
|
90814
|
+
|
|
90809
90815
|
// if (external !== undefined && external !== null) {
|
|
90810
90816
|
//
|
|
90811
90817
|
// /**
|
|
@@ -91109,18 +91115,19 @@ class MetaModel {
|
|
|
91109
91115
|
if (metaModelData.metaObjects) {
|
|
91110
91116
|
for (let i = 0, len = metaModelData.metaObjects.length; i < len; i++) {
|
|
91111
91117
|
const metaObjectData = metaModelData.metaObjects[i];
|
|
91112
|
-
const type = metaObjectData.type;
|
|
91113
|
-
const id = metaObjectData.id;
|
|
91114
|
-
const originalSystemId = metaObjectData.originalSystemId;
|
|
91115
|
-
const propertySetIds = metaObjectData.propertySets || metaObjectData.propertySetIds;
|
|
91116
91118
|
let metaObject = metaScene.metaObjects[id];
|
|
91117
91119
|
if (!metaObject) {
|
|
91120
|
+
const type = metaObjectData.type;
|
|
91121
|
+
const id = metaObjectData.id;
|
|
91122
|
+
const originalSystemId = metaObjectData.originalSystemId;
|
|
91123
|
+
const propertySetIds = metaObjectData.propertySets || metaObjectData.propertySetIds;
|
|
91118
91124
|
metaObject = new MetaObject({
|
|
91119
91125
|
id,
|
|
91120
91126
|
originalSystemId,
|
|
91121
91127
|
parentId: metaObjectData.parent,
|
|
91122
91128
|
type,
|
|
91123
91129
|
name: metaObjectData.name,
|
|
91130
|
+
attributes: metaObjectData.attributes,
|
|
91124
91131
|
propertySetIds
|
|
91125
91132
|
});
|
|
91126
91133
|
this.metaScene.metaObjects[id] = metaObject;
|
|
@@ -118095,6 +118102,8 @@ function inflate$9(deflatedData) {
|
|
|
118095
118102
|
|
|
118096
118103
|
function load$9(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118097
118104
|
|
|
118105
|
+
manifestCtx.getNextId();
|
|
118106
|
+
|
|
118098
118107
|
sceneModel.positionsCompression = "precompressed";
|
|
118099
118108
|
sceneModel.normalsCompression = "precompressed";
|
|
118100
118109
|
|
|
@@ -118192,7 +118201,7 @@ const ParserV1 = {
|
|
|
118192
118201
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118193
118202
|
const deflatedData = extract$9(elements);
|
|
118194
118203
|
const inflatedData = inflate$9(deflatedData);
|
|
118195
|
-
load$9(viewer, options, inflatedData, sceneModel);
|
|
118204
|
+
load$9(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118196
118205
|
}
|
|
118197
118206
|
};
|
|
118198
118207
|
|
|
@@ -118272,6 +118281,8 @@ const decompressColor$8 = (function () {
|
|
|
118272
118281
|
|
|
118273
118282
|
function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118274
118283
|
|
|
118284
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118285
|
+
|
|
118275
118286
|
sceneModel.positionsCompression = "precompressed";
|
|
118276
118287
|
sceneModel.normalsCompression = "precompressed";
|
|
118277
118288
|
|
|
@@ -118341,7 +118352,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118341
118352
|
const jj = entityMeshIds [j];
|
|
118342
118353
|
|
|
118343
118354
|
const lastMesh = (jj === (numMeshes - 1));
|
|
118344
|
-
const meshId = manifestCtx.
|
|
118355
|
+
const meshId = manifestCtx.getNextId();
|
|
118345
118356
|
|
|
118346
118357
|
const color = decompressColor$8(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
|
118347
118358
|
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
|
@@ -118353,7 +118364,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118353
118364
|
|
|
118354
118365
|
if (entityUsesInstancing [i] === 1) {
|
|
118355
118366
|
|
|
118356
|
-
const geometryId =
|
|
118367
|
+
const geometryId = `${modelPartId}.geometry.${meshId}.${jj}`;
|
|
118357
118368
|
|
|
118358
118369
|
if (!(geometryId in alreadyCreatedGeometries)) {
|
|
118359
118370
|
|
|
@@ -118375,7 +118386,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118375
118386
|
color: color,
|
|
118376
118387
|
opacity: opacity,
|
|
118377
118388
|
matrix: entityMatrix,
|
|
118378
|
-
geometryId
|
|
118389
|
+
geometryId,
|
|
118379
118390
|
}));
|
|
118380
118391
|
|
|
118381
118392
|
meshIds.push(meshId);
|
|
@@ -118486,6 +118497,8 @@ const decompressColor$7 = (function () {
|
|
|
118486
118497
|
|
|
118487
118498
|
function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118488
118499
|
|
|
118500
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118501
|
+
|
|
118489
118502
|
sceneModel.positionsCompression = "precompressed";
|
|
118490
118503
|
sceneModel.normalsCompression = "precompressed";
|
|
118491
118504
|
|
|
@@ -118558,7 +118571,7 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118558
118571
|
var jj = entityMeshIds [j];
|
|
118559
118572
|
|
|
118560
118573
|
const lastMesh = (jj === (numMeshes - 1));
|
|
118561
|
-
const meshId = entityId
|
|
118574
|
+
const meshId = `${modelPartId}.${entityId}.mesh.${jj}`;
|
|
118562
118575
|
|
|
118563
118576
|
const color = decompressColor$7(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
|
118564
118577
|
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
|
@@ -118569,7 +118582,8 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118569
118582
|
var tmpEdgeIndices = edgeIndices.subarray(meshEdgesIndices [jj], lastMesh ? edgeIndices.length : meshEdgesIndices [jj + 1]);
|
|
118570
118583
|
|
|
118571
118584
|
if (entityUsesInstancing [i] === 1) {
|
|
118572
|
-
|
|
118585
|
+
|
|
118586
|
+
const geometryId = `${modelPartId}.geometry.${meshId}.${jj}`;
|
|
118573
118587
|
|
|
118574
118588
|
if (!(geometryId in _alreadyCreatedGeometries)) {
|
|
118575
118589
|
|
|
@@ -118591,7 +118605,7 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118591
118605
|
color: color,
|
|
118592
118606
|
opacity: opacity,
|
|
118593
118607
|
matrix: entityMatrix,
|
|
118594
|
-
geometryId
|
|
118608
|
+
geometryId,
|
|
118595
118609
|
}));
|
|
118596
118610
|
|
|
118597
118611
|
meshIds.push(meshId);
|
|
@@ -118630,7 +118644,7 @@ const ParserV3 = {
|
|
|
118630
118644
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118631
118645
|
const deflatedData = extract$7(elements);
|
|
118632
118646
|
const inflatedData = inflate$7(deflatedData);
|
|
118633
|
-
load$7(viewer, options, inflatedData, sceneModel);
|
|
118647
|
+
load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118634
118648
|
}
|
|
118635
118649
|
};
|
|
118636
118650
|
|
|
@@ -118700,6 +118714,8 @@ const decompressColor$6 = (function () {
|
|
|
118700
118714
|
|
|
118701
118715
|
function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118702
118716
|
|
|
118717
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118718
|
+
|
|
118703
118719
|
sceneModel.positionsCompression = "precompressed";
|
|
118704
118720
|
sceneModel.normalsCompression = "precompressed";
|
|
118705
118721
|
|
|
@@ -118805,7 +118821,7 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118805
118821
|
|
|
118806
118822
|
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
118807
118823
|
|
|
118808
|
-
|
|
118824
|
+
const geometryId = `${modelPartId}-geometry.${orderedPrimitiveIndex}`; // These IDs are local to the SceneModel
|
|
118809
118825
|
|
|
118810
118826
|
sceneModel.createGeometry({
|
|
118811
118827
|
id: geometryId,
|
|
@@ -118821,7 +118837,7 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118821
118837
|
|
|
118822
118838
|
// Primitive is used only by one entity, and has positions pre-transformed into World-space
|
|
118823
118839
|
|
|
118824
|
-
const meshId = orderedPrimitiveIndex
|
|
118840
|
+
const meshId = `${modelPartId}-${orderedPrimitiveIndex}`;
|
|
118825
118841
|
|
|
118826
118842
|
const entityIndex = batchedPrimitiveEntityIndexes[orderedPrimitiveIndex];
|
|
118827
118843
|
eachEntityId[entityIndex];
|
|
@@ -118864,8 +118880,9 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118864
118880
|
|
|
118865
118881
|
const meshDefaults = {}; // TODO: get from lookup from entity IDs
|
|
118866
118882
|
|
|
118867
|
-
const meshId =
|
|
118868
|
-
const geometryId =
|
|
118883
|
+
const meshId = `${modelPartId}-instance.${countInstances++}`;
|
|
118884
|
+
const geometryId = `${modelPartId}-geometry.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
118885
|
+
|
|
118869
118886
|
const matricesIndex = (eachEntityMatricesPortion [entityIndex]) * 16;
|
|
118870
118887
|
const matrix = matrices.subarray(matricesIndex, matricesIndex + 16);
|
|
118871
118888
|
|
|
@@ -118901,7 +118918,7 @@ const ParserV4 = {
|
|
|
118901
118918
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118902
118919
|
const deflatedData = extract$6(elements);
|
|
118903
118920
|
const inflatedData = inflate$6(deflatedData);
|
|
118904
|
-
load$6(viewer, options, inflatedData, sceneModel);
|
|
118921
|
+
load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118905
118922
|
}
|
|
118906
118923
|
};
|
|
118907
118924
|
|
|
@@ -118966,6 +118983,8 @@ const decompressColor$5 = (function () {
|
|
|
118966
118983
|
|
|
118967
118984
|
function load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118968
118985
|
|
|
118986
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118987
|
+
|
|
118969
118988
|
sceneModel.positionsCompression = "disabled"; // Positions in XKT V4 are floats, which we never quantize, for precision with big models
|
|
118970
118989
|
sceneModel.normalsCompression = "precompressed"; // Normals are oct-encoded though
|
|
118971
118990
|
|
|
@@ -119043,7 +119062,7 @@ function load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119043
119062
|
|
|
119044
119063
|
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
119045
119064
|
|
|
119046
|
-
|
|
119065
|
+
const geometryId = `${modelPartId}-geometry.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
119047
119066
|
|
|
119048
119067
|
sceneModel.createGeometry({
|
|
119049
119068
|
id: geometryId,
|
|
@@ -119137,7 +119156,7 @@ const ParserV5 = {
|
|
|
119137
119156
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
119138
119157
|
const deflatedData = extract$5(elements);
|
|
119139
119158
|
const inflatedData = inflate$5(deflatedData);
|
|
119140
|
-
load$5(viewer, options, inflatedData, sceneModel);
|
|
119159
|
+
load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
119141
119160
|
}
|
|
119142
119161
|
};
|
|
119143
119162
|
|
|
@@ -119212,6 +119231,8 @@ const decompressColor$4 = (function () {
|
|
|
119212
119231
|
|
|
119213
119232
|
function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119214
119233
|
|
|
119234
|
+
const modelPartId = manifestCtx.getNextId();
|
|
119235
|
+
|
|
119215
119236
|
const positions = inflatedData.positions;
|
|
119216
119237
|
const normals = inflatedData.normals;
|
|
119217
119238
|
const indices = inflatedData.indices;
|
|
@@ -119359,13 +119380,13 @@ function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119359
119380
|
const color = decompressColor$4(eachPrimitiveColorAndOpacity.subarray((primitiveIndex * 4), (primitiveIndex * 4) + 3));
|
|
119360
119381
|
const opacity = eachPrimitiveColorAndOpacity[(primitiveIndex * 4) + 3] / 255.0;
|
|
119361
119382
|
|
|
119362
|
-
const meshId = manifestCtx.
|
|
119383
|
+
const meshId = manifestCtx.getNextId();
|
|
119363
119384
|
|
|
119364
119385
|
if (isReusedPrimitive) {
|
|
119365
119386
|
|
|
119366
119387
|
// Create mesh for multi-use primitive - create (or reuse) geometry, create mesh using that geometry
|
|
119367
119388
|
|
|
119368
|
-
const geometryId =
|
|
119389
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
119369
119390
|
|
|
119370
119391
|
if (!geometryCreated[geometryId]) {
|
|
119371
119392
|
|
|
@@ -119551,6 +119572,8 @@ function convertColorsRGBToRGBA$1(colorsRGB) {
|
|
|
119551
119572
|
|
|
119552
119573
|
function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119553
119574
|
|
|
119575
|
+
const modelPartId = manifestCtx.getNextId();
|
|
119576
|
+
|
|
119554
119577
|
const positions = inflatedData.positions;
|
|
119555
119578
|
const normals = inflatedData.normals;
|
|
119556
119579
|
const colors = inflatedData.colors;
|
|
@@ -119703,7 +119726,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119703
119726
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
119704
119727
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
119705
119728
|
|
|
119706
|
-
const meshId = manifestCtx.
|
|
119729
|
+
const meshId = manifestCtx.getNextId();
|
|
119707
119730
|
|
|
119708
119731
|
if (isReusedGeometry) {
|
|
119709
119732
|
|
|
@@ -119712,7 +119735,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119712
119735
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
119713
119736
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
119714
119737
|
|
|
119715
|
-
const geometryId =
|
|
119738
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
119716
119739
|
|
|
119717
119740
|
if (!geometryCreated[geometryId]) {
|
|
119718
119741
|
|
|
@@ -119990,6 +120013,8 @@ function convertColorsRGBToRGBA(colorsRGB) {
|
|
|
119990
120013
|
|
|
119991
120014
|
function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119992
120015
|
|
|
120016
|
+
const modelPartId = manifestCtx.getNextId();
|
|
120017
|
+
|
|
119993
120018
|
const types = JSON.parse(inflatedData.types);
|
|
119994
120019
|
const eachMetaObjectId = JSON.parse(inflatedData.eachMetaObjectId);
|
|
119995
120020
|
const eachMetaObjectType = inflatedData.eachMetaObjectType;
|
|
@@ -120177,7 +120202,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120177
120202
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
120178
120203
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
120179
120204
|
|
|
120180
|
-
const meshId = manifestCtx.
|
|
120205
|
+
const meshId = manifestCtx.getNextId();
|
|
120181
120206
|
|
|
120182
120207
|
if (isReusedGeometry) {
|
|
120183
120208
|
|
|
@@ -120186,7 +120211,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120186
120211
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
120187
120212
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
120188
120213
|
|
|
120189
|
-
|
|
120214
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
120190
120215
|
|
|
120191
120216
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
120192
120217
|
|
|
@@ -120521,6 +120546,8 @@ const decompressColor$1 = (function () {
|
|
|
120521
120546
|
|
|
120522
120547
|
function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
120523
120548
|
|
|
120549
|
+
const modelPartId = manifestCtx.getNextId();
|
|
120550
|
+
|
|
120524
120551
|
const metadata = inflatedData.metadata;
|
|
120525
120552
|
|
|
120526
120553
|
const positions = inflatedData.positions;
|
|
@@ -120680,7 +120707,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120680
120707
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
120681
120708
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
120682
120709
|
|
|
120683
|
-
const meshId = manifestCtx.
|
|
120710
|
+
const meshId = manifestCtx.getNextId();
|
|
120684
120711
|
|
|
120685
120712
|
if (isReusedGeometry) {
|
|
120686
120713
|
|
|
@@ -120689,7 +120716,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120689
120716
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
120690
120717
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
120691
120718
|
|
|
120692
|
-
const geometryId =
|
|
120719
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
120693
120720
|
|
|
120694
120721
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
120695
120722
|
|
|
@@ -121025,6 +121052,8 @@ const decompressColor = (function () {
|
|
|
121025
121052
|
|
|
121026
121053
|
function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
121027
121054
|
|
|
121055
|
+
const modelPartId = manifestCtx.getNextId();
|
|
121056
|
+
|
|
121028
121057
|
const metadata = inflatedData.metadata;
|
|
121029
121058
|
const textureData = inflatedData.textureData;
|
|
121030
121059
|
const eachTextureDataPortion = inflatedData.eachTextureDataPortion;
|
|
@@ -121091,7 +121120,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121091
121120
|
|
|
121092
121121
|
const imageDataSubarray = new Uint8Array(textureData.subarray(textureDataPortionStart, textureDataPortionEnd));
|
|
121093
121122
|
const arrayBuffer = imageDataSubarray.buffer;
|
|
121094
|
-
const textureId =
|
|
121123
|
+
const textureId = `${modelPartId}-texture-${textureIndex}`;
|
|
121095
121124
|
|
|
121096
121125
|
if (compressed) {
|
|
121097
121126
|
|
|
@@ -121132,7 +121161,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121132
121161
|
|
|
121133
121162
|
for (let textureSetIndex = 0; textureSetIndex < numTextureSets; textureSetIndex++) {
|
|
121134
121163
|
const eachTextureSetTexturesIndex = textureSetIndex * 5;
|
|
121135
|
-
const textureSetId =
|
|
121164
|
+
const textureSetId = `${modelPartId}-textureSet-${textureSetIndex}`;
|
|
121136
121165
|
const colorTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 0];
|
|
121137
121166
|
const metallicRoughnessTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 1];
|
|
121138
121167
|
const normalsTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 2];
|
|
@@ -121140,11 +121169,11 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121140
121169
|
const occlusionTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 4];
|
|
121141
121170
|
sceneModel.createTextureSet({
|
|
121142
121171
|
id: textureSetId,
|
|
121143
|
-
colorTextureId: colorTextureIndex >= 0 ?
|
|
121144
|
-
normalsTextureId: normalsTextureIndex >= 0 ?
|
|
121145
|
-
metallicRoughnessTextureId: metallicRoughnessTextureIndex >= 0 ?
|
|
121146
|
-
emissiveTextureId: emissiveTextureIndex >= 0 ?
|
|
121147
|
-
occlusionTextureId: occlusionTextureIndex >= 0 ?
|
|
121172
|
+
colorTextureId: colorTextureIndex >= 0 ? `${modelPartId}-texture-${colorTextureIndex}` : null,
|
|
121173
|
+
normalsTextureId: normalsTextureIndex >= 0 ? `${modelPartId}-texture-${normalsTextureIndex}` : null,
|
|
121174
|
+
metallicRoughnessTextureId: metallicRoughnessTextureIndex >= 0 ? `${modelPartId}-texture-${metallicRoughnessTextureIndex}` : null,
|
|
121175
|
+
emissiveTextureId: emissiveTextureIndex >= 0 ? `${modelPartId}-texture-${emissiveTextureIndex}` : null,
|
|
121176
|
+
occlusionTextureId: occlusionTextureIndex >= 0 ? `${modelPartId}-texture-${occlusionTextureIndex}` : null
|
|
121148
121177
|
});
|
|
121149
121178
|
}
|
|
121150
121179
|
|
|
@@ -121267,14 +121296,14 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121267
121296
|
|
|
121268
121297
|
const textureSetIndex = eachMeshTextureSet[meshIndex];
|
|
121269
121298
|
|
|
121270
|
-
const textureSetId = (textureSetIndex >= 0) ?
|
|
121299
|
+
const textureSetId = (textureSetIndex >= 0) ? `${modelPartId}-textureSet-${textureSetIndex}` : null;
|
|
121271
121300
|
|
|
121272
121301
|
const meshColor = decompressColor(eachMeshMaterialAttributes.subarray((meshIndex * 6), (meshIndex * 6) + 3));
|
|
121273
121302
|
const meshOpacity = eachMeshMaterialAttributes[(meshIndex * 6) + 3] / 255.0;
|
|
121274
121303
|
const meshMetallic = eachMeshMaterialAttributes[(meshIndex * 6) + 4] / 255.0;
|
|
121275
121304
|
const meshRoughness = eachMeshMaterialAttributes[(meshIndex * 6) + 5] / 255.0;
|
|
121276
121305
|
|
|
121277
|
-
const meshId = manifestCtx.
|
|
121306
|
+
const meshId = manifestCtx.getNextId();
|
|
121278
121307
|
|
|
121279
121308
|
if (isReusedGeometry) {
|
|
121280
121309
|
|
|
@@ -121283,7 +121312,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121283
121312
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
121284
121313
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
121285
121314
|
|
|
121286
|
-
const geometryId =
|
|
121315
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
121287
121316
|
|
|
121288
121317
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
121289
121318
|
|
|
@@ -121382,7 +121411,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121382
121411
|
|
|
121383
121412
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121384
121413
|
id: meshId,
|
|
121385
|
-
textureSetId
|
|
121414
|
+
textureSetId,
|
|
121386
121415
|
origin: tileCenter,
|
|
121387
121416
|
primitive: geometryArrays.primitiveName,
|
|
121388
121417
|
positionsCompressed: transformedAndRecompressedPositions,
|
|
@@ -121421,8 +121450,8 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121421
121450
|
|
|
121422
121451
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121423
121452
|
id: meshId,
|
|
121424
|
-
geometryId
|
|
121425
|
-
textureSetId
|
|
121453
|
+
geometryId,
|
|
121454
|
+
textureSetId,
|
|
121426
121455
|
matrix: meshMatrix,
|
|
121427
121456
|
color: meshColor,
|
|
121428
121457
|
metallic: meshMetallic,
|
|
@@ -121497,7 +121526,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121497
121526
|
|
|
121498
121527
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121499
121528
|
id: meshId,
|
|
121500
|
-
textureSetId
|
|
121529
|
+
textureSetId,
|
|
121501
121530
|
origin: tileCenter,
|
|
121502
121531
|
primitive: primitiveName,
|
|
121503
121532
|
positionsCompressed: geometryPositions,
|
|
@@ -122439,8 +122468,11 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122439
122468
|
sceneModel.fire("error", errMsg);
|
|
122440
122469
|
};
|
|
122441
122470
|
|
|
122471
|
+
let nextId = 0;
|
|
122442
122472
|
const manifestCtx = {
|
|
122443
|
-
|
|
122473
|
+
getNextId: () => {
|
|
122474
|
+
return `${modelId}.${nextId++}`;
|
|
122475
|
+
}
|
|
122444
122476
|
};
|
|
122445
122477
|
|
|
122446
122478
|
if (params.metaModelSrc || params.metaModelData) {
|
|
@@ -122483,7 +122515,6 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122483
122515
|
}
|
|
122484
122516
|
|
|
122485
122517
|
|
|
122486
|
-
|
|
122487
122518
|
} else {
|
|
122488
122519
|
|
|
122489
122520
|
if (params.src) {
|
|
@@ -122555,9 +122586,9 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122555
122586
|
|
|
122556
122587
|
_loadModel(src, params, options, sceneModel, metaModel, manifestCtx, done, error) {
|
|
122557
122588
|
this._dataSource.getXKT(params.src, (arrayBuffer) => {
|
|
122558
|
-
|
|
122559
|
-
|
|
122560
|
-
|
|
122589
|
+
this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
|
|
122590
|
+
done();
|
|
122591
|
+
}, error);
|
|
122561
122592
|
}
|
|
122562
122593
|
|
|
122563
122594
|
_parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx) {
|