@xeokit/xeokit-sdk 2.6.43 → 2.6.46

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 (51) hide show
  1. package/dist/xeokit-sdk.cjs.js +298 -99
  2. package/dist/xeokit-sdk.es.js +298 -99
  3. package/dist/xeokit-sdk.es5.js +135 -68
  4. package/dist/xeokit-sdk.min.cjs.js +5 -5
  5. package/dist/xeokit-sdk.min.es.js +5 -5
  6. package/dist/xeokit-sdk.min.es5.js +4 -4
  7. package/package.json +1 -1
  8. package/src/extras/ContextMenu/ContextMenu.js +24 -0
  9. package/src/plugins/DotBIMLoaderPlugin/DotBIMLoaderPlugin.js +2 -1
  10. package/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +1 -0
  11. package/src/plugins/GLTFLoaderPlugin/GLTFSceneModelLoader.js +5 -3
  12. package/src/plugins/LASLoaderPlugin/LASLoaderPlugin.js +156 -2
  13. package/src/plugins/TreeViewPlugin/RenderService.js +3 -0
  14. package/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +14 -16
  15. package/src/viewer/Viewer.js +5 -1
  16. package/src/viewer/scene/input/Input.js +5 -9
  17. package/src/viewer/scene/math/rtcCoords.js +5 -1
  18. package/src/viewer/scene/model/SceneModel.js +4 -2
  19. package/src/viewer/scene/model/SceneModelMesh.js +10 -9
  20. package/src/viewer/scene/model/dtx/lines/renderers/DTXLinesColorRenderer.js +2 -2
  21. package/src/viewer/scene/model/dtx/triangles/DTXTrianglesLayer.js +2 -2
  22. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesColorRenderer.js +2 -2
  23. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesDepthRenderer.js +2 -2
  24. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesEdgesColorRenderer.js +2 -2
  25. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesEdgesRenderer.js +2 -2
  26. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesNormalsRenderer.js +2 -2
  27. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesOcclusionRenderer.js +2 -2
  28. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickDepthRenderer.js +2 -2
  29. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickMeshRenderer.js +2 -2
  30. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickNormalsFlatRenderer.js +2 -2
  31. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesPickNormalsRenderer.js +2 -1
  32. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSilhouetteRenderer.js +2 -2
  33. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapInitRenderer.js +2 -2
  34. package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapRenderer.js +2 -2
  35. package/src/viewer/scene/model/vbo/VBORenderer.js +2 -2
  36. package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLineSnapInitRenderer.js +1 -1
  37. package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapInitRenderer.js +1 -1
  38. package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapRenderer.js +1 -1
  39. package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapInitRenderer.js +1 -1
  40. package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapRenderer.js +1 -1
  41. package/src/viewer/scene/model/vbo/batching/triangles/VBOBatchingTrianglesLayer.js +10 -6
  42. package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesSnapInitRenderer.js +1 -1
  43. package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesSnapRenderer.js +1 -1
  44. package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesSnapInitRenderer.js +1 -1
  45. package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesSnapRenderer.js +1 -1
  46. package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapInitRenderer.js +1 -1
  47. package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapRenderer.js +1 -1
  48. package/src/viewer/scene/model/vbo/instancing/triangles/VBOInstancingTrianglesLayer.js +9 -4
  49. package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesSnapInitRenderer.js +1 -1
  50. package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesSnapRenderer.js +1 -1
  51. package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +95 -5
@@ -503,6 +503,7 @@ class ContextMenu {
503
503
  this._updateItemsTitles();
504
504
  this._updateItemsEnabledStatus();
505
505
  this._showMenu(this._rootMenu.id, pageX, pageY);
506
+ this._updateSubMenuInfo();
506
507
  this._shown = true;
507
508
  this.fire("shown", {});
508
509
  }
@@ -911,6 +912,29 @@ class ContextMenu {
911
912
  }
912
913
  }
913
914
 
915
+ _updateSubMenuInfo() {
916
+ if (!this._context) return;
917
+ let itemElement, itemRect, subMenuElement, initialStyles, showOnLeft, subMenuWidth;
918
+ this._itemList.forEach((item) => {
919
+ if (item.subMenu) {
920
+ itemElement = item.itemElement;
921
+ itemRect = itemElement.getBoundingClientRect();
922
+ subMenuElement = item.subMenu.menuElement;
923
+ initialStyles = {
924
+ visibility: subMenuElement.style.visibility,
925
+ display: subMenuElement.style.display,
926
+ };
927
+ subMenuElement.style.display = "block";
928
+ subMenuElement.style.visibility = "hidden";
929
+ subMenuWidth = item.subMenu.menuElement.getBoundingClientRect().width;
930
+ subMenuElement.style.visibility = initialStyles.visibility;
931
+ subMenuElement.style.display = initialStyles.display;
932
+ showOnLeft = ((itemRect.right + subMenuWidth) > window.innerWidth);
933
+ itemElement.setAttribute("data-submenuposition", showOnLeft ? "left" : "right");
934
+ }
935
+ });
936
+ }
937
+
914
938
  _showMenu(menuId, pageX, pageY) { // Shows the given menu, at the specified page coordinates
915
939
  const menu = this._menuMap[menuId];
916
940
  if (!menu) {
@@ -1299,7 +1323,7 @@ const tempVec3a$N = new FloatArrayType(3);
1299
1323
 
1300
1324
  const tempMat1 = new FloatArrayType(16);
1301
1325
  const tempMat2 = new FloatArrayType(16);
1302
- const tempVec4$1 = new FloatArrayType(4);
1326
+ const tempVec4$2 = new FloatArrayType(4);
1303
1327
 
1304
1328
 
1305
1329
  /**
@@ -4488,7 +4512,7 @@ const math = {
4488
4512
  },
4489
4513
 
4490
4514
  quaternionToAngleAxis(q, angleAxis = math.vec4()) {
4491
- q = math.normalizeQuaternion(q, tempVec4$1);
4515
+ q = math.normalizeQuaternion(q, tempVec4$2);
4492
4516
  const q3 = q[3];
4493
4517
  const angle = 2 * Math.acos(q3);
4494
4518
  const s = Math.sqrt(1 - q3 * q3);
@@ -9772,6 +9796,7 @@ class Dot {
9772
9796
  }
9773
9797
 
9774
9798
  const tempVec3a$L = math.vec3();
9799
+ const tempVec4$1 = math.vec4();
9775
9800
 
9776
9801
  /**
9777
9802
  * Given a view matrix and a relative-to-center (RTC) coordinate origin, returns a view matrix
@@ -9900,7 +9925,10 @@ function rtcToWorldPos(rtcCenter, rtcPos, worldPos) {
9900
9925
  * @param rtcPlanePos
9901
9926
  * @returns {*}
9902
9927
  */
9903
- function getPlaneRTCPos(dist, dir, rtcCenter, rtcPlanePos) {
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))
9931
+ : rtcOrigin);
9904
9932
  const rtcCenterToPlaneDist = math.dotVec3(dir, rtcCenter) + dist;
9905
9933
  const dirNormalized = math.normalizeVec3(dir, tempVec3a$L);
9906
9934
  math.mulVec3Scalar(dirNormalized, -rtcCenterToPlaneDist, rtcPlanePos);
@@ -22272,15 +22300,11 @@ class Input extends Component {
22272
22300
  this.mouseCanvasPos[1] = event.y;
22273
22301
  } else {
22274
22302
  let element = event.target;
22275
- let totalOffsetLeft = 0;
22276
- let totalOffsetTop = 0;
22277
- while (element.offsetParent) {
22278
- totalOffsetLeft += element.offsetLeft;
22279
- totalOffsetTop += element.offsetTop;
22280
- element = element.offsetParent;
22281
- }
22282
- this.mouseCanvasPos[0] = event.pageX - totalOffsetLeft;
22283
- this.mouseCanvasPos[1] = event.pageY - totalOffsetTop;
22303
+
22304
+ const rect = element.getBoundingClientRect();
22305
+
22306
+ this.mouseCanvasPos[0] = event.clientX - rect.left;
22307
+ this.mouseCanvasPos[1] = event.clientY - rect.top;
22284
22308
  }
22285
22309
  }
22286
22310
 
@@ -51457,6 +51481,16 @@ class SceneModelMesh {
51457
51481
  */
51458
51482
  set aabb(aabb) { // Called by SceneModel
51459
51483
  this._aabbLocal = aabb;
51484
+ if (this.origin) {
51485
+ this._aabbLocal = aabb.slice(0);
51486
+ const origin = this.origin;
51487
+ this._aabbLocal[0] += origin[0];
51488
+ this._aabbLocal[1] += origin[1];
51489
+ this._aabbLocal[2] += origin[2];
51490
+ this._aabbLocal[3] += origin[0];
51491
+ this._aabbLocal[4] += origin[1];
51492
+ this._aabbLocal[5] += origin[2];
51493
+ }
51460
51494
  }
51461
51495
 
51462
51496
  /**
@@ -51473,15 +51507,6 @@ class SceneModelMesh {
51473
51507
  math.transformOBB3(this.model.worldMatrix, tempOBB3$1, tempOBB3b);
51474
51508
  math.OBB3ToAABB3(tempOBB3b, this._aabbWorld);
51475
51509
  }
51476
- if (this.origin) {
51477
- const origin = this.origin;
51478
- this._aabbWorld[0] += origin[0];
51479
- this._aabbWorld[1] += origin[1];
51480
- this._aabbWorld[2] += origin[2];
51481
- this._aabbWorld[3] += origin[0];
51482
- this._aabbWorld[4] += origin[1];
51483
- this._aabbWorld[5] += origin[2];
51484
- }
51485
51510
  this._aabbWorldDirty = false;
51486
51511
  }
51487
51512
  return this._aabbWorld;
@@ -51717,7 +51742,7 @@ class VBORenderer {
51717
51742
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
51718
51743
  const origin = layer._state.origin;
51719
51744
  if (origin) {
51720
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C);
51745
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C, model.rotationMatrix);
51721
51746
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
51722
51747
  } else {
51723
51748
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -52047,7 +52072,7 @@ class VBORenderer {
52047
52072
  let offset = 0;
52048
52073
  const mat4Size = 4 * 4;
52049
52074
 
52050
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
52075
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
52051
52076
 
52052
52077
  const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
52053
52078
  const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
@@ -55098,7 +55123,7 @@ class TrianglesSnapInitRenderer$1 extends VBORenderer {
55098
55123
  let offset = 0;
55099
55124
  const mat4Size = 4 * 4;
55100
55125
 
55101
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
55126
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
55102
55127
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
55103
55128
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
55104
55129
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -55407,7 +55432,7 @@ class TrianglesSnapRenderer$1 extends VBORenderer{
55407
55432
  let offset = 0;
55408
55433
  const mat4Size = 4 * 4;
55409
55434
 
55410
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
55435
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
55411
55436
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
55412
55437
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
55413
55438
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -57102,12 +57127,15 @@ class VBOBatchingTrianglesLayer {
57102
57127
  return;
57103
57128
  }
57104
57129
  const positions = portion.quantizedPositions;
57105
- const origin = state.origin;
57106
- const offsetX = origin[0] ;
57107
- const offsetY = origin[1] ;
57108
- const offsetZ = origin[2] ;
57109
- const worldPos = tempVec4a$9;
57110
57130
  const sceneModelMatrix = this.model.matrix;
57131
+ const origin = math.vec4();
57132
+ origin.set(state.origin, 0);
57133
+ origin[3] = 1;
57134
+ math.mulMat4v4(sceneModelMatrix, origin, origin);
57135
+ const offsetX = origin[0];
57136
+ const offsetY = origin[1];
57137
+ const offsetZ = origin[2];
57138
+ const worldPos = tempVec4a$9;
57111
57139
  const positionsDecodeMatrix = state.positionsDecodeMatrix;
57112
57140
  for (let i = 0, len = positions.length; i < len; i += 3) {
57113
57141
  worldPos[0] = positions[i];
@@ -57115,7 +57143,8 @@ class VBOBatchingTrianglesLayer {
57115
57143
  worldPos[2] = positions[i + 2];
57116
57144
  worldPos[3] = 1.0;
57117
57145
  math.decompressPosition(worldPos, positionsDecodeMatrix);
57118
- math.transformPoint4(sceneModelMatrix, worldPos);
57146
+ worldPos[3] = 1;
57147
+ math.mulMat4v4(sceneModelMatrix, worldPos, worldPos);
57119
57148
  worldPos[0] += offsetX;
57120
57149
  worldPos[1] += offsetY;
57121
57150
  worldPos[2] += offsetZ;
@@ -60523,7 +60552,7 @@ class TrianglesSnapInitRenderer extends VBORenderer {
60523
60552
  let offset = 0;
60524
60553
  const mat4Size = 4 * 4;
60525
60554
 
60526
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
60555
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
60527
60556
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
60528
60557
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
60529
60558
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -60860,7 +60889,7 @@ class TrianglesSnapRenderer extends VBORenderer {
60860
60889
  let offset = 0;
60861
60890
  const mat4Size = 4 * 4;
60862
60891
 
60863
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
60892
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
60864
60893
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
60865
60894
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
60866
60895
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -61839,6 +61868,7 @@ class VBOInstancingTrianglesLayer {
61839
61868
  && !!textureSet
61840
61869
  && !!textureSet.colorTexture;
61841
61870
 
61871
+
61842
61872
  if (!this.model.scene.readableGeometryEnabled) {
61843
61873
  this._state.geometry = null;
61844
61874
  }
@@ -62169,21 +62199,25 @@ class VBOInstancingTrianglesLayer {
62169
62199
  return;
62170
62200
  }
62171
62201
  const positions = geometry.positionsCompressed;
62172
- const origin = state.origin;
62202
+ const sceneModelMatrix = this.model.matrix;
62203
+ const origin = math.vec4();
62204
+ origin.set(state.origin, 0);
62205
+ origin[3] = 1;
62206
+ math.mulMat4v4(sceneModelMatrix, origin, origin);
62173
62207
  const offsetX = origin[0];
62174
62208
  const offsetY = origin[1];
62175
62209
  const offsetZ = origin[2];
62176
62210
  const worldPos = tempVec4a$8;
62177
62211
  const portionMatrix = portion.matrix;
62178
- const sceneModelMatrix = this.model.matrix;
62179
62212
  const positionsDecodeMatrix = state.positionsDecodeMatrix;
62180
62213
  for (let i = 0, len = positions.length; i < len; i += 3) {
62181
62214
  worldPos[0] = positions[i];
62182
62215
  worldPos[1] = positions[i + 1];
62183
62216
  worldPos[2] = positions[i + 2];
62184
62217
  math.decompressPosition(worldPos, positionsDecodeMatrix);
62185
- math.transformPoint3(portionMatrix, worldPos);
62186
- math.transformPoint3(sceneModelMatrix, worldPos);
62218
+ math.transformPoint3(portionMatrix, worldPos, worldPos);
62219
+ worldPos[3] = 1;
62220
+ math.mulMat4v4(sceneModelMatrix, worldPos, worldPos);
62187
62221
  worldPos[0] += offsetX;
62188
62222
  worldPos[1] += offsetY;
62189
62223
  worldPos[2] += offsetZ;
@@ -63040,7 +63074,7 @@ class VBOBatchingLinesSnapInitRenderer extends VBORenderer {
63040
63074
  let offset = 0;
63041
63075
  const mat4Size = 4 * 4;
63042
63076
 
63043
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
63077
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
63044
63078
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
63045
63079
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
63046
63080
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -63349,7 +63383,7 @@ class VBOBatchingLinesSnapRenderer extends VBORenderer{
63349
63383
  let offset = 0;
63350
63384
  const mat4Size = 4 * 4;
63351
63385
 
63352
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
63386
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
63353
63387
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
63354
63388
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
63355
63389
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -64751,7 +64785,7 @@ class VBOInstancingLinesSnapInitRenderer extends VBORenderer {
64751
64785
  let offset = 0;
64752
64786
  const mat4Size = 4 * 4;
64753
64787
 
64754
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
64788
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
64755
64789
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
64756
64790
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
64757
64791
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -65077,7 +65111,7 @@ class VBOInstancingLinesSnapRenderer extends VBORenderer {
65077
65111
  let offset = 0;
65078
65112
  const mat4Size = 4 * 4;
65079
65113
 
65080
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
65114
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
65081
65115
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
65082
65116
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
65083
65117
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -66993,7 +67027,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
66993
67027
  let offset = 0;
66994
67028
  const mat4Size = 4 * 4;
66995
67029
 
66996
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
67030
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
66997
67031
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
66998
67032
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
66999
67033
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -67300,7 +67334,7 @@ class VBOBatchingPointsSnapRenderer extends VBORenderer{
67300
67334
  let offset = 0;
67301
67335
  const mat4Size = 4 * 4;
67302
67336
 
67303
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
67337
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
67304
67338
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
67305
67339
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
67306
67340
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -69494,7 +69528,7 @@ class VBOInstancingPointsSnapInitRenderer extends VBORenderer {
69494
69528
  let offset = 0;
69495
69529
  const mat4Size = 4 * 4;
69496
69530
 
69497
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
69531
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
69498
69532
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
69499
69533
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
69500
69534
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -69819,7 +69853,7 @@ class VBOInstancingPointsSnapRenderer extends VBORenderer {
69819
69853
  let offset = 0;
69820
69854
  const mat4Size = 4 * 4;
69821
69855
 
69822
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
69856
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
69823
69857
  this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
69824
69858
  this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
69825
69859
  this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -71003,7 +71037,7 @@ class DTXLinesColorRenderer {
71003
71037
  rtcViewMatrix = viewMatrix;
71004
71038
  }
71005
71039
 
71006
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
71040
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
71007
71041
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
71008
71042
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
71009
71043
  gl.uniform1i(this._uRenderPass, renderPass);
@@ -71028,7 +71062,7 @@ class DTXLinesColorRenderer {
71028
71062
  if (active) {
71029
71063
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
71030
71064
  if (origin) {
71031
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n);
71065
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n, rotationMatrix);
71032
71066
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
71033
71067
  } else {
71034
71068
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -72915,7 +72949,7 @@ class DTXTrianglesColorRenderer {
72915
72949
  rtcCameraEye = camera.eye;
72916
72950
  }
72917
72951
 
72918
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
72952
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
72919
72953
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
72920
72954
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
72921
72955
  gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
@@ -72941,7 +72975,7 @@ class DTXTrianglesColorRenderer {
72941
72975
  if (active) {
72942
72976
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
72943
72977
  if (origin) {
72944
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m);
72978
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m, rotationMatrix);
72945
72979
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
72946
72980
  } else {
72947
72981
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -73531,7 +73565,7 @@ class DTXTrianglesSilhouetteRenderer {
73531
73565
 
73532
73566
  gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
73533
73567
  gl.uniform1i(this._uRenderPass, renderPass);
73534
- gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
73568
+ gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrix);
73535
73569
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
73536
73570
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
73537
73571
 
@@ -73575,7 +73609,7 @@ class DTXTrianglesSilhouetteRenderer {
73575
73609
  if (active) {
73576
73610
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
73577
73611
  if (origin) {
73578
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l);
73612
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l, rotationMatrix);
73579
73613
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
73580
73614
  } else {
73581
73615
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -73984,7 +74018,7 @@ class DTXTrianglesEdgesRenderer {
73984
74018
  }
73985
74019
 
73986
74020
  gl.uniform1i(this._uRenderPass, renderPass);
73987
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
74021
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
73988
74022
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
73989
74023
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
73990
74024
 
@@ -74025,7 +74059,7 @@ class DTXTrianglesEdgesRenderer {
74025
74059
  if (active) {
74026
74060
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74027
74061
  if (origin) {
74028
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k);
74062
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k, rotationMatrix);
74029
74063
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74030
74064
  } else {
74031
74065
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -74398,7 +74432,7 @@ class DTXTrianglesEdgesColorRenderer {
74398
74432
  }
74399
74433
 
74400
74434
  gl.uniform1i(this._uRenderPass, renderPass);
74401
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
74435
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
74402
74436
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
74403
74437
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
74404
74438
 
@@ -74417,7 +74451,7 @@ class DTXTrianglesEdgesColorRenderer {
74417
74451
  if (active) {
74418
74452
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74419
74453
  if (origin) {
74420
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j);
74454
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j, rotationMatrix);
74421
74455
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74422
74456
  } else {
74423
74457
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -74814,7 +74848,7 @@ class DTXTrianglesPickMeshRenderer {
74814
74848
  }
74815
74849
  gl.uniform2fv(this._uPickClipPos, frameCtx.pickClipPos);
74816
74850
  gl.uniform2f(this._uDrawingBufferSize, gl.drawingBufferWidth, gl.drawingBufferHeight);
74817
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
74851
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
74818
74852
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
74819
74853
  gl.uniformMatrix4fv(this._uProjMatrix, false, projMatrix);
74820
74854
  gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
@@ -74838,7 +74872,7 @@ class DTXTrianglesPickMeshRenderer {
74838
74872
  if (active) {
74839
74873
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74840
74874
  if (origin) {
74841
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i);
74875
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i, rotationMatrix);
74842
74876
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74843
74877
  } else {
74844
74878
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -75262,7 +75296,7 @@ class DTXTrianglesPickDepthRenderer {
75262
75296
  gl.uniform2f(this._uDrawingBufferSize, gl.drawingBufferWidth, gl.drawingBufferHeight);
75263
75297
  gl.uniform1f(this._uPickZNear, frameCtx.pickZNear);
75264
75298
  gl.uniform1f(this._uPickZFar, frameCtx.pickZFar);
75265
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
75299
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
75266
75300
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
75267
75301
  gl.uniformMatrix4fv(this._uProjMatrix, false, projMatrix);
75268
75302
  if (scene.logarithmicDepthBufferEnabled) {
@@ -75285,7 +75319,7 @@ class DTXTrianglesPickDepthRenderer {
75285
75319
  if (active) {
75286
75320
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
75287
75321
  if (origin) {
75288
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
75322
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h, rotationMatrix);
75289
75323
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
75290
75324
  } else {
75291
75325
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -75735,7 +75769,7 @@ class DTXTrianglesSnapRenderer {
75735
75769
  gl.uniform3fv(this._uCoordinateScaler, coordinateScaler);
75736
75770
  gl.uniform1i(this._uRenderPass, renderPass);
75737
75771
  gl.uniform1i(this._uPickInvisible, frameCtx.pickInvisible);
75738
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
75772
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
75739
75773
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
75740
75774
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
75741
75775
  {
@@ -75757,7 +75791,7 @@ class DTXTrianglesSnapRenderer {
75757
75791
  if (active) {
75758
75792
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
75759
75793
  if (origin) {
75760
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g);
75794
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g, rotationMatrix);
75761
75795
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
75762
75796
  } else {
75763
75797
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -76160,7 +76194,7 @@ class DTXTrianglesSnapInitRenderer {
76160
76194
  gl.uniform3fv(this._uCoordinateScaler, coordinateScaler);
76161
76195
  gl.uniform1i(this._uRenderPass, renderPass);
76162
76196
  gl.uniform1i(this._uPickInvisible, frameCtx.pickInvisible);
76163
- gl.uniformMatrix4fv(this._uSceneWorldModelMatrix, false, rotationMatrixConjugate);
76197
+ gl.uniformMatrix4fv(this._uSceneWorldModelMatrix, false, rotationMatrix);
76164
76198
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
76165
76199
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
76166
76200
  {
@@ -76182,7 +76216,7 @@ class DTXTrianglesSnapInitRenderer {
76182
76216
  if (active) {
76183
76217
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
76184
76218
  if (origin) {
76185
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f);
76219
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f, rotationMatrix);
76186
76220
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76187
76221
  } else {
76188
76222
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -76611,7 +76645,7 @@ class DTXTrianglesOcclusionRenderer {
76611
76645
 
76612
76646
  gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
76613
76647
  gl.uniform1i(this._uRenderPass, renderPass);
76614
- gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
76648
+ gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrix);
76615
76649
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
76616
76650
 
76617
76651
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
@@ -76631,7 +76665,7 @@ class DTXTrianglesOcclusionRenderer {
76631
76665
  if (active) {
76632
76666
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
76633
76667
  if (origin) {
76634
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e);
76668
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e, rotationMatrix);
76635
76669
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76636
76670
  } else {
76637
76671
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77008,7 +77042,7 @@ class DTXTrianglesDepthRenderer {
77008
77042
  rtcCameraEye = camera.eye;
77009
77043
  }
77010
77044
 
77011
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
77045
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
77012
77046
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
77013
77047
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
77014
77048
  gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
@@ -77034,7 +77068,7 @@ class DTXTrianglesDepthRenderer {
77034
77068
  if (active) {
77035
77069
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77036
77070
  if (origin) {
77037
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
77071
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d, rotationMatrix);
77038
77072
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77039
77073
  } else {
77040
77074
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77463,7 +77497,7 @@ class DTXTrianglesNormalsRenderer {
77463
77497
 
77464
77498
  gl.uniform1i(this._uRenderPass, renderPass);
77465
77499
 
77466
- gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
77500
+ gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrix);
77467
77501
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
77468
77502
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
77469
77503
 
@@ -77485,7 +77519,7 @@ class DTXTrianglesNormalsRenderer {
77485
77519
  if (active) {
77486
77520
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77487
77521
  if (origin) {
77488
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c);
77522
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c, rotationMatrix);
77489
77523
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77490
77524
  } else {
77491
77525
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77820,7 +77854,7 @@ class DTXTrianglesPickNormalsFlatRenderer {
77820
77854
  }
77821
77855
  gl.uniform2fv(this._uPickClipPos, frameCtx.pickClipPos);
77822
77856
  gl.uniform2f(this._uDrawingBufferSize, gl.drawingBufferWidth, gl.drawingBufferHeight);
77823
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
77857
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
77824
77858
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
77825
77859
  gl.uniformMatrix4fv(this._uProjMatrix, false, projMatrix);
77826
77860
  gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
@@ -77844,7 +77878,7 @@ class DTXTrianglesPickNormalsFlatRenderer {
77844
77878
  if (active) {
77845
77879
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77846
77880
  if (origin) {
77847
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b);
77881
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b, rotationMatrix);
77848
77882
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77849
77883
  } else {
77850
77884
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -80454,8 +80488,8 @@ class DTXTrianglesLayer {
80454
80488
  worldPos[2] = positions[i + 2];
80455
80489
  worldPos[3] = 1.0;
80456
80490
  math.decompressPosition(worldPos, positionsDecodeMatrix);
80457
- math.transformPoint4(this.model.worldMatrix, worldPos);
80458
- math.transformPoint4(this.model.worldMatrix, worldPos);
80491
+ math.transformPoint4(this.model.worldMatrix, worldPos, worldPos);
80492
+ math.transformPoint4(this.model.worldMatrix, worldPos, worldPos);
80459
80493
  worldPos[0] += offsetX;
80460
80494
  worldPos[1] += offsetY;
80461
80495
  worldPos[2] += offsetZ;
@@ -84281,7 +84315,7 @@ class SceneModel extends Component {
84281
84315
  if (this._matrixDirty) {
84282
84316
  math.quaternionToRotationMat4(this._quaternion, this._worldRotationMatrix);
84283
84317
  math.conjugateQuaternion(this._quaternion, this._conjugateQuaternion);
84284
- math.quaternionToRotationMat4(this._quaternion, this._worldRotationMatrixConjugate);
84318
+ math.quaternionToRotationMat4(this._conjugateQuaternion, this._worldRotationMatrixConjugate);
84285
84319
  this._matrix.set(this._worldRotationMatrix);
84286
84320
  math.translateMat4v(this._position, this._matrix);
84287
84321
  this._matrixDirty = false;
@@ -85805,6 +85839,7 @@ class SceneModel extends Component {
85805
85839
  cfg.meshMatrix = cfg.transform.worldMatrix;
85806
85840
  }
85807
85841
  mesh.portionId = mesh.layer.createPortion(mesh, cfg);
85842
+ mesh.numPrimitives = cfg.numPrimitives;
85808
85843
  this._meshes[cfg.id] = mesh;
85809
85844
  this._unusedMeshes[cfg.id] = mesh;
85810
85845
  this._meshList.push(mesh);
@@ -86168,7 +86203,7 @@ class SceneModel extends Component {
86168
86203
  flags = flags | ENTITY_FLAGS.SELECTED;
86169
86204
  }
86170
86205
  cfg.flags = flags;
86171
- this._createEntity(cfg);
86206
+ return this._createEntity(cfg);
86172
86207
  }
86173
86208
 
86174
86209
  _createEntity(cfg) {
@@ -86199,6 +86234,7 @@ class SceneModel extends Component {
86199
86234
  this._entities[cfg.id] = entity;
86200
86235
  this._entitiesToFinalize.push(entity);
86201
86236
  this.numEntities++;
86237
+ return entity;
86202
86238
  }
86203
86239
 
86204
86240
  /**
@@ -110445,10 +110481,14 @@ class Viewer {
110445
110481
 
110446
110482
  for (let i = 0, len = pluginContainerElements.length; i < len; i++) {
110447
110483
  const containerElement = pluginContainerElements[i];
110484
+ //only calculate the scale for first plugin
110485
+ //for all others keep the scale 1 otherwise it will keep multiplying the scale with the base scale of canvas
110486
+ //resulting in increase/decreased size for the the canvas that is being overlapped
110487
+ const scale = i == 0 ? snapshotCanvas.width / containerElement.clientWidth : 1;
110448
110488
  await html2canvas(containerElement, {
110449
110489
  canvas: snapshotCanvas,
110450
110490
  backgroundColor: null,
110451
- scale: snapshotCanvas.width / containerElement.clientWidth
110491
+ scale
110452
110492
  });
110453
110493
  }
110454
110494
  if (!params.includeGizmos) {
@@ -117959,6 +117999,7 @@ function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok) {
117959
117999
  entityId: options.entityId,
117960
118000
  metaModelJSON,
117961
118001
  autoMetaModel: options.autoMetaModel,
118002
+ globalizeObjectIds: options.globalizeObjectIds,
117962
118003
  metaObjects: [],
117963
118004
  loadBuffer: options.loadBuffer,
117964
118005
  basePath: options.basePath,
@@ -118287,16 +118328,17 @@ function loadDefaultScene(ctx) {
118287
118328
 
118288
118329
  if (entityId) {
118289
118330
  if (meshIds.length > 0) {
118331
+ const globalId = ctx.globalizeObjectIds ? math.globalizeObjectId(ctx.sceneModel.id, entityId) : entityId;
118290
118332
  ctx.sceneModel.createEntity({
118291
- id: entityId,
118333
+ id: globalId,
118292
118334
  meshIds: meshIds,
118293
118335
  isObject: true
118294
118336
  });
118295
118337
  if (ctx.autoMetaModel) {
118296
118338
  ctx.metaObjects.push({
118297
- id: entityId,
118339
+ id: globalId,
118298
118340
  type: "Default",
118299
- name: entityId,
118341
+ name: globalId,
118300
118342
  parent: ctx.sceneModel.id
118301
118343
  });
118302
118344
  }
@@ -118779,6 +118821,7 @@ class GLTFLoaderPlugin extends Plugin {
118779
118821
  * to non-textured triangle meshes, and that VBOs are always used for meshes that have textures, line segments, or point
118780
118822
  * primitives. Only works while {@link DTX#enabled} is also ````true````.
118781
118823
  * @param {Boolean} [params.autoMetaModel] When supplied, creates a default MetaModel with a single MetaObject.
118824
+ * @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models.
118782
118825
  * @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}
118783
118826
  */
118784
118827
  load(params = {}) {
@@ -126146,6 +126189,9 @@ class RenderService {
126146
126189
  }
126147
126190
  if (indeterminate !== checkbox.indeterminate) {
126148
126191
  checkbox.indeterminate = indeterminate;
126192
+ if (indeterminate) {
126193
+ checkbox.checked = false;
126194
+ }
126149
126195
  }
126150
126196
  }
126151
126197
  }
@@ -133227,10 +133273,8 @@ class XKTLoaderPlugin extends Plugin {
133227
133273
  delete params.id;
133228
133274
  }
133229
133275
 
133230
- if (!params.src && !params.xkt && !params.manifestSrc && !params.manifest) {
133231
- this.error("load() param expected: src, xkt, manifestSrc or manifestData");
133232
- return sceneModel; // Return new empty model
133233
- }
133276
+ if (!params.src && !params.xkt && !params.manifestSrc && !params.manifest)
133277
+ throw new Error("XKTLoaderPlugin: load() param expected: src, xkt, manifestSrc or manifestData");
133234
133278
 
133235
133279
  const options = {};
133236
133280
  const includeTypes = params.includeTypes || this._includeTypes;
@@ -133329,9 +133373,9 @@ class XKTLoaderPlugin extends Plugin {
133329
133373
  globalizeObjectIds: options.globalizeObjectIds
133330
133374
  });
133331
133375
  if (params.src) {
133332
- this._loadModel(params.src, params, options, sceneModel, null, manifestCtx, finish, error);
133376
+ this._loadModel(params.src, options, sceneModel, null, manifestCtx, finish, error);
133333
133377
  } else {
133334
- this._parseModel(params.xkt, params, options, sceneModel, null, manifestCtx);
133378
+ this._parseModel(params.xkt, options, sceneModel, null, manifestCtx);
133335
133379
  finish();
133336
133380
  }
133337
133381
  }, (errMsg) => {
@@ -133345,9 +133389,9 @@ class XKTLoaderPlugin extends Plugin {
133345
133389
  globalizeObjectIds: options.globalizeObjectIds
133346
133390
  });
133347
133391
  if (params.src) {
133348
- this._loadModel(params.src, params, options, sceneModel, null, manifestCtx, finish, error);
133392
+ this._loadModel(params.src, options, sceneModel, null, manifestCtx, finish, error);
133349
133393
  } else {
133350
- this._parseModel(params.xkt, params, options, sceneModel, null, manifestCtx);
133394
+ this._parseModel(params.xkt, options, sceneModel, null, manifestCtx);
133351
133395
  finish();
133352
133396
  }
133353
133397
  }
@@ -133356,9 +133400,9 @@ class XKTLoaderPlugin extends Plugin {
133356
133400
  } else {
133357
133401
 
133358
133402
  if (params.src) {
133359
- this._loadModel(params.src, params, options, sceneModel, metaModel, manifestCtx, finish, error);
133403
+ this._loadModel(params.src, options, sceneModel, metaModel, manifestCtx, finish, error);
133360
133404
  } else if (params.xkt) {
133361
- this._parseModel(params.xkt, params, options, sceneModel, metaModel, manifestCtx);
133405
+ this._parseModel(params.xkt, options, sceneModel, metaModel, manifestCtx);
133362
133406
  finish();
133363
133407
  } else if (params.manifestSrc || params.manifest) {
133364
133408
  const baseDir = params.manifestSrc ? getBaseDirectory(params.manifestSrc) : "";
@@ -133392,7 +133436,7 @@ class XKTLoaderPlugin extends Plugin {
133392
133436
  done();
133393
133437
  } else {
133394
133438
  this._dataSource.getXKT(`${baseDir}${xktFiles[i]}`, (arrayBuffer) => {
133395
- this._parseModel(arrayBuffer, params, options, sceneModel, null /* Ignore metamodel in XKT */, manifestCtx);
133439
+ this._parseModel(arrayBuffer, options, sceneModel, null /* Ignore metamodel in XKT */, manifestCtx);
133396
133440
  sceneModel.preFinalize();
133397
133441
  i++;
133398
133442
  this.scheduleTask(loadNext, 200);
@@ -133410,7 +133454,7 @@ class XKTLoaderPlugin extends Plugin {
133410
133454
  done();
133411
133455
  } else {
133412
133456
  this._dataSource.getXKT(`${baseDir}${xktFiles[i]}`, (arrayBuffer) => {
133413
- this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
133457
+ this._parseModel(arrayBuffer, options, sceneModel, metaModel, manifestCtx);
133414
133458
  sceneModel.preFinalize();
133415
133459
  i++;
133416
133460
  this.scheduleTask(loadNext, 200);
@@ -133460,15 +133504,15 @@ class XKTLoaderPlugin extends Plugin {
133460
133504
  return sceneModel;
133461
133505
  }
133462
133506
 
133463
- _loadModel(src, params, options, sceneModel, metaModel, manifestCtx, done, error) {
133464
- this._dataSource.getXKT(params.src, (arrayBuffer) => {
133465
- this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
133507
+ _loadModel(src, options, sceneModel, metaModel, manifestCtx, done, error) {
133508
+ this._dataSource.getXKT(src, (arrayBuffer) => {
133509
+ this._parseModel(arrayBuffer, options, sceneModel, metaModel, manifestCtx);
133466
133510
  sceneModel.preFinalize();
133467
133511
  done();
133468
133512
  }, error);
133469
133513
  }
133470
133514
 
133471
- async _parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx) {
133515
+ async _parseModel(arrayBuffer, options, sceneModel, metaModel, manifestCtx) {
133472
133516
  if (sceneModel.destroyed) {
133473
133517
  return;
133474
133518
  }
@@ -137692,6 +137736,10 @@ class LASLoaderPlugin extends Plugin {
137692
137736
  * @param {Number} [cfg.skip=1] Configures LASLoaderPlugin to load every **n** points.
137693
137737
  * @param {Number} [cfg.fp64=false] Configures if LASLoaderPlugin assumes that LAS positions are stored in 64-bit floats instead of 32-bit.
137694
137738
  * @param {Number} [cfg.colorDepth=8] Configures whether LASLoaderPlugin assumes that LAS colors are encoded using 8 or 16 bits. Accepted values are 8, 16 an "auto".
137739
+ * @param {Boolean} [cfg.center=false] Whether to center the LAS points. Applied before "rotateX", "rotate" and "transform".
137740
+ * @param {Boolean} [cfg.rotateX=false] Whether to rotate the LAS point positions 90 degrees. Applied after "center".
137741
+ * @param {Number[]} [cfg.rotate=[0,0,0]] Rotations to immediately apply to the LAS points, given as Euler angles in degrees, for each of the X, Y and Z axis. Rotation is applied after "center" and "rotateX".
137742
+ * @param {Number[]} [cfg.transform] 4x4 transform matrix to immediately apply to the LAS points. This is applied after "center", "rotateX" and "rotate". Typically used instead of "rotateX" and "rotate".
137695
137743
  */
137696
137744
  constructor(viewer, cfg = {}) {
137697
137745
 
@@ -137701,6 +137749,10 @@ class LASLoaderPlugin extends Plugin {
137701
137749
  this.skip = cfg.skip;
137702
137750
  this.fp64 = cfg.fp64;
137703
137751
  this.colorDepth = cfg.colorDepth;
137752
+ this.center = cfg.center;
137753
+ this.rotate = cfg.rotate;
137754
+ this.rotateX = cfg.rotateX;
137755
+ this.transform = cfg.transform;
137704
137756
  }
137705
137757
 
137706
137758
  /**
@@ -137795,6 +137847,106 @@ class LASLoaderPlugin extends Plugin {
137795
137847
  this._colorDepth = value || "auto";
137796
137848
  }
137797
137849
 
137850
+ /**
137851
+ * Gets if LASLoaderPlugin immediately centers LAS positions.
137852
+ *
137853
+ * If this is ````true```` then centering is the first thing that happens to LAS positions as they are loaded.
137854
+ *
137855
+ * Default value is ````false````.
137856
+ *
137857
+ * @returns {Boolean} True if LASLoaderPlugin immediately centers LAS positions.
137858
+ */
137859
+ get center() {
137860
+ return this._center;
137861
+ }
137862
+
137863
+ /**
137864
+ * Configures if LASLoaderPlugin immediately centers LAS positions.
137865
+ *
137866
+ * If this is ````true```` then centering is the first thing that happens to LAS positions as they are loaded.
137867
+ *
137868
+ * Default value is ````false````.
137869
+ *
137870
+ * @param {Boolean} value True if LASLoaderPlugin immediately centers LAS positions.
137871
+ */
137872
+ set center(value) {
137873
+ this._center = !!value;
137874
+ }
137875
+
137876
+ /**
137877
+ * Gets the current transformation to apply to LAS positions as they are loaded.
137878
+ *
137879
+ * If this is ````true````, then LAS positions will be transformed after they are centered and rotated.
137880
+ *
137881
+ * Default value is null.
137882
+ *
137883
+ * @returns {Number[]|null} A 16-element array containing a 4x4 transformation matrix.
137884
+ */
137885
+ get transform() {
137886
+ return this._transform;
137887
+ }
137888
+
137889
+ /**
137890
+ * Sets the current transformation to apply to LAS positions as they are loaded.
137891
+ *
137892
+ * If this is ````true````, then LAS positions will be transformed after they are centered and rotated.
137893
+ *
137894
+ * Default value is null.
137895
+ *
137896
+ * @param {Number[]|null} transform A 16-element array containing a 4x4 transformation matrix.
137897
+ */
137898
+ set transform(transform) {
137899
+ this._transform = transform;
137900
+ }
137901
+
137902
+ /**
137903
+ * Gets the current rotations to apply to LAS positions as they are loaded.
137904
+ *
137905
+ * Rotations are an array of three Euler angles in degrees, for each of the X, Y and Z axis, applied in that order.
137906
+ *
137907
+ * Default value is null.
137908
+ *
137909
+ * @returns {Number[]|null} If defined, an array of three Euler angles in degrees, for each of the X, Y and Z axis. Null if undefined.
137910
+ */
137911
+ get rotate() {
137912
+ return this._rotate;
137913
+ }
137914
+
137915
+ /**
137916
+ * Sets the current rotations to apply to LAS positions as they are loaded.
137917
+ *
137918
+ * Rotations are an array of three Euler angles in degrees, for each of the X, Y and Z axis, applied in that order.
137919
+ *
137920
+ * Default value is null.
137921
+ *
137922
+ * @param {Number[]|null} rotate Array of three Euler angles in degrees, for each of the X, Y and Z axis.
137923
+ */
137924
+ set rotate(rotate) {
137925
+ this._rotate = rotate;
137926
+ }
137927
+
137928
+ /**
137929
+ * Gets if LAS positions are rotated 90 degrees about X as they are loaded.
137930
+ *
137931
+ * Default value is ````false````.
137932
+ *
137933
+ * @returns {*}
137934
+ */
137935
+ get rotateX() {
137936
+ return this._rotateX;
137937
+ }
137938
+
137939
+ /**
137940
+ * Sets if LAS positions are rotated 90 degrees about X as they are loaded.
137941
+ *
137942
+ * Default value is ````false````.
137943
+ *
137944
+ * @param rotateX
137945
+ */
137946
+ set rotateX(rotateX) {
137947
+ this._rotateX = rotateX;
137948
+ }
137949
+
137798
137950
  /**
137799
137951
  * Loads an ````LAS```` model into this LASLoaderPlugin's {@link Viewer}.
137800
137952
  *
@@ -137874,9 +138026,26 @@ class LASLoaderPlugin extends Plugin {
137874
138026
 
137875
138027
  _parseModel(arrayBuffer, params, options, sceneModel) {
137876
138028
 
137877
- function readPositions(attributesPosition) {
138029
+ const readPositions = (attributesPosition) => {
137878
138030
  const positionsValue = attributesPosition.value;
137879
- if (params.rotateX) {
138031
+ if (this._center) {
138032
+ const centerPos = math.vec3();
138033
+ const numPoints = positionsValue.length;
138034
+ for (let i = 0, len = positionsValue.length; i < len; i += 3) {
138035
+ centerPos[0] += positionsValue[i + 0];
138036
+ centerPos[1] += positionsValue[i + 1];
138037
+ centerPos[2] += positionsValue[i + 2];
138038
+ }
138039
+ centerPos[0] /= numPoints;
138040
+ centerPos[1] /= numPoints;
138041
+ centerPos[2] /= numPoints;
138042
+ for (let i = 0, len = positionsValue.length; i < len; i += 3) {
138043
+ positionsValue[i + 0] -= centerPos[0];
138044
+ positionsValue[i + 1] -= centerPos[1];
138045
+ positionsValue[i + 2] -= centerPos[2];
138046
+ }
138047
+ }
138048
+ if (this._rotateX) {
137880
138049
  if (positionsValue) {
137881
138050
  for (let i = 0, len = positionsValue.length; i < len; i += 3) {
137882
138051
  const temp = positionsValue[i + 1];
@@ -137885,8 +138054,37 @@ class LASLoaderPlugin extends Plugin {
137885
138054
  }
137886
138055
  }
137887
138056
  }
138057
+ if (this._rotate) {
138058
+ const quaternion = math.identityQuaternion();
138059
+ const mat = math.mat4();
138060
+ math.eulerToQuaternion(this._rotate, "XYZ", quaternion);
138061
+ math.quaternionToRotationMat4(quaternion, mat);
138062
+ const pos = math.vec3();
138063
+ for (let i = 0, len = positionsValue.length; i < len; i += 3) {
138064
+ pos[0] = positionsValue[i + 0];
138065
+ pos[1] = positionsValue[i + 1];
138066
+ pos[2] = positionsValue[i + 2];
138067
+ math.transformPoint3(mat, pos, pos);
138068
+ positionsValue[i + 0] = pos[0];
138069
+ positionsValue[i + 1] = pos[1];
138070
+ positionsValue[i + 2] = pos[2];
138071
+ }
138072
+ }
138073
+ if (this._transform) {
138074
+ const mat = math.mat4(this._transform);
138075
+ const pos = math.vec3();
138076
+ for (let i = 0, len = positionsValue.length; i < len; i += 3) {
138077
+ pos[0] = positionsValue[i + 0];
138078
+ pos[1] = positionsValue[i + 1];
138079
+ pos[2] = positionsValue[i + 2];
138080
+ math.transformPoint3(mat, pos, pos);
138081
+ positionsValue[i + 0] = pos[0];
138082
+ positionsValue[i + 1] = pos[1];
138083
+ positionsValue[i + 2] = pos[2];
138084
+ }
138085
+ }
137888
138086
  return positionsValue;
137889
- }
138087
+ };
137890
138088
 
137891
138089
  function readColorsAndIntensities(attributesColor, attributesIntensity) {
137892
138090
  const colors = attributesColor.value;
@@ -140144,7 +140342,8 @@ class DotBIMLoaderPlugin extends Plugin {
140144
140342
  }
140145
140343
  metaModelData.propertySets.push({
140146
140344
  id: objectId,
140147
- properties
140345
+ name: "Properties",
140346
+ properties: properties
140148
140347
  });
140149
140348
 
140150
140349
  metaModelData.metaObjects.push({