@crystaldesign/real-time-viewer 24.12.0-beta.26 → 24.12.0-beta.28
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.
- package/build/esm/index.js +161 -67
- package/build/types/real-time-viewer/src/parser/index.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/store/SceneStore.d.ts +9 -0
- package/build/types/real-time-viewer/src/store/SceneStore.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/useRealTimeRenderData.d.ts.map +1 -1
- package/build/umd/real-time-viewer.umd.min.js +1 -1
- package/build/umd/report.html +1 -1
- package/package.json +2 -2
package/build/esm/index.js
CHANGED
|
@@ -27,13 +27,14 @@ 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 } from '@babylonjs/core/Maths/math';
|
|
30
|
+
import { Matrix as Matrix$1, Vector3 as Vector3$1, Frustum } 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';
|
|
37
38
|
import '@babylonjs/loaders/glTF/2.0/';
|
|
38
39
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
39
40
|
|
|
@@ -65,12 +66,12 @@ function GetCameraControls(camera) {
|
|
|
65
66
|
var delta = sceneStore.scene.getEngine().getDeltaTime();
|
|
66
67
|
var deltaCamPos = sceneStore.targetCameraPosition.subtract(camera.position).multiplyByFloats(delta / 100, delta / 100, delta / 100);
|
|
67
68
|
var deltaTarget = sceneStore.cameraTargetPosition.subtract(camera.target).multiplyByFloats(delta / 100, delta / 100, delta / 100);
|
|
68
|
-
if (Math.abs(deltaCamPos.x) + Math.abs(deltaCamPos.y) + Math.abs(deltaCamPos.z) > 0.
|
|
69
|
+
if (Math.abs(deltaCamPos.x) + Math.abs(deltaCamPos.y) + Math.abs(deltaCamPos.z) > 0.0001) {
|
|
69
70
|
camera.position = camera.position.addInPlaceFromFloats(deltaCamPos.x, deltaCamPos.y, deltaCamPos.z);
|
|
70
71
|
camera.setTarget(sceneStore.cameraTargetPosition);
|
|
71
72
|
stopRender = false;
|
|
72
73
|
}
|
|
73
|
-
if (Math.abs(deltaTarget.x) + Math.abs(deltaTarget.y) + Math.abs(deltaTarget.z) > 0.
|
|
74
|
+
if (Math.abs(deltaTarget.x) + Math.abs(deltaTarget.y) + Math.abs(deltaTarget.z) > 0.0001) {
|
|
74
75
|
camera.setTarget(camera.target.addInPlaceFromFloats(deltaTarget.x, deltaTarget.y, deltaTarget.z));
|
|
75
76
|
stopRender = false;
|
|
76
77
|
}
|
|
@@ -339,9 +340,9 @@ function getGridControls(scene, element, selected, elements, selectMesh) {
|
|
|
339
340
|
};
|
|
340
341
|
}
|
|
341
342
|
|
|
342
|
-
function _createForOfIteratorHelper$
|
|
343
|
-
function _unsupportedIterableToArray$
|
|
344
|
-
function _arrayLikeToArray$
|
|
343
|
+
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; } } }; }
|
|
344
|
+
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; } }
|
|
345
|
+
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; }
|
|
345
346
|
function Grids () {
|
|
346
347
|
var utilStore = useUtilStoreContext();
|
|
347
348
|
var sceneStore = useSceneStoreContext();
|
|
@@ -408,7 +409,7 @@ function Grids () {
|
|
|
408
409
|
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
|
|
409
410
|
gridName = _Object$entries2$_i[0];
|
|
410
411
|
_Object$entries2$_i[1];
|
|
411
|
-
var _iterator = _createForOfIteratorHelper$
|
|
412
|
+
var _iterator = _createForOfIteratorHelper$9(plannedPlaceOnGrid.grids[gridName].accessories),
|
|
412
413
|
_step;
|
|
413
414
|
try {
|
|
414
415
|
var _loop4 = function _loop4() {
|
|
@@ -924,9 +925,9 @@ function updateCam(camera, scene) {
|
|
|
924
925
|
sceneStore.targetCameraPosition = newPos;
|
|
925
926
|
}
|
|
926
927
|
|
|
927
|
-
function _createForOfIteratorHelper$
|
|
928
|
-
function _unsupportedIterableToArray$
|
|
929
|
-
function _arrayLikeToArray$
|
|
928
|
+
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; } } }; }
|
|
929
|
+
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; } }
|
|
930
|
+
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; }
|
|
930
931
|
/*
|
|
931
932
|
SceneStore
|
|
932
933
|
Wraps the scene with additional data and methods
|
|
@@ -959,6 +960,7 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
959
960
|
_defineProperty(this, "_cameraTargetPosition", Vector3.Zero());
|
|
960
961
|
_defineProperty(this, "_targetCameraPosition", Vector3.Zero());
|
|
961
962
|
_defineProperty(this, "_selectedElement", void 0);
|
|
963
|
+
_defineProperty(this, "_focusedElement", void 0);
|
|
962
964
|
_defineProperty(this, "light", undefined);
|
|
963
965
|
_defineProperty(this, "changedElements", void 0);
|
|
964
966
|
scene.clearColor = new Color4(1, 1, 1, 1);
|
|
@@ -1045,6 +1047,29 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1045
1047
|
set: function set(element) {
|
|
1046
1048
|
this._selectedElement = element;
|
|
1047
1049
|
}
|
|
1050
|
+
}, {
|
|
1051
|
+
key: "focusedElement",
|
|
1052
|
+
get: function get() {
|
|
1053
|
+
var _this$_focusedElement;
|
|
1054
|
+
if (!this._focusedElement) {
|
|
1055
|
+
var root = this.scene.getTransformNodeByName('Root');
|
|
1056
|
+
if (root) {
|
|
1057
|
+
var bbox = root.getHierarchyBoundingVectors();
|
|
1058
|
+
this._focusedElement = {
|
|
1059
|
+
id: this.getId(root),
|
|
1060
|
+
name: 'Root',
|
|
1061
|
+
position: root.absolutePosition,
|
|
1062
|
+
size: Vector3.Distance(bbox.min, bbox.max)
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
return (_this$_focusedElement = this._focusedElement) !== null && _this$_focusedElement !== void 0 ? _this$_focusedElement : {
|
|
1067
|
+
id: 'Root',
|
|
1068
|
+
name: 'Root',
|
|
1069
|
+
position: Vector3.Zero(),
|
|
1070
|
+
size: 0
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1048
1073
|
}, {
|
|
1049
1074
|
key: "controlRenderLoop",
|
|
1050
1075
|
get: function get() {
|
|
@@ -1073,12 +1098,12 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1073
1098
|
var _this$_sceneConstruct2;
|
|
1074
1099
|
var elms = [];
|
|
1075
1100
|
if (!((_this$_sceneConstruct2 = this._sceneConstruct.root) !== null && _this$_sceneConstruct2 !== void 0 && _this$_sceneConstruct2.sets)) return [];
|
|
1076
|
-
var _iterator = _createForOfIteratorHelper$
|
|
1101
|
+
var _iterator = _createForOfIteratorHelper$8(this._sceneConstruct.root.sets),
|
|
1077
1102
|
_step;
|
|
1078
1103
|
try {
|
|
1079
1104
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1080
1105
|
var set = _step.value;
|
|
1081
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
1106
|
+
var _iterator2 = _createForOfIteratorHelper$8(set.elements),
|
|
1082
1107
|
_step2;
|
|
1083
1108
|
try {
|
|
1084
1109
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -1133,12 +1158,12 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1133
1158
|
value: function getElementByName(name) {
|
|
1134
1159
|
var _this$_sceneConstruct3, _this$_sceneConstruct4;
|
|
1135
1160
|
if (!((_this$_sceneConstruct3 = this._sceneConstruct.root) !== null && _this$_sceneConstruct3 !== void 0 && _this$_sceneConstruct3.sets)) return undefined;
|
|
1136
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
1161
|
+
var _iterator3 = _createForOfIteratorHelper$8((_this$_sceneConstruct4 = this._sceneConstruct.root) === null || _this$_sceneConstruct4 === void 0 ? void 0 : _this$_sceneConstruct4.sets),
|
|
1137
1162
|
_step3;
|
|
1138
1163
|
try {
|
|
1139
1164
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1140
1165
|
var set = _step3.value;
|
|
1141
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
1166
|
+
var _iterator4 = _createForOfIteratorHelper$8(set.elements),
|
|
1142
1167
|
_step4;
|
|
1143
1168
|
try {
|
|
1144
1169
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -1163,12 +1188,12 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1163
1188
|
value: function getElementNameById(id) {
|
|
1164
1189
|
var _this$_sceneConstruct5, _this$_sceneConstruct6;
|
|
1165
1190
|
if (!((_this$_sceneConstruct5 = this._sceneConstruct.root) !== null && _this$_sceneConstruct5 !== void 0 && _this$_sceneConstruct5.sets)) return undefined;
|
|
1166
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
1191
|
+
var _iterator5 = _createForOfIteratorHelper$8((_this$_sceneConstruct6 = this._sceneConstruct.root) === null || _this$_sceneConstruct6 === void 0 ? void 0 : _this$_sceneConstruct6.sets),
|
|
1167
1192
|
_step5;
|
|
1168
1193
|
try {
|
|
1169
1194
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
1170
1195
|
var set = _step5.value;
|
|
1171
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
1196
|
+
var _iterator6 = _createForOfIteratorHelper$8(set.elements),
|
|
1172
1197
|
_step6;
|
|
1173
1198
|
try {
|
|
1174
1199
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -1400,9 +1425,18 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1400
1425
|
var pos = new Vector3((bbox.max.x + bbox.min.x) / 2, (bbox.max.y + bbox.min.y) / 2, (bbox.max.z + bbox.min.z) / 2);
|
|
1401
1426
|
this.scene.getCameraByName('defaultCam').target = pos;
|
|
1402
1427
|
this.cameraTargetPosition = pos;
|
|
1403
|
-
|
|
1404
1428
|
// this.doRenderControlLoop = true;
|
|
1405
1429
|
}
|
|
1430
|
+
}, {
|
|
1431
|
+
key: "getId",
|
|
1432
|
+
value: function getId(ob) {
|
|
1433
|
+
var id = ob.name;
|
|
1434
|
+
while (ob.parent) {
|
|
1435
|
+
id += '.' + ob.name;
|
|
1436
|
+
ob = ob.parent;
|
|
1437
|
+
}
|
|
1438
|
+
return id;
|
|
1439
|
+
}
|
|
1406
1440
|
}, {
|
|
1407
1441
|
key: "focusElement",
|
|
1408
1442
|
value: function focusElement(root) {
|
|
@@ -1417,11 +1451,17 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1417
1451
|
var radius = Vector3.Distance(bbox.min, bbox.max) / 2;
|
|
1418
1452
|
if (radius == Infinity) return;
|
|
1419
1453
|
var aspectRatio = engine.getRenderWidth() / engine.getRenderHeight();
|
|
1420
|
-
var distance = radius / Math.tan(cam.fov * 0.
|
|
1454
|
+
var distance = radius / Math.tan(cam.fov * 0.75);
|
|
1421
1455
|
var direction = cam.getDirection(Vector3.Backward());
|
|
1422
1456
|
if (aspectRatio > 1) distance *= aspectRatio;
|
|
1423
1457
|
var newPosition = center.add(direction.scale(distance));
|
|
1424
1458
|
if (newPosition.x == 0 && newPosition.y == 0 && newPosition.z == 0) return;
|
|
1459
|
+
this._focusedElement = {
|
|
1460
|
+
id: this.getId(root),
|
|
1461
|
+
name: root.id,
|
|
1462
|
+
position: root.absolutePosition,
|
|
1463
|
+
size: Vector3.Distance(bbox.min, bbox.max)
|
|
1464
|
+
};
|
|
1425
1465
|
this.cameraTargetPosition = center;
|
|
1426
1466
|
this.targetCameraPosition = newPosition;
|
|
1427
1467
|
this.doRenderControlLoop = true;
|
|
@@ -1443,9 +1483,9 @@ var delButton = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%
|
|
|
1443
1483
|
|
|
1444
1484
|
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";
|
|
1445
1485
|
|
|
1446
|
-
function _createForOfIteratorHelper$
|
|
1447
|
-
function _unsupportedIterableToArray$
|
|
1448
|
-
function _arrayLikeToArray$
|
|
1486
|
+
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; } } }; }
|
|
1487
|
+
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; } }
|
|
1488
|
+
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; }
|
|
1449
1489
|
function SelHandler (_ref) {
|
|
1450
1490
|
var onElSelected = _ref.onElSelected;
|
|
1451
1491
|
useUtilStoreContext();
|
|
@@ -1478,7 +1518,7 @@ function SelHandler (_ref) {
|
|
|
1478
1518
|
if (!pickedElement && hit !== null && hit !== void 0 && hit.pickedPoint) {
|
|
1479
1519
|
var _hit$pickedMesh;
|
|
1480
1520
|
if (sceneStore.elements) {
|
|
1481
|
-
var _iterator = _createForOfIteratorHelper$
|
|
1521
|
+
var _iterator = _createForOfIteratorHelper$7(sceneStore.elements),
|
|
1482
1522
|
_step;
|
|
1483
1523
|
try {
|
|
1484
1524
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -1528,9 +1568,9 @@ function SelHandler (_ref) {
|
|
|
1528
1568
|
};
|
|
1529
1569
|
}
|
|
1530
1570
|
|
|
1531
|
-
function _createForOfIteratorHelper$
|
|
1532
|
-
function _unsupportedIterableToArray$
|
|
1533
|
-
function _arrayLikeToArray$
|
|
1571
|
+
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; } } }; }
|
|
1572
|
+
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; } }
|
|
1573
|
+
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; }
|
|
1534
1574
|
/*
|
|
1535
1575
|
UIStore
|
|
1536
1576
|
*/
|
|
@@ -1708,7 +1748,7 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
1708
1748
|
key: "selectElem",
|
|
1709
1749
|
value: function selectElem(name) {
|
|
1710
1750
|
var _this5 = this;
|
|
1711
|
-
var _iterator = _createForOfIteratorHelper$
|
|
1751
|
+
var _iterator = _createForOfIteratorHelper$6(this._gui.getControlsByType('ellipse')),
|
|
1712
1752
|
_step;
|
|
1713
1753
|
try {
|
|
1714
1754
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -2055,9 +2095,9 @@ var useUtilStoreContext = function useUtilStoreContext() {
|
|
|
2055
2095
|
return (_context5 = _context) === null || _context5 === void 0 ? void 0 : _context5.utilStore;
|
|
2056
2096
|
};
|
|
2057
2097
|
|
|
2058
|
-
function _createForOfIteratorHelper$
|
|
2059
|
-
function _unsupportedIterableToArray$
|
|
2060
|
-
function _arrayLikeToArray$
|
|
2098
|
+
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; } } }; }
|
|
2099
|
+
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; } }
|
|
2100
|
+
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; }
|
|
2061
2101
|
function caching () {
|
|
2062
2102
|
var _useSceneStoreContext = useSceneStoreContext(),
|
|
2063
2103
|
cache = _useSceneStoreContext.cache,
|
|
@@ -2072,7 +2112,7 @@ function caching () {
|
|
|
2072
2112
|
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) {
|
|
2073
2113
|
if ((prevElementRoot === null || prevElementRoot === void 0 ? void 0 : prevElementRoot.nodes) === undefined) return true;
|
|
2074
2114
|
var didChange = true;
|
|
2075
|
-
var _iterator = _createForOfIteratorHelper$
|
|
2115
|
+
var _iterator = _createForOfIteratorHelper$5(prevElementRoot.nodes),
|
|
2076
2116
|
_step;
|
|
2077
2117
|
try {
|
|
2078
2118
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -2097,7 +2137,7 @@ function caching () {
|
|
|
2097
2137
|
var prevGeo = (_assets$geos = previousHQRenderScript.assets.geos) === null || _assets$geos === void 0 ? void 0 : _assets$geos[idx];
|
|
2098
2138
|
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) {
|
|
2099
2139
|
var _cache$idx$geo;
|
|
2100
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
2140
|
+
var _iterator2 = _createForOfIteratorHelper$5((_cache$idx$geo = cache[idx].geo) === null || _cache$idx$geo === void 0 ? void 0 : _cache$idx$geo.onElements),
|
|
2101
2141
|
_step2;
|
|
2102
2142
|
try {
|
|
2103
2143
|
var _loop = function _loop() {
|
|
@@ -2127,7 +2167,7 @@ function caching () {
|
|
|
2127
2167
|
var prevMat = (_assets$mats = previousHQRenderScript.assets.mats) === null || _assets$mats === void 0 ? void 0 : _assets$mats[idx];
|
|
2128
2168
|
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) {
|
|
2129
2169
|
var _cache$idx$material;
|
|
2130
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
2170
|
+
var _iterator3 = _createForOfIteratorHelper$5((_cache$idx$material = cache[idx].material) === null || _cache$idx$material === void 0 ? void 0 : _cache$idx$material.onElements),
|
|
2131
2171
|
_step3;
|
|
2132
2172
|
try {
|
|
2133
2173
|
var _loop2 = function _loop2() {
|
|
@@ -2158,7 +2198,7 @@ function caching () {
|
|
|
2158
2198
|
deletedElements: prevElementRoot === null || prevElementRoot === void 0 || (_prevElementRoot$node = prevElementRoot.nodes) === null || _prevElementRoot$node === void 0 ? void 0 : _prevElementRoot$node.filter(function (prevElement) {
|
|
2159
2199
|
if ((curElementRoot === null || curElementRoot === void 0 ? void 0 : curElementRoot.nodes) === undefined) return true;
|
|
2160
2200
|
var wasDeleted = true;
|
|
2161
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
2201
|
+
var _iterator4 = _createForOfIteratorHelper$5(curElementRoot.nodes),
|
|
2162
2202
|
_step4;
|
|
2163
2203
|
try {
|
|
2164
2204
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -2275,9 +2315,9 @@ var customMat = /*#__PURE__*/function () {
|
|
|
2275
2315
|
};
|
|
2276
2316
|
}();
|
|
2277
2317
|
|
|
2278
|
-
function _createForOfIteratorHelper$
|
|
2279
|
-
function _unsupportedIterableToArray$
|
|
2280
|
-
function _arrayLikeToArray$
|
|
2318
|
+
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; } } }; }
|
|
2319
|
+
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; } }
|
|
2320
|
+
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; }
|
|
2281
2321
|
getLogger('RealTimeViewer', 'FindAsset');
|
|
2282
2322
|
function findAssets(_x, _x2) {
|
|
2283
2323
|
return _findAssets.apply(this, arguments);
|
|
@@ -2391,7 +2431,7 @@ function _findAssets() {
|
|
|
2391
2431
|
});
|
|
2392
2432
|
geo.material = mat.mat;
|
|
2393
2433
|
oldMat = sceneStore.scene.getMaterialByUniqueID(oldMatId);
|
|
2394
|
-
_iterator3 = _createForOfIteratorHelper$
|
|
2434
|
+
_iterator3 = _createForOfIteratorHelper$4(oldMat.getBindedMeshes());
|
|
2395
2435
|
try {
|
|
2396
2436
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
2397
2437
|
mesh = _step3.value;
|
|
@@ -2406,7 +2446,7 @@ function _findAssets() {
|
|
|
2406
2446
|
_context.next = 37;
|
|
2407
2447
|
break;
|
|
2408
2448
|
case 20:
|
|
2409
|
-
_iterator4 = _createForOfIteratorHelper$
|
|
2449
|
+
_iterator4 = _createForOfIteratorHelper$4(geo.getChildMeshes());
|
|
2410
2450
|
_context.prev = 21;
|
|
2411
2451
|
_iterator4.s();
|
|
2412
2452
|
case 23:
|
|
@@ -2451,7 +2491,7 @@ function _findAssets() {
|
|
|
2451
2491
|
//TODO: tiling with Node Materials, multiple Textures
|
|
2452
2492
|
|
|
2453
2493
|
//! clean std. materials from importing (.00x)
|
|
2454
|
-
_iterator = _createForOfIteratorHelper$
|
|
2494
|
+
_iterator = _createForOfIteratorHelper$4(assets.geos);
|
|
2455
2495
|
_context5.prev = 11;
|
|
2456
2496
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
2457
2497
|
var geo, path, mesh, cachedGeo;
|
|
@@ -2533,7 +2573,7 @@ function _findAssets() {
|
|
|
2533
2573
|
return _context5.finish(26);
|
|
2534
2574
|
case 29:
|
|
2535
2575
|
// Und alle materialien erstellt
|
|
2536
|
-
_iterator2 = _createForOfIteratorHelper$
|
|
2576
|
+
_iterator2 = _createForOfIteratorHelper$4(assets.mats);
|
|
2537
2577
|
_context5.prev = 30;
|
|
2538
2578
|
_loop2 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop2() {
|
|
2539
2579
|
var mat, _nwCache$material;
|
|
@@ -2651,7 +2691,7 @@ function _createOrGetMaterial() {
|
|
|
2651
2691
|
_context6.next = 18;
|
|
2652
2692
|
break;
|
|
2653
2693
|
}
|
|
2654
|
-
_iterator5 = _createForOfIteratorHelper$
|
|
2694
|
+
_iterator5 = _createForOfIteratorHelper$4(scene.materials);
|
|
2655
2695
|
_context6.prev = 2;
|
|
2656
2696
|
_iterator5.s();
|
|
2657
2697
|
case 4:
|
|
@@ -2708,9 +2748,9 @@ function _createOrGetMaterial() {
|
|
|
2708
2748
|
return _createOrGetMaterial.apply(this, arguments);
|
|
2709
2749
|
}
|
|
2710
2750
|
|
|
2711
|
-
function _createForOfIteratorHelper$
|
|
2712
|
-
function _unsupportedIterableToArray$
|
|
2713
|
-
function _arrayLikeToArray$
|
|
2751
|
+
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; } } }; }
|
|
2752
|
+
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; } }
|
|
2753
|
+
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; }
|
|
2714
2754
|
var buildScene = function buildScene(_ref) {
|
|
2715
2755
|
var _sceneStore$elements;
|
|
2716
2756
|
var startNode = _ref.startNode,
|
|
@@ -2749,7 +2789,7 @@ var buildScene = function buildScene(_ref) {
|
|
|
2749
2789
|
|
|
2750
2790
|
//! getNodes / getGeos
|
|
2751
2791
|
if (curGeo.nodes !== undefined) {
|
|
2752
|
-
var _iterator = _createForOfIteratorHelper$
|
|
2792
|
+
var _iterator = _createForOfIteratorHelper$3(curGeo.nodes),
|
|
2753
2793
|
_step;
|
|
2754
2794
|
try {
|
|
2755
2795
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -2764,7 +2804,7 @@ var buildScene = function buildScene(_ref) {
|
|
|
2764
2804
|
}
|
|
2765
2805
|
//! each geo
|
|
2766
2806
|
if (curGeo.geos !== undefined) {
|
|
2767
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
2807
|
+
var _iterator2 = _createForOfIteratorHelper$3(curGeo.geos),
|
|
2768
2808
|
_step2;
|
|
2769
2809
|
try {
|
|
2770
2810
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -2819,7 +2859,7 @@ var buildScene = function buildScene(_ref) {
|
|
|
2819
2859
|
|
|
2820
2860
|
//! each node
|
|
2821
2861
|
if (hqsNode.nodes !== undefined) {
|
|
2822
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
2862
|
+
var _iterator3 = _createForOfIteratorHelper$3(hqsNode.nodes),
|
|
2823
2863
|
_step3;
|
|
2824
2864
|
try {
|
|
2825
2865
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -2834,7 +2874,7 @@ var buildScene = function buildScene(_ref) {
|
|
|
2834
2874
|
}
|
|
2835
2875
|
//! each material
|
|
2836
2876
|
if (hqsNode.mats !== undefined) {
|
|
2837
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
2877
|
+
var _iterator4 = _createForOfIteratorHelper$3(hqsNode.mats),
|
|
2838
2878
|
_step4;
|
|
2839
2879
|
try {
|
|
2840
2880
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -2849,7 +2889,7 @@ var buildScene = function buildScene(_ref) {
|
|
|
2849
2889
|
}
|
|
2850
2890
|
//! each geo
|
|
2851
2891
|
if (hqsNode.geos !== undefined) {
|
|
2852
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
2892
|
+
var _iterator5 = _createForOfIteratorHelper$3(hqsNode.geos),
|
|
2853
2893
|
_step5;
|
|
2854
2894
|
try {
|
|
2855
2895
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -2867,14 +2907,14 @@ var buildScene = function buildScene(_ref) {
|
|
|
2867
2907
|
sceneStore.cache = cachedAssets;
|
|
2868
2908
|
};
|
|
2869
2909
|
|
|
2870
|
-
function _createForOfIteratorHelper$
|
|
2871
|
-
function _unsupportedIterableToArray$
|
|
2872
|
-
function _arrayLikeToArray$
|
|
2910
|
+
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; } } }; }
|
|
2911
|
+
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; } }
|
|
2912
|
+
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; }
|
|
2873
2913
|
function findMaterials(cache) {
|
|
2874
2914
|
//! parent = the parent from which on every child should receive the Material
|
|
2875
2915
|
//! id = the id which points to the material that should be assigned
|
|
2876
2916
|
var setMaterials = function setMaterials(onNode, mat) {
|
|
2877
|
-
var _iterator = _createForOfIteratorHelper$
|
|
2917
|
+
var _iterator = _createForOfIteratorHelper$2(onNode.getChildMeshes()),
|
|
2878
2918
|
_step;
|
|
2879
2919
|
try {
|
|
2880
2920
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -2892,12 +2932,12 @@ function findMaterials(cache) {
|
|
|
2892
2932
|
var findOnNode = function findOnNode(mat, parent) {
|
|
2893
2933
|
if (!mat.onNodes) return;
|
|
2894
2934
|
var children = parent.getChildTransformNodes(false);
|
|
2895
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
2935
|
+
var _iterator2 = _createForOfIteratorHelper$2(children),
|
|
2896
2936
|
_step2;
|
|
2897
2937
|
try {
|
|
2898
2938
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
2899
2939
|
var child = _step2.value;
|
|
2900
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
2940
|
+
var _iterator3 = _createForOfIteratorHelper$2(mat.onNodes),
|
|
2901
2941
|
_step3;
|
|
2902
2942
|
try {
|
|
2903
2943
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -2918,13 +2958,13 @@ function findMaterials(cache) {
|
|
|
2918
2958
|
_iterator2.f();
|
|
2919
2959
|
}
|
|
2920
2960
|
};
|
|
2921
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
2961
|
+
var _iterator4 = _createForOfIteratorHelper$2(cache),
|
|
2922
2962
|
_step4;
|
|
2923
2963
|
try {
|
|
2924
2964
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
2925
2965
|
var element = _step4.value;
|
|
2926
2966
|
if (!element.material || !element.material.parents) continue;
|
|
2927
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
2967
|
+
var _iterator5 = _createForOfIteratorHelper$2(element.material.parents),
|
|
2928
2968
|
_step5;
|
|
2929
2969
|
try {
|
|
2930
2970
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -2945,11 +2985,11 @@ function findMaterials(cache) {
|
|
|
2945
2985
|
return findMaterials;
|
|
2946
2986
|
}
|
|
2947
2987
|
|
|
2948
|
-
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; } } }; }
|
|
2949
|
-
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; } }
|
|
2950
|
-
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; }
|
|
2988
|
+
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; } } }; }
|
|
2989
|
+
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; } }
|
|
2990
|
+
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; }
|
|
2951
2991
|
function deacCache(cache) {
|
|
2952
|
-
var _iterator = _createForOfIteratorHelper(cache.getChildTransformNodes(true)),
|
|
2992
|
+
var _iterator = _createForOfIteratorHelper$1(cache.getChildTransformNodes(true)),
|
|
2953
2993
|
_step;
|
|
2954
2994
|
try {
|
|
2955
2995
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -3008,11 +3048,15 @@ function shadow() {
|
|
|
3008
3048
|
}
|
|
3009
3049
|
}
|
|
3010
3050
|
|
|
3051
|
+
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; } } }; }
|
|
3052
|
+
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; } }
|
|
3053
|
+
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; }
|
|
3054
|
+
|
|
3011
3055
|
//! sets element set
|
|
3012
3056
|
var parser = /*#__PURE__*/function () {
|
|
3013
3057
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
3014
3058
|
var _changedElements$upda;
|
|
3015
|
-
var sceneStore, hasRendered, hqRenderScript, scene, cache, changedElements, utilStore, wasPlanned, elementCount, _yield$findAssets, cacheGroup, newCache, _changedElements$upda2;
|
|
3059
|
+
var sceneStore, hasRendered, hqRenderScript, scene, cache, changedElements, utilStore, wasPlanned, elementCount, _yield$findAssets, cacheGroup, newCache, _changedElements$upda2, focusedElement, focusedNode, _iterator, _step, node, bbox, boundingInfo, frustumPlanes, isInFrustum;
|
|
3016
3060
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3017
3061
|
while (1) switch (_context.prev = _context.next) {
|
|
3018
3062
|
case 0:
|
|
@@ -3063,8 +3107,46 @@ var parser = /*#__PURE__*/function () {
|
|
|
3063
3107
|
}
|
|
3064
3108
|
utilStore.setRTVAnalyzeData();
|
|
3065
3109
|
deacCache(cacheGroup);
|
|
3066
|
-
|
|
3067
|
-
|
|
3110
|
+
|
|
3111
|
+
// Check if the bounding box is in the frustum
|
|
3112
|
+
focusedElement = sceneStore.focusedElement;
|
|
3113
|
+
if (!focusedElement) {
|
|
3114
|
+
_context.next = 27;
|
|
3115
|
+
break;
|
|
3116
|
+
}
|
|
3117
|
+
// let focusedNode = scene.getTransformNodeByName(focusedElement.name)!;
|
|
3118
|
+
focusedNode = undefined;
|
|
3119
|
+
_iterator = _createForOfIteratorHelper(scene.transformNodes);
|
|
3120
|
+
try {
|
|
3121
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
3122
|
+
node = _step.value;
|
|
3123
|
+
if (node.name == focusedElement.name) {
|
|
3124
|
+
if (sceneStore.getId(node) == focusedElement.id) {
|
|
3125
|
+
focusedNode = node;
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
3129
|
+
} catch (err) {
|
|
3130
|
+
_iterator.e(err);
|
|
3131
|
+
} finally {
|
|
3132
|
+
_iterator.f();
|
|
3133
|
+
}
|
|
3134
|
+
if (focusedNode) {
|
|
3135
|
+
_context.next = 22;
|
|
3136
|
+
break;
|
|
3137
|
+
}
|
|
3138
|
+
return _context.abrupt("return");
|
|
3139
|
+
case 22:
|
|
3140
|
+
bbox = focusedNode.getHierarchyBoundingVectors();
|
|
3141
|
+
boundingInfo = new BoundingInfo(bbox.min, bbox.max);
|
|
3142
|
+
frustumPlanes = Frustum.GetPlanes(scene.activeCamera.getTransformationMatrix());
|
|
3143
|
+
isInFrustum = boundingInfo.isCompletelyInFrustum(frustumPlanes);
|
|
3144
|
+
if (focusedNode.absolutePosition.x != focusedElement.position.x || focusedNode.absolutePosition.y != focusedElement.position.y || focusedNode.absolutePosition.z != focusedElement.position.z) {
|
|
3145
|
+
sceneStore.focusElement(focusedNode);
|
|
3146
|
+
} else if (wasPlanned && (elementCount != sceneStore.elements.length || !isInFrustum && focusedElement.size != 0 && focusedElement.size != Vector3$1.Distance(bbox.min, bbox.max))) {
|
|
3147
|
+
sceneStore.focusElement(focusedNode);
|
|
3148
|
+
}
|
|
3149
|
+
case 27:
|
|
3068
3150
|
case "end":
|
|
3069
3151
|
return _context.stop();
|
|
3070
3152
|
}
|
|
@@ -3138,7 +3220,7 @@ function useRealTimeRenderData (_ref) {
|
|
|
3138
3220
|
}
|
|
3139
3221
|
function _onSceneReady() {
|
|
3140
3222
|
_onSceneReady = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
3141
|
-
var _sceneStore$hqRenderS, getEnableUnityRtvKombi, cams, filteredCustomViewpoints, activeViewpoint, activeViewpointIdx;
|
|
3223
|
+
var _sceneStore$hqRenderS, getEnableUnityRtvKombi, cams, filteredCustomViewpoints, activeViewpoint, activeViewpointIdx, activeElement, _activeElement;
|
|
3142
3224
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
3143
3225
|
while (1) switch (_context2.prev = _context2.next) {
|
|
3144
3226
|
case 0:
|
|
@@ -3184,7 +3266,13 @@ function useRealTimeRenderData (_ref) {
|
|
|
3184
3266
|
_context2.next = 17;
|
|
3185
3267
|
break;
|
|
3186
3268
|
}
|
|
3187
|
-
if (elementsInfo)
|
|
3269
|
+
if (elementsInfo) {
|
|
3270
|
+
activeElement = elementsInfo.find(function (e) {
|
|
3271
|
+
return e.active;
|
|
3272
|
+
});
|
|
3273
|
+
if (activeElement) sceneStore.selectedElement = activeElement.elementId.toString();
|
|
3274
|
+
uiStore.initGui(callbacks.onElementSelected, sceneStore.elements, elementsInfo);
|
|
3275
|
+
}
|
|
3188
3276
|
if (!overlayImage) actions.toggleLoading('buildScene', false, false);
|
|
3189
3277
|
sceneStore.isInitializing = false;
|
|
3190
3278
|
return _context2.abrupt("return");
|
|
@@ -3198,7 +3286,13 @@ function useRealTimeRenderData (_ref) {
|
|
|
3198
3286
|
_context2.next = 21;
|
|
3199
3287
|
return parser();
|
|
3200
3288
|
case 21:
|
|
3201
|
-
if (elementsInfo)
|
|
3289
|
+
if (elementsInfo) {
|
|
3290
|
+
_activeElement = elementsInfo.find(function (e) {
|
|
3291
|
+
return e.active;
|
|
3292
|
+
});
|
|
3293
|
+
if (_activeElement) sceneStore.selectedElement = _activeElement.elementId.toString();
|
|
3294
|
+
uiStore.initGui(callbacks.onElementSelected, sceneStore.elements, elementsInfo);
|
|
3295
|
+
}
|
|
3202
3296
|
if (freePlacesOnGrids || plannedPlacesOnGrids) gridStore.getGrids(freePlacesOnGrids, plannedPlacesOnGrids);
|
|
3203
3297
|
_context2.next = 30;
|
|
3204
3298
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/index.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,MAAM,qBAqEX,CAAC;AAEF,eAAe,MAAM,CAAC"}
|