@crystaldesign/real-time-viewer 24.14.0-beta.34 → 24.14.0-beta.35

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.
@@ -27,14 +27,13 @@ import { SceneOptimizerOptions, ShadowsOptimization, RenderTargetsOptimization,
27
27
  import { getLogger, DivaError } from '@crystaldesign/diva-core';
28
28
  import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
29
29
  import { Ellipse, Rectangle, Button, TextBlock, AdvancedDynamicTexture, Image } from '@babylonjs/gui';
30
- import { Matrix as Matrix$1, Vector3 as Vector3$1, Frustum } from '@babylonjs/core/Maths/math';
30
+ import { Matrix as Matrix$1, Vector3 as Vector3$1 } from '@babylonjs/core/Maths/math';
31
31
  import { Engine } from '@babylonjs/core/Engines/engine';
32
32
  import { Scene } from '@babylonjs/core/scene';
33
33
  import { DracoCompression } from '@babylonjs/core/Meshes/Compression/dracoCompression';
34
34
  import { SceneLoader } from '@babylonjs/core/Loading/sceneLoader';
35
35
  import { PBRMetallicRoughnessMaterial } from '@babylonjs/core/Materials/PBR/pbrMetallicRoughnessMaterial';
36
36
  import { DirectionalLight } from '@babylonjs/core/Lights/directionalLight';
37
- import { BoundingInfo } from '@babylonjs/core/Culling/boundingInfo';
38
37
  import '@babylonjs/loaders/glTF/2.0/';
39
38
  import { jsxs, jsx } from 'react/jsx-runtime';
40
39
 
@@ -59,6 +58,7 @@ function GetCameraControls(camera) {
59
58
  var isZooming = false;
60
59
  var initDistance = 0;
61
60
  function renderLoop() {
61
+ var _sceneStore$updateCam;
62
62
  if (!sceneStore.doRenderControlLoop || sceneStore.isInitializing || uistore.isStaticBg) return;
63
63
  if (sceneStore.cameraTargetPosition.x == 0 && sceneStore.cameraTargetPosition.y == 0 && sceneStore.cameraTargetPosition.z == 0) sceneStore.setCameraTarget();
64
64
  uistore.onMove();
@@ -75,7 +75,7 @@ function GetCameraControls(camera) {
75
75
  camera.setTarget(camera.target.addInPlaceFromFloats(deltaTarget.x, deltaTarget.y, deltaTarget.z));
76
76
  stopRender = false;
77
77
  }
78
- uistore.requestNewOverlayImage({
78
+ var cam = {
79
79
  horiFov: camera.fov * 180 / Math.PI,
80
80
  lensShiftX: 0,
81
81
  lensShiftY: 0,
@@ -90,8 +90,15 @@ function GetCameraControls(camera) {
90
90
  y: camera.rotation.y * 180 / Math.PI,
91
91
  z: camera.rotation.z * 180 / Math.PI
92
92
  },
93
+ targetPos: {
94
+ x: camera.target.x,
95
+ y: camera.target.y,
96
+ z: camera.target.z
97
+ },
93
98
  vertFov: camera.fov * 180 / Math.PI
94
- });
99
+ };
100
+ (_sceneStore$updateCam = sceneStore.updateCameraInformation) === null || _sceneStore$updateCam === void 0 || _sceneStore$updateCam.call(sceneStore, cam);
101
+ uistore.requestNewOverlayImage(cam, sceneStore.focusedElement, sceneStore.targetCameraPosition);
95
102
  if (stopRender) sceneStore.doRenderControlLoop = false;
96
103
  }
97
104
  function moveTarget(deltaX, deltaY) {
@@ -342,9 +349,9 @@ function getGridControls(scene, element, selected, elements, selectMesh) {
342
349
  };
343
350
  }
344
351
 
345
- function _createForOfIteratorHelper$9(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$9(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
346
- function _unsupportedIterableToArray$9(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$9(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$9(r, a) : void 0; } }
347
- function _arrayLikeToArray$9(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
352
+ function _createForOfIteratorHelper$8(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$8(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
353
+ function _unsupportedIterableToArray$8(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$8(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$8(r, a) : void 0; } }
354
+ function _arrayLikeToArray$8(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
348
355
  function Grids () {
349
356
  var utilStore = useUtilStoreContext();
350
357
  var sceneStore = useSceneStoreContext();
@@ -411,7 +418,7 @@ function Grids () {
411
418
  var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
412
419
  gridName = _Object$entries2$_i[0];
413
420
  _Object$entries2$_i[1];
414
- var _iterator = _createForOfIteratorHelper$9(plannedPlaceOnGrid.grids[gridName].accessories),
421
+ var _iterator = _createForOfIteratorHelper$8(plannedPlaceOnGrid.grids[gridName].accessories),
415
422
  _step;
416
423
  try {
417
424
  var _loop4 = function _loop4() {
@@ -916,6 +923,7 @@ function createCams(scene, activeViewpoint, viewPoints) {
916
923
  })];
917
924
  }
918
925
  function updateCam(camera, scene) {
926
+ var _sceneStore$updateCam;
919
927
  if (camera.pos.x == 0 && camera.pos.y == 0 && camera.pos.z == 0) return;
920
928
  var utilStore = useUtilStoreContext();
921
929
  var sceneStore = useSceneStoreContext();
@@ -926,18 +934,42 @@ function updateCam(camera, scene) {
926
934
  cam.rotation = utilStore.degreesToRadians(utilStore.vector3ToBVector3(_objectSpread$1(_objectSpread$1({}, camera.rot), {}, {
927
935
  x: -camera.rot.x
928
936
  })));
937
+ cam.target = utilStore.vector3ToBVector3(camera.targetPos).multiply(new Vector3(-0.01, 0.01, 0.01));
929
938
  sceneStore.targetCameraPosition = newPos;
939
+ sceneStore.cameraTargetPosition = cam.target;
940
+ (_sceneStore$updateCam = sceneStore.updateCameraInformation) === null || _sceneStore$updateCam === void 0 || _sceneStore$updateCam.call(sceneStore, {
941
+ horiFov: cam.fov * 180 / Math.PI,
942
+ lensShiftX: 0,
943
+ lensShiftY: 0,
944
+ name: cam.name,
945
+ pos: {
946
+ x: cam.position.x,
947
+ y: cam.position.y,
948
+ z: cam.position.z
949
+ },
950
+ rot: {
951
+ x: cam.rotation.x * 180 / Math.PI,
952
+ y: cam.rotation.y * 180 / Math.PI,
953
+ z: cam.rotation.z * 180 / Math.PI
954
+ },
955
+ targetPos: {
956
+ x: cam.target.x,
957
+ y: cam.target.y,
958
+ z: cam.target.z
959
+ },
960
+ vertFov: cam.fov * 180 / Math.PI
961
+ });
930
962
  }
931
963
 
932
- function _createForOfIteratorHelper$8(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$8(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
933
- function _unsupportedIterableToArray$8(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$8(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$8(r, a) : void 0; } }
934
- function _arrayLikeToArray$8(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
964
+ function _createForOfIteratorHelper$7(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$7(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
965
+ function _unsupportedIterableToArray$7(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$7(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0; } }
966
+ function _arrayLikeToArray$7(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
935
967
  /*
936
968
  SceneStore
937
969
  Wraps the scene with additional data and methods
938
970
  */
939
971
  var SceneStore = /*#__PURE__*/function () {
940
- function SceneStore(scene, hqRenderScript, utilStore, apiConfig, jwt, onMissingGeo) {
972
+ function SceneStore(scene, hqRenderScript, utilStore, apiConfig, jwt, onMissingGeo, updateCameraInformation) {
941
973
  var _this = this;
942
974
  _classCallCheck(this, SceneStore);
943
975
  _defineProperty(this, "_hqRenderScript", void 0);
@@ -969,10 +1001,12 @@ var SceneStore = /*#__PURE__*/function () {
969
1001
  // if the current viewpoint should automatically change with the planning
970
1002
  _defineProperty(this, "light", undefined);
971
1003
  _defineProperty(this, "changedElements", void 0);
1004
+ _defineProperty(this, "updateCameraInformation", void 0);
972
1005
  scene.clearColor = new Color4(1, 1, 1, 1);
973
1006
  this._scene = scene;
974
1007
  this._apiConfig = apiConfig;
975
1008
  this._onMissingGeo = onMissingGeo;
1009
+ this.updateCameraInformation = updateCameraInformation;
976
1010
  this._cancelSceneExport = false;
977
1011
  this._jwt = jwt;
978
1012
  var options = new SceneOptimizerOptions(15, 1000);
@@ -1115,12 +1149,12 @@ var SceneStore = /*#__PURE__*/function () {
1115
1149
  var _this$_sceneConstruct2;
1116
1150
  var elms = [];
1117
1151
  if (!((_this$_sceneConstruct2 = this._sceneConstruct.root) !== null && _this$_sceneConstruct2 !== void 0 && _this$_sceneConstruct2.sets)) return [];
1118
- var _iterator = _createForOfIteratorHelper$8(this._sceneConstruct.root.sets),
1152
+ var _iterator = _createForOfIteratorHelper$7(this._sceneConstruct.root.sets),
1119
1153
  _step;
1120
1154
  try {
1121
1155
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
1122
1156
  var set = _step.value;
1123
- var _iterator2 = _createForOfIteratorHelper$8(set.elements),
1157
+ var _iterator2 = _createForOfIteratorHelper$7(set.elements),
1124
1158
  _step2;
1125
1159
  try {
1126
1160
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -1148,12 +1182,12 @@ var SceneStore = /*#__PURE__*/function () {
1148
1182
  var _this$_sceneConstruct3;
1149
1183
  var elms = [];
1150
1184
  if (!((_this$_sceneConstruct3 = this._sceneConstruct.root) !== null && _this$_sceneConstruct3 !== void 0 && _this$_sceneConstruct3.sets)) return [];
1151
- var _iterator3 = _createForOfIteratorHelper$8(this._sceneConstruct.root.sets),
1185
+ var _iterator3 = _createForOfIteratorHelper$7(this._sceneConstruct.root.sets),
1152
1186
  _step3;
1153
1187
  try {
1154
1188
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1155
1189
  var set = _step3.value;
1156
- var _iterator4 = _createForOfIteratorHelper$8(set.elements),
1190
+ var _iterator4 = _createForOfIteratorHelper$7(set.elements),
1157
1191
  _step4;
1158
1192
  try {
1159
1193
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
@@ -1208,12 +1242,12 @@ var SceneStore = /*#__PURE__*/function () {
1208
1242
  value: function getElementByName(name) {
1209
1243
  var _this$_sceneConstruct4, _this$_sceneConstruct5;
1210
1244
  if (!((_this$_sceneConstruct4 = this._sceneConstruct.root) !== null && _this$_sceneConstruct4 !== void 0 && _this$_sceneConstruct4.sets)) return undefined;
1211
- var _iterator5 = _createForOfIteratorHelper$8((_this$_sceneConstruct5 = this._sceneConstruct.root) === null || _this$_sceneConstruct5 === void 0 ? void 0 : _this$_sceneConstruct5.sets),
1245
+ var _iterator5 = _createForOfIteratorHelper$7((_this$_sceneConstruct5 = this._sceneConstruct.root) === null || _this$_sceneConstruct5 === void 0 ? void 0 : _this$_sceneConstruct5.sets),
1212
1246
  _step5;
1213
1247
  try {
1214
1248
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1215
1249
  var set = _step5.value;
1216
- var _iterator6 = _createForOfIteratorHelper$8(set.elements),
1250
+ var _iterator6 = _createForOfIteratorHelper$7(set.elements),
1217
1251
  _step6;
1218
1252
  try {
1219
1253
  for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
@@ -1238,12 +1272,12 @@ var SceneStore = /*#__PURE__*/function () {
1238
1272
  value: function getElementNameById(id) {
1239
1273
  var _this$_sceneConstruct6, _this$_sceneConstruct7;
1240
1274
  if (!((_this$_sceneConstruct6 = this._sceneConstruct.root) !== null && _this$_sceneConstruct6 !== void 0 && _this$_sceneConstruct6.sets)) return undefined;
1241
- var _iterator7 = _createForOfIteratorHelper$8((_this$_sceneConstruct7 = this._sceneConstruct.root) === null || _this$_sceneConstruct7 === void 0 ? void 0 : _this$_sceneConstruct7.sets),
1275
+ var _iterator7 = _createForOfIteratorHelper$7((_this$_sceneConstruct7 = this._sceneConstruct.root) === null || _this$_sceneConstruct7 === void 0 ? void 0 : _this$_sceneConstruct7.sets),
1242
1276
  _step7;
1243
1277
  try {
1244
1278
  for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
1245
1279
  var set = _step7.value;
1246
- var _iterator8 = _createForOfIteratorHelper$8(set.elements),
1280
+ var _iterator8 = _createForOfIteratorHelper$7(set.elements),
1247
1281
  _step8;
1248
1282
  try {
1249
1283
  for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
@@ -1533,12 +1567,12 @@ var delButton = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%
1533
1567
 
1534
1568
  var gdelButton = "data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2221%22%20viewBox%3D%220%200%2016%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M15.2784%203.0226H10.9717V2.08029C10.9717%201.35784%2010.4151%200.72963%209.71198%200.72963H6.78229C6.10846%200.72963%205.52252%201.32643%205.52252%202.08029V3.0226H1.21588C0.981506%203.0226%200.776428%203.24248%200.776428%203.49376C0.776428%203.74505%200.981506%203.96492%201.21588%203.96492H2.18268V17.7542C2.18268%2019.0734%203.17877%2020.11%204.37994%2020.11H12.1436C13.3741%2020.11%2014.3409%2019.042%2014.3409%2017.7542V3.93351H15.3077C15.5714%203.93351%2015.7764%203.71364%2015.7764%203.46235C15.7764%203.17966%2015.5421%203.0226%2015.2784%203.0226ZM6.43073%202.08029C6.43073%201.829%206.6358%201.67195%206.78229%201.67195H9.71198C9.94635%201.67195%2010.0928%201.86041%2010.0928%202.08029V3.0226H6.43073V2.08029ZM13.462%2017.7228C13.462%2018.508%2012.876%2019.1363%2012.1436%2019.1363H4.37994C3.64752%2019.1363%203.06158%2018.508%203.06158%2017.7228V3.96492H13.462V17.7228Z%22%20fill%3D%22%234A4A4A%22%2F%3E%3Cpath%20d%3D%22M8.68658%206.82326V16.2464C8.68658%2016.5291%208.5108%2016.749%208.24713%2016.749C7.98346%2016.749%207.80768%2016.5291%207.80768%2016.2464V6.82326C7.80768%206.54056%208.04205%206.3521%208.24713%206.3521C8.48151%206.3521%208.68658%206.57197%208.68658%206.82326Z%22%20fill%3D%22%234A4A4A%22%2F%3E%3Cpath%20d%3D%22M11.6456%206.82326V16.2464C11.6456%2016.5291%2011.4405%2016.749%2011.2061%2016.749C10.9717%2016.749%2010.7667%2016.5291%2010.7667%2016.2464V6.82326C10.7667%206.54056%2010.9717%206.3521%2011.2061%206.3521C11.4405%206.3521%2011.6456%206.57197%2011.6456%206.82326Z%22%20fill%3D%22%234A4A4A%22%2F%3E%3Cpath%20d%3D%22M5.78619%206.82326V16.2464C5.78619%2016.5291%205.58112%2016.749%205.34674%2016.749C5.11237%2016.749%204.87799%2016.5291%204.87799%2016.2464V6.82326C4.87799%206.54056%205.08307%206.3521%205.31744%206.3521C5.55182%206.3521%205.78619%206.57197%205.78619%206.82326Z%22%20fill%3D%22%234A4A4A%22%2F%3E%3C%2Fsvg%3E";
1535
1569
 
1536
- function _createForOfIteratorHelper$7(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$7(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1537
- function _unsupportedIterableToArray$7(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$7(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0; } }
1538
- function _arrayLikeToArray$7(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1570
+ function _createForOfIteratorHelper$6(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$6(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1571
+ function _unsupportedIterableToArray$6(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$6(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$6(r, a) : void 0; } }
1572
+ function _arrayLikeToArray$6(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1539
1573
  function SelHandler (_ref) {
1540
1574
  var onElSelected = _ref.onElSelected;
1541
- useUtilStoreContext();
1575
+ var utilStore = useUtilStoreContext();
1542
1576
  var gridStore = useGridStoreContext();
1543
1577
  var sceneStore = useSceneStoreContext();
1544
1578
  var uiStore = useUIStoreContext();
@@ -1551,35 +1585,33 @@ function SelHandler (_ref) {
1551
1585
  var element = hit === null || hit === void 0 ? void 0 : hit.pickedMesh;
1552
1586
  clearTimeout(timeoutId);
1553
1587
  timeoutId = setTimeout(function () {
1554
- while (element) {
1555
- var _element, _element2;
1556
- element = (_element = element) === null || _element === void 0 ? void 0 : _element.parent;
1557
- if ((_element2 = element) !== null && _element2 !== void 0 && _element2.name.toLowerCase().startsWith('element')) {
1558
- pickedElement = true;
1559
- if (evt.type == 64 && hit !== null && hit !== void 0 && hit.pickedPoint) {
1560
- onElementSelected(element, hit, true);
1561
- return;
1562
- } else if (evt.type == 16 && hit !== null && hit !== void 0 && hit.pickedPoint) {
1563
- onElementSelected(element, hit);
1564
- return;
1565
- }
1588
+ var res = utilStore.findParentElementAndSet(element);
1589
+ if (res.element) {
1590
+ element = res.element;
1591
+ pickedElement = true;
1592
+ if (evt.type == 64 && hit !== null && hit !== void 0 && hit.pickedPoint) {
1593
+ onElementSelected(element, hit, true);
1594
+ return;
1595
+ } else if (evt.type == 16 && hit !== null && hit !== void 0 && hit.pickedPoint) {
1596
+ onElementSelected(element, hit);
1597
+ return;
1566
1598
  }
1567
1599
  }
1568
1600
  if (!pickedElement && hit !== null && hit !== void 0 && hit.pickedPoint) {
1569
1601
  var _hit$pickedMesh;
1570
1602
  if (sceneStore.elements) {
1571
- var _iterator = _createForOfIteratorHelper$7(sceneStore.elements),
1603
+ var _iterator = _createForOfIteratorHelper$6(sceneStore.elements),
1572
1604
  _step;
1573
1605
  try {
1574
1606
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
1575
- var _element3 = _step.value;
1576
- var _element3$bbn$getHier = _element3.bbn.getHierarchyBoundingVectors(),
1577
- min = _element3$bbn$getHier.min,
1578
- max = _element3$bbn$getHier.max;
1607
+ var _element = _step.value;
1608
+ var _element$bbn$getHiera = _element.bbn.getHierarchyBoundingVectors(),
1609
+ min = _element$bbn$getHiera.min,
1610
+ max = _element$bbn$getHiera.max;
1579
1611
  var point = hit.pickedPoint;
1580
1612
  if (min.x < point.x && min.z < point.y && max.x > point.x && max.z > point.z && evt.type == 16) {
1581
1613
  pickedElement = true;
1582
- onElementSelected(_element3.bbn, hit);
1614
+ onElementSelected(_element.bbn, hit);
1583
1615
  }
1584
1616
  }
1585
1617
  } catch (err) {
@@ -1619,9 +1651,9 @@ function SelHandler (_ref) {
1619
1651
  };
1620
1652
  }
1621
1653
 
1622
- function _createForOfIteratorHelper$6(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$6(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1623
- function _unsupportedIterableToArray$6(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$6(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$6(r, a) : void 0; } }
1624
- function _arrayLikeToArray$6(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1654
+ function _createForOfIteratorHelper$5(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$5(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1655
+ function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$5(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0; } }
1656
+ function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1625
1657
  /*
1626
1658
  UIStore
1627
1659
  */
@@ -1803,7 +1835,7 @@ var UIStore = /*#__PURE__*/function () {
1803
1835
  key: "selectElem",
1804
1836
  value: function selectElem(name) {
1805
1837
  var _this5 = this;
1806
- var _iterator = _createForOfIteratorHelper$6(this._gui.getControlsByType('ellipse')),
1838
+ var _iterator = _createForOfIteratorHelper$5(this._gui.getControlsByType('ellipse')),
1807
1839
  _step;
1808
1840
  try {
1809
1841
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -1902,18 +1934,34 @@ var UIStore = /*#__PURE__*/function () {
1902
1934
  }
1903
1935
  }, {
1904
1936
  key: "requestNewOverlayImage",
1905
- value: function requestNewOverlayImage(viewpoint) {
1937
+ value: function requestNewOverlayImage(viewpoint, focusedElement, targetCameraPosition) {
1906
1938
  var _this7 = this;
1907
1939
  //this._overlayImage exists only when unity combi is enabled
1908
1940
  if (!this._overlayImage) return;
1941
+ var elementId = undefined;
1942
+ var setId = undefined;
1943
+ var ob = this._scene.getTransformNodeByName(focusedElement.name);
1944
+ var _this$_utilStore$find = this._utilStore.findParentElementAndSet(ob),
1945
+ element = _this$_utilStore$find.element,
1946
+ set = _this$_utilStore$find.set;
1947
+ if (element) {
1948
+ elementId = Number(element.name.slice(element.name.lastIndexOf('E') + 1, element.name.length));
1949
+ setId = set === null || set === void 0 ? void 0 : set.replace('planning_', '');
1950
+ }
1909
1951
  clearTimeout(this._timeoutId);
1910
1952
  this._timeoutId = setTimeout(function () {
1911
1953
  var _this7$_requestNewOve;
1912
1954
  _this7._utilStore.addOutstandingImage();
1913
1955
  _this7._latestViewpoint = viewpoint;
1914
- (_this7$_requestNewOve = _this7._requestNewOverlayImage) === null || _this7$_requestNewOve === void 0 || _this7$_requestNewOve.call(_this7, viewpoint);
1956
+ (_this7$_requestNewOve = _this7._requestNewOverlayImage) === null || _this7$_requestNewOve === void 0 || _this7$_requestNewOve.call(_this7, viewpoint, {
1957
+ adjustZoomInUnity: false,
1958
+ onlyAdjustZoomBBChanged: false,
1959
+ rotationCenter: viewpoint.targetPos,
1960
+ elementId: elementId,
1961
+ setId: setId
1962
+ });
1915
1963
  _this7._utilStore.updateCam = true;
1916
- }, 500);
1964
+ }, 200);
1917
1965
  }
1918
1966
  }]);
1919
1967
  }();
@@ -1982,9 +2030,7 @@ var UtilStore = /*#__PURE__*/function () {
1982
2030
  }, {
1983
2031
  key: "updateWithUnityData",
1984
2032
  get: function get() {
1985
- var isNotOutStandingImage = this._outstandingImageCount > 0;
1986
- if (isNotOutStandingImage) this._outstandingImageCount--;
1987
- return !isNotOutStandingImage && this._updateCam;
2033
+ return true;
1988
2034
  }
1989
2035
  }, {
1990
2036
  key: "onElementDeleted",
@@ -2113,6 +2159,25 @@ var UtilStore = /*#__PURE__*/function () {
2113
2159
  direction.normalize();
2114
2160
  mesh.position.addInPlace(direction.scale(distance));
2115
2161
  }
2162
+ }, {
2163
+ key: "findParentElementAndSet",
2164
+ value: function findParentElementAndSet(ob) {
2165
+ var element = undefined;
2166
+ var set = undefined;
2167
+ while (ob) {
2168
+ var name = ob.name.toLowerCase();
2169
+ if (name.startsWith('element')) {
2170
+ element = ob;
2171
+ } else if (name.startsWith('planning')) {
2172
+ set = name;
2173
+ }
2174
+ ob = ob.parent;
2175
+ }
2176
+ return {
2177
+ element: element,
2178
+ set: set
2179
+ };
2180
+ }
2116
2181
  }]);
2117
2182
  }();
2118
2183
 
@@ -2120,9 +2185,9 @@ var _context;
2120
2185
  var unregisterContext = function unregisterContext() {
2121
2186
  _context = undefined;
2122
2187
  };
2123
- var registerContext = function registerContext(scene, hqRenderScript, apiConfig, jwt, viewHandler, onMissingGeo, requestNewOverlayImage, overlayImage, uiConfig) {
2188
+ var registerContext = function registerContext(scene, hqRenderScript, apiConfig, jwt, viewHandler, onMissingGeo, requestNewOverlayImage, overlayImage, uiConfig, updateCameraInformation) {
2124
2189
  var utilStore = new UtilStore(false, viewHandler);
2125
- var sceneStore = new SceneStore(scene, hqRenderScript, utilStore, apiConfig, jwt, onMissingGeo);
2190
+ var sceneStore = new SceneStore(scene, hqRenderScript, utilStore, apiConfig, jwt, onMissingGeo, updateCameraInformation);
2126
2191
  var uiStore = new UIStore(scene, sceneStore.enableSSAO.bind(sceneStore), utilStore, uiConfig, requestNewOverlayImage, overlayImage);
2127
2192
  return _context = {
2128
2193
  utilStore: utilStore,
@@ -2148,9 +2213,9 @@ var useUtilStoreContext = function useUtilStoreContext() {
2148
2213
  return (_context5 = _context) === null || _context5 === void 0 ? void 0 : _context5.utilStore;
2149
2214
  };
2150
2215
 
2151
- function _createForOfIteratorHelper$5(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$5(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2152
- function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$5(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0; } }
2153
- function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2216
+ function _createForOfIteratorHelper$4(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2217
+ function _unsupportedIterableToArray$4(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$4(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; } }
2218
+ function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2154
2219
  function caching () {
2155
2220
  var _useSceneStoreContext = useSceneStoreContext(),
2156
2221
  cache = _useSceneStoreContext.cache,
@@ -2165,7 +2230,7 @@ function caching () {
2165
2230
  var updatedElements = (_curElementRoot$nodes = curElementRoot === null || curElementRoot === void 0 || (_curElementRoot$nodes2 = curElementRoot.nodes) === null || _curElementRoot$nodes2 === void 0 ? void 0 : _curElementRoot$nodes2.filter(function (curElement) {
2166
2231
  if ((prevElementRoot === null || prevElementRoot === void 0 ? void 0 : prevElementRoot.nodes) === undefined) return true;
2167
2232
  var didChange = true;
2168
- var _iterator = _createForOfIteratorHelper$5(prevElementRoot.nodes),
2233
+ var _iterator = _createForOfIteratorHelper$4(prevElementRoot.nodes),
2169
2234
  _step;
2170
2235
  try {
2171
2236
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -2190,7 +2255,7 @@ function caching () {
2190
2255
  var prevGeo = (_assets$geos = previousHQRenderScript.assets.geos) === null || _assets$geos === void 0 ? void 0 : _assets$geos[idx];
2191
2256
  if (prevGeo && !(geo.id + geo.name === prevGeo.id + prevGeo.name) && cache !== null && cache !== void 0 && (_cache$idx = cache[idx]) !== null && _cache$idx !== void 0 && (_cache$idx = _cache$idx.geo) !== null && _cache$idx !== void 0 && _cache$idx.onElements) {
2192
2257
  var _cache$idx$geo;
2193
- var _iterator2 = _createForOfIteratorHelper$5((_cache$idx$geo = cache[idx].geo) === null || _cache$idx$geo === void 0 ? void 0 : _cache$idx$geo.onElements),
2258
+ var _iterator2 = _createForOfIteratorHelper$4((_cache$idx$geo = cache[idx].geo) === null || _cache$idx$geo === void 0 ? void 0 : _cache$idx$geo.onElements),
2194
2259
  _step2;
2195
2260
  try {
2196
2261
  var _loop = function _loop() {
@@ -2220,7 +2285,7 @@ function caching () {
2220
2285
  var prevMat = (_assets$mats = previousHQRenderScript.assets.mats) === null || _assets$mats === void 0 ? void 0 : _assets$mats[idx];
2221
2286
  if (prevMat && !(mat.id + mat.name === prevMat.id + prevMat.name) && cache !== null && cache !== void 0 && (_cache$idx2 = cache[idx]) !== null && _cache$idx2 !== void 0 && (_cache$idx2 = _cache$idx2.material) !== null && _cache$idx2 !== void 0 && _cache$idx2.onElements) {
2222
2287
  var _cache$idx$material;
2223
- var _iterator3 = _createForOfIteratorHelper$5((_cache$idx$material = cache[idx].material) === null || _cache$idx$material === void 0 ? void 0 : _cache$idx$material.onElements),
2288
+ var _iterator3 = _createForOfIteratorHelper$4((_cache$idx$material = cache[idx].material) === null || _cache$idx$material === void 0 ? void 0 : _cache$idx$material.onElements),
2224
2289
  _step3;
2225
2290
  try {
2226
2291
  var _loop2 = function _loop2() {
@@ -2251,7 +2316,7 @@ function caching () {
2251
2316
  deletedElements: prevElementRoot === null || prevElementRoot === void 0 || (_prevElementRoot$node = prevElementRoot.nodes) === null || _prevElementRoot$node === void 0 ? void 0 : _prevElementRoot$node.filter(function (prevElement) {
2252
2317
  if ((curElementRoot === null || curElementRoot === void 0 ? void 0 : curElementRoot.nodes) === undefined) return true;
2253
2318
  var wasDeleted = true;
2254
- var _iterator4 = _createForOfIteratorHelper$5(curElementRoot.nodes),
2319
+ var _iterator4 = _createForOfIteratorHelper$4(curElementRoot.nodes),
2255
2320
  _step4;
2256
2321
  try {
2257
2322
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
@@ -2366,9 +2431,9 @@ var customMat = /*#__PURE__*/function () {
2366
2431
  };
2367
2432
  }();
2368
2433
 
2369
- function _createForOfIteratorHelper$4(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2370
- function _unsupportedIterableToArray$4(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$4(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; } }
2371
- function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2434
+ function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2435
+ function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; } }
2436
+ function _arrayLikeToArray$3(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2372
2437
  getLogger('RealTimeViewer', 'FindAsset');
2373
2438
  function findAssets(_x, _x2) {
2374
2439
  return _findAssets.apply(this, arguments);
@@ -2482,7 +2547,7 @@ function _findAssets() {
2482
2547
  });
2483
2548
  geo.material = mat.mat;
2484
2549
  oldMat = sceneStore.scene.getMaterialByUniqueID(oldMatId);
2485
- _iterator3 = _createForOfIteratorHelper$4(oldMat.getBindedMeshes());
2550
+ _iterator3 = _createForOfIteratorHelper$3(oldMat.getBindedMeshes());
2486
2551
  try {
2487
2552
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
2488
2553
  mesh = _step3.value;
@@ -2497,7 +2562,7 @@ function _findAssets() {
2497
2562
  _context.next = 37;
2498
2563
  break;
2499
2564
  case 20:
2500
- _iterator4 = _createForOfIteratorHelper$4(geo.getChildMeshes());
2565
+ _iterator4 = _createForOfIteratorHelper$3(geo.getChildMeshes());
2501
2566
  _context.prev = 21;
2502
2567
  _iterator4.s();
2503
2568
  case 23:
@@ -2542,7 +2607,7 @@ function _findAssets() {
2542
2607
  //TODO: tiling with Node Materials, multiple Textures
2543
2608
 
2544
2609
  //! clean std. materials from importing (.00x)
2545
- _iterator = _createForOfIteratorHelper$4(assets.geos);
2610
+ _iterator = _createForOfIteratorHelper$3(assets.geos);
2546
2611
  _context5.prev = 11;
2547
2612
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
2548
2613
  var geo, path, mesh, cachedGeo;
@@ -2624,7 +2689,7 @@ function _findAssets() {
2624
2689
  return _context5.finish(26);
2625
2690
  case 29:
2626
2691
  // Und alle materialien erstellt
2627
- _iterator2 = _createForOfIteratorHelper$4(assets.mats);
2692
+ _iterator2 = _createForOfIteratorHelper$3(assets.mats);
2628
2693
  _context5.prev = 30;
2629
2694
  _loop2 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop2() {
2630
2695
  var mat, _nwCache$material;
@@ -2742,7 +2807,7 @@ function _createOrGetMaterial() {
2742
2807
  _context6.next = 18;
2743
2808
  break;
2744
2809
  }
2745
- _iterator5 = _createForOfIteratorHelper$4(scene.materials);
2810
+ _iterator5 = _createForOfIteratorHelper$3(scene.materials);
2746
2811
  _context6.prev = 2;
2747
2812
  _iterator5.s();
2748
2813
  case 4:
@@ -2799,9 +2864,9 @@ function _createOrGetMaterial() {
2799
2864
  return _createOrGetMaterial.apply(this, arguments);
2800
2865
  }
2801
2866
 
2802
- function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2803
- function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; } }
2804
- function _arrayLikeToArray$3(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2867
+ function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2868
+ function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }
2869
+ function _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2805
2870
  var buildScene = function buildScene(_ref) {
2806
2871
  var _sceneStore$elements;
2807
2872
  var startNode = _ref.startNode,
@@ -2840,7 +2905,7 @@ var buildScene = function buildScene(_ref) {
2840
2905
 
2841
2906
  //! getNodes / getGeos
2842
2907
  if (curGeo.nodes !== undefined) {
2843
- var _iterator = _createForOfIteratorHelper$3(curGeo.nodes),
2908
+ var _iterator = _createForOfIteratorHelper$2(curGeo.nodes),
2844
2909
  _step;
2845
2910
  try {
2846
2911
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -2855,7 +2920,7 @@ var buildScene = function buildScene(_ref) {
2855
2920
  }
2856
2921
  //! each geo
2857
2922
  if (curGeo.geos !== undefined) {
2858
- var _iterator2 = _createForOfIteratorHelper$3(curGeo.geos),
2923
+ var _iterator2 = _createForOfIteratorHelper$2(curGeo.geos),
2859
2924
  _step2;
2860
2925
  try {
2861
2926
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -2910,7 +2975,7 @@ var buildScene = function buildScene(_ref) {
2910
2975
 
2911
2976
  //! each node
2912
2977
  if (hqsNode.nodes !== undefined) {
2913
- var _iterator3 = _createForOfIteratorHelper$3(hqsNode.nodes),
2978
+ var _iterator3 = _createForOfIteratorHelper$2(hqsNode.nodes),
2914
2979
  _step3;
2915
2980
  try {
2916
2981
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -2925,7 +2990,7 @@ var buildScene = function buildScene(_ref) {
2925
2990
  }
2926
2991
  //! each material
2927
2992
  if (hqsNode.mats !== undefined) {
2928
- var _iterator4 = _createForOfIteratorHelper$3(hqsNode.mats),
2993
+ var _iterator4 = _createForOfIteratorHelper$2(hqsNode.mats),
2929
2994
  _step4;
2930
2995
  try {
2931
2996
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
@@ -2940,7 +3005,7 @@ var buildScene = function buildScene(_ref) {
2940
3005
  }
2941
3006
  //! each geo
2942
3007
  if (hqsNode.geos !== undefined) {
2943
- var _iterator5 = _createForOfIteratorHelper$3(hqsNode.geos),
3008
+ var _iterator5 = _createForOfIteratorHelper$2(hqsNode.geos),
2944
3009
  _step5;
2945
3010
  try {
2946
3011
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
@@ -2958,14 +3023,14 @@ var buildScene = function buildScene(_ref) {
2958
3023
  sceneStore.cache = cachedAssets;
2959
3024
  };
2960
3025
 
2961
- function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2962
- function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }
2963
- function _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3026
+ function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3027
+ function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
3028
+ function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2964
3029
  function findMaterials(cache) {
2965
3030
  //! parent = the parent from which on every child should receive the Material
2966
3031
  //! id = the id which points to the material that should be assigned
2967
3032
  var setMaterials = function setMaterials(onNode, mat) {
2968
- var _iterator = _createForOfIteratorHelper$2(onNode.getChildMeshes()),
3033
+ var _iterator = _createForOfIteratorHelper$1(onNode.getChildMeshes()),
2969
3034
  _step;
2970
3035
  try {
2971
3036
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -2983,12 +3048,12 @@ function findMaterials(cache) {
2983
3048
  var findOnNode = function findOnNode(mat, parent) {
2984
3049
  if (!mat.onNodes) return;
2985
3050
  var children = parent.getChildTransformNodes(false);
2986
- var _iterator2 = _createForOfIteratorHelper$2(children),
3051
+ var _iterator2 = _createForOfIteratorHelper$1(children),
2987
3052
  _step2;
2988
3053
  try {
2989
3054
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
2990
3055
  var child = _step2.value;
2991
- var _iterator3 = _createForOfIteratorHelper$2(mat.onNodes),
3056
+ var _iterator3 = _createForOfIteratorHelper$1(mat.onNodes),
2992
3057
  _step3;
2993
3058
  try {
2994
3059
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -3009,13 +3074,13 @@ function findMaterials(cache) {
3009
3074
  _iterator2.f();
3010
3075
  }
3011
3076
  };
3012
- var _iterator4 = _createForOfIteratorHelper$2(cache),
3077
+ var _iterator4 = _createForOfIteratorHelper$1(cache),
3013
3078
  _step4;
3014
3079
  try {
3015
3080
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
3016
3081
  var element = _step4.value;
3017
3082
  if (!element.material || !element.material.parents) continue;
3018
- var _iterator5 = _createForOfIteratorHelper$2(element.material.parents),
3083
+ var _iterator5 = _createForOfIteratorHelper$1(element.material.parents),
3019
3084
  _step5;
3020
3085
  try {
3021
3086
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
@@ -3036,11 +3101,11 @@ function findMaterials(cache) {
3036
3101
  return findMaterials;
3037
3102
  }
3038
3103
 
3039
- function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3040
- function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
3041
- function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3104
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3105
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3106
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3042
3107
  function deacCache(cache) {
3043
- var _iterator = _createForOfIteratorHelper$1(cache.getChildTransformNodes(true)),
3108
+ var _iterator = _createForOfIteratorHelper(cache.getChildTransformNodes(true)),
3044
3109
  _step;
3045
3110
  try {
3046
3111
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -3099,30 +3164,23 @@ function shadow() {
3099
3164
  }
3100
3165
  }
3101
3166
 
3102
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3103
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3104
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3105
-
3106
3167
  //! sets element set
3107
3168
  var parser = /*#__PURE__*/function () {
3108
3169
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
3109
3170
  var _changedElements$upda;
3110
- var sceneStore, hasRendered, hqRenderScript, scene, cache, changedElements, utilStore, uiStore, wasPlanned, elementCount, _yield$findAssets, cacheGroup, newCache, _changedElements$upda2, focusedElement, focusedNode, _iterator, _step, node, bbox, boundingInfo, frustumPlanes, isInFrustum, sizeDiff;
3171
+ var sceneStore, hasRendered, hqRenderScript, scene, cache, changedElements, utilStore, _yield$findAssets, cacheGroup, newCache, _changedElements$upda2;
3111
3172
  return _regeneratorRuntime.wrap(function _callee$(_context) {
3112
3173
  while (1) switch (_context.prev = _context.next) {
3113
3174
  case 0:
3114
3175
  sceneStore = useSceneStoreContext();
3115
3176
  hasRendered = sceneStore.hasRendered, hqRenderScript = sceneStore.hqRenderScript, scene = sceneStore.scene, cache = sceneStore.cache, changedElements = sceneStore.changedElements;
3116
- utilStore = useUtilStoreContext();
3117
- uiStore = useUIStoreContext();
3118
- wasPlanned = sceneStore.hasPlanned;
3119
- elementCount = sceneStore.mainElements.length; //disable elementrows from old cache
3177
+ utilStore = useUtilStoreContext(); //disable elementrows from old cache
3120
3178
  changedElements === null || changedElements === void 0 || (_changedElements$upda = changedElements.updatedElements) === null || _changedElements$upda === void 0 || _changedElements$upda.forEach(function (el) {
3121
3179
  return utilStore.disableElementRows(el.name, cache);
3122
3180
  });
3123
- _context.next = 9;
3181
+ _context.next = 6;
3124
3182
  return findAssets(hqRenderScript.assets, cache);
3125
- case 9:
3183
+ case 6:
3126
3184
  _yield$findAssets = _context.sent;
3127
3185
  cacheGroup = _yield$findAssets.cacheGroup;
3128
3186
  newCache = _yield$findAssets.newCache;
@@ -3159,49 +3217,8 @@ var parser = /*#__PURE__*/function () {
3159
3217
  }
3160
3218
  utilStore.setRTVAnalyzeData();
3161
3219
  deacCache(cacheGroup);
3162
-
3163
- // Check if the bounding box is in the frustum
3164
- focusedElement = sceneStore.focusedElement;
3165
- if (!focusedElement) {
3166
- _context.next = 29;
3167
- break;
3168
- }
3169
- // let focusedNode = scene.getTransformNodeByName(focusedElement.name)!;
3170
- focusedNode = undefined;
3171
- _iterator = _createForOfIteratorHelper(scene.transformNodes);
3172
- try {
3173
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
3174
- node = _step.value;
3175
- if (node.name == focusedElement.name) {
3176
- if (sceneStore.getId(node) == focusedElement.id) {
3177
- focusedNode = node;
3178
- }
3179
- }
3180
- }
3181
- } catch (err) {
3182
- _iterator.e(err);
3183
- } finally {
3184
- _iterator.f();
3185
- }
3186
- if (focusedNode) {
3187
- _context.next = 23;
3188
- break;
3189
- }
3190
- return _context.abrupt("return");
3191
- case 23:
3192
- bbox = focusedNode.getHierarchyBoundingVectors();
3193
- boundingInfo = new BoundingInfo(bbox.min, bbox.max);
3194
- frustumPlanes = Frustum.GetPlanes(scene.activeCamera.getTransformationMatrix());
3195
- isInFrustum = boundingInfo.isCompletelyInFrustum(frustumPlanes);
3196
- sizeDiff = Vector3$1.Distance(bbox.min, bbox.max) - focusedElement.size;
3197
- if ((Math.abs(focusedNode.absolutePosition.x - focusedElement.position.x) > 0.05 || Math.abs(focusedNode.absolutePosition.y - focusedElement.position.y) > 0.05 || Math.abs(focusedNode.absolutePosition.z - focusedElement.position.z) > 0.05) && sceneStore.isControlledViewpoint || wasPlanned && sceneStore.isControlledViewpoint && (focusedElement.size != 0 && Math.abs(sizeDiff) > 0.09 || !isInFrustum && Math.abs(sizeDiff) > 0)) {
3198
- sceneStore.focusElement(focusedNode);
3199
- } else if ((wasPlanned || !uiStore.unityCombActive) && elementCount != sceneStore.mainElements.length) {
3200
- sceneStore.focusElement();
3201
- } else if (uiStore.unityCombActive) {
3202
- updateCam(sceneStore.hqRenderScript.cams[0], sceneStore.scene);
3203
- }
3204
- case 29:
3220
+ updateCam(hqRenderScript.cams[0], scene);
3221
+ case 14:
3205
3222
  case "end":
3206
3223
  return _context.stop();
3207
3224
  }
@@ -3275,7 +3292,7 @@ function useRealTimeRenderData (_ref) {
3275
3292
  }
3276
3293
  function _onSceneReady() {
3277
3294
  _onSceneReady = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
3278
- var _sceneStore$hqRenderS, getEnableUnityRtvKombi, cams, filteredCustomViewpoints, activeViewpoint, activeViewpointIdx, _sceneStore$previousH, activeElement, newCam, prevCam, _activeElement;
3295
+ var _sceneStore$hqRenderS, getEnableUnityRtvKombi, cams, filteredCustomViewpoints, activeViewpoint, activeViewpointIdx, activeElement, _activeElement;
3279
3296
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
3280
3297
  while (1) switch (_context2.prev = _context2.next) {
3281
3298
  case 0:
@@ -3313,12 +3330,12 @@ function useRealTimeRenderData (_ref) {
3313
3330
  allViewpoints: filteredCustomViewpoints
3314
3331
  }));
3315
3332
  }
3316
- _context2.next = 22;
3333
+ _context2.next = 17;
3317
3334
  break;
3318
3335
  case 11:
3319
3336
  sceneStore.hqRenderScript = JSON.parse(renderjob);
3320
3337
  if (checkCachedData()) {
3321
- _context2.next = 22;
3338
+ _context2.next = 17;
3322
3339
  break;
3323
3340
  }
3324
3341
  if (elementsInfo) {
@@ -3330,28 +3347,17 @@ function useRealTimeRenderData (_ref) {
3330
3347
  }
3331
3348
  if (!overlayImage) actions.toggleLoading('buildScene', false, false);
3332
3349
  sceneStore.isInitializing = false;
3333
- newCam = sceneStore.hqRenderScript.cams[0];
3334
- prevCam = (_sceneStore$previousH = sceneStore.previousHQRenderScript) === null || _sceneStore$previousH === void 0 ? void 0 : _sceneStore$previousH.cams[0];
3335
- if (prevCam) {
3336
- _context2.next = 20;
3337
- break;
3338
- }
3339
- return _context2.abrupt("return");
3340
- case 20:
3341
- if (utilStore.updateCam && (newCam.pos.x != prevCam.pos.x || newCam.pos.y != prevCam.pos.y || newCam.pos.z != prevCam.pos.z || newCam.rot.x != prevCam.rot.x || newCam.rot.y != prevCam.rot.y || newCam.rot.z != prevCam.rot.z)) {
3342
- updateCam(newCam, sceneStore.scene);
3343
- }
3344
3350
  return _context2.abrupt("return");
3345
- case 22:
3351
+ case 17:
3346
3352
  LOG.startTransaction({
3347
3353
  event: 'buildScene',
3348
3354
  message: 'Start Building Realtime Scene',
3349
3355
  eventId: 'BUILD_SCENE'
3350
3356
  });
3351
- _context2.prev = 23;
3352
- _context2.next = 26;
3357
+ _context2.prev = 18;
3358
+ _context2.next = 21;
3353
3359
  return parser();
3354
- case 26:
3360
+ case 21:
3355
3361
  if (elementsInfo) {
3356
3362
  _activeElement = elementsInfo.find(function (e) {
3357
3363
  return e.active;
@@ -3360,18 +3366,18 @@ function useRealTimeRenderData (_ref) {
3360
3366
  uiStore.initGui(callbacks.onElementSelected, sceneStore.elements, elementsInfo);
3361
3367
  }
3362
3368
  if (freePlacesOnGrids || plannedPlacesOnGrids) gridStore.getGrids(freePlacesOnGrids, plannedPlacesOnGrids);
3363
- _context2.next = 35;
3369
+ _context2.next = 30;
3364
3370
  break;
3365
- case 30:
3366
- _context2.prev = 30;
3367
- _context2.t0 = _context2["catch"](23);
3371
+ case 25:
3372
+ _context2.prev = 25;
3373
+ _context2.t0 = _context2["catch"](18);
3368
3374
  LOG.errorTransaction('BUILD_SCENE', 'RTS_0001', _context2.t0.message);
3369
3375
  LOG.error(new DivaError('Error building scene', {
3370
3376
  cause: _context2.t0,
3371
3377
  code: 'RTS_0001'
3372
3378
  }));
3373
3379
  sceneStore.isInitializing = false;
3374
- case 35:
3380
+ case 30:
3375
3381
  if (callbacks.setGlb) {
3376
3382
  sceneStore.exportScene().then(function (res) {
3377
3383
  var _callbacks$setGlb;
@@ -3386,17 +3392,16 @@ function useRealTimeRenderData (_ref) {
3386
3392
  }
3387
3393
  sceneStore.scene.onAfterRenderObservable.add(onFirstFrame);
3388
3394
  LOG.successTransaction('BUILD_SCENE');
3389
- case 39:
3395
+ case 34:
3390
3396
  case "end":
3391
3397
  return _context2.stop();
3392
3398
  }
3393
- }, _callee2, null, [[23, 30]]);
3399
+ }, _callee2, null, [[18, 25]]);
3394
3400
  }));
3395
3401
  return _onSceneReady.apply(this, arguments);
3396
3402
  }
3397
3403
  function onFirstFrame() {
3398
3404
  var _callbacks$onInitiali2, _sceneStore;
3399
- // sceneStore.scene.debugLayer!.show();
3400
3405
  sceneStore.isInitializing = false;
3401
3406
  sceneStore.scene.onAfterRenderObservable.removeCallback(onFirstFrame);
3402
3407
  if (!overlayImage) actions.toggleLoading('buildScene', false, false);
@@ -3443,7 +3448,7 @@ function useRealTimeRenderData (_ref) {
3443
3448
  engine.renderEvenInBackground = renderInBackground;
3444
3449
  engine.disablePerformanceMonitorInBackground = true;
3445
3450
  bScene = new Scene(engine, undefined);
3446
- context = registerContext(bScene, renderjob, apiConfig, jwt, viewHandler, callbacks.onMissingGeo, callbacks.requestNewOverlayImage, overlayImage, uiConfig);
3451
+ context = registerContext(bScene, renderjob, apiConfig, jwt, viewHandler, callbacks.onMissingGeo, callbacks.requestNewOverlayImage, overlayImage, uiConfig, callbacks.updateCameraInformation);
3447
3452
  sceneStore = context.sceneStore;
3448
3453
  utilStore = context.utilStore;
3449
3454
  gridStore = context.gridStore;