@xeokit/xeokit-sdk 2.6.48 → 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 (38) hide show
  1. package/dist/xeokit-sdk.cjs.js +67 -74
  2. package/dist/xeokit-sdk.es.js +67 -74
  3. package/dist/xeokit-sdk.es5.js +42 -42
  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/scene/math/rtcCoords.js +4 -4
  10. package/src/viewer/scene/model/SceneModel.js +16 -31
  11. package/src/viewer/scene/model/dtx/lines/renderers/DTXLinesColorRenderer.js +2 -2
  12. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesColorRenderer.js +2 -2
  13. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesDepthRenderer.js +2 -2
  14. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesEdgesColorRenderer.js +2 -2
  15. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesEdgesRenderer.js +2 -2
  16. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesNormalsRenderer.js +2 -2
  17. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesOcclusionRenderer.js +2 -2
  18. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickDepthRenderer.js +2 -2
  19. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickMeshRenderer.js +2 -2
  20. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickNormalsFlatRenderer.js +2 -2
  21. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickNormalsRenderer.js +1 -2
  22. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSilhouetteRenderer.js +2 -2
  23. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapInitRenderer.js +2 -2
  24. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapRenderer.js +2 -2
  25. package/src/viewer/scene/model/vbo/VBORenderer.js +2 -2
  26. package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLineSnapInitRenderer.js +1 -1
  27. package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapInitRenderer.js +1 -1
  28. package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapRenderer.js +1 -1
  29. package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapInitRenderer.js +5 -1
  30. package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapRenderer.js +1 -1
  31. package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesSnapInitRenderer.js +1 -1
  32. package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesSnapRenderer.js +1 -1
  33. package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesSnapInitRenderer.js +1 -1
  34. package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesSnapRenderer.js +1 -1
  35. package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapInitRenderer.js +1 -1
  36. package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapRenderer.js +1 -1
  37. package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesSnapInitRenderer.js +1 -1
  38. package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesSnapRenderer.js +1 -1
@@ -9925,9 +9925,9 @@ function rtcToWorldPos(rtcCenter, rtcPos, worldPos) {
9925
9925
  * @param rtcPlanePos
9926
9926
  * @returns {*}
9927
9927
  */
9928
- function getPlaneRTCPos(dist, dir, rtcOrigin, rtcPlanePos, rotationMatrix) {
9929
- const rtcCenter = (rotationMatrix
9930
- ? (tempVec4$1.set(rtcOrigin, 0), tempVec4$1[3] = 1, math.mulMat4v4(rotationMatrix, tempVec4$1, tempVec4$1))
9928
+ function getPlaneRTCPos(dist, dir, rtcOrigin, rtcPlanePos, originMatrix) {
9929
+ const rtcCenter = (originMatrix
9930
+ ? (tempVec4$1.set(rtcOrigin, 0), tempVec4$1[3] = 1, math.mulMat4v4(originMatrix, tempVec4$1, tempVec4$1))
9931
9931
  : rtcOrigin);
9932
9932
  const rtcCenterToPlaneDist = math.dotVec3(dir, rtcCenter) + dist;
9933
9933
  const dirNormalized = math.normalizeVec3(dir, tempVec3a$L);
@@ -51742,7 +51742,7 @@ class VBORenderer {
51742
51742
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
51743
51743
  const origin = layer._state.origin;
51744
51744
  if (origin) {
51745
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C, model.rotationMatrix);
51745
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C, model.matrix);
51746
51746
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
51747
51747
  } else {
51748
51748
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -52049,7 +52049,7 @@ class VBORenderer {
52049
52049
  const {camera} = model.scene;
52050
52050
  const {viewNormalMatrix, project} = camera;
52051
52051
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
52052
- const {position, rotationMatrix, rotationMatrixConjugate, worldNormalMatrix} = model;
52052
+ const {position, rotationMatrix, worldNormalMatrix} = model;
52053
52053
 
52054
52054
  if (!this._program) {
52055
52055
  this._allocate();
@@ -55058,7 +55058,7 @@ class TrianglesSnapInitRenderer$1 extends VBORenderer {
55058
55058
  const gl = scene.canvas.gl;
55059
55059
  const state = batchingLayer._state;
55060
55060
  const origin = batchingLayer._state.origin;
55061
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
55061
+ const {position, rotationMatrix} = model;
55062
55062
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
55063
55063
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
55064
55064
 
@@ -55367,7 +55367,7 @@ class TrianglesSnapRenderer$1 extends VBORenderer{
55367
55367
  const gl = scene.canvas.gl;
55368
55368
  const state = batchingLayer._state;
55369
55369
  const origin = batchingLayer._state.origin;
55370
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
55370
+ const {position, rotationMatrix} = model;
55371
55371
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
55372
55372
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
55373
55373
 
@@ -60489,7 +60489,7 @@ class TrianglesSnapInitRenderer extends VBORenderer {
60489
60489
  const camera = scene.camera;
60490
60490
  const state = instancingLayer._state;
60491
60491
  const origin = instancingLayer._state.origin;
60492
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
60492
+ const {position, rotationMatrix} = model;
60493
60493
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
60494
60494
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
60495
60495
 
@@ -60825,7 +60825,7 @@ class TrianglesSnapRenderer extends VBORenderer {
60825
60825
  const gl = scene.canvas.gl;
60826
60826
  const state = instancingLayer._state;
60827
60827
  const origin = instancingLayer._state.origin;
60828
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
60828
+ const {position, rotationMatrix} = model;
60829
60829
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
60830
60830
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
60831
60831
 
@@ -63009,7 +63009,7 @@ class VBOBatchingLinesSnapInitRenderer extends VBORenderer {
63009
63009
  const gl = scene.canvas.gl;
63010
63010
  const state = batchingLayer._state;
63011
63011
  const origin = batchingLayer._state.origin;
63012
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
63012
+ const {position, rotationMatrix} = model;
63013
63013
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
63014
63014
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
63015
63015
 
@@ -63318,7 +63318,7 @@ class VBOBatchingLinesSnapRenderer extends VBORenderer{
63318
63318
  const gl = scene.canvas.gl;
63319
63319
  const state = batchingLayer._state;
63320
63320
  const origin = batchingLayer._state.origin;
63321
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
63321
+ const {position, rotationMatrix} = model;
63322
63322
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
63323
63323
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
63324
63324
 
@@ -64729,7 +64729,7 @@ class VBOInstancingLinesSnapInitRenderer extends VBORenderer {
64729
64729
  const camera = scene.camera;
64730
64730
  const state = instancingLayer._state;
64731
64731
  const origin = instancingLayer._state.origin;
64732
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
64732
+ const {position, rotationMatrix} = model;
64733
64733
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
64734
64734
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
64735
64735
 
@@ -65054,7 +65054,7 @@ class VBOInstancingLinesSnapRenderer extends VBORenderer {
65054
65054
  const gl = scene.canvas.gl;
65055
65055
  const state = instancingLayer._state;
65056
65056
  const origin = instancingLayer._state.origin;
65057
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
65057
+ const {position, rotationMatrix} = model;
65058
65058
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
65059
65059
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
65060
65060
 
@@ -66962,7 +66962,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
66962
66962
  const gl = scene.canvas.gl;
66963
66963
  const state = batchingLayer._state;
66964
66964
  const origin = batchingLayer._state.origin;
66965
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
66965
+ const {position, rotationMatrix} = model;
66966
66966
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
66967
66967
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
66968
66968
 
@@ -67023,6 +67023,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
67023
67023
  gl.uniform3fv(this._uCoordinateScaler, coordinateScaler);
67024
67024
  gl.uniform1i(this._uRenderPass, renderPass);
67025
67025
  gl.uniform1i(this._uPickInvisible, frameCtx.pickInvisible);
67026
+ gl.uniform1f(this._uPointSize, 1.0);
67026
67027
 
67027
67028
  let offset = 0;
67028
67029
  const mat4Size = 4 * 4;
@@ -67066,6 +67067,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
67066
67067
  this.uInverseVectorAB = program.getLocation("snapInvVectorAB");
67067
67068
  this._uLayerNumber = program.getLocation("layerNumber");
67068
67069
  this._uCoordinateScaler = program.getLocation("coordinateScaler");
67070
+ this._uPointSize = program.getLocation("pointSize");
67069
67071
  }
67070
67072
 
67071
67073
  _bindProgram() {
@@ -67106,6 +67108,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
67106
67108
  src.push("uniform vec3 uCameraEyeRtc;");
67107
67109
  src.push("uniform vec2 snapVectorA;");
67108
67110
  src.push("uniform vec2 snapInvVectorAB;");
67111
+ src.push("uniform float pointSize;");
67109
67112
  {
67110
67113
  src.push("uniform float logDepthBufFC;");
67111
67114
  src.push("out float vFragDepth;");
@@ -67153,6 +67156,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
67153
67156
  src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
67154
67157
  }
67155
67158
  src.push("gl_Position = clipPos;");
67159
+ src.push("gl_PointSize = pointSize;");
67156
67160
  src.push(" }");
67157
67161
  src.push("}");
67158
67162
  return src;
@@ -67269,7 +67273,7 @@ class VBOBatchingPointsSnapRenderer extends VBORenderer{
67269
67273
  const gl = scene.canvas.gl;
67270
67274
  const state = batchingLayer._state;
67271
67275
  const origin = batchingLayer._state.origin;
67272
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
67276
+ const {position, rotationMatrix} = model;
67273
67277
  const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
67274
67278
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
67275
67279
 
@@ -69472,7 +69476,7 @@ class VBOInstancingPointsSnapInitRenderer extends VBORenderer {
69472
69476
  const camera = scene.camera;
69473
69477
  const state = instancingLayer._state;
69474
69478
  const origin = instancingLayer._state.origin;
69475
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
69479
+ const {position, rotationMatrix} = model;
69476
69480
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
69477
69481
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
69478
69482
 
@@ -69796,7 +69800,7 @@ class VBOInstancingPointsSnapRenderer extends VBORenderer {
69796
69800
  const gl = scene.canvas.gl;
69797
69801
  const state = instancingLayer._state;
69798
69802
  const origin = instancingLayer._state.origin;
69799
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
69803
+ const {position, rotationMatrix} = model;
69800
69804
  const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
69801
69805
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
69802
69806
 
@@ -70990,7 +70994,7 @@ class DTXLinesColorRenderer {
70990
70994
  const state = dataTextureLayer._state;
70991
70995
  const textureState = state.textureState;
70992
70996
  const origin = dataTextureLayer._state.origin;
70993
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
70997
+ const {position, rotationMatrix} = model;
70994
70998
  const viewMatrix = camera.viewMatrix;
70995
70999
 
70996
71000
  if (!this._program) {
@@ -71062,7 +71066,7 @@ class DTXLinesColorRenderer {
71062
71066
  if (active) {
71063
71067
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
71064
71068
  if (origin) {
71065
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n, rotationMatrix);
71069
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n, model.matrix);
71066
71070
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
71067
71071
  } else {
71068
71072
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -72897,7 +72901,7 @@ class DTXTrianglesColorRenderer {
72897
72901
  const state = dataTextureLayer._state;
72898
72902
  const textureState = state.textureState;
72899
72903
  const origin = dataTextureLayer._state.origin;
72900
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
72904
+ const {position, rotationMatrix} = model;
72901
72905
 
72902
72906
  if (!this._program) {
72903
72907
  this._allocate();
@@ -72975,7 +72979,7 @@ class DTXTrianglesColorRenderer {
72975
72979
  if (active) {
72976
72980
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
72977
72981
  if (origin) {
72978
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m, rotationMatrix);
72982
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m, model.matrix);
72979
72983
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
72980
72984
  } else {
72981
72985
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -73510,7 +73514,7 @@ class DTXTrianglesSilhouetteRenderer {
73510
73514
  const state = dataTextureLayer._state;
73511
73515
  const textureState = state.textureState;
73512
73516
  const origin = dataTextureLayer._state.origin;
73513
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
73517
+ const {position, rotationMatrix} = model;
73514
73518
  const viewMatrix = camera.viewMatrix;
73515
73519
 
73516
73520
  if (!this._program) {
@@ -73609,7 +73613,7 @@ class DTXTrianglesSilhouetteRenderer {
73609
73613
  if (active) {
73610
73614
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
73611
73615
  if (origin) {
73612
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l, rotationMatrix);
73616
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l, model.matrix);
73613
73617
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
73614
73618
  } else {
73615
73619
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -73970,7 +73974,7 @@ class DTXTrianglesEdgesRenderer {
73970
73974
  const state = dataTextureLayer._state;
73971
73975
  const textureState = state.textureState;
73972
73976
  const origin = dataTextureLayer._state.origin;
73973
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
73977
+ const {position, rotationMatrix} = model;
73974
73978
  const viewMatrix = camera.viewMatrix;
73975
73979
 
73976
73980
  if (!this._program) {
@@ -74059,7 +74063,7 @@ class DTXTrianglesEdgesRenderer {
74059
74063
  if (active) {
74060
74064
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74061
74065
  if (origin) {
74062
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k, rotationMatrix);
74066
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k, model.matrix);
74063
74067
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74064
74068
  } else {
74065
74069
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -74384,7 +74388,7 @@ class DTXTrianglesEdgesColorRenderer {
74384
74388
  const state = dataTextureLayer._state;
74385
74389
  const textureState = state.textureState;
74386
74390
  const origin = dataTextureLayer._state.origin;
74387
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
74391
+ const {position, rotationMatrix} = model;
74388
74392
  const viewMatrix = camera.viewMatrix;
74389
74393
 
74390
74394
  if (!this._program) {
@@ -74451,7 +74455,7 @@ class DTXTrianglesEdgesColorRenderer {
74451
74455
  if (active) {
74452
74456
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74453
74457
  if (origin) {
74454
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j, rotationMatrix);
74458
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j, model.matrix);
74455
74459
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74456
74460
  } else {
74457
74461
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -74804,7 +74808,7 @@ class DTXTrianglesPickMeshRenderer {
74804
74808
  const state = dataTextureLayer._state;
74805
74809
  const textureState = state.textureState;
74806
74810
  const origin = dataTextureLayer._state.origin;
74807
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
74811
+ const {position, rotationMatrix} = model;
74808
74812
 
74809
74813
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
74810
74814
  const projMatrix = frameCtx.pickProjMatrix || camera.projMatrix;
@@ -74872,7 +74876,7 @@ class DTXTrianglesPickMeshRenderer {
74872
74876
  if (active) {
74873
74877
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74874
74878
  if (origin) {
74875
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i, rotationMatrix);
74879
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i, model.matrix);
74876
74880
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74877
74881
  } else {
74878
74882
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -75230,7 +75234,7 @@ class DTXTrianglesPickDepthRenderer {
75230
75234
  const state = dataTextureLayer._state;
75231
75235
  const textureState = state.textureState;
75232
75236
  const origin = dataTextureLayer._state.origin;
75233
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
75237
+ const {position, rotationMatrix} = model;
75234
75238
 
75235
75239
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
75236
75240
  const projMatrix = frameCtx.pickProjMatrix || camera.projMatrix;
@@ -75319,7 +75323,7 @@ class DTXTrianglesPickDepthRenderer {
75319
75323
  if (active) {
75320
75324
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
75321
75325
  if (origin) {
75322
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h, rotationMatrix);
75326
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h, model.matrix);
75323
75327
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
75324
75328
  } else {
75325
75329
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -75705,7 +75709,7 @@ class DTXTrianglesSnapRenderer {
75705
75709
  const state = dataTextureLayer._state;
75706
75710
  const textureState = state.textureState;
75707
75711
  const origin = dataTextureLayer._state.origin;
75708
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
75712
+ const {position, rotationMatrix} = model;
75709
75713
  const aabb = dataTextureLayer.aabb; // Per-layer AABB for best RTC accuracy
75710
75714
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
75711
75715
 
@@ -75791,7 +75795,7 @@ class DTXTrianglesSnapRenderer {
75791
75795
  if (active) {
75792
75796
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
75793
75797
  if (origin) {
75794
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g, rotationMatrix);
75798
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g, model.matrix);
75795
75799
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
75796
75800
  } else {
75797
75801
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -76131,7 +76135,7 @@ class DTXTrianglesSnapInitRenderer {
76131
76135
  const state = dataTextureLayer._state;
76132
76136
  const textureState = state.textureState;
76133
76137
  const origin = dataTextureLayer._state.origin;
76134
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
76138
+ const {position, rotationMatrix} = model;
76135
76139
  const aabb = dataTextureLayer.aabb; // Per-layer AABB for best RTC accuracy
76136
76140
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
76137
76141
 
@@ -76216,7 +76220,7 @@ class DTXTrianglesSnapInitRenderer {
76216
76220
  if (active) {
76217
76221
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
76218
76222
  if (origin) {
76219
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f, rotationMatrix);
76223
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f, model.matrix);
76220
76224
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76221
76225
  } else {
76222
76226
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -76591,7 +76595,7 @@ class DTXTrianglesOcclusionRenderer {
76591
76595
  const state = dataTextureLayer._state;
76592
76596
  const textureState = state.textureState;
76593
76597
  const origin = dataTextureLayer._state.origin;
76594
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
76598
+ const {position, rotationMatrix} = model;
76595
76599
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
76596
76600
 
76597
76601
  if (!this._program) {
@@ -76665,7 +76669,7 @@ class DTXTrianglesOcclusionRenderer {
76665
76669
  if (active) {
76666
76670
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
76667
76671
  if (origin) {
76668
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e, rotationMatrix);
76672
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e, model.matrix);
76669
76673
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76670
76674
  } else {
76671
76675
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -76990,7 +76994,7 @@ class DTXTrianglesDepthRenderer {
76990
76994
  const state = dataTextureLayer._state;
76991
76995
  const textureState = state.textureState;
76992
76996
  const origin = dataTextureLayer._state.origin;
76993
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
76997
+ const {position, rotationMatrix} = model;
76994
76998
 
76995
76999
  if (!this._program) {
76996
77000
  this._allocate();
@@ -77068,7 +77072,7 @@ class DTXTrianglesDepthRenderer {
77068
77072
  if (active) {
77069
77073
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77070
77074
  if (origin) {
77071
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d, rotationMatrix);
77075
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d, model.matrix);
77072
77076
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77073
77077
  } else {
77074
77078
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77449,7 +77453,7 @@ class DTXTrianglesNormalsRenderer {
77449
77453
  const gl = scene.canvas.gl;
77450
77454
  const state = dataTextureLayer._state;
77451
77455
  const origin = dataTextureLayer._state.origin;
77452
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
77456
+ const {position, rotationMatrix} = model;
77453
77457
  const viewMatrix = camera.viewMatrix;
77454
77458
 
77455
77459
  if (!this._program) {
@@ -77519,7 +77523,7 @@ class DTXTrianglesNormalsRenderer {
77519
77523
  if (active) {
77520
77524
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77521
77525
  if (origin) {
77522
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c, rotationMatrix);
77526
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c, model.matrix);
77523
77527
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77524
77528
  } else {
77525
77529
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77796,7 +77800,7 @@ class DTXTrianglesPickNormalsFlatRenderer {
77796
77800
  const state = dataTextureLayer._state;
77797
77801
  const textureState = state.textureState;
77798
77802
  const origin = dataTextureLayer._state.origin;
77799
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
77803
+ const {position, rotationMatrix} = model;
77800
77804
 
77801
77805
  if (!this._program) {
77802
77806
  this._allocate();
@@ -77878,7 +77882,7 @@ class DTXTrianglesPickNormalsFlatRenderer {
77878
77882
  if (active) {
77879
77883
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77880
77884
  if (origin) {
77881
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b, rotationMatrix);
77885
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b, model.matrix);
77882
77886
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77883
77887
  } else {
77884
77888
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -84293,9 +84297,7 @@ class SceneModel extends Component {
84293
84297
  * @type {Number[]}
84294
84298
  */
84295
84299
  get matrix() {
84296
- if (this._matrixDirty) {
84297
- this._rebuildMatrices();
84298
- }
84300
+ this._rebuildMatrices();
84299
84301
  return this._matrix;
84300
84302
  }
84301
84303
 
@@ -84305,9 +84307,7 @@ class SceneModel extends Component {
84305
84307
  * @type {Number[]}
84306
84308
  */
84307
84309
  get rotationMatrix() {
84308
- if (this._matrixDirty) {
84309
- this._rebuildMatrices();
84310
- }
84310
+ this._rebuildMatrices();
84311
84311
  return this._worldRotationMatrix;
84312
84312
  }
84313
84313
 
@@ -84319,6 +84319,7 @@ class SceneModel extends Component {
84319
84319
  this._matrix.set(this._worldRotationMatrix);
84320
84320
  math.translateMat4v(this._position, this._matrix);
84321
84321
  this._matrixDirty = false;
84322
+ this._viewMatrixDirty = true;
84322
84323
  }
84323
84324
  }
84324
84325
 
@@ -84330,9 +84331,7 @@ class SceneModel extends Component {
84330
84331
  * @type {Number[]}
84331
84332
  */
84332
84333
  get rotationMatrixConjugate() {
84333
- if (this._matrixDirty) {
84334
- this._rebuildMatrices();
84335
- }
84334
+ this._rebuildMatrices();
84336
84335
  return this._worldRotationMatrixConjugate;
84337
84336
  }
84338
84337
 
@@ -84376,6 +84375,16 @@ class SceneModel extends Component {
84376
84375
  return this._worldNormalMatrix;
84377
84376
  }
84378
84377
 
84378
+ _rebuildViewMatrices() {
84379
+ this._rebuildMatrices();
84380
+ if (this._viewMatrixDirty) {
84381
+ math.mulMat4(this.scene.camera.viewMatrix, this._matrix, this._viewMatrix);
84382
+ math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
84383
+ math.transposeMat4(this._viewNormalMatrix);
84384
+ this._viewMatrixDirty = false;
84385
+ }
84386
+ }
84387
+
84379
84388
  /**
84380
84389
  * Called by private renderers in ./lib, returns the view matrix with which to
84381
84390
  * render this SceneModel. The view matrix is the concatenation of the
@@ -84387,16 +84396,7 @@ class SceneModel extends Component {
84387
84396
  if (!this._viewMatrix) {
84388
84397
  return this.scene.camera.viewMatrix;
84389
84398
  }
84390
- if (this._matrixDirty) {
84391
- this._rebuildMatrices();
84392
- this._viewMatrixDirty = true;
84393
- }
84394
- if (this._viewMatrixDirty) {
84395
- math.mulMat4(this.scene.camera.viewMatrix, this._matrix, this._viewMatrix);
84396
- math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
84397
- math.transposeMat4(this._viewNormalMatrix);
84398
- this._viewMatrixDirty = false;
84399
- }
84399
+ this._rebuildViewMatrices();
84400
84400
  return this._viewMatrix;
84401
84401
  }
84402
84402
 
@@ -84409,18 +84409,7 @@ class SceneModel extends Component {
84409
84409
  if (!this._viewNormalMatrix) {
84410
84410
  return this.scene.camera.viewNormalMatrix;
84411
84411
  }
84412
- if (this._matrixDirty) {
84413
- this._rebuildMatrices();
84414
- this._viewMatrixDirty = true;
84415
- }
84416
- if (this._viewMatrixDirty) {
84417
- math.mulMat4(this.scene.camera.viewMatrix, this._matrix, this._viewMatrix);
84418
- math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
84419
- math.transposeMat4(this._viewNormalMatrix);
84420
- this._viewMatrixDirty = false;
84421
- }
84422
- math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
84423
- math.transposeMat4(this._viewNormalMatrix);
84412
+ this._rebuildViewMatrices();
84424
84413
  return this._viewNormalMatrix;
84425
84414
  }
84426
84415
 
@@ -110486,9 +110475,13 @@ class Viewer {
110486
110475
  //for all others keep the scale 1 otherwise it will keep multiplying the scale with the base scale of canvas
110487
110476
  //resulting in increase/decreased size for the the canvas that is being overlapped
110488
110477
  const scale = i == 0 ? snapshotCanvas.width / containerElement.clientWidth : 1;
110478
+ const off = math.vec2([ 0, 0 ]);
110479
+ transformToNode(canvas, containerElement, off);
110489
110480
  await html2canvas(containerElement, {
110490
110481
  canvas: snapshotCanvas,
110491
110482
  backgroundColor: null,
110483
+ x: off[0],
110484
+ y: off[1],
110492
110485
  scale
110493
110486
  });
110494
110487
  }