@xeokit/xeokit-sdk 2.4.0-alpha-62 → 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 +73 -46
- package/dist/xeokit-sdk.es.js +73 -46
- package/dist/xeokit-sdk.es5.js +38 -35
- 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.cjs.js
CHANGED
|
@@ -59836,6 +59836,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59836
59836
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
59837
59837
|
}
|
|
59838
59838
|
src.push("gl_Position = clipPos;");
|
|
59839
|
+
src.push("gl_PointSize = 1.0;"); // Windows needs this?
|
|
59839
59840
|
src.push(" }");
|
|
59840
59841
|
src.push("}");
|
|
59841
59842
|
return src;
|
|
@@ -64576,7 +64577,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64576
64577
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
64577
64578
|
const src = [];
|
|
64578
64579
|
src.push ('#version 300 es');
|
|
64579
|
-
src.push("//
|
|
64580
|
+
src.push("// SnapInstancingDepthBufInitRenderer vertex shader");
|
|
64580
64581
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
64581
64582
|
src.push("precision highp float;");
|
|
64582
64583
|
src.push("precision highp int;");
|
|
@@ -64946,7 +64947,7 @@ class SnapInstancingDepthRenderer {
|
|
|
64946
64947
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
64947
64948
|
const src = [];
|
|
64948
64949
|
src.push ('#version 300 es');
|
|
64949
|
-
src.push("//
|
|
64950
|
+
src.push("// SnapInstancingDepthRenderer vertex shader");
|
|
64950
64951
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
64951
64952
|
src.push("precision highp float;");
|
|
64952
64953
|
src.push("precision highp int;");
|
|
@@ -65023,6 +65024,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65023
65024
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
65024
65025
|
}
|
|
65025
65026
|
src.push("gl_Position = clipPos;");
|
|
65027
|
+
src.push("gl_PointSize = 1.0;"); // Windows needs this?
|
|
65026
65028
|
src.push("}");
|
|
65027
65029
|
src.push("}");
|
|
65028
65030
|
return src;
|
|
@@ -65034,7 +65036,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65034
65036
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
65035
65037
|
const src = [];
|
|
65036
65038
|
src.push ('#version 300 es');
|
|
65037
|
-
src.push("//
|
|
65039
|
+
src.push("// SnapInstancingDepthRenderer fragment shader");
|
|
65038
65040
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
65039
65041
|
src.push("precision highp float;");
|
|
65040
65042
|
src.push("precision highp int;");
|
|
@@ -65074,7 +65076,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65074
65076
|
src.push("}");
|
|
65075
65077
|
}
|
|
65076
65078
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
65077
|
-
src.push("gl_FragDepth = log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
65079
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
65078
65080
|
}
|
|
65079
65081
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, layerNumber);");
|
|
65080
65082
|
src.push("}");
|
|
@@ -76485,6 +76487,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76485
76487
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
76486
76488
|
}
|
|
76487
76489
|
src.push("gl_Position = clipPos;");
|
|
76490
|
+
src.push("gl_PointSize = 1.0;"); // Windows needs this?
|
|
76488
76491
|
src.push(" }");
|
|
76489
76492
|
src.push("}");
|
|
76490
76493
|
return src;
|
|
@@ -118096,6 +118099,8 @@ function inflate$9(deflatedData) {
|
|
|
118096
118099
|
|
|
118097
118100
|
function load$9(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118098
118101
|
|
|
118102
|
+
manifestCtx.getNextId();
|
|
118103
|
+
|
|
118099
118104
|
sceneModel.positionsCompression = "precompressed";
|
|
118100
118105
|
sceneModel.normalsCompression = "precompressed";
|
|
118101
118106
|
|
|
@@ -118193,7 +118198,7 @@ const ParserV1 = {
|
|
|
118193
118198
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118194
118199
|
const deflatedData = extract$9(elements);
|
|
118195
118200
|
const inflatedData = inflate$9(deflatedData);
|
|
118196
|
-
load$9(viewer, options, inflatedData, sceneModel);
|
|
118201
|
+
load$9(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118197
118202
|
}
|
|
118198
118203
|
};
|
|
118199
118204
|
|
|
@@ -118273,6 +118278,8 @@ const decompressColor$8 = (function () {
|
|
|
118273
118278
|
|
|
118274
118279
|
function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118275
118280
|
|
|
118281
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118282
|
+
|
|
118276
118283
|
sceneModel.positionsCompression = "precompressed";
|
|
118277
118284
|
sceneModel.normalsCompression = "precompressed";
|
|
118278
118285
|
|
|
@@ -118342,7 +118349,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118342
118349
|
const jj = entityMeshIds [j];
|
|
118343
118350
|
|
|
118344
118351
|
const lastMesh = (jj === (numMeshes - 1));
|
|
118345
|
-
const meshId = manifestCtx.
|
|
118352
|
+
const meshId = manifestCtx.getNextId();
|
|
118346
118353
|
|
|
118347
118354
|
const color = decompressColor$8(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
|
118348
118355
|
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
|
@@ -118354,7 +118361,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118354
118361
|
|
|
118355
118362
|
if (entityUsesInstancing [i] === 1) {
|
|
118356
118363
|
|
|
118357
|
-
const geometryId =
|
|
118364
|
+
const geometryId = `${modelPartId}.geometry.${meshId}.${jj}`;
|
|
118358
118365
|
|
|
118359
118366
|
if (!(geometryId in alreadyCreatedGeometries)) {
|
|
118360
118367
|
|
|
@@ -118376,7 +118383,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118376
118383
|
color: color,
|
|
118377
118384
|
opacity: opacity,
|
|
118378
118385
|
matrix: entityMatrix,
|
|
118379
|
-
geometryId
|
|
118386
|
+
geometryId,
|
|
118380
118387
|
}));
|
|
118381
118388
|
|
|
118382
118389
|
meshIds.push(meshId);
|
|
@@ -118487,6 +118494,8 @@ const decompressColor$7 = (function () {
|
|
|
118487
118494
|
|
|
118488
118495
|
function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118489
118496
|
|
|
118497
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118498
|
+
|
|
118490
118499
|
sceneModel.positionsCompression = "precompressed";
|
|
118491
118500
|
sceneModel.normalsCompression = "precompressed";
|
|
118492
118501
|
|
|
@@ -118559,7 +118568,7 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118559
118568
|
var jj = entityMeshIds [j];
|
|
118560
118569
|
|
|
118561
118570
|
const lastMesh = (jj === (numMeshes - 1));
|
|
118562
|
-
const meshId = entityId
|
|
118571
|
+
const meshId = `${modelPartId}.${entityId}.mesh.${jj}`;
|
|
118563
118572
|
|
|
118564
118573
|
const color = decompressColor$7(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
|
118565
118574
|
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
|
@@ -118570,7 +118579,8 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118570
118579
|
var tmpEdgeIndices = edgeIndices.subarray(meshEdgesIndices [jj], lastMesh ? edgeIndices.length : meshEdgesIndices [jj + 1]);
|
|
118571
118580
|
|
|
118572
118581
|
if (entityUsesInstancing [i] === 1) {
|
|
118573
|
-
|
|
118582
|
+
|
|
118583
|
+
const geometryId = `${modelPartId}.geometry.${meshId}.${jj}`;
|
|
118574
118584
|
|
|
118575
118585
|
if (!(geometryId in _alreadyCreatedGeometries)) {
|
|
118576
118586
|
|
|
@@ -118592,7 +118602,7 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118592
118602
|
color: color,
|
|
118593
118603
|
opacity: opacity,
|
|
118594
118604
|
matrix: entityMatrix,
|
|
118595
|
-
geometryId
|
|
118605
|
+
geometryId,
|
|
118596
118606
|
}));
|
|
118597
118607
|
|
|
118598
118608
|
meshIds.push(meshId);
|
|
@@ -118631,7 +118641,7 @@ const ParserV3 = {
|
|
|
118631
118641
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118632
118642
|
const deflatedData = extract$7(elements);
|
|
118633
118643
|
const inflatedData = inflate$7(deflatedData);
|
|
118634
|
-
load$7(viewer, options, inflatedData, sceneModel);
|
|
118644
|
+
load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118635
118645
|
}
|
|
118636
118646
|
};
|
|
118637
118647
|
|
|
@@ -118701,6 +118711,8 @@ const decompressColor$6 = (function () {
|
|
|
118701
118711
|
|
|
118702
118712
|
function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118703
118713
|
|
|
118714
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118715
|
+
|
|
118704
118716
|
sceneModel.positionsCompression = "precompressed";
|
|
118705
118717
|
sceneModel.normalsCompression = "precompressed";
|
|
118706
118718
|
|
|
@@ -118806,7 +118818,7 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118806
118818
|
|
|
118807
118819
|
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
118808
118820
|
|
|
118809
|
-
|
|
118821
|
+
const geometryId = `${modelPartId}-geometry.${orderedPrimitiveIndex}`; // These IDs are local to the SceneModel
|
|
118810
118822
|
|
|
118811
118823
|
sceneModel.createGeometry({
|
|
118812
118824
|
id: geometryId,
|
|
@@ -118822,7 +118834,7 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118822
118834
|
|
|
118823
118835
|
// Primitive is used only by one entity, and has positions pre-transformed into World-space
|
|
118824
118836
|
|
|
118825
|
-
const meshId = orderedPrimitiveIndex
|
|
118837
|
+
const meshId = `${modelPartId}-${orderedPrimitiveIndex}`;
|
|
118826
118838
|
|
|
118827
118839
|
const entityIndex = batchedPrimitiveEntityIndexes[orderedPrimitiveIndex];
|
|
118828
118840
|
eachEntityId[entityIndex];
|
|
@@ -118865,8 +118877,9 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118865
118877
|
|
|
118866
118878
|
const meshDefaults = {}; // TODO: get from lookup from entity IDs
|
|
118867
118879
|
|
|
118868
|
-
const meshId =
|
|
118869
|
-
const geometryId =
|
|
118880
|
+
const meshId = `${modelPartId}-instance.${countInstances++}`;
|
|
118881
|
+
const geometryId = `${modelPartId}-geometry.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
118882
|
+
|
|
118870
118883
|
const matricesIndex = (eachEntityMatricesPortion [entityIndex]) * 16;
|
|
118871
118884
|
const matrix = matrices.subarray(matricesIndex, matricesIndex + 16);
|
|
118872
118885
|
|
|
@@ -118902,7 +118915,7 @@ const ParserV4 = {
|
|
|
118902
118915
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118903
118916
|
const deflatedData = extract$6(elements);
|
|
118904
118917
|
const inflatedData = inflate$6(deflatedData);
|
|
118905
|
-
load$6(viewer, options, inflatedData, sceneModel);
|
|
118918
|
+
load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118906
118919
|
}
|
|
118907
118920
|
};
|
|
118908
118921
|
|
|
@@ -118967,6 +118980,8 @@ const decompressColor$5 = (function () {
|
|
|
118967
118980
|
|
|
118968
118981
|
function load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118969
118982
|
|
|
118983
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118984
|
+
|
|
118970
118985
|
sceneModel.positionsCompression = "disabled"; // Positions in XKT V4 are floats, which we never quantize, for precision with big models
|
|
118971
118986
|
sceneModel.normalsCompression = "precompressed"; // Normals are oct-encoded though
|
|
118972
118987
|
|
|
@@ -119044,7 +119059,7 @@ function load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119044
119059
|
|
|
119045
119060
|
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
119046
119061
|
|
|
119047
|
-
|
|
119062
|
+
const geometryId = `${modelPartId}-geometry.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
119048
119063
|
|
|
119049
119064
|
sceneModel.createGeometry({
|
|
119050
119065
|
id: geometryId,
|
|
@@ -119138,7 +119153,7 @@ const ParserV5 = {
|
|
|
119138
119153
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
119139
119154
|
const deflatedData = extract$5(elements);
|
|
119140
119155
|
const inflatedData = inflate$5(deflatedData);
|
|
119141
|
-
load$5(viewer, options, inflatedData, sceneModel);
|
|
119156
|
+
load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
119142
119157
|
}
|
|
119143
119158
|
};
|
|
119144
119159
|
|
|
@@ -119213,6 +119228,8 @@ const decompressColor$4 = (function () {
|
|
|
119213
119228
|
|
|
119214
119229
|
function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119215
119230
|
|
|
119231
|
+
const modelPartId = manifestCtx.getNextId();
|
|
119232
|
+
|
|
119216
119233
|
const positions = inflatedData.positions;
|
|
119217
119234
|
const normals = inflatedData.normals;
|
|
119218
119235
|
const indices = inflatedData.indices;
|
|
@@ -119360,13 +119377,13 @@ function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119360
119377
|
const color = decompressColor$4(eachPrimitiveColorAndOpacity.subarray((primitiveIndex * 4), (primitiveIndex * 4) + 3));
|
|
119361
119378
|
const opacity = eachPrimitiveColorAndOpacity[(primitiveIndex * 4) + 3] / 255.0;
|
|
119362
119379
|
|
|
119363
|
-
const meshId = manifestCtx.
|
|
119380
|
+
const meshId = manifestCtx.getNextId();
|
|
119364
119381
|
|
|
119365
119382
|
if (isReusedPrimitive) {
|
|
119366
119383
|
|
|
119367
119384
|
// Create mesh for multi-use primitive - create (or reuse) geometry, create mesh using that geometry
|
|
119368
119385
|
|
|
119369
|
-
const geometryId =
|
|
119386
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
119370
119387
|
|
|
119371
119388
|
if (!geometryCreated[geometryId]) {
|
|
119372
119389
|
|
|
@@ -119552,6 +119569,8 @@ function convertColorsRGBToRGBA$1(colorsRGB) {
|
|
|
119552
119569
|
|
|
119553
119570
|
function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119554
119571
|
|
|
119572
|
+
const modelPartId = manifestCtx.getNextId();
|
|
119573
|
+
|
|
119555
119574
|
const positions = inflatedData.positions;
|
|
119556
119575
|
const normals = inflatedData.normals;
|
|
119557
119576
|
const colors = inflatedData.colors;
|
|
@@ -119704,7 +119723,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119704
119723
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
119705
119724
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
119706
119725
|
|
|
119707
|
-
const meshId = manifestCtx.
|
|
119726
|
+
const meshId = manifestCtx.getNextId();
|
|
119708
119727
|
|
|
119709
119728
|
if (isReusedGeometry) {
|
|
119710
119729
|
|
|
@@ -119713,7 +119732,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119713
119732
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
119714
119733
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
119715
119734
|
|
|
119716
|
-
const geometryId =
|
|
119735
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
119717
119736
|
|
|
119718
119737
|
if (!geometryCreated[geometryId]) {
|
|
119719
119738
|
|
|
@@ -119991,6 +120010,8 @@ function convertColorsRGBToRGBA(colorsRGB) {
|
|
|
119991
120010
|
|
|
119992
120011
|
function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119993
120012
|
|
|
120013
|
+
const modelPartId = manifestCtx.getNextId();
|
|
120014
|
+
|
|
119994
120015
|
const types = JSON.parse(inflatedData.types);
|
|
119995
120016
|
const eachMetaObjectId = JSON.parse(inflatedData.eachMetaObjectId);
|
|
119996
120017
|
const eachMetaObjectType = inflatedData.eachMetaObjectType;
|
|
@@ -120178,7 +120199,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120178
120199
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
120179
120200
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
120180
120201
|
|
|
120181
|
-
const meshId = manifestCtx.
|
|
120202
|
+
const meshId = manifestCtx.getNextId();
|
|
120182
120203
|
|
|
120183
120204
|
if (isReusedGeometry) {
|
|
120184
120205
|
|
|
@@ -120187,7 +120208,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120187
120208
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
120188
120209
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
120189
120210
|
|
|
120190
|
-
|
|
120211
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
120191
120212
|
|
|
120192
120213
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
120193
120214
|
|
|
@@ -120522,6 +120543,8 @@ const decompressColor$1 = (function () {
|
|
|
120522
120543
|
|
|
120523
120544
|
function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
120524
120545
|
|
|
120546
|
+
const modelPartId = manifestCtx.getNextId();
|
|
120547
|
+
|
|
120525
120548
|
const metadata = inflatedData.metadata;
|
|
120526
120549
|
|
|
120527
120550
|
const positions = inflatedData.positions;
|
|
@@ -120681,7 +120704,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120681
120704
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
120682
120705
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
120683
120706
|
|
|
120684
|
-
const meshId = manifestCtx.
|
|
120707
|
+
const meshId = manifestCtx.getNextId();
|
|
120685
120708
|
|
|
120686
120709
|
if (isReusedGeometry) {
|
|
120687
120710
|
|
|
@@ -120690,7 +120713,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120690
120713
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
120691
120714
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
120692
120715
|
|
|
120693
|
-
const geometryId =
|
|
120716
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
120694
120717
|
|
|
120695
120718
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
120696
120719
|
|
|
@@ -121026,6 +121049,8 @@ const decompressColor = (function () {
|
|
|
121026
121049
|
|
|
121027
121050
|
function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
121028
121051
|
|
|
121052
|
+
const modelPartId = manifestCtx.getNextId();
|
|
121053
|
+
|
|
121029
121054
|
const metadata = inflatedData.metadata;
|
|
121030
121055
|
const textureData = inflatedData.textureData;
|
|
121031
121056
|
const eachTextureDataPortion = inflatedData.eachTextureDataPortion;
|
|
@@ -121092,7 +121117,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121092
121117
|
|
|
121093
121118
|
const imageDataSubarray = new Uint8Array(textureData.subarray(textureDataPortionStart, textureDataPortionEnd));
|
|
121094
121119
|
const arrayBuffer = imageDataSubarray.buffer;
|
|
121095
|
-
const textureId =
|
|
121120
|
+
const textureId = `${modelPartId}-texture-${textureIndex}`;
|
|
121096
121121
|
|
|
121097
121122
|
if (compressed) {
|
|
121098
121123
|
|
|
@@ -121133,7 +121158,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121133
121158
|
|
|
121134
121159
|
for (let textureSetIndex = 0; textureSetIndex < numTextureSets; textureSetIndex++) {
|
|
121135
121160
|
const eachTextureSetTexturesIndex = textureSetIndex * 5;
|
|
121136
|
-
const textureSetId =
|
|
121161
|
+
const textureSetId = `${modelPartId}-textureSet-${textureSetIndex}`;
|
|
121137
121162
|
const colorTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 0];
|
|
121138
121163
|
const metallicRoughnessTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 1];
|
|
121139
121164
|
const normalsTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 2];
|
|
@@ -121141,11 +121166,11 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121141
121166
|
const occlusionTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 4];
|
|
121142
121167
|
sceneModel.createTextureSet({
|
|
121143
121168
|
id: textureSetId,
|
|
121144
|
-
colorTextureId: colorTextureIndex >= 0 ?
|
|
121145
|
-
normalsTextureId: normalsTextureIndex >= 0 ?
|
|
121146
|
-
metallicRoughnessTextureId: metallicRoughnessTextureIndex >= 0 ?
|
|
121147
|
-
emissiveTextureId: emissiveTextureIndex >= 0 ?
|
|
121148
|
-
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
|
|
121149
121174
|
});
|
|
121150
121175
|
}
|
|
121151
121176
|
|
|
@@ -121268,14 +121293,14 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121268
121293
|
|
|
121269
121294
|
const textureSetIndex = eachMeshTextureSet[meshIndex];
|
|
121270
121295
|
|
|
121271
|
-
const textureSetId = (textureSetIndex >= 0) ?
|
|
121296
|
+
const textureSetId = (textureSetIndex >= 0) ? `${modelPartId}-textureSet-${textureSetIndex}` : null;
|
|
121272
121297
|
|
|
121273
121298
|
const meshColor = decompressColor(eachMeshMaterialAttributes.subarray((meshIndex * 6), (meshIndex * 6) + 3));
|
|
121274
121299
|
const meshOpacity = eachMeshMaterialAttributes[(meshIndex * 6) + 3] / 255.0;
|
|
121275
121300
|
const meshMetallic = eachMeshMaterialAttributes[(meshIndex * 6) + 4] / 255.0;
|
|
121276
121301
|
const meshRoughness = eachMeshMaterialAttributes[(meshIndex * 6) + 5] / 255.0;
|
|
121277
121302
|
|
|
121278
|
-
const meshId = manifestCtx.
|
|
121303
|
+
const meshId = manifestCtx.getNextId();
|
|
121279
121304
|
|
|
121280
121305
|
if (isReusedGeometry) {
|
|
121281
121306
|
|
|
@@ -121284,7 +121309,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121284
121309
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
121285
121310
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
121286
121311
|
|
|
121287
|
-
const geometryId =
|
|
121312
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
121288
121313
|
|
|
121289
121314
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
121290
121315
|
|
|
@@ -121383,7 +121408,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121383
121408
|
|
|
121384
121409
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121385
121410
|
id: meshId,
|
|
121386
|
-
textureSetId
|
|
121411
|
+
textureSetId,
|
|
121387
121412
|
origin: tileCenter,
|
|
121388
121413
|
primitive: geometryArrays.primitiveName,
|
|
121389
121414
|
positionsCompressed: transformedAndRecompressedPositions,
|
|
@@ -121422,8 +121447,8 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121422
121447
|
|
|
121423
121448
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121424
121449
|
id: meshId,
|
|
121425
|
-
geometryId
|
|
121426
|
-
textureSetId
|
|
121450
|
+
geometryId,
|
|
121451
|
+
textureSetId,
|
|
121427
121452
|
matrix: meshMatrix,
|
|
121428
121453
|
color: meshColor,
|
|
121429
121454
|
metallic: meshMetallic,
|
|
@@ -121498,7 +121523,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121498
121523
|
|
|
121499
121524
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121500
121525
|
id: meshId,
|
|
121501
|
-
textureSetId
|
|
121526
|
+
textureSetId,
|
|
121502
121527
|
origin: tileCenter,
|
|
121503
121528
|
primitive: primitiveName,
|
|
121504
121529
|
positionsCompressed: geometryPositions,
|
|
@@ -122440,8 +122465,11 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122440
122465
|
sceneModel.fire("error", errMsg);
|
|
122441
122466
|
};
|
|
122442
122467
|
|
|
122468
|
+
let nextId = 0;
|
|
122443
122469
|
const manifestCtx = {
|
|
122444
|
-
|
|
122470
|
+
getNextId: () => {
|
|
122471
|
+
return `${modelId}.${nextId++}`;
|
|
122472
|
+
}
|
|
122445
122473
|
};
|
|
122446
122474
|
|
|
122447
122475
|
if (params.metaModelSrc || params.metaModelData) {
|
|
@@ -122484,7 +122512,6 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122484
122512
|
}
|
|
122485
122513
|
|
|
122486
122514
|
|
|
122487
|
-
|
|
122488
122515
|
} else {
|
|
122489
122516
|
|
|
122490
122517
|
if (params.src) {
|
|
@@ -122556,9 +122583,9 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122556
122583
|
|
|
122557
122584
|
_loadModel(src, params, options, sceneModel, metaModel, manifestCtx, done, error) {
|
|
122558
122585
|
this._dataSource.getXKT(params.src, (arrayBuffer) => {
|
|
122559
|
-
|
|
122560
|
-
|
|
122561
|
-
|
|
122586
|
+
this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
|
|
122587
|
+
done();
|
|
122588
|
+
}, error);
|
|
122562
122589
|
}
|
|
122563
122590
|
|
|
122564
122591
|
_parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx) {
|