@crystaldesign/real-time-viewer 25.3.0-beta.3 → 25.3.0-beta.31

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 (158) hide show
  1. package/build/esm/index.js +283 -168
  2. package/build/types/real-time-viewer/src/CustomMaterial/index.d.ts.map +1 -1
  3. package/build/types/real-time-viewer/src/index.d.ts +1 -1
  4. package/build/types/real-time-viewer/src/index.d.ts.map +1 -1
  5. package/build/types/real-time-viewer/src/parser/createCams/index.d.ts.map +1 -1
  6. package/build/types/real-time-viewer/src/parser/findAssets/index.d.ts.map +1 -1
  7. package/build/types/real-time-viewer/src/parser/index.d.ts.map +1 -1
  8. package/build/types/real-time-viewer/src/parser/shadow/index.d.ts.map +1 -1
  9. package/build/types/real-time-viewer/src/store/SceneStore.d.ts +9 -1
  10. package/build/types/real-time-viewer/src/store/SceneStore.d.ts.map +1 -1
  11. package/build/types/real-time-viewer/src/store/UIStore.d.ts +6 -2
  12. package/build/types/real-time-viewer/src/store/UIStore.d.ts.map +1 -1
  13. package/build/types/real-time-viewer/src/store/UtilStore.d.ts +2 -1
  14. package/build/types/real-time-viewer/src/store/UtilStore.d.ts.map +1 -1
  15. package/build/types/real-time-viewer/src/store/types.d.ts +6 -0
  16. package/build/types/real-time-viewer/src/store/types.d.ts.map +1 -1
  17. package/build/types/real-time-viewer/src/types.d.ts +2 -1
  18. package/build/types/real-time-viewer/src/types.d.ts.map +1 -1
  19. package/build/types/real-time-viewer/src/useRealTimeRenderData.d.ts.map +1 -1
  20. package/build/umd/real-time-viewer.umd.min.js +1 -1
  21. package/build/umd/report.html +1 -1
  22. package/package.json +12 -12
  23. package/build/umd/1309.real-time-viewer.umd.min.js +0 -2
  24. package/build/umd/1309.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  25. package/build/umd/1447.real-time-viewer.umd.min.js +0 -2
  26. package/build/umd/1447.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  27. package/build/umd/1499.real-time-viewer.umd.min.js +0 -2
  28. package/build/umd/1499.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  29. package/build/umd/1781.real-time-viewer.umd.min.js +0 -2
  30. package/build/umd/1781.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  31. package/build/umd/1896.real-time-viewer.umd.min.js +0 -2
  32. package/build/umd/1896.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  33. package/build/umd/2011.real-time-viewer.umd.min.js +0 -2
  34. package/build/umd/2011.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  35. package/build/umd/2439.real-time-viewer.umd.min.js +0 -2
  36. package/build/umd/2439.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  37. package/build/umd/2817.real-time-viewer.umd.min.js +0 -2
  38. package/build/umd/2817.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  39. package/build/umd/2871.real-time-viewer.umd.min.js +0 -2
  40. package/build/umd/2871.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  41. package/build/umd/3116.real-time-viewer.umd.min.js +0 -2
  42. package/build/umd/3116.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  43. package/build/umd/3243.real-time-viewer.umd.min.js +0 -2
  44. package/build/umd/3243.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  45. package/build/umd/3351.real-time-viewer.umd.min.js +0 -2
  46. package/build/umd/3351.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  47. package/build/umd/3456.real-time-viewer.umd.min.js +0 -2
  48. package/build/umd/3456.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  49. package/build/umd/3945.real-time-viewer.umd.min.js +0 -2
  50. package/build/umd/3945.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  51. package/build/umd/4091.real-time-viewer.umd.min.js +0 -2
  52. package/build/umd/4091.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  53. package/build/umd/410.real-time-viewer.umd.min.js +0 -2
  54. package/build/umd/410.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  55. package/build/umd/4153.real-time-viewer.umd.min.js +0 -2
  56. package/build/umd/4153.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  57. package/build/umd/4248.real-time-viewer.umd.min.js +0 -2
  58. package/build/umd/4248.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  59. package/build/umd/4378.real-time-viewer.umd.min.js +0 -2
  60. package/build/umd/4378.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  61. package/build/umd/4431.real-time-viewer.umd.min.js +0 -2
  62. package/build/umd/4431.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  63. package/build/umd/4542.real-time-viewer.umd.min.js +0 -2
  64. package/build/umd/4542.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  65. package/build/umd/4602.real-time-viewer.umd.min.js +0 -2
  66. package/build/umd/4602.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  67. package/build/umd/4661.real-time-viewer.umd.min.js +0 -2
  68. package/build/umd/4661.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  69. package/build/umd/4669.real-time-viewer.umd.min.js +0 -2
  70. package/build/umd/4669.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  71. package/build/umd/4711.real-time-viewer.umd.min.js +0 -2
  72. package/build/umd/4711.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  73. package/build/umd/4823.real-time-viewer.umd.min.js +0 -2
  74. package/build/umd/4823.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  75. package/build/umd/5462.real-time-viewer.umd.min.js +0 -2
  76. package/build/umd/5462.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  77. package/build/umd/5478.real-time-viewer.umd.min.js +0 -2
  78. package/build/umd/5478.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  79. package/build/umd/5483.real-time-viewer.umd.min.js +0 -2
  80. package/build/umd/5483.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  81. package/build/umd/5555.real-time-viewer.umd.min.js +0 -2
  82. package/build/umd/5555.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  83. package/build/umd/5860.real-time-viewer.umd.min.js +0 -2
  84. package/build/umd/5860.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  85. package/build/umd/5922.real-time-viewer.umd.min.js +0 -2
  86. package/build/umd/5922.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  87. package/build/umd/6095.real-time-viewer.umd.min.js +0 -2
  88. package/build/umd/6095.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  89. package/build/umd/615.real-time-viewer.umd.min.js +0 -2
  90. package/build/umd/615.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  91. package/build/umd/6230.real-time-viewer.umd.min.js +0 -2
  92. package/build/umd/6230.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  93. package/build/umd/6357.real-time-viewer.umd.min.js +0 -2
  94. package/build/umd/6357.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  95. package/build/umd/653.real-time-viewer.umd.min.js +0 -2
  96. package/build/umd/653.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  97. package/build/umd/6656.real-time-viewer.umd.min.js +0 -2
  98. package/build/umd/6656.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  99. package/build/umd/6829.real-time-viewer.umd.min.js +0 -2
  100. package/build/umd/6829.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  101. package/build/umd/7042.real-time-viewer.umd.min.js +0 -2
  102. package/build/umd/7042.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  103. package/build/umd/710.real-time-viewer.umd.min.js +0 -2
  104. package/build/umd/710.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  105. package/build/umd/7142.real-time-viewer.umd.min.js +0 -2
  106. package/build/umd/7142.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  107. package/build/umd/7229.real-time-viewer.umd.min.js +0 -2
  108. package/build/umd/7229.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  109. package/build/umd/7276.real-time-viewer.umd.min.js +0 -2
  110. package/build/umd/7276.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  111. package/build/umd/7352.real-time-viewer.umd.min.js +0 -2
  112. package/build/umd/7352.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  113. package/build/umd/7501.real-time-viewer.umd.min.js +0 -2
  114. package/build/umd/7501.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  115. package/build/umd/7607.real-time-viewer.umd.min.js +0 -2
  116. package/build/umd/7607.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  117. package/build/umd/7729.real-time-viewer.umd.min.js +0 -2
  118. package/build/umd/7729.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  119. package/build/umd/7751.real-time-viewer.umd.min.js +0 -2
  120. package/build/umd/7751.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  121. package/build/umd/7754.real-time-viewer.umd.min.js +0 -2
  122. package/build/umd/7754.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  123. package/build/umd/8078.real-time-viewer.umd.min.js +0 -2
  124. package/build/umd/8078.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  125. package/build/umd/8105.real-time-viewer.umd.min.js +0 -2
  126. package/build/umd/8105.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  127. package/build/umd/815.real-time-viewer.umd.min.js +0 -2
  128. package/build/umd/815.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  129. package/build/umd/8240.real-time-viewer.umd.min.js +0 -2
  130. package/build/umd/8240.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  131. package/build/umd/8333.real-time-viewer.umd.min.js +0 -2
  132. package/build/umd/8333.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  133. package/build/umd/8526.real-time-viewer.umd.min.js +0 -2
  134. package/build/umd/8526.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  135. package/build/umd/8620.real-time-viewer.umd.min.js +0 -2
  136. package/build/umd/8620.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  137. package/build/umd/8728.real-time-viewer.umd.min.js +0 -2
  138. package/build/umd/8728.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  139. package/build/umd/8729.real-time-viewer.umd.min.js +0 -2
  140. package/build/umd/8729.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  141. package/build/umd/8991.real-time-viewer.umd.min.js +0 -2
  142. package/build/umd/8991.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  143. package/build/umd/9078.real-time-viewer.umd.min.js +0 -2
  144. package/build/umd/9078.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  145. package/build/umd/913.real-time-viewer.umd.min.js +0 -2
  146. package/build/umd/913.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  147. package/build/umd/930.real-time-viewer.umd.min.js +0 -2
  148. package/build/umd/930.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  149. package/build/umd/9383.real-time-viewer.umd.min.js +0 -2
  150. package/build/umd/9383.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  151. package/build/umd/9473.real-time-viewer.umd.min.js +0 -2
  152. package/build/umd/9473.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  153. package/build/umd/9568.real-time-viewer.umd.min.js +0 -2
  154. package/build/umd/9568.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  155. package/build/umd/9712.real-time-viewer.umd.min.js +0 -2
  156. package/build/umd/9712.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
  157. package/build/umd/9884.real-time-viewer.umd.min.js +0 -2
  158. package/build/umd/9884.real-time-viewer.umd.min.js.LICENSE.txt +0 -1
@@ -1,6 +1,7 @@
1
1
  import { useRef, useEffect, memo } from 'react';
2
2
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
3
3
  import _regeneratorRuntime from '@babel/runtime/regenerator';
4
+ import { Constants, HighlightLayer, Color4 as Color4$1 } from '@babylonjs/core';
4
5
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
5
6
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
6
7
  import _createClass from '@babel/runtime/helpers/createClass';
@@ -33,10 +34,8 @@ import { Rectangle } from '@babylonjs/gui/2D/controls/rectangle';
33
34
  import { TextBlock } from '@babylonjs/gui/2D/controls/textBlock';
34
35
  import { Mesh } from '@babylonjs/core/Meshes/mesh';
35
36
  import { Axis } from '@babylonjs/core/Maths/math.axis';
36
- import { HighlightLayer } from '@babylonjs/core/Layers/';
37
37
  import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial';
38
38
  import { Texture } from '@babylonjs/core/Materials/Textures/texture';
39
- import { Constants } from '@babylonjs/core/Engines/constants';
40
39
  import { Matrix as Matrix$1, Vector3 as Vector3$1 } from '@babylonjs/core/Maths/math';
41
40
  import { Engine } from '@babylonjs/core/Engines/engine';
42
41
  import { Scene } from '@babylonjs/core/scene';
@@ -183,8 +182,8 @@ function GetCameraControls(camera) {
183
182
  }
184
183
  function onRotateMouse(event) {
185
184
  if (previousTouch != undefined) return;
186
- var deltaX = event.movementX || event.mozMovementX || event.webkitMovementX || 0;
187
- var deltaY = event.movementY || event.mozMovementY || event.webkitMovementY || 0;
185
+ var deltaX = event.movementX || 0;
186
+ var deltaY = event.movementY || 0;
188
187
  onRotate(deltaX, deltaY);
189
188
  }
190
189
  function onMouseDown(ev) {
@@ -204,8 +203,8 @@ function GetCameraControls(camera) {
204
203
  element === null || element === void 0 || element.removeEventListener('pointermove', onMouseMoveTarget, false);
205
204
  }
206
205
  function onMouseMoveTarget(event) {
207
- var deltaX = event.movementX || event.mozMovementX || event.webkitMovementX || 0;
208
- var deltaY = event.movementY || event.mozMovementY || event.webkitMovementY || 0;
206
+ var deltaX = event.movementX || 0;
207
+ var deltaY = event.movementY || 0;
209
208
  moveTarget(deltaX * 0.002, deltaY * 0.002);
210
209
  sceneStore.doRenderControlLoop = true;
211
210
  }
@@ -940,6 +939,7 @@ function updateCam(camera, scene) {
940
939
  var _sceneStore$updateCam;
941
940
  if (camera.pos.x == 0 && camera.pos.y == 0 && camera.pos.z == 0) return;
942
941
  var utilStore = useUtilStoreContext();
942
+ if (!utilStore.updateCam) return;
943
943
  var sceneStore = useSceneStoreContext();
944
944
  var cam = scene.getCameraByName('defaultCam');
945
945
  if (!cam) {
@@ -1000,6 +1000,7 @@ var SceneStore = /*#__PURE__*/function () {
1000
1000
  _defineProperty(this, "_sceneConstruct", {});
1001
1001
  _defineProperty(this, "_hasRendered", false);
1002
1002
  _defineProperty(this, "_hasPlanned", false);
1003
+ _defineProperty(this, "_modelIteration", 0);
1003
1004
  _defineProperty(this, "_utilStore", void 0);
1004
1005
  _defineProperty(this, "_cache", []);
1005
1006
  _defineProperty(this, "_ssao", undefined);
@@ -1010,6 +1011,7 @@ var SceneStore = /*#__PURE__*/function () {
1010
1011
  _defineProperty(this, "_jwt", void 0);
1011
1012
  _defineProperty(this, "_onMissingGeo", void 0);
1012
1013
  _defineProperty(this, "_cancelSceneExport", void 0);
1014
+ _defineProperty(this, "_materialCache", void 0);
1013
1015
  //controls
1014
1016
  _defineProperty(this, "_renderControlLoop", undefined);
1015
1017
  _defineProperty(this, "_doRenderControlLoop", false);
@@ -1029,6 +1031,7 @@ var SceneStore = /*#__PURE__*/function () {
1029
1031
  this.updateCameraInformation = updateCameraInformation;
1030
1032
  this._cancelSceneExport = false;
1031
1033
  this._jwt = jwt;
1034
+ this._materialCache = [];
1032
1035
  var options = new SceneOptimizerOptions(15, 1000);
1033
1036
  options.addOptimization(new ShadowsOptimization(0));
1034
1037
  options.addOptimization(new RenderTargetsOptimization(0));
@@ -1058,6 +1061,16 @@ var SceneStore = /*#__PURE__*/function () {
1058
1061
  this._utilStore = utilStore;
1059
1062
  }
1060
1063
  return _createClass(SceneStore, [{
1064
+ key: "materialCache",
1065
+ get: function get() {
1066
+ return this._materialCache;
1067
+ }
1068
+ }, {
1069
+ key: "modelIteration",
1070
+ get: function get() {
1071
+ return this._modelIteration;
1072
+ }
1073
+ }, {
1061
1074
  key: "jwt",
1062
1075
  get: function get() {
1063
1076
  return this._jwt;
@@ -1392,6 +1405,40 @@ var SceneStore = /*#__PURE__*/function () {
1392
1405
  }
1393
1406
  this._scene.getEngine().resize();
1394
1407
  }
1408
+ }, {
1409
+ key: "checkMaterialCache",
1410
+ value: function checkMaterialCache() {
1411
+ // material cache can't go over amount x because it leads to performance issues
1412
+ if (this._materialCache.length < 10) return;
1413
+ var amountToDispose = this._materialCache.length - 11;
1414
+ var disposableMaterials = this._materialCache.filter(function (m) {
1415
+ return m.mat.getBindedMeshes().length == 0;
1416
+ });
1417
+ disposableMaterials = disposableMaterials.sort(function (dm) {
1418
+ return dm.lastUsage;
1419
+ });
1420
+ for (var idx = 0; idx < amountToDispose; idx++) {
1421
+ if (idx < disposableMaterials.length - 1) {
1422
+ var _mat$baseTexture, _mat$metallicRoughnes, _mat$normalTexture;
1423
+ var mat = disposableMaterials[idx].mat;
1424
+ mat.dispose();
1425
+ (_mat$baseTexture = mat.baseTexture) === null || _mat$baseTexture === void 0 || _mat$baseTexture.dispose();
1426
+ (_mat$metallicRoughnes = mat.metallicRoughnessTexture) === null || _mat$metallicRoughnes === void 0 || _mat$metallicRoughnes.dispose();
1427
+ (_mat$normalTexture = mat.normalTexture) === null || _mat$normalTexture === void 0 || _mat$normalTexture.dispose();
1428
+ this._materialCache.splice(this._materialCache.indexOf(disposableMaterials[idx]), 1);
1429
+ }
1430
+ }
1431
+ }
1432
+ }, {
1433
+ key: "addMaterialToCache",
1434
+ value: function addMaterialToCache(materialCache) {
1435
+ this._materialCache.push(materialCache);
1436
+ }
1437
+ }, {
1438
+ key: "updateModelIteration",
1439
+ value: function updateModelIteration() {
1440
+ this._modelIteration = this._modelIteration + 1;
1441
+ }
1395
1442
  }, {
1396
1443
  key: "init",
1397
1444
  value: function init(diva3durl, gameCanvas, viewpoint, resolution) {
@@ -1685,7 +1732,7 @@ function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.lengt
1685
1732
  */
1686
1733
 
1687
1734
  var UIStore = /*#__PURE__*/function () {
1688
- function UIStore(scene, enableSSAO, utilStore, uiConfig, requestNewOverlayImage, _overlayImage, onElementCopy) {
1735
+ function UIStore(scene, enableSSAO, _utilStore, uiConfig, requestNewOverlayImage, _overlayImage, onElementCopy) {
1689
1736
  var _this = this;
1690
1737
  _classCallCheck(this, UIStore);
1691
1738
  _defineProperty(this, "_utilStore", void 0);
@@ -1708,38 +1755,53 @@ var UIStore = /*#__PURE__*/function () {
1708
1755
  _defineProperty(this, "_gridGui", void 0);
1709
1756
  _defineProperty(this, "_isStaticBg", void 0);
1710
1757
  _defineProperty(this, "_elementsInfo", void 0);
1711
- _defineProperty(this, "_selectedHl", void 0);
1712
1758
  _defineProperty(this, "_diffuseTexture", void 0);
1713
1759
  _defineProperty(this, "_plane", void 0);
1714
1760
  _defineProperty(this, "_selectedMeshes", []);
1761
+ _defineProperty(this, "_isUnityComb", false);
1762
+ _defineProperty(this, "_selectedHl", void 0);
1715
1763
  _defineProperty(this, "updateOverlayImage", function (overlayImage) {
1716
1764
  var _this$_diffuseTexture;
1717
1765
  if (!overlayImage || !_this._scene || ((_this$_diffuseTexture = _this._diffuseTexture) === null || _this$_diffuseTexture === void 0 ? void 0 : _this$_diffuseTexture.url) == overlayImage.base64) return;
1766
+ var utilStore = useUtilStoreContext();
1767
+ if (!utilStore.updateCam) return;
1718
1768
  _this._isStaticBg = overlayImage.isStaticBg;
1719
1769
  _this._diffuseTexture.updateURL(overlayImage.base64);
1720
1770
  _this._plane.visibility = 1;
1771
+ var root = _this._scene.getTransformNodeByName('Root');
1772
+ if (root) root.getChildMeshes().forEach(function (m) {
1773
+ if (!m.material) return;
1774
+ m.material.depthFunction = Constants.ALWAYS;
1775
+ m.material.disableColorWrite = true;
1776
+ });
1721
1777
  _this._enableSSAO(false);
1778
+ _this._plane.setEnabled(true);
1722
1779
  });
1723
1780
  this._scene = scene;
1781
+ var engine = this._scene.getEngine();
1724
1782
  var plane = MeshBuilder.CreatePlane('overlayplane', {
1725
1783
  size: 0.0047
1726
1784
  }, scene);
1785
+ plane.setEnabled(false);
1727
1786
  var mat = new StandardMaterial('planeMat', scene);
1728
- this._diffuseTexture = new Texture('data:image/gif;base64,R0lGODlhAQABALMAAAAAAP///////////////////////////////////////////////////////////yH5BAEAAAEALAAAAAABAAEAAAQCMEQAOw==', scene);
1787
+ this._diffuseTexture = new Texture('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAwAB/ep3wWkAAAAASUVORK5CYII=', scene);
1729
1788
  mat.diffuseTexture = this._diffuseTexture;
1730
1789
  mat.emissiveTexture = this._diffuseTexture;
1731
1790
  mat.specularColor = Color3.Black();
1732
1791
  this._plane = plane;
1733
- plane.material = mat;
1734
- var engine = this._scene.getEngine();
1735
- plane.scaling.x = engine.getRenderingCanvas().width / engine.getRenderingCanvas().height;
1736
- plane.position.z = 0.011;
1737
- plane.isPickable = false;
1738
- plane.parent = scene.activeCamera;
1792
+ this._plane.material = mat;
1793
+ this._plane.scaling.x = engine.getRenderingCanvas().width / engine.getRenderingCanvas().height;
1794
+ this._plane.position.z = 0.011;
1795
+ this._plane.isPickable = false;
1796
+ this._plane.parent = scene.activeCamera;
1739
1797
  this._selectedHl = new HighlightLayer('hl', this._scene);
1740
1798
  this._selectedHl.innerGlow = false;
1799
+ this._selectedHl.outerGlow = false;
1800
+ this._selectedHl.blurHorizontalSize = 1;
1801
+ this._selectedHl.blurVerticalSize = 1;
1802
+ this._selectedHl.mainTexture.samples = 4;
1741
1803
  this._enableSSAO = enableSSAO;
1742
- this._utilStore = utilStore;
1804
+ this._utilStore = _utilStore;
1743
1805
  this._gui = AdvancedDynamicTexture.CreateFullscreenUI('UI');
1744
1806
  this._gui.layer.layerMask = 0x0fffffff;
1745
1807
  this._gui.renderScale = 1;
@@ -1756,12 +1818,23 @@ var UIStore = /*#__PURE__*/function () {
1756
1818
  }
1757
1819
  this._isStaticBg = _overlayImage === null || _overlayImage === void 0 ? void 0 : _overlayImage.isStaticBg;
1758
1820
  if (_overlayImage) {
1759
- this._diffuseTexture.updateURL(_overlayImage.base64);
1821
+ this._isUnityComb = true;
1760
1822
  this._plane.visibility = 1;
1823
+ var root = this._scene.getTransformNodeByName('Root');
1824
+ if (root) root.getChildMeshes().forEach(function (m) {
1825
+ if (!m.material) return;
1826
+ m.material.depthFunction = Constants.ALWAYS;
1827
+ m.material.disableColorWrite = false;
1828
+ });
1761
1829
  this._enableSSAO(false);
1762
1830
  }
1763
1831
  }
1764
1832
  return _createClass(UIStore, [{
1833
+ key: "highlightLayer",
1834
+ get: function get() {
1835
+ return this._selectedHl;
1836
+ }
1837
+ }, {
1765
1838
  key: "isStaticBg",
1766
1839
  get: function get() {
1767
1840
  return !!this._isStaticBg;
@@ -1769,7 +1842,7 @@ var UIStore = /*#__PURE__*/function () {
1769
1842
  }, {
1770
1843
  key: "unityCombActive",
1771
1844
  get: function get() {
1772
- return !!this._plane;
1845
+ return !!this._isUnityComb;
1773
1846
  }
1774
1847
  }, {
1775
1848
  key: "initSelectionHandler",
@@ -1792,25 +1865,10 @@ var UIStore = /*#__PURE__*/function () {
1792
1865
  return mesh.isPickable && mesh.isReady() && mesh.isEnabled() && (!_this2._scene.cameraToUseForPointers || (_this2._scene.cameraToUseForPointers.layerMask & mesh.layerMask) !== 0);
1793
1866
  };
1794
1867
  }
1795
- }, {
1796
- key: "highlightObservable",
1797
- value: function highlightObservable(meshes) {
1798
- var _this3 = this;
1799
- meshes.forEach(function (m) {
1800
- if (_this3._plane.visibility == 1) {
1801
- m.material.depthFunction = Constants.ALWAYS;
1802
- m.material.disableColorWrite = true;
1803
- } else {
1804
- m.visibility = 1;
1805
- m.material.depthFunction = Constants.LESS;
1806
- m.material.disableColorWrite = false;
1807
- }
1808
- });
1809
- }
1810
1868
  }, {
1811
1869
  key: "createGridGui",
1812
1870
  value: function createGridGui(mesh, onClickDel) {
1813
- var _this4 = this;
1871
+ var _this3 = this;
1814
1872
  if (!this._selectionHandler || !mesh) return;
1815
1873
  this.removeGridGui();
1816
1874
  var guiElem = new TransformNode('gridGuiElem', this._scene);
@@ -1833,10 +1891,10 @@ var UIStore = /*#__PURE__*/function () {
1833
1891
  dbt.height = this._uiConfig.templateConfig == 'standard' ? '40px' : '70%';
1834
1892
  dbt.onPointerClickObservable.add(onClickDel);
1835
1893
  dtarget.onPointerEnterObservable = new Observable(function () {
1836
- return dtarget.background = _this4._colors.hoverBg;
1894
+ return dtarget.background = _this3._colors.hoverBg;
1837
1895
  });
1838
1896
  dtarget.onPointerOutObservable = new Observable(function () {
1839
- return dtarget.background = _this4._colors.defaultBg;
1897
+ return dtarget.background = _this3._colors.defaultBg;
1840
1898
  });
1841
1899
  if (this._uiConfig.templateConfig == 'standard') dtarget.linkOffsetY = -48;
1842
1900
  dtarget.addControl(dbt);
@@ -1869,9 +1927,7 @@ var UIStore = /*#__PURE__*/function () {
1869
1927
  }, {
1870
1928
  key: "createPosNr",
1871
1929
  value: function createPosNr(elementInfo, element, isBoxPlanner) {
1872
- var _this5 = this,
1873
- _this$_utilStore$view,
1874
- _this$_utilStore$view2;
1930
+ var _this4 = this;
1875
1931
  var guiElem = {
1876
1932
  elementId: elementInfo.elementId,
1877
1933
  elements: []
@@ -1916,43 +1972,48 @@ var UIStore = /*#__PURE__*/function () {
1916
1972
  guiElemRightBack.position = _pos;
1917
1973
  }
1918
1974
  var childMeshes = element.getChildMeshes();
1919
- this._scene.onBeforeRenderObservable.add(function () {
1920
- return _this5.highlightObservable(childMeshes);
1975
+ childMeshes.forEach(function (m) {
1976
+ if (_this4._plane.visibility == 1) {
1977
+ m.material.depthFunction = Constants.ALWAYS;
1978
+ m.material.disableColorWrite = true;
1979
+ } else {
1980
+ m.visibility = 1;
1981
+ m.material.depthFunction = Constants.LESS;
1982
+ m.material.disableColorWrite = false;
1983
+ }
1921
1984
  });
1922
1985
  if (!elementInfo.active) {
1923
1986
  childMeshes.forEach(function (m) {
1924
- m.visibility = 0;
1925
- if (!m.actionManager) m.actionManager = new ActionManager(_this5._scene);
1987
+ if (_this4._plane.visibility == 1) m.visibility = 0;
1988
+ if (!m.actionManager) m.actionManager = new ActionManager(_this4._scene);
1926
1989
  m.actionManager.registerAction(new ExecuteCodeAction(ActionManager.OnPointerOverTrigger, function (ev) {
1927
- _this5._selectedHl.removeAllMeshes();
1928
- _this5._selectedMeshes.forEach(function (_m) {
1990
+ _this4._selectedHl.removeAllMeshes();
1991
+ if (_this4._plane.visibility == 1) _this4._selectedMeshes.forEach(function (_m) {
1929
1992
  return _m.visibility = 0;
1930
1993
  });
1931
1994
  element.getChildMeshes().forEach(function (_m) {
1932
1995
  _m.visibility = 1;
1933
- _this5._selectedHl.addMesh(_m, Color3.Black());
1996
+ _this4._selectedHl.addMesh(_m, Color3.Black());
1934
1997
  });
1935
1998
  }));
1936
1999
  m.actionManager.registerAction(new ExecuteCodeAction(ActionManager.OnPointerOutTrigger, function (ev) {
1937
- _this5._selectedHl.removeAllMeshes();
1938
- element.getChildMeshes().forEach(function (_m) {
2000
+ _this4._selectedHl.removeAllMeshes();
2001
+ if (_this4._plane.visibility == 1) element.getChildMeshes().forEach(function (_m) {
1939
2002
  return _m.visibility = 0;
1940
2003
  });
1941
- _this5._selectedMeshes.forEach(function (_m) {
2004
+ _this4._selectedMeshes.forEach(function (_m) {
1942
2005
  _m.visibility = 1;
1943
- _this5._selectedHl.addMesh(_m, Color3.Black());
2006
+ _this4._selectedHl.addMesh(_m, Color3.Black());
1944
2007
  });
1945
2008
  }));
1946
2009
  });
1947
- }
1948
- if (elementInfo.active && (((_this$_utilStore$view = this._utilStore.viewHandler) === null || _this$_utilStore$view === void 0 ? void 0 : _this$_utilStore$view.tabGroupState.curTabGroup.type) == 'PLANNER' || ((_this$_utilStore$view2 = this._utilStore.viewHandler) === null || _this$_utilStore$view2 === void 0 ? void 0 : _this$_utilStore$view2.tabGroupState.curTabGroup.type) == 'OPTION')) {
2010
+ } else {
1949
2011
  var _guiElemRightBack;
1950
2012
  this._selectedMeshes = childMeshes;
1951
2013
  this._selectedMeshes.forEach(function (_m) {
1952
2014
  _m.visibility = 1;
1953
- _this5._selectedHl.addMesh(_m, Color3.Black());
2015
+ _this4._selectedHl.addMesh(_m, Color3.Black());
1954
2016
  });
1955
- this._selectedHl.addExcludedMesh(this._plane);
1956
2017
  var dtarget = this._uiConfig.templateConfig == 'standard' ? new Ellipse('deleteEllipse') : new Rectangle('deleteEllipse');
1957
2018
  guiElem.elements.push(dtarget);
1958
2019
  dtarget.width = this._uiConfig.templateConfig == 'standard' ? '40px' : '35px';
@@ -1965,13 +2026,14 @@ var UIStore = /*#__PURE__*/function () {
1965
2026
  dbt.width = this._uiConfig.templateConfig == 'standard' ? '40px' : '60%';
1966
2027
  dbt.height = this._uiConfig.templateConfig == 'standard' ? '40px' : '70%';
1967
2028
  dbt.onPointerClickObservable.add(function () {
1968
- return _this5._utilStore.onElementDeleted(elementInfo.setId, elementInfo.elementId);
2029
+ return _this4._utilStore.onElementDeleted(elementInfo.setId, elementInfo.elementId);
1969
2030
  });
1970
2031
  if (this._uiConfig.templateConfig == 'standard' && !guiElemRightBack) dtarget.linkOffsetY = -48;
1971
2032
  dtarget.addControl(dbt);
1972
2033
  this._gui.addControl(dtarget);
1973
2034
  dtarget.linkWithMesh((_guiElemRightBack = guiElemRightBack) !== null && _guiElemRightBack !== void 0 ? _guiElemRightBack : guiElemLeftBack);
1974
2035
  }
2036
+ this._selectedHl.addExcludedMesh(this._plane);
1975
2037
  this._guiElements.push(guiElem);
1976
2038
  }
1977
2039
  }, {
@@ -1979,7 +2041,7 @@ var UIStore = /*#__PURE__*/function () {
1979
2041
  value: function createBoxCopyButtons(elementInfo, element) {
1980
2042
  var _this$_scene$activeCa,
1981
2043
  _this$_scene$activeCa2,
1982
- _this6 = this,
2044
+ _this5 = this,
1983
2045
  _this$_scene$activeCa3;
1984
2046
  var guiElem = {
1985
2047
  elementId: elementInfo.elementId,
@@ -2005,8 +2067,8 @@ var UIStore = /*#__PURE__*/function () {
2005
2067
  target.rotation = 0;
2006
2068
  }
2007
2069
  (_this$_scene$activeCa2 = this._scene.activeCamera) === null || _this$_scene$activeCa2 === void 0 || _this$_scene$activeCa2.onViewMatrixChangedObservable.add(function () {
2008
- var _this6$_scene$activeC;
2009
- var _dir = (_this6$_scene$activeC = _this6._scene.activeCamera) === null || _this6$_scene$activeC === void 0 ? void 0 : _this6$_scene$activeC.getDirection(Axis.Z);
2070
+ var _this5$_scene$activeC;
2071
+ var _dir = (_this5$_scene$activeC = _this5._scene.activeCamera) === null || _this5$_scene$activeC === void 0 ? void 0 : _this5$_scene$activeC.getDirection(Axis.Z);
2010
2072
  if (_dir.z > 0) {
2011
2073
  target.rotation = 180 * Math.PI / 180;
2012
2074
  } else {
@@ -2014,8 +2076,8 @@ var UIStore = /*#__PURE__*/function () {
2014
2076
  }
2015
2077
  });
2016
2078
  target.onPointerClickObservable.add(function () {
2017
- var _this6$_onElementCopy;
2018
- return (_this6$_onElementCopy = _this6._onElementCopy) === null || _this6$_onElementCopy === void 0 ? void 0 : _this6$_onElementCopy.call(_this6, elementInfo.setId, elementInfo.elementId, 'LEFT');
2079
+ var _this5$_onElementCopy;
2080
+ return (_this5$_onElementCopy = _this5._onElementCopy) === null || _this5$_onElementCopy === void 0 ? void 0 : _this5$_onElementCopy.call(_this5, elementInfo.setId, elementInfo.elementId, 'LEFT');
2019
2081
  });
2020
2082
  break;
2021
2083
  case 'BoxCopyRight':
@@ -2028,8 +2090,8 @@ var UIStore = /*#__PURE__*/function () {
2028
2090
  guiElement.position = element.absolutePosition.add(new Vector3(-(bbox.max.x - bbox.min.x), (bbox.max.y - bbox.min.y) / 2, bbox.max.z - bbox.min.z));
2029
2091
  guiElement.rotation = new Vector3(90 * Math.PI / 180, 0, 0);
2030
2092
  (_this$_scene$activeCa3 = this._scene.activeCamera) === null || _this$_scene$activeCa3 === void 0 || _this$_scene$activeCa3.onViewMatrixChangedObservable.add(function () {
2031
- var _this6$_scene$activeC2;
2032
- var _dir = (_this6$_scene$activeC2 = _this6._scene.activeCamera) === null || _this6$_scene$activeC2 === void 0 ? void 0 : _this6$_scene$activeC2.getDirection(Axis.Z);
2093
+ var _this5$_scene$activeC2;
2094
+ var _dir = (_this5$_scene$activeC2 = _this5._scene.activeCamera) === null || _this5$_scene$activeC2 === void 0 ? void 0 : _this5$_scene$activeC2.getDirection(Axis.Z);
2033
2095
  if (_dir.z < 0) {
2034
2096
  target.rotation = 180 * Math.PI / 180;
2035
2097
  } else {
@@ -2037,16 +2099,16 @@ var UIStore = /*#__PURE__*/function () {
2037
2099
  }
2038
2100
  });
2039
2101
  target.onPointerClickObservable.add(function () {
2040
- var _this6$_onElementCopy2;
2041
- return (_this6$_onElementCopy2 = _this6._onElementCopy) === null || _this6$_onElementCopy2 === void 0 ? void 0 : _this6$_onElementCopy2.call(_this6, elementInfo.setId, elementInfo.elementId, 'RIGHT');
2102
+ var _this5$_onElementCopy2;
2103
+ return (_this5$_onElementCopy2 = _this5._onElementCopy) === null || _this5$_onElementCopy2 === void 0 ? void 0 : _this5$_onElementCopy2.call(_this5, elementInfo.setId, elementInfo.elementId, 'RIGHT');
2042
2104
  });
2043
2105
  break;
2044
2106
  case 'BoxCopyTop':
2045
2107
  target.rotation = 90 * Math.PI / 180;
2046
2108
  guiElement.position = element.absolutePosition.add(new Vector3(-(bbox.max.x - bbox.min.x) / 2, bbox.max.y - bbox.min.y, bbox.max.z - bbox.min.z));
2047
2109
  target.onPointerClickObservable.add(function () {
2048
- var _this6$_onElementCopy3;
2049
- return (_this6$_onElementCopy3 = _this6._onElementCopy) === null || _this6$_onElementCopy3 === void 0 ? void 0 : _this6$_onElementCopy3.call(_this6, elementInfo.setId, elementInfo.elementId, 'TOP');
2110
+ var _this5$_onElementCopy3;
2111
+ return (_this5$_onElementCopy3 = _this5._onElementCopy) === null || _this5$_onElementCopy3 === void 0 ? void 0 : _this5$_onElementCopy3.call(_this5, elementInfo.setId, elementInfo.elementId, 'TOP');
2050
2112
  });
2051
2113
  break;
2052
2114
  }
@@ -2057,7 +2119,7 @@ var UIStore = /*#__PURE__*/function () {
2057
2119
  }, {
2058
2120
  key: "initGui",
2059
2121
  value: function initGui(onElSelected, elements) {
2060
- var _this7 = this;
2122
+ var _this6 = this;
2061
2123
  if (!this._selectionHandler) this.initSelectionHandler(onElSelected);
2062
2124
  if (!this._scene) return;
2063
2125
  if (!this._elementsInfo) return;
@@ -2074,15 +2136,15 @@ var UIStore = /*#__PURE__*/function () {
2074
2136
  return Number(el.bbn.name.slice(el.bbn.name.lastIndexOf('E') + 1, el.bbn.name.length)) == elementInfo.elementId;
2075
2137
  });
2076
2138
  if (!emnt) return;
2077
- var element = _this7._scene.getTransformNodeByName(emnt.bbn.name);
2139
+ var element = _this6._scene.getTransformNodeByName(emnt.bbn.name);
2078
2140
  if (!element) return;
2079
- if (elementInfo.type == 'PosNr') _this7.createPosNr(elementInfo, element, isBoxPlanner);else _this7.createBoxCopyButtons(elementInfo, element);
2141
+ if (elementInfo.type == 'PosNr') _this6.createPosNr(elementInfo, element, isBoxPlanner);else _this6.createBoxCopyButtons(elementInfo, element);
2080
2142
  });
2081
2143
  }
2082
2144
  }, {
2083
2145
  key: "selectElem",
2084
2146
  value: function selectElem(name) {
2085
- var _this8 = this;
2147
+ var _this7 = this;
2086
2148
  var _iterator = _createForOfIteratorHelper$5(this._gui.getControlsByType('ellipse')),
2087
2149
  _step;
2088
2150
  try {
@@ -2098,14 +2160,24 @@ var UIStore = /*#__PURE__*/function () {
2098
2160
  this._guiElements.forEach(function (guiElem) {
2099
2161
  return guiElem.elements.forEach(function (element) {
2100
2162
  if (element.typeName == 'label') element.color = 'Black';
2101
- if (element.typeName == 'Ellipse') element.color = _this8._colors.defaultBg;
2163
+ if (element.typeName == 'Ellipse') element.color = _this7._colors.defaultBg;
2102
2164
  if (guiElem.elementId.toString() == name) {
2103
- if (element.typeName == 'label') element.color = _this8._colors.selectedBg;
2165
+ if (element.typeName == 'label') element.color = _this7._colors.selectedBg;
2104
2166
  if (element.typeName == 'Ellipse') element.color = 'White';
2105
2167
  }
2106
2168
  });
2107
2169
  });
2108
2170
  }
2171
+ }, {
2172
+ key: "deactivateHighlightLayer",
2173
+ value: function deactivateHighlightLayer() {
2174
+ this._selectedHl.outerGlow = false;
2175
+ }
2176
+ }, {
2177
+ key: "activateHightlightLayer",
2178
+ value: function activateHightlightLayer() {
2179
+ this._selectedHl.outerGlow = true;
2180
+ }
2109
2181
  }, {
2110
2182
  key: "clearGui",
2111
2183
  value: function clearGui() {
@@ -2118,22 +2190,30 @@ var UIStore = /*#__PURE__*/function () {
2118
2190
  this._scene.transformNodes.forEach(function (tN) {
2119
2191
  return tN.name.startsWith('guiElem_') && tN.dispose();
2120
2192
  });
2121
- this._selectedHl.removeAllMeshes();
2122
2193
  }
2123
2194
  }, {
2124
2195
  key: "onMove",
2125
2196
  value: function onMove() {
2126
- if (!this._plane) return;
2127
- this._plane.visibility = 0;
2128
- this._enableSSAO(true);
2129
- this._utilStore.updateCam = false;
2197
+ if (!this._isUnityComb) return;
2198
+ if (this._plane.visibility != 0) {
2199
+ var root = this._scene.getTransformNodeByName('Root');
2200
+ if (root) root.getChildMeshes().forEach(function (m) {
2201
+ m.visibility = 1;
2202
+ if (!m.material) return;
2203
+ m.material.depthFunction = Constants.LESS;
2204
+ m.material.disableColorWrite = false;
2205
+ });
2206
+ this._enableSSAO(true);
2207
+ this._plane.visibility = 0;
2208
+ }
2209
+ this._utilStore.updateCam = false; // need to always update since can move again while image is waiting to be updated
2130
2210
  }
2131
2211
  }, {
2132
2212
  key: "requestNewOverlayImage",
2133
2213
  value: function requestNewOverlayImage(viewpoint, focusedElement, targetCameraPosition) {
2134
- var _this9 = this;
2214
+ var _this8 = this;
2135
2215
  //this._overlayImage exists only when unity combi is enabled
2136
- if (!this._plane) return;
2216
+ if (!this._isUnityComb) return;
2137
2217
  var elementId = undefined;
2138
2218
  var setId = undefined;
2139
2219
  var ob = this._scene.getTransformNodeByName(focusedElement.name);
@@ -2147,21 +2227,26 @@ var UIStore = /*#__PURE__*/function () {
2147
2227
  clearTimeout(this._timeoutId);
2148
2228
  if (!this._latestViewpoint || this._latestViewpoint.isOutdated || Math.abs(this._latestViewpoint.pos.x - viewpoint.pos.x) > 0.05 || Math.abs(this._latestViewpoint.pos.y - viewpoint.pos.y) > 0.05 || Math.abs(this._latestViewpoint.pos.z - viewpoint.pos.z) > 0.05 || Math.abs(this._latestViewpoint.rot.x - viewpoint.rot.x) > 0.05 || Math.abs(this._latestViewpoint.rot.y - viewpoint.rot.y) > 0.05 || Math.abs(this._latestViewpoint.rot.z - viewpoint.rot.z) > 0.05) {
2149
2229
  this._timeoutId = setTimeout(function () {
2150
- var _this9$_requestNewOve;
2151
- _this9._utilStore.addOutstandingImage();
2152
- _this9._latestViewpoint = viewpoint;
2153
- console.log('requestNewOverlay Image');
2154
- (_this9$_requestNewOve = _this9._requestNewOverlayImage) === null || _this9$_requestNewOve === void 0 || _this9$_requestNewOve.call(_this9, viewpoint, {
2230
+ var _this8$_requestNewOve;
2231
+ _this8._latestViewpoint = viewpoint;
2232
+ _this8._utilStore.addOutstandingImageCount();
2233
+ (_this8$_requestNewOve = _this8._requestNewOverlayImage) === null || _this8$_requestNewOve === void 0 || _this8$_requestNewOve.call(_this8, viewpoint, {
2155
2234
  adjustZoomInUnity: false,
2156
2235
  onlyAdjustZoomBBChanged: false,
2157
2236
  rotationCenter: viewpoint.targetPos,
2158
2237
  elementId: elementId,
2159
2238
  setId: setId
2160
2239
  });
2161
- _this9._utilStore.updateCam = true;
2240
+ _this8._utilStore.updateCam = true;
2162
2241
  }, 200);
2163
2242
  } else {
2164
2243
  this._plane.visibility = 1;
2244
+ var root = this._scene.getTransformNodeByName('Root');
2245
+ if (root) root.getChildMeshes().forEach(function (m) {
2246
+ if (!m.material) return;
2247
+ m.material.depthFunction = Constants.ALWAYS;
2248
+ m.material.disableColorWrite = true;
2249
+ });
2165
2250
  }
2166
2251
  }
2167
2252
  }]);
@@ -2223,7 +2308,7 @@ var UtilStore = /*#__PURE__*/function () {
2223
2308
  }, {
2224
2309
  key: "updateCam",
2225
2310
  get: function get() {
2226
- return this._updateCam && this._outstandingImageCount == 0;
2311
+ return this._updateCam;
2227
2312
  },
2228
2313
  set: function set(doUpdateCam) {
2229
2314
  this._updateCam = doUpdateCam;
@@ -2237,15 +2322,21 @@ var UtilStore = /*#__PURE__*/function () {
2237
2322
  key: "onElementDeleted",
2238
2323
  value: function onElementDeleted(setId, elementId) {
2239
2324
  var _this$viewHandler;
2240
- this.addOutstandingImage();
2325
+ this.addOutstandingImageCount();
2241
2326
  (_this$viewHandler = this.viewHandler) === null || _this$viewHandler === void 0 || _this$viewHandler.viewPlannerHandler.onElementDeleted(setId, elementId);
2242
2327
  this._updateCam = true;
2243
2328
  }
2244
2329
  }, {
2245
- key: "addOutstandingImage",
2246
- value: function addOutstandingImage() {
2330
+ key: "addOutstandingImageCount",
2331
+ value: function addOutstandingImageCount() {
2247
2332
  this._outstandingImageCount++;
2248
2333
  }
2334
+ }, {
2335
+ key: "subtractOutstandingImageCount",
2336
+ value: function subtractOutstandingImageCount() {
2337
+ if (this._outstandingImageCount == 0) return;
2338
+ this._outstandingImageCount--;
2339
+ }
2249
2340
  }, {
2250
2341
  key: "disableElementRows",
2251
2342
  value: function disableElementRows(element, cache) {
@@ -2551,13 +2642,14 @@ var customMat = /*#__PURE__*/function () {
2551
2642
  var setDataRow,
2552
2643
  sceneStore,
2553
2644
  url,
2554
- mat,
2645
+ _mat,
2555
2646
  res,
2556
2647
  parsedMat,
2557
2648
  baseTexture,
2558
2649
  mRTexture,
2559
2650
  nTexture,
2560
2651
  found,
2652
+ mat,
2561
2653
  _args = arguments;
2562
2654
  return _regeneratorRuntime.wrap(function _callee$(_context) {
2563
2655
  while (1) switch (_context.prev = _context.next) {
@@ -2579,9 +2671,9 @@ var customMat = /*#__PURE__*/function () {
2579
2671
  }
2580
2672
  });
2581
2673
  case 11:
2582
- mat = _context.sent;
2674
+ _mat = _context.sent;
2583
2675
  _context.next = 14;
2584
- return mat.json();
2676
+ return _mat.json();
2585
2677
  case 14:
2586
2678
  res = _context.sent;
2587
2679
  parsedMat = PBRMetallicRoughnessMaterial.Parse(res, _customMat.scene, '');
@@ -2602,12 +2694,14 @@ var customMat = /*#__PURE__*/function () {
2602
2694
  path: _customMat.blob,
2603
2695
  sizeMb: 0
2604
2696
  });
2697
+ parsedMat.depthFunction = Constants.ALWAYS;
2698
+ parsedMat.disableColorWrite = true;
2605
2699
  return _context.abrupt("return", {
2606
2700
  mat: parsedMat,
2607
2701
  found: true
2608
2702
  });
2609
- case 29:
2610
- _context.prev = 29;
2703
+ case 31:
2704
+ _context.prev = 31;
2611
2705
  _context.t0 = _context["catch"](8);
2612
2706
  if (setDataRow) useUtilStoreContext().setAnalyzeDataRow({
2613
2707
  type: 'MAT',
@@ -2617,16 +2711,19 @@ var customMat = /*#__PURE__*/function () {
2617
2711
  path: _customMat.blob,
2618
2712
  sizeMb: 0
2619
2713
  });
2620
- case 32:
2714
+ case 34:
2715
+ mat = new PBRMetallicRoughnessMaterial(_customMat.name, _customMat.scene);
2716
+ mat.depthFunction = Constants.ALWAYS;
2717
+ mat.disableColorWrite = true;
2621
2718
  return _context.abrupt("return", {
2622
- mat: new PBRMetallicRoughnessMaterial(_customMat.name, _customMat.scene),
2719
+ mat: mat,
2623
2720
  found: true
2624
2721
  });
2625
- case 33:
2722
+ case 38:
2626
2723
  case "end":
2627
2724
  return _context.stop();
2628
2725
  }
2629
- }, _callee, null, [[8, 29]]);
2726
+ }, _callee, null, [[8, 31]]);
2630
2727
  }));
2631
2728
  return function customMat(_x) {
2632
2729
  return _ref.apply(this, arguments);
@@ -2708,7 +2805,7 @@ function _findAssets() {
2708
2805
  }));
2709
2806
  return _importGeo.apply(this, arguments);
2710
2807
  };
2711
- importGeo = function _importGeo2(_x13, _x14) {
2808
+ importGeo = function _importGeo2(_x12, _x13) {
2712
2809
  return _importGeo.apply(this, arguments);
2713
2810
  };
2714
2811
  _unifyAndSetStdMats = function _unifyAndSetStdMats3() {
@@ -2734,7 +2831,7 @@ function _findAssets() {
2734
2831
  case 8:
2735
2832
  name = 'std_' + name;
2736
2833
  _context.next = 11;
2737
- return createOrGetMaterial(name, path, splittedName[0], true, sceneStore.scene, undefined, true, true);
2834
+ return createOrGetMaterial(name, path, splittedName[0], true, true, undefined, true);
2738
2835
  case 11:
2739
2836
  mat = _context.sent;
2740
2837
  if (!mat.found) utilStore.setAnalyzeDataRow({
@@ -2796,7 +2893,7 @@ function _findAssets() {
2796
2893
  }));
2797
2894
  return _unifyAndSetStdMats.apply(this, arguments);
2798
2895
  };
2799
- unifyAndSetStdMats = function _unifyAndSetStdMats2(_x11, _x12) {
2896
+ unifyAndSetStdMats = function _unifyAndSetStdMats2(_x10, _x11) {
2800
2897
  return _unifyAndSetStdMats.apply(this, arguments);
2801
2898
  };
2802
2899
  sceneStore = useSceneStoreContext();
@@ -2912,7 +3009,7 @@ function _findAssets() {
2912
3009
  return _context4.abrupt("return", 1);
2913
3010
  case 5:
2914
3011
  _context4.next = 7;
2915
- return createOrGetMaterial(mat.id + '_' + mat.name, mat.blob, mat.name, true, sceneStore.scene, {
3012
+ return createOrGetMaterial(mat.id + '_' + mat.name, mat.blob, mat.name, true, false, {
2916
3013
  tileU: mat.tileU,
2917
3014
  tileV: mat.tileV
2918
3015
  }, true);
@@ -2921,7 +3018,8 @@ function _findAssets() {
2921
3018
  _context4.t1 = [];
2922
3019
  _context4.t2 = mat.name;
2923
3020
  nwCache.material = {
2924
- material: _context4.t0,
3021
+ mat: _context4.t0,
3022
+ isStdMat: false,
2925
3023
  onElements: _context4.t1,
2926
3024
  name: _context4.t2
2927
3025
  };
@@ -2931,7 +3029,7 @@ function _findAssets() {
2931
3029
  _context4.t3 = newCache;
2932
3030
  _context4.t4 = mat.id;
2933
3031
  _context4.next = 17;
2934
- return createOrGetMaterial(mat.id + '_' + mat.name, mat.blob, mat.name, true, sceneStore.scene, {
3032
+ return createOrGetMaterial(mat.id + '_' + mat.name, mat.blob, mat.name, true, false, {
2935
3033
  tileU: mat.tileU,
2936
3034
  tileV: mat.tileV
2937
3035
  }, true);
@@ -2940,9 +3038,10 @@ function _findAssets() {
2940
3038
  _context4.t6 = [];
2941
3039
  _context4.t7 = mat.name;
2942
3040
  _context4.t8 = {
2943
- material: _context4.t5,
3041
+ mat: _context4.t5,
2944
3042
  onElements: _context4.t6,
2945
- name: _context4.t7
3043
+ name: _context4.t7,
3044
+ isStdMat: false
2946
3045
  };
2947
3046
  _context4.t9 = {
2948
3047
  id: _context4.t4,
@@ -2995,72 +3094,79 @@ function _findAssets() {
2995
3094
  }));
2996
3095
  return _findAssets.apply(this, arguments);
2997
3096
  }
2998
- function createOrGetMaterial(_x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10) {
3097
+ function createOrGetMaterial(_x3, _x4, _x5, _x6, _x7, _x8, _x9) {
2999
3098
  return _createOrGetMaterial.apply(this, arguments);
3000
3099
  }
3001
3100
  function _createOrGetMaterial() {
3002
- _createOrGetMaterial = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(name, blob, fileName, checkExisting, scene, tiling, setDataRow, isStdMat) {
3003
- var _iterator5, _step5, _mat, mat, material;
3101
+ _createOrGetMaterial = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(name, blob, fileName, checkExisting, isStdMat, tiling, setDataRow) {
3102
+ var sceneStore, _iterator5, _step5, cachedMaterial, mat, material;
3004
3103
  return _regeneratorRuntime.wrap(function _callee4$(_context6) {
3005
3104
  while (1) switch (_context6.prev = _context6.next) {
3006
3105
  case 0:
3106
+ sceneStore = useSceneStoreContext();
3007
3107
  if (!checkExisting) {
3008
- _context6.next = 18;
3108
+ _context6.next = 20;
3009
3109
  break;
3010
3110
  }
3011
- _iterator5 = _createForOfIteratorHelper$3(scene.materials);
3012
- _context6.prev = 2;
3111
+ _iterator5 = _createForOfIteratorHelper$3(sceneStore.materialCache);
3112
+ _context6.prev = 3;
3013
3113
  _iterator5.s();
3014
- case 4:
3114
+ case 5:
3015
3115
  if ((_step5 = _iterator5.n()).done) {
3016
- _context6.next = 10;
3116
+ _context6.next = 12;
3017
3117
  break;
3018
3118
  }
3019
- _mat = _step5.value;
3020
- if (!(name === _mat.name)) {
3021
- _context6.next = 8;
3119
+ cachedMaterial = _step5.value;
3120
+ if (!(name === cachedMaterial.mat.name)) {
3121
+ _context6.next = 10;
3022
3122
  break;
3023
3123
  }
3124
+ cachedMaterial.lastUsage = sceneStore.modelIteration;
3024
3125
  return _context6.abrupt("return", {
3025
- mat: _mat,
3126
+ mat: cachedMaterial.mat,
3026
3127
  found: true
3027
3128
  });
3028
- case 8:
3029
- _context6.next = 4;
3030
- break;
3031
3129
  case 10:
3032
- _context6.next = 15;
3130
+ _context6.next = 5;
3033
3131
  break;
3034
3132
  case 12:
3035
- _context6.prev = 12;
3036
- _context6.t0 = _context6["catch"](2);
3133
+ _context6.next = 17;
3134
+ break;
3135
+ case 14:
3136
+ _context6.prev = 14;
3137
+ _context6.t0 = _context6["catch"](3);
3037
3138
  _iterator5.e(_context6.t0);
3038
- case 15:
3039
- _context6.prev = 15;
3139
+ case 17:
3140
+ _context6.prev = 17;
3040
3141
  _iterator5.f();
3041
- return _context6.finish(15);
3042
- case 18:
3142
+ return _context6.finish(17);
3143
+ case 20:
3043
3144
  mat = {
3044
3145
  isStdMat: !!isStdMat,
3045
3146
  blob: blob,
3046
3147
  name: name,
3047
3148
  fileName: fileName,
3048
- scene: scene,
3149
+ scene: sceneStore.scene,
3049
3150
  tiling: tiling
3050
3151
  };
3051
- _context6.next = 21;
3152
+ _context6.next = 23;
3052
3153
  return customMat(mat, setDataRow);
3053
- case 21:
3154
+ case 23:
3054
3155
  material = _context6.sent;
3156
+ sceneStore.addMaterialToCache({
3157
+ mat: material.mat,
3158
+ isStdMat: isStdMat,
3159
+ lastUsage: sceneStore.modelIteration
3160
+ });
3055
3161
  return _context6.abrupt("return", {
3056
3162
  mat: material.mat,
3057
3163
  found: material.found
3058
3164
  });
3059
- case 23:
3165
+ case 26:
3060
3166
  case "end":
3061
3167
  return _context6.stop();
3062
3168
  }
3063
- }, _callee4, null, [[2, 12, 15, 18]]);
3169
+ }, _callee4, null, [[3, 14, 17, 20]]);
3064
3170
  }));
3065
3171
  return _createOrGetMaterial.apply(this, arguments);
3066
3172
  }
@@ -3260,7 +3366,7 @@ function findMaterials(cache) {
3260
3366
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
3261
3367
  var onNode = _step3.value;
3262
3368
  if (child.name.startsWith(onNode) || child.name.startsWith('geo_') && child.name.includes(onNode)) {
3263
- setMaterials(child, mat.material);
3369
+ setMaterials(child, mat.mat);
3264
3370
  }
3265
3371
  }
3266
3372
  } catch (err) {
@@ -3332,7 +3438,7 @@ function shadow() {
3332
3438
  var lightf = new DirectionalLight('dirf', new Vector3(0, -0.436, -0.9), scene);
3333
3439
  var lightr = new DirectionalLight('dirr', new Vector3(0, -1, 0.3), scene);
3334
3440
  var lightl = new DirectionalLight('dirb', new Vector3(0.2, -1, 0.2), scene);
3335
- lightl.intensity = 1;
3441
+ lightl.intensity = 2;
3336
3442
  lightf.intensity = 2.2;
3337
3443
  light.intensity = 1;
3338
3444
  lightr.intensity = 1;
@@ -3352,6 +3458,8 @@ function shadow() {
3352
3458
  z: 0
3353
3459
  });
3354
3460
  var std_mat = new PBRMetallicRoughnessMaterial('std_mat', scene);
3461
+ std_mat.depthFunction = Constants.ALWAYS;
3462
+ std_mat.disableColorWrite = true;
3355
3463
  std_mat.metallic = 0;
3356
3464
  scene.defaultMaterial = std_mat;
3357
3465
  var mat = new PBRMetallicRoughnessMaterial('white', scene);
@@ -3375,17 +3483,17 @@ var parser = /*#__PURE__*/function () {
3375
3483
  case 0:
3376
3484
  sceneStore = useSceneStoreContext();
3377
3485
  hasRendered = sceneStore.hasRendered, hqRenderScript = sceneStore.hqRenderScript, scene = sceneStore.scene, cache = sceneStore.cache, changedElements = sceneStore.changedElements;
3378
- utilStore = useUtilStoreContext();
3379
- useUIStoreContext(); //disable elementrows from old cache
3486
+ utilStore = useUtilStoreContext(); //disable elementrows from old cache
3380
3487
  changedElements === null || changedElements === void 0 || (_changedElements$upda = changedElements.updatedElements) === null || _changedElements$upda === void 0 || _changedElements$upda.forEach(function (el) {
3381
3488
  return utilStore.disableElementRows(el.name, cache);
3382
3489
  });
3383
- _context.next = 7;
3490
+ _context.next = 6;
3384
3491
  return findAssets(hqRenderScript.assets, cache);
3385
- case 7:
3492
+ case 6:
3386
3493
  _yield$findAssets = _context.sent;
3387
3494
  cacheGroup = _yield$findAssets.cacheGroup;
3388
3495
  newCache = _yield$findAssets.newCache;
3496
+ sceneStore.updateModelIteration();
3389
3497
  if (changedElements && changedElements.deletedElements && changedElements.deletedElements.length > 0) {
3390
3498
  changedElements.deletedElements.forEach(function (deletedElement) {
3391
3499
  var _scene$getTransformNo;
@@ -3419,7 +3527,8 @@ var parser = /*#__PURE__*/function () {
3419
3527
  }
3420
3528
  utilStore.setRTVAnalyzeData();
3421
3529
  deacCache(cacheGroup);
3422
- case 14:
3530
+ sceneStore.checkMaterialCache();
3531
+ case 15:
3423
3532
  case "end":
3424
3533
  return _context.stop();
3425
3534
  }
@@ -3450,7 +3559,7 @@ function useRealTimeRenderData (_ref) {
3450
3559
  renderInBackground = _ref.renderInBackground;
3451
3560
  var gameCanvas = useRef(null);
3452
3561
  var sceneStore = useSceneStoreContext();
3453
- var utilStore = useUtilStoreContext();
3562
+ useUtilStoreContext();
3454
3563
  var gridStore = useGridStoreContext();
3455
3564
  var uiStore = useUIStoreContext();
3456
3565
  DracoCompression.Configuration = {
@@ -3514,15 +3623,17 @@ function useRealTimeRenderData (_ref) {
3514
3623
  eventId: 'BUILD_SCENE'
3515
3624
  });
3516
3625
  _context2.prev = 15;
3517
- _context2.next = 18;
3626
+ uiStore.deactivateHighlightLayer();
3627
+ uiStore.highlightLayer.isEnabled = false;
3628
+ _context2.next = 20;
3518
3629
  return parser();
3519
- case 18:
3630
+ case 20:
3520
3631
  uiStore.initGui(callbacks.onElementSelected, sceneStore.elements);
3521
3632
  if (freePlacesOnGrids || plannedPlacesOnGrids) gridStore.getGrids(freePlacesOnGrids, plannedPlacesOnGrids);
3522
- _context2.next = 27;
3633
+ _context2.next = 29;
3523
3634
  break;
3524
- case 22:
3525
- _context2.prev = 22;
3635
+ case 24:
3636
+ _context2.prev = 24;
3526
3637
  _context2.t0 = _context2["catch"](15);
3527
3638
  LOG.errorTransaction('BUILD_SCENE', 'RTS_0001', _context2.t0.message);
3528
3639
  LOG.error(new DivaError('Error building scene', {
@@ -3530,11 +3641,11 @@ function useRealTimeRenderData (_ref) {
3530
3641
  code: 'RTS_0001'
3531
3642
  }));
3532
3643
  sceneStore.isInitializing = false;
3533
- case 27:
3644
+ case 29:
3534
3645
  if (callbacks.setGlb) {
3535
3646
  sceneStore.exportScene().then(function (res) {
3536
3647
  var _callbacks$setGlb;
3537
- if (res) (_callbacks$setGlb = callbacks.setGlb) === null || _callbacks$setGlb === void 0 || _callbacks$setGlb.call(callbacks, URL.createObjectURL(res.glTFFiles['fileName.glb']));
3648
+ if (res) (_callbacks$setGlb = callbacks.setGlb) === null || _callbacks$setGlb === void 0 || _callbacks$setGlb.call(callbacks, URL.createObjectURL(res.glTFFiles['fileName.glb']), res.glTFFiles['fileName.glb']);
3538
3649
  });
3539
3650
  } else {
3540
3651
  LOG.debug('callbacks.setGlb is undefined');
@@ -3545,11 +3656,11 @@ function useRealTimeRenderData (_ref) {
3545
3656
  }
3546
3657
  sceneStore.scene.onAfterRenderObservable.add(onFirstFrame);
3547
3658
  LOG.successTransaction('BUILD_SCENE');
3548
- case 31:
3659
+ case 33:
3549
3660
  case "end":
3550
3661
  return _context2.stop();
3551
3662
  }
3552
- }, _callee2, null, [[15, 22]]);
3663
+ }, _callee2, null, [[15, 24]]);
3553
3664
  }));
3554
3665
  return _onSceneReady.apply(this, arguments);
3555
3666
  }
@@ -3560,10 +3671,15 @@ function useRealTimeRenderData (_ref) {
3560
3671
  if (!overlayImage) actions.toggleLoading('buildScene', false, false);
3561
3672
  (_callbacks$onInitiali2 = callbacks.onInitialized) === null || _callbacks$onInitiali2 === void 0 || _callbacks$onInitiali2.call(callbacks);
3562
3673
  (_sceneStore = sceneStore) === null || _sceneStore === void 0 || _sceneStore.optimizeScene();
3674
+ setTimeout(function () {
3675
+ return uiStore.highlightLayer.isEnabled = true;
3676
+ }, 500);
3677
+ uiStore.activateHightlightLayer();
3563
3678
  }
3564
3679
  function renderLoop() {
3565
3680
  var _sceneStore$controlRe, _sceneStore2;
3566
3681
  if (!gameCanvas.current) sceneStore.scene.getEngine().dispose();
3682
+ if (sceneStore.cameraTargetPosition.x == 0 && sceneStore.cameraTargetPosition.y == 0 && sceneStore.cameraTargetPosition.z == 0) sceneStore.setCameraTarget();
3567
3683
  (_sceneStore$controlRe = (_sceneStore2 = sceneStore).controlRenderLoop) === null || _sceneStore$controlRe === void 0 || _sceneStore$controlRe.call(_sceneStore2);
3568
3684
  sceneStore.scene.render();
3569
3685
  }
@@ -3590,7 +3706,7 @@ function useRealTimeRenderData (_ref) {
3590
3706
  while (1) switch (_context.prev = _context.next) {
3591
3707
  case 0:
3592
3708
  if (!gameCanvas.current) {
3593
- _context.next = 20;
3709
+ _context.next = 21;
3594
3710
  break;
3595
3711
  }
3596
3712
  engine = new Engine(gameCanvas.current, true, {
@@ -3601,26 +3717,27 @@ function useRealTimeRenderData (_ref) {
3601
3717
  engine.renderEvenInBackground = renderInBackground;
3602
3718
  engine.disablePerformanceMonitorInBackground = true;
3603
3719
  bScene = new Scene(engine, undefined);
3720
+ bScene.clearColor = new Color4$1(255, 255, 255, 255);
3604
3721
  context = registerContext(bScene, renderjob, apiConfig, jwt, viewHandler, callbacks.onMissingGeo, callbacks.requestNewOverlayImage, overlayImage, uiConfig, callbacks.updateCameraInformation);
3605
3722
  sceneStore = context.sceneStore;
3606
- utilStore = context.utilStore;
3723
+ context.utilStore;
3607
3724
  gridStore = context.gridStore;
3608
3725
  uiStore = context.uiStore;
3609
3726
  scene = bScene;
3610
3727
  if (!bScene.isReady()) {
3611
- _context.next = 16;
3728
+ _context.next = 17;
3612
3729
  break;
3613
3730
  }
3614
- _context.next = 14;
3731
+ _context.next = 15;
3615
3732
  return onSceneReady();
3616
- case 14:
3617
- _context.next = 17;
3733
+ case 15:
3734
+ _context.next = 18;
3618
3735
  break;
3619
- case 16:
3736
+ case 17:
3620
3737
  bScene.executeWhenReady(function () {
3621
3738
  return onSceneReady();
3622
3739
  });
3623
- case 17:
3740
+ case 18:
3624
3741
  resize = function resize() {
3625
3742
  if (inBackground || !scene || !scene.getEngine()) return;
3626
3743
  if (sceneStore.hasPlanned) sceneStore.doRenderControlLoop = true;
@@ -3640,9 +3757,9 @@ function useRealTimeRenderData (_ref) {
3640
3757
  window.removeEventListener('resize', resize);
3641
3758
  }
3642
3759
  });
3643
- case 20:
3644
- return _context.abrupt("return");
3645
3760
  case 21:
3761
+ return _context.abrupt("return");
3762
+ case 22:
3646
3763
  case "end":
3647
3764
  return _context.stop();
3648
3765
  }
@@ -3654,14 +3771,11 @@ function useRealTimeRenderData (_ref) {
3654
3771
  asyncUseEffect();
3655
3772
  }, []);
3656
3773
  useEffect(function () {
3657
- if (overlayImage && uiStore) uiStore.updateOverlayImage(overlayImage);
3658
- // update cam pos for start viewpoints (hqr) could be the same, since it doesn't change when rotating
3659
- }, [overlayImage]);
3660
- useEffect(function () {
3661
- if (utilStore && viewpoint) {
3662
- updateCam(viewpoint, sceneStore.scene);
3774
+ if (overlayImage && uiStore) {
3775
+ uiStore.updateOverlayImage(overlayImage);
3776
+ if (viewpoint) updateCam(viewpoint, sceneStore.scene);
3663
3777
  }
3664
- }, [viewpoint]);
3778
+ }, [overlayImage]);
3665
3779
  useEffect(function () {
3666
3780
  if (sceneStore && elementsInfo) {
3667
3781
  var activeElement = elementsInfo.find(function (e) {
@@ -3735,7 +3849,8 @@ var RealTimeRenderer = /*#__PURE__*/memo(function (props) {
3735
3849
  height: '100%',
3736
3850
  width: '100%',
3737
3851
  margin: 'auto',
3738
- display: 'block'
3852
+ display: 'block',
3853
+ backgroundColor: 'white'
3739
3854
  },
3740
3855
  className: canvas
3741
3856
  })