@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.es.js
CHANGED
|
@@ -59832,6 +59832,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59832
59832
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
59833
59833
|
}
|
|
59834
59834
|
src.push("gl_Position = clipPos;");
|
|
59835
|
+
src.push("gl_PointSize = 1.0;"); // Windows needs this?
|
|
59835
59836
|
src.push(" }");
|
|
59836
59837
|
src.push("}");
|
|
59837
59838
|
return src;
|
|
@@ -64572,7 +64573,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64572
64573
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
64573
64574
|
const src = [];
|
|
64574
64575
|
src.push ('#version 300 es');
|
|
64575
|
-
src.push("//
|
|
64576
|
+
src.push("// SnapInstancingDepthBufInitRenderer vertex shader");
|
|
64576
64577
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
64577
64578
|
src.push("precision highp float;");
|
|
64578
64579
|
src.push("precision highp int;");
|
|
@@ -64942,7 +64943,7 @@ class SnapInstancingDepthRenderer {
|
|
|
64942
64943
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
64943
64944
|
const src = [];
|
|
64944
64945
|
src.push ('#version 300 es');
|
|
64945
|
-
src.push("//
|
|
64946
|
+
src.push("// SnapInstancingDepthRenderer vertex shader");
|
|
64946
64947
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
64947
64948
|
src.push("precision highp float;");
|
|
64948
64949
|
src.push("precision highp int;");
|
|
@@ -65019,6 +65020,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65019
65020
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
65020
65021
|
}
|
|
65021
65022
|
src.push("gl_Position = clipPos;");
|
|
65023
|
+
src.push("gl_PointSize = 1.0;"); // Windows needs this?
|
|
65022
65024
|
src.push("}");
|
|
65023
65025
|
src.push("}");
|
|
65024
65026
|
return src;
|
|
@@ -65030,7 +65032,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65030
65032
|
const clipping = sectionPlanesState.sectionPlanes.length > 0;
|
|
65031
65033
|
const src = [];
|
|
65032
65034
|
src.push ('#version 300 es');
|
|
65033
|
-
src.push("//
|
|
65035
|
+
src.push("// SnapInstancingDepthRenderer fragment shader");
|
|
65034
65036
|
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
65035
65037
|
src.push("precision highp float;");
|
|
65036
65038
|
src.push("precision highp int;");
|
|
@@ -65070,7 +65072,7 @@ class SnapInstancingDepthRenderer {
|
|
|
65070
65072
|
src.push("}");
|
|
65071
65073
|
}
|
|
65072
65074
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
65073
|
-
src.push("gl_FragDepth = log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
65075
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
65074
65076
|
}
|
|
65075
65077
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, layerNumber);");
|
|
65076
65078
|
src.push("}");
|
|
@@ -76481,6 +76483,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76481
76483
|
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
|
|
76482
76484
|
}
|
|
76483
76485
|
src.push("gl_Position = clipPos;");
|
|
76486
|
+
src.push("gl_PointSize = 1.0;"); // Windows needs this?
|
|
76484
76487
|
src.push(" }");
|
|
76485
76488
|
src.push("}");
|
|
76486
76489
|
return src;
|
|
@@ -118092,6 +118095,8 @@ function inflate$9(deflatedData) {
|
|
|
118092
118095
|
|
|
118093
118096
|
function load$9(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118094
118097
|
|
|
118098
|
+
manifestCtx.getNextId();
|
|
118099
|
+
|
|
118095
118100
|
sceneModel.positionsCompression = "precompressed";
|
|
118096
118101
|
sceneModel.normalsCompression = "precompressed";
|
|
118097
118102
|
|
|
@@ -118189,7 +118194,7 @@ const ParserV1 = {
|
|
|
118189
118194
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118190
118195
|
const deflatedData = extract$9(elements);
|
|
118191
118196
|
const inflatedData = inflate$9(deflatedData);
|
|
118192
|
-
load$9(viewer, options, inflatedData, sceneModel);
|
|
118197
|
+
load$9(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118193
118198
|
}
|
|
118194
118199
|
};
|
|
118195
118200
|
|
|
@@ -118269,6 +118274,8 @@ const decompressColor$8 = (function () {
|
|
|
118269
118274
|
|
|
118270
118275
|
function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118271
118276
|
|
|
118277
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118278
|
+
|
|
118272
118279
|
sceneModel.positionsCompression = "precompressed";
|
|
118273
118280
|
sceneModel.normalsCompression = "precompressed";
|
|
118274
118281
|
|
|
@@ -118338,7 +118345,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118338
118345
|
const jj = entityMeshIds [j];
|
|
118339
118346
|
|
|
118340
118347
|
const lastMesh = (jj === (numMeshes - 1));
|
|
118341
|
-
const meshId = manifestCtx.
|
|
118348
|
+
const meshId = manifestCtx.getNextId();
|
|
118342
118349
|
|
|
118343
118350
|
const color = decompressColor$8(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
|
118344
118351
|
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
|
@@ -118350,7 +118357,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118350
118357
|
|
|
118351
118358
|
if (entityUsesInstancing [i] === 1) {
|
|
118352
118359
|
|
|
118353
|
-
const geometryId =
|
|
118360
|
+
const geometryId = `${modelPartId}.geometry.${meshId}.${jj}`;
|
|
118354
118361
|
|
|
118355
118362
|
if (!(geometryId in alreadyCreatedGeometries)) {
|
|
118356
118363
|
|
|
@@ -118372,7 +118379,7 @@ function load$8(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118372
118379
|
color: color,
|
|
118373
118380
|
opacity: opacity,
|
|
118374
118381
|
matrix: entityMatrix,
|
|
118375
|
-
geometryId
|
|
118382
|
+
geometryId,
|
|
118376
118383
|
}));
|
|
118377
118384
|
|
|
118378
118385
|
meshIds.push(meshId);
|
|
@@ -118483,6 +118490,8 @@ const decompressColor$7 = (function () {
|
|
|
118483
118490
|
|
|
118484
118491
|
function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118485
118492
|
|
|
118493
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118494
|
+
|
|
118486
118495
|
sceneModel.positionsCompression = "precompressed";
|
|
118487
118496
|
sceneModel.normalsCompression = "precompressed";
|
|
118488
118497
|
|
|
@@ -118555,7 +118564,7 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118555
118564
|
var jj = entityMeshIds [j];
|
|
118556
118565
|
|
|
118557
118566
|
const lastMesh = (jj === (numMeshes - 1));
|
|
118558
|
-
const meshId = entityId
|
|
118567
|
+
const meshId = `${modelPartId}.${entityId}.mesh.${jj}`;
|
|
118559
118568
|
|
|
118560
118569
|
const color = decompressColor$7(meshColors.subarray((jj * 4), (jj * 4) + 3));
|
|
118561
118570
|
const opacity = meshColors[(jj * 4) + 3] / 255.0;
|
|
@@ -118566,7 +118575,8 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118566
118575
|
var tmpEdgeIndices = edgeIndices.subarray(meshEdgesIndices [jj], lastMesh ? edgeIndices.length : meshEdgesIndices [jj + 1]);
|
|
118567
118576
|
|
|
118568
118577
|
if (entityUsesInstancing [i] === 1) {
|
|
118569
|
-
|
|
118578
|
+
|
|
118579
|
+
const geometryId = `${modelPartId}.geometry.${meshId}.${jj}`;
|
|
118570
118580
|
|
|
118571
118581
|
if (!(geometryId in _alreadyCreatedGeometries)) {
|
|
118572
118582
|
|
|
@@ -118588,7 +118598,7 @@ function load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118588
118598
|
color: color,
|
|
118589
118599
|
opacity: opacity,
|
|
118590
118600
|
matrix: entityMatrix,
|
|
118591
|
-
geometryId
|
|
118601
|
+
geometryId,
|
|
118592
118602
|
}));
|
|
118593
118603
|
|
|
118594
118604
|
meshIds.push(meshId);
|
|
@@ -118627,7 +118637,7 @@ const ParserV3 = {
|
|
|
118627
118637
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118628
118638
|
const deflatedData = extract$7(elements);
|
|
118629
118639
|
const inflatedData = inflate$7(deflatedData);
|
|
118630
|
-
load$7(viewer, options, inflatedData, sceneModel);
|
|
118640
|
+
load$7(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118631
118641
|
}
|
|
118632
118642
|
};
|
|
118633
118643
|
|
|
@@ -118697,6 +118707,8 @@ const decompressColor$6 = (function () {
|
|
|
118697
118707
|
|
|
118698
118708
|
function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118699
118709
|
|
|
118710
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118711
|
+
|
|
118700
118712
|
sceneModel.positionsCompression = "precompressed";
|
|
118701
118713
|
sceneModel.normalsCompression = "precompressed";
|
|
118702
118714
|
|
|
@@ -118802,7 +118814,7 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118802
118814
|
|
|
118803
118815
|
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
118804
118816
|
|
|
118805
|
-
|
|
118817
|
+
const geometryId = `${modelPartId}-geometry.${orderedPrimitiveIndex}`; // These IDs are local to the SceneModel
|
|
118806
118818
|
|
|
118807
118819
|
sceneModel.createGeometry({
|
|
118808
118820
|
id: geometryId,
|
|
@@ -118818,7 +118830,7 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118818
118830
|
|
|
118819
118831
|
// Primitive is used only by one entity, and has positions pre-transformed into World-space
|
|
118820
118832
|
|
|
118821
|
-
const meshId = orderedPrimitiveIndex
|
|
118833
|
+
const meshId = `${modelPartId}-${orderedPrimitiveIndex}`;
|
|
118822
118834
|
|
|
118823
118835
|
const entityIndex = batchedPrimitiveEntityIndexes[orderedPrimitiveIndex];
|
|
118824
118836
|
eachEntityId[entityIndex];
|
|
@@ -118861,8 +118873,9 @@ function load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
118861
118873
|
|
|
118862
118874
|
const meshDefaults = {}; // TODO: get from lookup from entity IDs
|
|
118863
118875
|
|
|
118864
|
-
const meshId =
|
|
118865
|
-
const geometryId =
|
|
118876
|
+
const meshId = `${modelPartId}-instance.${countInstances++}`;
|
|
118877
|
+
const geometryId = `${modelPartId}-geometry.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
118878
|
+
|
|
118866
118879
|
const matricesIndex = (eachEntityMatricesPortion [entityIndex]) * 16;
|
|
118867
118880
|
const matrix = matrices.subarray(matricesIndex, matricesIndex + 16);
|
|
118868
118881
|
|
|
@@ -118898,7 +118911,7 @@ const ParserV4 = {
|
|
|
118898
118911
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
118899
118912
|
const deflatedData = extract$6(elements);
|
|
118900
118913
|
const inflatedData = inflate$6(deflatedData);
|
|
118901
|
-
load$6(viewer, options, inflatedData, sceneModel);
|
|
118914
|
+
load$6(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
118902
118915
|
}
|
|
118903
118916
|
};
|
|
118904
118917
|
|
|
@@ -118963,6 +118976,8 @@ const decompressColor$5 = (function () {
|
|
|
118963
118976
|
|
|
118964
118977
|
function load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
118965
118978
|
|
|
118979
|
+
const modelPartId = manifestCtx.getNextId();
|
|
118980
|
+
|
|
118966
118981
|
sceneModel.positionsCompression = "disabled"; // Positions in XKT V4 are floats, which we never quantize, for precision with big models
|
|
118967
118982
|
sceneModel.normalsCompression = "precompressed"; // Normals are oct-encoded though
|
|
118968
118983
|
|
|
@@ -119040,7 +119055,7 @@ function load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119040
119055
|
|
|
119041
119056
|
// Primitive instanced by more than one entity, and has positions in Model-space
|
|
119042
119057
|
|
|
119043
|
-
|
|
119058
|
+
const geometryId = `${modelPartId}-geometry.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
119044
119059
|
|
|
119045
119060
|
sceneModel.createGeometry({
|
|
119046
119061
|
id: geometryId,
|
|
@@ -119134,7 +119149,7 @@ const ParserV5 = {
|
|
|
119134
119149
|
parse: function (viewer, options, elements, sceneModel, metaModel, manifestCtx) {
|
|
119135
119150
|
const deflatedData = extract$5(elements);
|
|
119136
119151
|
const inflatedData = inflate$5(deflatedData);
|
|
119137
|
-
load$5(viewer, options, inflatedData, sceneModel);
|
|
119152
|
+
load$5(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx);
|
|
119138
119153
|
}
|
|
119139
119154
|
};
|
|
119140
119155
|
|
|
@@ -119209,6 +119224,8 @@ const decompressColor$4 = (function () {
|
|
|
119209
119224
|
|
|
119210
119225
|
function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119211
119226
|
|
|
119227
|
+
const modelPartId = manifestCtx.getNextId();
|
|
119228
|
+
|
|
119212
119229
|
const positions = inflatedData.positions;
|
|
119213
119230
|
const normals = inflatedData.normals;
|
|
119214
119231
|
const indices = inflatedData.indices;
|
|
@@ -119356,13 +119373,13 @@ function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119356
119373
|
const color = decompressColor$4(eachPrimitiveColorAndOpacity.subarray((primitiveIndex * 4), (primitiveIndex * 4) + 3));
|
|
119357
119374
|
const opacity = eachPrimitiveColorAndOpacity[(primitiveIndex * 4) + 3] / 255.0;
|
|
119358
119375
|
|
|
119359
|
-
const meshId = manifestCtx.
|
|
119376
|
+
const meshId = manifestCtx.getNextId();
|
|
119360
119377
|
|
|
119361
119378
|
if (isReusedPrimitive) {
|
|
119362
119379
|
|
|
119363
119380
|
// Create mesh for multi-use primitive - create (or reuse) geometry, create mesh using that geometry
|
|
119364
119381
|
|
|
119365
|
-
const geometryId =
|
|
119382
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${primitiveIndex}`; // These IDs are local to the SceneModel
|
|
119366
119383
|
|
|
119367
119384
|
if (!geometryCreated[geometryId]) {
|
|
119368
119385
|
|
|
@@ -119548,6 +119565,8 @@ function convertColorsRGBToRGBA$1(colorsRGB) {
|
|
|
119548
119565
|
|
|
119549
119566
|
function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119550
119567
|
|
|
119568
|
+
const modelPartId = manifestCtx.getNextId();
|
|
119569
|
+
|
|
119551
119570
|
const positions = inflatedData.positions;
|
|
119552
119571
|
const normals = inflatedData.normals;
|
|
119553
119572
|
const colors = inflatedData.colors;
|
|
@@ -119700,7 +119719,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119700
119719
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
119701
119720
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
119702
119721
|
|
|
119703
|
-
const meshId = manifestCtx.
|
|
119722
|
+
const meshId = manifestCtx.getNextId();
|
|
119704
119723
|
|
|
119705
119724
|
if (isReusedGeometry) {
|
|
119706
119725
|
|
|
@@ -119709,7 +119728,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
119709
119728
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
119710
119729
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
119711
119730
|
|
|
119712
|
-
const geometryId =
|
|
119731
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
119713
119732
|
|
|
119714
119733
|
if (!geometryCreated[geometryId]) {
|
|
119715
119734
|
|
|
@@ -119987,6 +120006,8 @@ function convertColorsRGBToRGBA(colorsRGB) {
|
|
|
119987
120006
|
|
|
119988
120007
|
function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
119989
120008
|
|
|
120009
|
+
const modelPartId = manifestCtx.getNextId();
|
|
120010
|
+
|
|
119990
120011
|
const types = JSON.parse(inflatedData.types);
|
|
119991
120012
|
const eachMetaObjectId = JSON.parse(inflatedData.eachMetaObjectId);
|
|
119992
120013
|
const eachMetaObjectType = inflatedData.eachMetaObjectType;
|
|
@@ -120174,7 +120195,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120174
120195
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
120175
120196
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
120176
120197
|
|
|
120177
|
-
const meshId = manifestCtx.
|
|
120198
|
+
const meshId = manifestCtx.getNextId();
|
|
120178
120199
|
|
|
120179
120200
|
if (isReusedGeometry) {
|
|
120180
120201
|
|
|
@@ -120183,7 +120204,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120183
120204
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
120184
120205
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
120185
120206
|
|
|
120186
|
-
|
|
120207
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
120187
120208
|
|
|
120188
120209
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
120189
120210
|
|
|
@@ -120518,6 +120539,8 @@ const decompressColor$1 = (function () {
|
|
|
120518
120539
|
|
|
120519
120540
|
function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
120520
120541
|
|
|
120542
|
+
const modelPartId = manifestCtx.getNextId();
|
|
120543
|
+
|
|
120521
120544
|
const metadata = inflatedData.metadata;
|
|
120522
120545
|
|
|
120523
120546
|
const positions = inflatedData.positions;
|
|
@@ -120677,7 +120700,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120677
120700
|
const meshMetallic = eachMeshMaterial[(meshIndex * 6) + 4] / 255.0;
|
|
120678
120701
|
const meshRoughness = eachMeshMaterial[(meshIndex * 6) + 5] / 255.0;
|
|
120679
120702
|
|
|
120680
|
-
const meshId = manifestCtx.
|
|
120703
|
+
const meshId = manifestCtx.getNextId();
|
|
120681
120704
|
|
|
120682
120705
|
if (isReusedGeometry) {
|
|
120683
120706
|
|
|
@@ -120686,7 +120709,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
120686
120709
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
120687
120710
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
120688
120711
|
|
|
120689
|
-
const geometryId =
|
|
120712
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
120690
120713
|
|
|
120691
120714
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
120692
120715
|
|
|
@@ -121022,6 +121045,8 @@ const decompressColor = (function () {
|
|
|
121022
121045
|
|
|
121023
121046
|
function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx) {
|
|
121024
121047
|
|
|
121048
|
+
const modelPartId = manifestCtx.getNextId();
|
|
121049
|
+
|
|
121025
121050
|
const metadata = inflatedData.metadata;
|
|
121026
121051
|
const textureData = inflatedData.textureData;
|
|
121027
121052
|
const eachTextureDataPortion = inflatedData.eachTextureDataPortion;
|
|
@@ -121088,7 +121113,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121088
121113
|
|
|
121089
121114
|
const imageDataSubarray = new Uint8Array(textureData.subarray(textureDataPortionStart, textureDataPortionEnd));
|
|
121090
121115
|
const arrayBuffer = imageDataSubarray.buffer;
|
|
121091
|
-
const textureId =
|
|
121116
|
+
const textureId = `${modelPartId}-texture-${textureIndex}`;
|
|
121092
121117
|
|
|
121093
121118
|
if (compressed) {
|
|
121094
121119
|
|
|
@@ -121129,7 +121154,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121129
121154
|
|
|
121130
121155
|
for (let textureSetIndex = 0; textureSetIndex < numTextureSets; textureSetIndex++) {
|
|
121131
121156
|
const eachTextureSetTexturesIndex = textureSetIndex * 5;
|
|
121132
|
-
const textureSetId =
|
|
121157
|
+
const textureSetId = `${modelPartId}-textureSet-${textureSetIndex}`;
|
|
121133
121158
|
const colorTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 0];
|
|
121134
121159
|
const metallicRoughnessTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 1];
|
|
121135
121160
|
const normalsTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 2];
|
|
@@ -121137,11 +121162,11 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121137
121162
|
const occlusionTextureIndex = eachTextureSetTextures[eachTextureSetTexturesIndex + 4];
|
|
121138
121163
|
sceneModel.createTextureSet({
|
|
121139
121164
|
id: textureSetId,
|
|
121140
|
-
colorTextureId: colorTextureIndex >= 0 ?
|
|
121141
|
-
normalsTextureId: normalsTextureIndex >= 0 ?
|
|
121142
|
-
metallicRoughnessTextureId: metallicRoughnessTextureIndex >= 0 ?
|
|
121143
|
-
emissiveTextureId: emissiveTextureIndex >= 0 ?
|
|
121144
|
-
occlusionTextureId: occlusionTextureIndex >= 0 ?
|
|
121165
|
+
colorTextureId: colorTextureIndex >= 0 ? `${modelPartId}-texture-${colorTextureIndex}` : null,
|
|
121166
|
+
normalsTextureId: normalsTextureIndex >= 0 ? `${modelPartId}-texture-${normalsTextureIndex}` : null,
|
|
121167
|
+
metallicRoughnessTextureId: metallicRoughnessTextureIndex >= 0 ? `${modelPartId}-texture-${metallicRoughnessTextureIndex}` : null,
|
|
121168
|
+
emissiveTextureId: emissiveTextureIndex >= 0 ? `${modelPartId}-texture-${emissiveTextureIndex}` : null,
|
|
121169
|
+
occlusionTextureId: occlusionTextureIndex >= 0 ? `${modelPartId}-texture-${occlusionTextureIndex}` : null
|
|
121145
121170
|
});
|
|
121146
121171
|
}
|
|
121147
121172
|
|
|
@@ -121264,14 +121289,14 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121264
121289
|
|
|
121265
121290
|
const textureSetIndex = eachMeshTextureSet[meshIndex];
|
|
121266
121291
|
|
|
121267
|
-
const textureSetId = (textureSetIndex >= 0) ?
|
|
121292
|
+
const textureSetId = (textureSetIndex >= 0) ? `${modelPartId}-textureSet-${textureSetIndex}` : null;
|
|
121268
121293
|
|
|
121269
121294
|
const meshColor = decompressColor(eachMeshMaterialAttributes.subarray((meshIndex * 6), (meshIndex * 6) + 3));
|
|
121270
121295
|
const meshOpacity = eachMeshMaterialAttributes[(meshIndex * 6) + 3] / 255.0;
|
|
121271
121296
|
const meshMetallic = eachMeshMaterialAttributes[(meshIndex * 6) + 4] / 255.0;
|
|
121272
121297
|
const meshRoughness = eachMeshMaterialAttributes[(meshIndex * 6) + 5] / 255.0;
|
|
121273
121298
|
|
|
121274
|
-
const meshId = manifestCtx.
|
|
121299
|
+
const meshId = manifestCtx.getNextId();
|
|
121275
121300
|
|
|
121276
121301
|
if (isReusedGeometry) {
|
|
121277
121302
|
|
|
@@ -121280,7 +121305,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121280
121305
|
const meshMatrixIndex = eachMeshMatricesPortion[meshIndex];
|
|
121281
121306
|
const meshMatrix = matrices.slice(meshMatrixIndex, meshMatrixIndex + 16);
|
|
121282
121307
|
|
|
121283
|
-
const geometryId =
|
|
121308
|
+
const geometryId = `${modelPartId}-geometry.${tileIndex}.${geometryIndex}`; // These IDs are local to the SceneModel
|
|
121284
121309
|
|
|
121285
121310
|
let geometryArrays = geometryArraysCache[geometryId];
|
|
121286
121311
|
|
|
@@ -121379,7 +121404,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121379
121404
|
|
|
121380
121405
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121381
121406
|
id: meshId,
|
|
121382
|
-
textureSetId
|
|
121407
|
+
textureSetId,
|
|
121383
121408
|
origin: tileCenter,
|
|
121384
121409
|
primitive: geometryArrays.primitiveName,
|
|
121385
121410
|
positionsCompressed: transformedAndRecompressedPositions,
|
|
@@ -121418,8 +121443,8 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121418
121443
|
|
|
121419
121444
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121420
121445
|
id: meshId,
|
|
121421
|
-
geometryId
|
|
121422
|
-
textureSetId
|
|
121446
|
+
geometryId,
|
|
121447
|
+
textureSetId,
|
|
121423
121448
|
matrix: meshMatrix,
|
|
121424
121449
|
color: meshColor,
|
|
121425
121450
|
metallic: meshMetallic,
|
|
@@ -121494,7 +121519,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121494
121519
|
|
|
121495
121520
|
sceneModel.createMesh(utils.apply(meshDefaults, {
|
|
121496
121521
|
id: meshId,
|
|
121497
|
-
textureSetId
|
|
121522
|
+
textureSetId,
|
|
121498
121523
|
origin: tileCenter,
|
|
121499
121524
|
primitive: primitiveName,
|
|
121500
121525
|
positionsCompressed: geometryPositions,
|
|
@@ -122436,8 +122461,11 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122436
122461
|
sceneModel.fire("error", errMsg);
|
|
122437
122462
|
};
|
|
122438
122463
|
|
|
122464
|
+
let nextId = 0;
|
|
122439
122465
|
const manifestCtx = {
|
|
122440
|
-
|
|
122466
|
+
getNextId: () => {
|
|
122467
|
+
return `${modelId}.${nextId++}`;
|
|
122468
|
+
}
|
|
122441
122469
|
};
|
|
122442
122470
|
|
|
122443
122471
|
if (params.metaModelSrc || params.metaModelData) {
|
|
@@ -122480,7 +122508,6 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122480
122508
|
}
|
|
122481
122509
|
|
|
122482
122510
|
|
|
122483
|
-
|
|
122484
122511
|
} else {
|
|
122485
122512
|
|
|
122486
122513
|
if (params.src) {
|
|
@@ -122552,9 +122579,9 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
122552
122579
|
|
|
122553
122580
|
_loadModel(src, params, options, sceneModel, metaModel, manifestCtx, done, error) {
|
|
122554
122581
|
this._dataSource.getXKT(params.src, (arrayBuffer) => {
|
|
122555
|
-
|
|
122556
|
-
|
|
122557
|
-
|
|
122582
|
+
this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
|
|
122583
|
+
done();
|
|
122584
|
+
}, error);
|
|
122558
122585
|
}
|
|
122559
122586
|
|
|
122560
122587
|
_parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx) {
|