@crystaldesign/real-time-viewer 24.13.0-beta.11 → 24.13.0-beta.13
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 +20 -13
- package/build/types/real-time-viewer/src/parser/createCams/index.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/store/UIStore.d.ts +1 -0
- package/build/types/real-time-viewer/src/store/UIStore.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
|
@@ -836,10 +836,10 @@ var GridStore = /*#__PURE__*/function () {
|
|
|
836
836
|
var lightning = function lightning(diva3durl, scene, cams, isMobile, sceneStore) {
|
|
837
837
|
var environmentTexture = CubeTexture.CreateFromPrefilteredData(diva3durl + 'environment.env', scene);
|
|
838
838
|
environmentTexture.gammaSpace = false;
|
|
839
|
-
environmentTexture.rotationY = 1.
|
|
839
|
+
environmentTexture.rotationY = 1.45;
|
|
840
840
|
scene.environmentTexture = environmentTexture;
|
|
841
841
|
scene.createDefaultSkybox(environmentTexture);
|
|
842
|
-
scene.environmentIntensity =
|
|
842
|
+
scene.environmentIntensity = 1;
|
|
843
843
|
scene.getMaterialByName('skyBox').alpha = 0;
|
|
844
844
|
var ssao = new SSAO2RenderingPipeline('ssao', scene, {
|
|
845
845
|
ssaoRatio: 0.5,
|
|
@@ -868,6 +868,7 @@ function createCams(scene, activeViewpoint, viewPoints) {
|
|
|
868
868
|
var _useUtilStoreContext = useUtilStoreContext(),
|
|
869
869
|
vector3ToBVector3 = _useUtilStoreContext.vector3ToBVector3,
|
|
870
870
|
degreesToRadians = _useUtilStoreContext.degreesToRadians;
|
|
871
|
+
useUIStoreContext();
|
|
871
872
|
function createCam(_ref) {
|
|
872
873
|
var name = _ref.name,
|
|
873
874
|
pos = _ref.pos,
|
|
@@ -1466,7 +1467,7 @@ var SceneStore = /*#__PURE__*/function () {
|
|
|
1466
1467
|
var radius = Vector3.Distance(bbox.min, bbox.max) / 2;
|
|
1467
1468
|
if (radius == Infinity) return;
|
|
1468
1469
|
var aspectRatio = engine.getRenderHeight() / engine.getRenderWidth();
|
|
1469
|
-
var distance = radius / Math.tan(cam.fov * 0.
|
|
1470
|
+
var distance = radius / Math.tan(cam.fov * 0.55);
|
|
1470
1471
|
var direction = cam.getDirection(Vector3.Backward());
|
|
1471
1472
|
if (aspectRatio > 1) distance *= aspectRatio;
|
|
1472
1473
|
var newPosition = center.add(direction.scale(distance));
|
|
@@ -1654,6 +1655,11 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
1654
1655
|
get: function get() {
|
|
1655
1656
|
return !!this._isStaticBg;
|
|
1656
1657
|
}
|
|
1658
|
+
}, {
|
|
1659
|
+
key: "unityCombActive",
|
|
1660
|
+
get: function get() {
|
|
1661
|
+
return !!this._overlayImage;
|
|
1662
|
+
}
|
|
1657
1663
|
}, {
|
|
1658
1664
|
key: "initSelectionHandler",
|
|
1659
1665
|
value: function initSelectionHandler(onElementSelected) {
|
|
@@ -3069,21 +3075,22 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
3069
3075
|
var parser = /*#__PURE__*/function () {
|
|
3070
3076
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
3071
3077
|
var _changedElements$upda;
|
|
3072
|
-
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, sizeDiff;
|
|
3078
|
+
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;
|
|
3073
3079
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3074
3080
|
while (1) switch (_context.prev = _context.next) {
|
|
3075
3081
|
case 0:
|
|
3076
3082
|
sceneStore = useSceneStoreContext();
|
|
3077
3083
|
hasRendered = sceneStore.hasRendered, hqRenderScript = sceneStore.hqRenderScript, scene = sceneStore.scene, cache = sceneStore.cache, changedElements = sceneStore.changedElements;
|
|
3078
3084
|
utilStore = useUtilStoreContext();
|
|
3085
|
+
uiStore = useUIStoreContext();
|
|
3079
3086
|
wasPlanned = sceneStore.hasPlanned;
|
|
3080
3087
|
elementCount = sceneStore.elements.length; //disable elementrows from old cache
|
|
3081
3088
|
changedElements === null || changedElements === void 0 || (_changedElements$upda = changedElements.updatedElements) === null || _changedElements$upda === void 0 || _changedElements$upda.forEach(function (el) {
|
|
3082
3089
|
return utilStore.disableElementRows(el.name, cache);
|
|
3083
3090
|
});
|
|
3084
|
-
_context.next =
|
|
3091
|
+
_context.next = 9;
|
|
3085
3092
|
return findAssets(hqRenderScript.assets, cache);
|
|
3086
|
-
case
|
|
3093
|
+
case 9:
|
|
3087
3094
|
_yield$findAssets = _context.sent;
|
|
3088
3095
|
cacheGroup = _yield$findAssets.cacheGroup;
|
|
3089
3096
|
newCache = _yield$findAssets.newCache;
|
|
@@ -3124,7 +3131,7 @@ var parser = /*#__PURE__*/function () {
|
|
|
3124
3131
|
// Check if the bounding box is in the frustum
|
|
3125
3132
|
focusedElement = sceneStore.focusedElement;
|
|
3126
3133
|
if (!focusedElement) {
|
|
3127
|
-
_context.next =
|
|
3134
|
+
_context.next = 29;
|
|
3128
3135
|
break;
|
|
3129
3136
|
}
|
|
3130
3137
|
// let focusedNode = scene.getTransformNodeByName(focusedElement.name)!;
|
|
@@ -3145,24 +3152,24 @@ var parser = /*#__PURE__*/function () {
|
|
|
3145
3152
|
_iterator.f();
|
|
3146
3153
|
}
|
|
3147
3154
|
if (focusedNode) {
|
|
3148
|
-
_context.next =
|
|
3155
|
+
_context.next = 23;
|
|
3149
3156
|
break;
|
|
3150
3157
|
}
|
|
3151
3158
|
return _context.abrupt("return");
|
|
3152
|
-
case
|
|
3159
|
+
case 23:
|
|
3153
3160
|
bbox = focusedNode.getHierarchyBoundingVectors();
|
|
3154
3161
|
boundingInfo = new BoundingInfo(bbox.min, bbox.max);
|
|
3155
3162
|
frustumPlanes = Frustum.GetPlanes(scene.activeCamera.getTransformationMatrix());
|
|
3156
3163
|
isInFrustum = boundingInfo.isCompletelyInFrustum(frustumPlanes);
|
|
3157
3164
|
sizeDiff = Vector3$1.Distance(bbox.min, bbox.max) - focusedElement.size;
|
|
3158
|
-
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) {
|
|
3159
|
-
sceneStore.focusElement(focusedNode);
|
|
3160
|
-
} else if (wasPlanned && sceneStore.isControlledViewpoint && (focusedElement.size != 0 && Math.abs(sizeDiff) > 0.09 || !isInFrustum && Math.abs(sizeDiff) > 0) || wasPlanned && elementCount != sceneStore.elements.length) {
|
|
3165
|
+
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)) {
|
|
3161
3166
|
sceneStore.focusElement(focusedNode);
|
|
3167
|
+
} else if ((wasPlanned || !uiStore.unityCombActive) && elementCount != sceneStore.elements.length) {
|
|
3168
|
+
sceneStore.focusElement();
|
|
3162
3169
|
} else {
|
|
3163
3170
|
updateCam(sceneStore.hqRenderScript.cams[0], sceneStore.scene);
|
|
3164
3171
|
}
|
|
3165
|
-
case
|
|
3172
|
+
case 29:
|
|
3166
3173
|
case "end":
|
|
3167
3174
|
return _context.stop();
|
|
3168
3175
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/createCams/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG1E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIvD,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,KAAK,EAAE,KAAK,EACZ,eAAe,CAAC,EAAE,SAAS,GAAG,gBAAgB,EAC9C,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,GAC5C,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/createCams/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG1E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIvD,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,KAAK,EAAE,KAAK,EACZ,eAAe,CAAC,EAAE,SAAS,GAAG,gBAAgB,EAC9C,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,GAC5C,eAAe,EAAE,CAqGnB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,QAU/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UIStore.d.ts","sourceRoot":"","sources":["../../../../../src/store/UIStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAI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