@xeokit/xeokit-sdk 2.6.46 → 2.6.49

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.
Files changed (39) hide show
  1. package/dist/xeokit-sdk.cjs.js +73 -79
  2. package/dist/xeokit-sdk.es.js +73 -79
  3. package/dist/xeokit-sdk.es5.js +46 -46
  4. package/dist/xeokit-sdk.min.cjs.js +3 -3
  5. package/dist/xeokit-sdk.min.es.js +3 -3
  6. package/dist/xeokit-sdk.min.es5.js +3 -3
  7. package/package.json +1 -1
  8. package/src/viewer/Viewer.js +6 -0
  9. package/src/viewer/metadata/MetaModel.js +6 -5
  10. package/src/viewer/scene/math/rtcCoords.js +4 -4
  11. package/src/viewer/scene/model/SceneModel.js +16 -31
  12. package/src/viewer/scene/model/dtx/lines/renderers/DTXLinesColorRenderer.js +2 -2
  13. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesColorRenderer.js +2 -2
  14. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesDepthRenderer.js +2 -2
  15. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesEdgesColorRenderer.js +2 -2
  16. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesEdgesRenderer.js +2 -2
  17. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesNormalsRenderer.js +2 -2
  18. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesOcclusionRenderer.js +2 -2
  19. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickDepthRenderer.js +2 -2
  20. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickMeshRenderer.js +2 -2
  21. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickNormalsFlatRenderer.js +2 -2
  22. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickNormalsRenderer.js +1 -2
  23. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSilhouetteRenderer.js +2 -2
  24. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapInitRenderer.js +2 -2
  25. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapRenderer.js +2 -2
  26. package/src/viewer/scene/model/vbo/VBORenderer.js +2 -2
  27. package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLineSnapInitRenderer.js +1 -1
  28. package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapInitRenderer.js +1 -1
  29. package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapRenderer.js +1 -1
  30. package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapInitRenderer.js +5 -1
  31. package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapRenderer.js +1 -1
  32. package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesSnapInitRenderer.js +1 -1
  33. package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesSnapRenderer.js +1 -1
  34. package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesSnapInitRenderer.js +1 -1
  35. package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesSnapRenderer.js +1 -1
  36. package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapInitRenderer.js +1 -1
  37. package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapRenderer.js +1 -1
  38. package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesSnapInitRenderer.js +1 -1
  39. package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesSnapRenderer.js +1 -1
@@ -9929,9 +9929,9 @@ function rtcToWorldPos(rtcCenter, rtcPos, worldPos) {
9929
9929
  * @param rtcPlanePos
9930
9930
  * @returns {*}
9931
9931
  */
9932
- function getPlaneRTCPos(dist, dir, rtcOrigin, rtcPlanePos, rotationMatrix) {
9933
- const rtcCenter = (rotationMatrix
9934
- ? (tempVec4$1.set(rtcOrigin, 0), tempVec4$1[3] = 1, math.mulMat4v4(rotationMatrix, tempVec4$1, tempVec4$1))
9932
+ function getPlaneRTCPos(dist, dir, rtcOrigin, rtcPlanePos, originMatrix) {
9933
+ const rtcCenter = (originMatrix
9934
+ ? (tempVec4$1.set(rtcOrigin, 0), tempVec4$1[3] = 1, math.mulMat4v4(originMatrix, tempVec4$1, tempVec4$1))
9935
9935
  : rtcOrigin);
9936
9936
  const rtcCenterToPlaneDist = math.dotVec3(dir, rtcCenter) + dist;
9937
9937
  const dirNormalized = math.normalizeVec3(dir, tempVec3a$L);
@@ -51746,7 +51746,7 @@ class VBORenderer {
51746
51746
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
51747
51747
  const origin = layer._state.origin;
51748
51748
  if (origin) {
51749
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C, model.rotationMatrix);
51749
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C, model.matrix);
51750
51750
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
51751
51751
  } else {
51752
51752
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -52053,7 +52053,7 @@ class VBORenderer {
52053
52053
  const {camera} = model.scene;
52054
52054
  const {viewNormalMatrix, project} = camera;
52055
52055
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
52056
- const {position, rotationMatrix, rotationMatrixConjugate, worldNormalMatrix} = model;
52056
+ const {position, rotationMatrix, worldNormalMatrix} = model;
52057
52057
 
52058
52058
  if (!this._program) {
52059
52059
  this._allocate();
@@ -55062,7 +55062,7 @@ class TrianglesSnapInitRenderer$1 extends VBORenderer {
55062
55062
  const gl = scene.canvas.gl;
55063
55063
  const state = batchingLayer._state;
55064
55064
  const origin = batchingLayer._state.origin;
55065
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
55065
+ const {position, rotationMatrix} = model;
55066
55066
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
55067
55067
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
55068
55068
 
@@ -55371,7 +55371,7 @@ class TrianglesSnapRenderer$1 extends VBORenderer{
55371
55371
  const gl = scene.canvas.gl;
55372
55372
  const state = batchingLayer._state;
55373
55373
  const origin = batchingLayer._state.origin;
55374
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
55374
+ const {position, rotationMatrix} = model;
55375
55375
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
55376
55376
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
55377
55377
 
@@ -60493,7 +60493,7 @@ class TrianglesSnapInitRenderer extends VBORenderer {
60493
60493
  const camera = scene.camera;
60494
60494
  const state = instancingLayer._state;
60495
60495
  const origin = instancingLayer._state.origin;
60496
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
60496
+ const {position, rotationMatrix} = model;
60497
60497
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
60498
60498
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
60499
60499
 
@@ -60829,7 +60829,7 @@ class TrianglesSnapRenderer extends VBORenderer {
60829
60829
  const gl = scene.canvas.gl;
60830
60830
  const state = instancingLayer._state;
60831
60831
  const origin = instancingLayer._state.origin;
60832
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
60832
+ const {position, rotationMatrix} = model;
60833
60833
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
60834
60834
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
60835
60835
 
@@ -63013,7 +63013,7 @@ class VBOBatchingLinesSnapInitRenderer extends VBORenderer {
63013
63013
  const gl = scene.canvas.gl;
63014
63014
  const state = batchingLayer._state;
63015
63015
  const origin = batchingLayer._state.origin;
63016
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
63016
+ const {position, rotationMatrix} = model;
63017
63017
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
63018
63018
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
63019
63019
 
@@ -63322,7 +63322,7 @@ class VBOBatchingLinesSnapRenderer extends VBORenderer{
63322
63322
  const gl = scene.canvas.gl;
63323
63323
  const state = batchingLayer._state;
63324
63324
  const origin = batchingLayer._state.origin;
63325
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
63325
+ const {position, rotationMatrix} = model;
63326
63326
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
63327
63327
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
63328
63328
 
@@ -64733,7 +64733,7 @@ class VBOInstancingLinesSnapInitRenderer extends VBORenderer {
64733
64733
  const camera = scene.camera;
64734
64734
  const state = instancingLayer._state;
64735
64735
  const origin = instancingLayer._state.origin;
64736
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
64736
+ const {position, rotationMatrix} = model;
64737
64737
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
64738
64738
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
64739
64739
 
@@ -65058,7 +65058,7 @@ class VBOInstancingLinesSnapRenderer extends VBORenderer {
65058
65058
  const gl = scene.canvas.gl;
65059
65059
  const state = instancingLayer._state;
65060
65060
  const origin = instancingLayer._state.origin;
65061
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
65061
+ const {position, rotationMatrix} = model;
65062
65062
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
65063
65063
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
65064
65064
 
@@ -66966,7 +66966,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
66966
66966
  const gl = scene.canvas.gl;
66967
66967
  const state = batchingLayer._state;
66968
66968
  const origin = batchingLayer._state.origin;
66969
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
66969
+ const {position, rotationMatrix} = model;
66970
66970
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
66971
66971
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
66972
66972
 
@@ -67027,6 +67027,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
67027
67027
  gl.uniform3fv(this._uCoordinateScaler, coordinateScaler);
67028
67028
  gl.uniform1i(this._uRenderPass, renderPass);
67029
67029
  gl.uniform1i(this._uPickInvisible, frameCtx.pickInvisible);
67030
+ gl.uniform1f(this._uPointSize, 1.0);
67030
67031
 
67031
67032
  let offset = 0;
67032
67033
  const mat4Size = 4 * 4;
@@ -67070,6 +67071,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
67070
67071
  this.uInverseVectorAB = program.getLocation("snapInvVectorAB");
67071
67072
  this._uLayerNumber = program.getLocation("layerNumber");
67072
67073
  this._uCoordinateScaler = program.getLocation("coordinateScaler");
67074
+ this._uPointSize = program.getLocation("pointSize");
67073
67075
  }
67074
67076
 
67075
67077
  _bindProgram() {
@@ -67110,6 +67112,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
67110
67112
  src.push("uniform vec3 uCameraEyeRtc;");
67111
67113
  src.push("uniform vec2 snapVectorA;");
67112
67114
  src.push("uniform vec2 snapInvVectorAB;");
67115
+ src.push("uniform float pointSize;");
67113
67116
  {
67114
67117
  src.push("uniform float logDepthBufFC;");
67115
67118
  src.push("out float vFragDepth;");
@@ -67157,6 +67160,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
67157
67160
  src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
67158
67161
  }
67159
67162
  src.push("gl_Position = clipPos;");
67163
+ src.push("gl_PointSize = pointSize;");
67160
67164
  src.push(" }");
67161
67165
  src.push("}");
67162
67166
  return src;
@@ -67273,7 +67277,7 @@ class VBOBatchingPointsSnapRenderer extends VBORenderer{
67273
67277
  const gl = scene.canvas.gl;
67274
67278
  const state = batchingLayer._state;
67275
67279
  const origin = batchingLayer._state.origin;
67276
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
67280
+ const {position, rotationMatrix} = model;
67277
67281
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
67278
67282
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
67279
67283
 
@@ -69476,7 +69480,7 @@ class VBOInstancingPointsSnapInitRenderer extends VBORenderer {
69476
69480
  const camera = scene.camera;
69477
69481
  const state = instancingLayer._state;
69478
69482
  const origin = instancingLayer._state.origin;
69479
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
69483
+ const {position, rotationMatrix} = model;
69480
69484
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
69481
69485
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
69482
69486
 
@@ -69800,7 +69804,7 @@ class VBOInstancingPointsSnapRenderer extends VBORenderer {
69800
69804
  const gl = scene.canvas.gl;
69801
69805
  const state = instancingLayer._state;
69802
69806
  const origin = instancingLayer._state.origin;
69803
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
69807
+ const {position, rotationMatrix} = model;
69804
69808
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
69805
69809
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
69806
69810
 
@@ -70994,7 +70998,7 @@ class DTXLinesColorRenderer {
70994
70998
  const state = dataTextureLayer._state;
70995
70999
  const textureState = state.textureState;
70996
71000
  const origin = dataTextureLayer._state.origin;
70997
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
71001
+ const {position, rotationMatrix} = model;
70998
71002
  const viewMatrix = camera.viewMatrix;
70999
71003
 
71000
71004
  if (!this._program) {
@@ -71066,7 +71070,7 @@ class DTXLinesColorRenderer {
71066
71070
  if (active) {
71067
71071
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
71068
71072
  if (origin) {
71069
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n, rotationMatrix);
71073
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n, model.matrix);
71070
71074
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
71071
71075
  } else {
71072
71076
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -72901,7 +72905,7 @@ class DTXTrianglesColorRenderer {
72901
72905
  const state = dataTextureLayer._state;
72902
72906
  const textureState = state.textureState;
72903
72907
  const origin = dataTextureLayer._state.origin;
72904
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
72908
+ const {position, rotationMatrix} = model;
72905
72909
 
72906
72910
  if (!this._program) {
72907
72911
  this._allocate();
@@ -72979,7 +72983,7 @@ class DTXTrianglesColorRenderer {
72979
72983
  if (active) {
72980
72984
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
72981
72985
  if (origin) {
72982
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m, rotationMatrix);
72986
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m, model.matrix);
72983
72987
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
72984
72988
  } else {
72985
72989
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -73514,7 +73518,7 @@ class DTXTrianglesSilhouetteRenderer {
73514
73518
  const state = dataTextureLayer._state;
73515
73519
  const textureState = state.textureState;
73516
73520
  const origin = dataTextureLayer._state.origin;
73517
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
73521
+ const {position, rotationMatrix} = model;
73518
73522
  const viewMatrix = camera.viewMatrix;
73519
73523
 
73520
73524
  if (!this._program) {
@@ -73613,7 +73617,7 @@ class DTXTrianglesSilhouetteRenderer {
73613
73617
  if (active) {
73614
73618
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
73615
73619
  if (origin) {
73616
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l, rotationMatrix);
73620
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l, model.matrix);
73617
73621
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
73618
73622
  } else {
73619
73623
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -73974,7 +73978,7 @@ class DTXTrianglesEdgesRenderer {
73974
73978
  const state = dataTextureLayer._state;
73975
73979
  const textureState = state.textureState;
73976
73980
  const origin = dataTextureLayer._state.origin;
73977
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
73981
+ const {position, rotationMatrix} = model;
73978
73982
  const viewMatrix = camera.viewMatrix;
73979
73983
 
73980
73984
  if (!this._program) {
@@ -74063,7 +74067,7 @@ class DTXTrianglesEdgesRenderer {
74063
74067
  if (active) {
74064
74068
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74065
74069
  if (origin) {
74066
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k, rotationMatrix);
74070
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k, model.matrix);
74067
74071
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74068
74072
  } else {
74069
74073
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -74388,7 +74392,7 @@ class DTXTrianglesEdgesColorRenderer {
74388
74392
  const state = dataTextureLayer._state;
74389
74393
  const textureState = state.textureState;
74390
74394
  const origin = dataTextureLayer._state.origin;
74391
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
74395
+ const {position, rotationMatrix} = model;
74392
74396
  const viewMatrix = camera.viewMatrix;
74393
74397
 
74394
74398
  if (!this._program) {
@@ -74455,7 +74459,7 @@ class DTXTrianglesEdgesColorRenderer {
74455
74459
  if (active) {
74456
74460
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74457
74461
  if (origin) {
74458
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j, rotationMatrix);
74462
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j, model.matrix);
74459
74463
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74460
74464
  } else {
74461
74465
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -74808,7 +74812,7 @@ class DTXTrianglesPickMeshRenderer {
74808
74812
  const state = dataTextureLayer._state;
74809
74813
  const textureState = state.textureState;
74810
74814
  const origin = dataTextureLayer._state.origin;
74811
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
74815
+ const {position, rotationMatrix} = model;
74812
74816
 
74813
74817
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
74814
74818
  const projMatrix = frameCtx.pickProjMatrix || camera.projMatrix;
@@ -74876,7 +74880,7 @@ class DTXTrianglesPickMeshRenderer {
74876
74880
  if (active) {
74877
74881
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74878
74882
  if (origin) {
74879
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i, rotationMatrix);
74883
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i, model.matrix);
74880
74884
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74881
74885
  } else {
74882
74886
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -75234,7 +75238,7 @@ class DTXTrianglesPickDepthRenderer {
75234
75238
  const state = dataTextureLayer._state;
75235
75239
  const textureState = state.textureState;
75236
75240
  const origin = dataTextureLayer._state.origin;
75237
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
75241
+ const {position, rotationMatrix} = model;
75238
75242
 
75239
75243
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
75240
75244
  const projMatrix = frameCtx.pickProjMatrix || camera.projMatrix;
@@ -75323,7 +75327,7 @@ class DTXTrianglesPickDepthRenderer {
75323
75327
  if (active) {
75324
75328
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
75325
75329
  if (origin) {
75326
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h, rotationMatrix);
75330
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h, model.matrix);
75327
75331
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
75328
75332
  } else {
75329
75333
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -75709,7 +75713,7 @@ class DTXTrianglesSnapRenderer {
75709
75713
  const state = dataTextureLayer._state;
75710
75714
  const textureState = state.textureState;
75711
75715
  const origin = dataTextureLayer._state.origin;
75712
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
75716
+ const {position, rotationMatrix} = model;
75713
75717
  const aabb = dataTextureLayer.aabb; // Per-layer AABB for best RTC accuracy
75714
75718
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
75715
75719
 
@@ -75795,7 +75799,7 @@ class DTXTrianglesSnapRenderer {
75795
75799
  if (active) {
75796
75800
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
75797
75801
  if (origin) {
75798
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g, rotationMatrix);
75802
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g, model.matrix);
75799
75803
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
75800
75804
  } else {
75801
75805
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -76135,7 +76139,7 @@ class DTXTrianglesSnapInitRenderer {
76135
76139
  const state = dataTextureLayer._state;
76136
76140
  const textureState = state.textureState;
76137
76141
  const origin = dataTextureLayer._state.origin;
76138
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
76142
+ const {position, rotationMatrix} = model;
76139
76143
  const aabb = dataTextureLayer.aabb; // Per-layer AABB for best RTC accuracy
76140
76144
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
76141
76145
 
@@ -76220,7 +76224,7 @@ class DTXTrianglesSnapInitRenderer {
76220
76224
  if (active) {
76221
76225
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
76222
76226
  if (origin) {
76223
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f, rotationMatrix);
76227
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f, model.matrix);
76224
76228
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76225
76229
  } else {
76226
76230
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -76595,7 +76599,7 @@ class DTXTrianglesOcclusionRenderer {
76595
76599
  const state = dataTextureLayer._state;
76596
76600
  const textureState = state.textureState;
76597
76601
  const origin = dataTextureLayer._state.origin;
76598
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
76602
+ const {position, rotationMatrix} = model;
76599
76603
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
76600
76604
 
76601
76605
  if (!this._program) {
@@ -76669,7 +76673,7 @@ class DTXTrianglesOcclusionRenderer {
76669
76673
  if (active) {
76670
76674
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
76671
76675
  if (origin) {
76672
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e, rotationMatrix);
76676
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e, model.matrix);
76673
76677
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76674
76678
  } else {
76675
76679
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -76994,7 +76998,7 @@ class DTXTrianglesDepthRenderer {
76994
76998
  const state = dataTextureLayer._state;
76995
76999
  const textureState = state.textureState;
76996
77000
  const origin = dataTextureLayer._state.origin;
76997
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
77001
+ const {position, rotationMatrix} = model;
76998
77002
 
76999
77003
  if (!this._program) {
77000
77004
  this._allocate();
@@ -77072,7 +77076,7 @@ class DTXTrianglesDepthRenderer {
77072
77076
  if (active) {
77073
77077
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77074
77078
  if (origin) {
77075
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d, rotationMatrix);
77079
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d, model.matrix);
77076
77080
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77077
77081
  } else {
77078
77082
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77453,7 +77457,7 @@ class DTXTrianglesNormalsRenderer {
77453
77457
  const gl = scene.canvas.gl;
77454
77458
  const state = dataTextureLayer._state;
77455
77459
  const origin = dataTextureLayer._state.origin;
77456
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
77460
+ const {position, rotationMatrix} = model;
77457
77461
  const viewMatrix = camera.viewMatrix;
77458
77462
 
77459
77463
  if (!this._program) {
@@ -77523,7 +77527,7 @@ class DTXTrianglesNormalsRenderer {
77523
77527
  if (active) {
77524
77528
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77525
77529
  if (origin) {
77526
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c, rotationMatrix);
77530
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c, model.matrix);
77527
77531
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77528
77532
  } else {
77529
77533
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77800,7 +77804,7 @@ class DTXTrianglesPickNormalsFlatRenderer {
77800
77804
  const state = dataTextureLayer._state;
77801
77805
  const textureState = state.textureState;
77802
77806
  const origin = dataTextureLayer._state.origin;
77803
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
77807
+ const {position, rotationMatrix} = model;
77804
77808
 
77805
77809
  if (!this._program) {
77806
77810
  this._allocate();
@@ -77882,7 +77886,7 @@ class DTXTrianglesPickNormalsFlatRenderer {
77882
77886
  if (active) {
77883
77887
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77884
77888
  if (origin) {
77885
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b, rotationMatrix);
77889
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b, model.matrix);
77886
77890
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77887
77891
  } else {
77888
77892
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -84297,9 +84301,7 @@ class SceneModel extends Component {
84297
84301
  * @type {Number[]}
84298
84302
  */
84299
84303
  get matrix() {
84300
- if (this._matrixDirty) {
84301
- this._rebuildMatrices();
84302
- }
84304
+ this._rebuildMatrices();
84303
84305
  return this._matrix;
84304
84306
  }
84305
84307
 
@@ -84309,9 +84311,7 @@ class SceneModel extends Component {
84309
84311
  * @type {Number[]}
84310
84312
  */
84311
84313
  get rotationMatrix() {
84312
- if (this._matrixDirty) {
84313
- this._rebuildMatrices();
84314
- }
84314
+ this._rebuildMatrices();
84315
84315
  return this._worldRotationMatrix;
84316
84316
  }
84317
84317
 
@@ -84323,6 +84323,7 @@ class SceneModel extends Component {
84323
84323
  this._matrix.set(this._worldRotationMatrix);
84324
84324
  math.translateMat4v(this._position, this._matrix);
84325
84325
  this._matrixDirty = false;
84326
+ this._viewMatrixDirty = true;
84326
84327
  }
84327
84328
  }
84328
84329
 
@@ -84334,9 +84335,7 @@ class SceneModel extends Component {
84334
84335
  * @type {Number[]}
84335
84336
  */
84336
84337
  get rotationMatrixConjugate() {
84337
- if (this._matrixDirty) {
84338
- this._rebuildMatrices();
84339
- }
84338
+ this._rebuildMatrices();
84340
84339
  return this._worldRotationMatrixConjugate;
84341
84340
  }
84342
84341
 
@@ -84380,6 +84379,16 @@ class SceneModel extends Component {
84380
84379
  return this._worldNormalMatrix;
84381
84380
  }
84382
84381
 
84382
+ _rebuildViewMatrices() {
84383
+ this._rebuildMatrices();
84384
+ if (this._viewMatrixDirty) {
84385
+ math.mulMat4(this.scene.camera.viewMatrix, this._matrix, this._viewMatrix);
84386
+ math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
84387
+ math.transposeMat4(this._viewNormalMatrix);
84388
+ this._viewMatrixDirty = false;
84389
+ }
84390
+ }
84391
+
84383
84392
  /**
84384
84393
  * Called by private renderers in ./lib, returns the view matrix with which to
84385
84394
  * render this SceneModel. The view matrix is the concatenation of the
@@ -84391,16 +84400,7 @@ class SceneModel extends Component {
84391
84400
  if (!this._viewMatrix) {
84392
84401
  return this.scene.camera.viewMatrix;
84393
84402
  }
84394
- if (this._matrixDirty) {
84395
- this._rebuildMatrices();
84396
- this._viewMatrixDirty = true;
84397
- }
84398
- if (this._viewMatrixDirty) {
84399
- math.mulMat4(this.scene.camera.viewMatrix, this._matrix, this._viewMatrix);
84400
- math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
84401
- math.transposeMat4(this._viewNormalMatrix);
84402
- this._viewMatrixDirty = false;
84403
- }
84403
+ this._rebuildViewMatrices();
84404
84404
  return this._viewMatrix;
84405
84405
  }
84406
84406
 
@@ -84413,18 +84413,7 @@ class SceneModel extends Component {
84413
84413
  if (!this._viewNormalMatrix) {
84414
84414
  return this.scene.camera.viewNormalMatrix;
84415
84415
  }
84416
- if (this._matrixDirty) {
84417
- this._rebuildMatrices();
84418
- this._viewMatrixDirty = true;
84419
- }
84420
- if (this._viewMatrixDirty) {
84421
- math.mulMat4(this.scene.camera.viewMatrix, this._matrix, this._viewMatrix);
84422
- math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
84423
- math.transposeMat4(this._viewNormalMatrix);
84424
- this._viewMatrixDirty = false;
84425
- }
84426
- math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
84427
- math.transposeMat4(this._viewNormalMatrix);
84416
+ this._rebuildViewMatrices();
84428
84417
  return this._viewNormalMatrix;
84429
84418
  }
84430
84419
 
@@ -101520,9 +101509,9 @@ class MetaModel {
101520
101509
  * The {@link MetaObject}s in this MetaModel, each mapped to its ID.
101521
101510
  *
101522
101511
  * @property metaObjects
101523
- * @type {MetaObject[]}
101512
+ * @type {{String:MetaObject}}
101524
101513
  */
101525
- this.metaObjects = [];
101514
+ this.metaObjects = {};
101526
101515
 
101527
101516
  /**
101528
101517
  * Connectivity graph.
@@ -101621,7 +101610,7 @@ class MetaModel {
101621
101610
  this.metaScene.metaObjects[id] = metaObject;
101622
101611
  metaObject.metaModels = [];
101623
101612
  }
101624
- this.metaObjects.push(metaObject);
101613
+ this.metaObjects[id] =metaObject;
101625
101614
  if (!metaObjectData.parent) {
101626
101615
  this.rootMetaObjects.push(metaObject);
101627
101616
  metaScene.rootMetaObjects[id] = metaObject;
@@ -101745,8 +101734,9 @@ class MetaModel {
101745
101734
  metaObjects: [],
101746
101735
  propertySets: []
101747
101736
  };
101748
- for (let i = 0, len = this.metaObjects.length; i < len; i++) {
101749
- const metaObject = this.metaObjects[i];
101737
+ const metaObjectsList = Object.values(this.metaObjects);
101738
+ for (let i = 0, len = metaObjectsList.length; i < len; i++) {
101739
+ const metaObject = metaObjectsList[i];
101750
101740
  const metaObjectCfg = {
101751
101741
  id: metaObject.id,
101752
101742
  originalSystemId: metaObject.originalSystemId,
@@ -110489,9 +110479,13 @@ class Viewer {
110489
110479
  //for all others keep the scale 1 otherwise it will keep multiplying the scale with the base scale of canvas
110490
110480
  //resulting in increase/decreased size for the the canvas that is being overlapped
110491
110481
  const scale = i == 0 ? snapshotCanvas.width / containerElement.clientWidth : 1;
110482
+ const off = math.vec2([ 0, 0 ]);
110483
+ transformToNode(canvas, containerElement, off);
110492
110484
  await html2canvas(containerElement, {
110493
110485
  canvas: snapshotCanvas,
110494
110486
  backgroundColor: null,
110487
+ x: off[0],
110488
+ y: off[1],
110495
110489
  scale
110496
110490
  });
110497
110491
  }