@crystaldesign/real-time-viewer-next 26.14.0-beta.2 → 26.14.0-beta.21
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/{DeckCutoutSubsystem-ed8fa51b.js → DeckCutoutSubsystem-6aca7b92.js} +1 -1
- package/build/esm/{GpuPassTiming-0366ebe3.js → GpuPassTiming-47d7d14b.js} +1 -1
- package/build/esm/{RoomShell-6844aeb7.js → RoomShell-e9d62ae3.js} +1 -1
- package/build/esm/{SunLensflare-a9b51b28.js → SunLensflare-8e6b2ccb.js} +1 -1
- package/build/esm/{WaterSurface-8e95a363.js → WaterSurface-aa2471d6.js} +1 -1
- package/build/esm/{chipPlacement-ea37d089.js → chipPlacement-f6e598a2.js} +1 -1
- package/build/esm/{coachChunk-dccd0731.js → coachChunk-f22b1ed4.js} +2 -2
- package/build/esm/{doorSwapChunk-98d0c552.js → doorSwapChunk-4ba535c4.js} +2 -2
- package/build/esm/{index-d32454b2.js → index-451a8bb2.js} +1238 -603
- package/build/esm/index.js +1 -1
- package/build/types/real-time-viewer-next/src/capture/applyShot.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/core/SceneRenderer.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/core/camera/cameraIntents.d.ts +6 -0
- package/build/types/real-time-viewer-next/src/core/camera/cameraIntents.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/core/camera/retarget.d.ts +29 -9
- package/build/types/real-time-viewer-next/src/core/camera/retarget.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/core/camera/useCameraActions.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/core/camera/useCameraConstraints.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/core/interaction/ElementOverlay.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/core/interaction/FreeGridLayer.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/core/interaction/overlayChrome.d.ts +10 -0
- package/build/types/real-time-viewer-next/src/core/interaction/overlayChrome.d.ts.map +1 -0
- package/build/types/real-time-viewer-next/src/core/interaction/overlayChrome.test.d.ts +5 -0
- package/build/types/real-time-viewer-next/src/core/interaction/overlayChrome.test.d.ts.map +1 -0
- package/build/types/real-time-viewer-next/src/core/shownScene.d.ts +15 -0
- package/build/types/real-time-viewer-next/src/core/shownScene.d.ts.map +1 -0
- package/build/types/real-time-viewer-next/src/core/shownScene.test.d.ts +2 -0
- package/build/types/real-time-viewer-next/src/core/shownScene.test.d.ts.map +1 -0
- package/build/types/real-time-viewer-next/src/core/view2d/DockingPoints2D.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/hooks/useAssembledScene.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/hooks/useEndGesturesOnUnmount.d.ts +7 -0
- package/build/types/real-time-viewer-next/src/hooks/useEndGesturesOnUnmount.d.ts.map +1 -0
- package/build/types/real-time-viewer-next/src/hooks/useEndGesturesOnUnmount.test.d.ts +5 -0
- package/build/types/real-time-viewer-next/src/hooks/useEndGesturesOnUnmount.test.d.ts.map +1 -0
- package/build/types/real-time-viewer-next/src/hooks/useHostPropsSync.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/publicApi.d.ts +4 -0
- package/build/types/real-time-viewer-next/src/publicApi.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/store/index.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/store/slices/accessory.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/store/slices/camera.d.ts +5 -0
- package/build/types/real-time-viewer-next/src/store/slices/camera.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/store/slices/doorSwap.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/store/slices/interaction.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/store/slices/plannerOperation.d.ts +68 -0
- package/build/types/real-time-viewer-next/src/store/slices/plannerOperation.d.ts.map +1 -0
- package/build/types/real-time-viewer-next/src/store/slices/plannerOperation.test.d.ts +5 -0
- package/build/types/real-time-viewer-next/src/store/slices/plannerOperation.test.d.ts.map +1 -0
- package/build/types/real-time-viewer-next/src/store/slices/selection.d.ts +6 -0
- package/build/types/real-time-viewer-next/src/store/slices/selection.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/store/types.d.ts +16 -9
- package/build/types/real-time-viewer-next/src/store/types.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/types/environment.d.ts +1 -1
- package/build/types/real-time-viewer-next/src/types/environment.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/utils/cameraFraming.d.ts +9 -1
- package/build/types/real-time-viewer-next/src/utils/cameraFraming.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/utils/collisionTargets.d.ts +2 -0
- package/build/types/real-time-viewer-next/src/utils/collisionTargets.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/utils/detectDeviceTier.d.ts +2 -3
- package/build/types/real-time-viewer-next/src/utils/detectDeviceTier.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/utils/focusVisibility.d.ts +45 -4
- package/build/types/real-time-viewer-next/src/utils/focusVisibility.d.ts.map +1 -1
- package/build/types/real-time-viewer-next/src/utils/whiteRoomPreset.d.ts.map +1 -1
- package/build/umd/114.real-time-viewer-next.umd.min.js +1 -1
- package/build/umd/{216.real-time-viewer-next.umd.min.js → 177.real-time-viewer-next.umd.min.js} +2 -2
- package/build/umd/177.real-time-viewer-next.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{674.real-time-viewer-next.umd.min.js → 187.real-time-viewer-next.umd.min.js} +2 -2
- package/build/umd/187.real-time-viewer-next.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{469.real-time-viewer-next.umd.min.js → 207.real-time-viewer-next.umd.min.js} +2 -2
- package/build/umd/207.real-time-viewer-next.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{402.real-time-viewer-next.umd.min.js → 391.real-time-viewer-next.umd.min.js} +2 -2
- package/build/umd/391.real-time-viewer-next.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{463.real-time-viewer-next.umd.min.js → 422.real-time-viewer-next.umd.min.js} +2 -2
- package/build/umd/422.real-time-viewer-next.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{733.real-time-viewer-next.umd.min.js → 498.real-time-viewer-next.umd.min.js} +2 -2
- package/build/umd/498.real-time-viewer-next.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/real-time-viewer-next.umd.min.js +1 -1
- package/build/umd/report.html +1 -1
- package/package.json +2 -2
- package/build/umd/216.real-time-viewer-next.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/402.real-time-viewer-next.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/463.real-time-viewer-next.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/469.real-time-viewer-next.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/674.real-time-viewer-next.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/733.real-time-viewer-next.umd.min.js.LICENSE.txt +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, lazy, Suspense, useEffect, createContext, useContext, useRef, useLayoutEffect, useState, useCallback, memo, Component, useDeferredValue } from 'react';
|
|
2
2
|
import { useThree, useFrame, events, useLoader, useStore, addEffect, addTail, _roots, Canvas } from '@react-three/fiber';
|
|
3
|
-
import { Vector3, Matrix4, Scene, Box3, Texture, Source, ImageLoader, Mesh, MeshStandardMaterial, InterleavedBufferAttribute, TextureLoader, RepeatWrapping, SRGBColorSpace, DataTexture, RGBAFormat, LinearFilter, LinearMipmapLinearFilter, Vector4, Vector2, MeshPhysicalMaterial, Color, PlaneGeometry, Quaternion, LessEqualDepth, Group, Plane, Raycaster, ShaderMaterial, DoubleSide, BufferGeometry, Float32BufferAttribute, Euler, InstancedInterleavedBuffer, Triangle, Spherical, PerspectiveCamera, MathUtils,
|
|
3
|
+
import { Vector3, Matrix4, Scene, Box3, Texture, Source, ImageLoader, Mesh, MeshStandardMaterial, InterleavedBufferAttribute, TextureLoader, RepeatWrapping, SRGBColorSpace, DataTexture, RGBAFormat, LinearFilter, LinearMipmapLinearFilter, Vector4, Vector2, MeshPhysicalMaterial, Color, PlaneGeometry, Quaternion, LessEqualDepth, Group, Plane, Raycaster, ShaderMaterial, DoubleSide, BufferGeometry, Float32BufferAttribute, Euler, InstancedInterleavedBuffer, Sphere, Triangle, Spherical, PerspectiveCamera, MathUtils, MOUSE, TOUCH, CanvasTexture, HalfFloatType, EquirectangularReflectionMapping, PMREMGenerator, WebGLRenderTarget, OrthographicCamera, MeshBasicMaterial, SphereGeometry, CircleGeometry, BackSide, NoToneMapping, Points, LineSegments, Line as Line$1, Camera, FloatType, NearestFilter, FileLoader } from 'three';
|
|
4
4
|
import { getLogger, DivaError, useDivaCore } from '@crystaldesign/diva-core';
|
|
5
5
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
6
6
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
@@ -78,9 +78,9 @@ function hashString(text) {
|
|
|
78
78
|
return "".concat(text.length, ":").concat(h1, ":").concat(h2);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
function _createForOfIteratorHelper$
|
|
82
|
-
function _unsupportedIterableToArray$
|
|
83
|
-
function _arrayLikeToArray$
|
|
81
|
+
function _createForOfIteratorHelper$1c(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1c(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; } } }; }
|
|
82
|
+
function _unsupportedIterableToArray$1c(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1c(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$1c(r, a) : void 0; } }
|
|
83
|
+
function _arrayLikeToArray$1c(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; }
|
|
84
84
|
var cache = new Map();
|
|
85
85
|
/** Bumped by {@link clearSuspenseCache}; a run that started in an older one may not write. */
|
|
86
86
|
var generation = 0;
|
|
@@ -106,7 +106,7 @@ function evictSettledOverflow() {
|
|
|
106
106
|
// Settled entries alone count against the budget — a pending burst must neither shrink the
|
|
107
107
|
// retained-results window nor trigger eviction by itself.
|
|
108
108
|
var settled = 0;
|
|
109
|
-
var _iterator = _createForOfIteratorHelper$
|
|
109
|
+
var _iterator = _createForOfIteratorHelper$1c(cache.values()),
|
|
110
110
|
_step;
|
|
111
111
|
try {
|
|
112
112
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -120,7 +120,7 @@ function evictSettledOverflow() {
|
|
|
120
120
|
}
|
|
121
121
|
if (settled <= MAX_SETTLED_ENTRIES) return;
|
|
122
122
|
var now = performance.now();
|
|
123
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
123
|
+
var _iterator2 = _createForOfIteratorHelper$1c(cache),
|
|
124
124
|
_step2;
|
|
125
125
|
try {
|
|
126
126
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -206,11 +206,11 @@ function clearSuspenseCache() {
|
|
|
206
206
|
cache.clear();
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
function _createForOfIteratorHelper$
|
|
210
|
-
function _unsupportedIterableToArray$
|
|
211
|
-
function _arrayLikeToArray$
|
|
209
|
+
function _createForOfIteratorHelper$1b(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1b(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; } } }; }
|
|
210
|
+
function _unsupportedIterableToArray$1b(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1b(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$1b(r, a) : void 0; } }
|
|
211
|
+
function _arrayLikeToArray$1b(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; }
|
|
212
212
|
getLogger('RealTimeViewer', 'parseRenderScript');
|
|
213
|
-
var DEG_TO_RAD$
|
|
213
|
+
var DEG_TO_RAD$8 = Math.PI / 180;
|
|
214
214
|
var _geoAssetIndex = new WeakMap();
|
|
215
215
|
|
|
216
216
|
/**
|
|
@@ -282,7 +282,7 @@ function resolveGeoUrls(geos, baseUrl) {
|
|
|
282
282
|
* to Three.js Euler radians.
|
|
283
283
|
*/
|
|
284
284
|
function nodeRotationToRadians(rot) {
|
|
285
|
-
return [-rot.x * DEG_TO_RAD$
|
|
285
|
+
return [-rot.x * DEG_TO_RAD$8, -rot.y * DEG_TO_RAD$8, rot.z * DEG_TO_RAD$8];
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
/**
|
|
@@ -291,7 +291,7 @@ function nodeRotationToRadians(rot) {
|
|
|
291
291
|
*/
|
|
292
292
|
function geoRotationToRadians(rot, isIDM3D) {
|
|
293
293
|
var x = isIDM3D && rot.x !== 0 ? 90 - rot.x : -rot.x;
|
|
294
|
-
return [x * DEG_TO_RAD$
|
|
294
|
+
return [x * DEG_TO_RAD$8, -rot.y * DEG_TO_RAD$8, -rot.z * DEG_TO_RAD$8];
|
|
295
295
|
}
|
|
296
296
|
function walkNode(hqsNode, allGeos) {
|
|
297
297
|
var _hqsNode$nodes, _hqsNode$geos, _hqsNode$mats;
|
|
@@ -331,7 +331,7 @@ function collectGeoRefs(geosList, allGeos) {
|
|
|
331
331
|
position: [geos.pos.x / 100, geos.pos.y / 100, geos.pos.z / 100],
|
|
332
332
|
rotation: geoRotationToRadians(geos.rot, isIDM3D)
|
|
333
333
|
});
|
|
334
|
-
var _iterator = _createForOfIteratorHelper$
|
|
334
|
+
var _iterator = _createForOfIteratorHelper$1b((_geos$geos = geos.geos) !== null && _geos$geos !== void 0 ? _geos$geos : []),
|
|
335
335
|
_step;
|
|
336
336
|
try {
|
|
337
337
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -344,7 +344,7 @@ function collectGeoRefs(geosList, allGeos) {
|
|
|
344
344
|
_iterator.f();
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
347
|
+
var _iterator2 = _createForOfIteratorHelper$1b(geosList),
|
|
348
348
|
_step2;
|
|
349
349
|
try {
|
|
350
350
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -425,11 +425,11 @@ function getHostCallbacks() {
|
|
|
425
425
|
return hostCallbacks;
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
-
function _createForOfIteratorHelper$
|
|
429
|
-
function _unsupportedIterableToArray$
|
|
430
|
-
function _arrayLikeToArray$
|
|
431
|
-
function ownKeys$
|
|
432
|
-
function _objectSpread$
|
|
428
|
+
function _createForOfIteratorHelper$1a(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1a(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; } } }; }
|
|
429
|
+
function _unsupportedIterableToArray$1a(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1a(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$1a(r, a) : void 0; } }
|
|
430
|
+
function _arrayLikeToArray$1a(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; }
|
|
431
|
+
function ownKeys$G(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
432
|
+
function _objectSpread$G(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$G(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$G(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
433
433
|
var ACCGRID_LOG$1 = getLogger('RealTimeViewer', 'AccGrid');
|
|
434
434
|
|
|
435
435
|
/**
|
|
@@ -452,7 +452,7 @@ function replacePlaceholderBoxes(allGrids) {
|
|
|
452
452
|
return box.x <= PLACEHOLDER_BOX_CM && box.y <= PLACEHOLDER_BOX_CM && box.z <= PLACEHOLDER_BOX_CM;
|
|
453
453
|
};
|
|
454
454
|
return allGrids.map(function (element) {
|
|
455
|
-
return _objectSpread$
|
|
455
|
+
return _objectSpread$G(_objectSpread$G({}, element), {}, {
|
|
456
456
|
accessories: element.accessories.map(function (entry) {
|
|
457
457
|
var size = entry.gridPositionSize;
|
|
458
458
|
if (!entry.geo || !isPlaceholder(entry.geo.geoBboxSize) || !size || isPlaceholder(size)) return entry;
|
|
@@ -461,8 +461,8 @@ function replacePlaceholderBoxes(allGrids) {
|
|
|
461
461
|
y: Math.max(size.y, PLACEHOLDER_BOX_CM),
|
|
462
462
|
z: Math.max(size.z, PLACEHOLDER_BOX_CM)
|
|
463
463
|
};
|
|
464
|
-
return _objectSpread$
|
|
465
|
-
geo: _objectSpread$
|
|
464
|
+
return _objectSpread$G(_objectSpread$G({}, entry), {}, {
|
|
465
|
+
geo: _objectSpread$G(_objectSpread$G({}, entry.geo), {}, {
|
|
466
466
|
geoBboxSize: geoBboxSize
|
|
467
467
|
})
|
|
468
468
|
});
|
|
@@ -509,7 +509,7 @@ function buildCacheKey(_ref7) {
|
|
|
509
509
|
}
|
|
510
510
|
return shelf;
|
|
511
511
|
};
|
|
512
|
-
var _iterator = _createForOfIteratorHelper$
|
|
512
|
+
var _iterator = _createForOfIteratorHelper$1a(planned),
|
|
513
513
|
_step;
|
|
514
514
|
try {
|
|
515
515
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -521,7 +521,7 @@ function buildCacheKey(_ref7) {
|
|
|
521
521
|
gridName = _Object$entries$_i[0],
|
|
522
522
|
grid = _Object$entries$_i[1];
|
|
523
523
|
shelf.grids.add(gridName);
|
|
524
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
524
|
+
var _iterator3 = _createForOfIteratorHelper$1a(grid.accessories),
|
|
525
525
|
_step3;
|
|
526
526
|
try {
|
|
527
527
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -540,7 +540,7 @@ function buildCacheKey(_ref7) {
|
|
|
540
540
|
} finally {
|
|
541
541
|
_iterator.f();
|
|
542
542
|
}
|
|
543
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
543
|
+
var _iterator2 = _createForOfIteratorHelper$1a(freePlaces),
|
|
544
544
|
_step2;
|
|
545
545
|
try {
|
|
546
546
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -612,7 +612,7 @@ function _fetchGridGeometry() {
|
|
|
612
612
|
_context.prev = 12;
|
|
613
613
|
// The server resolves the catalog from the body's first entry, not the query params.
|
|
614
614
|
bodyFree = freePlaces.map(function (f) {
|
|
615
|
-
return _objectSpread$
|
|
615
|
+
return _objectSpread$G(_objectSpread$G({}, f), {}, {
|
|
616
616
|
catalogCodex: catalogCodex,
|
|
617
617
|
iln: iln
|
|
618
618
|
});
|
|
@@ -620,7 +620,7 @@ function _fetchGridGeometry() {
|
|
|
620
620
|
_context.next = 16;
|
|
621
621
|
return fetch(url, {
|
|
622
622
|
method: 'POST',
|
|
623
|
-
headers: _objectSpread$
|
|
623
|
+
headers: _objectSpread$G({
|
|
624
624
|
'Content-Type': 'application/json'
|
|
625
625
|
}, jwt ? {
|
|
626
626
|
Authorization: "Bearer ".concat(jwt)
|
|
@@ -835,10 +835,10 @@ var sameElement = function sameElement(a, b) {
|
|
|
835
835
|
return a.setId === b.setId && a.elementId === b.elementId;
|
|
836
836
|
};
|
|
837
837
|
|
|
838
|
-
function _createForOfIteratorHelper$
|
|
839
|
-
function _unsupportedIterableToArray$
|
|
840
|
-
function _arrayLikeToArray$
|
|
841
|
-
var LOG$
|
|
838
|
+
function _createForOfIteratorHelper$19(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$19(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; } } }; }
|
|
839
|
+
function _unsupportedIterableToArray$19(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$19(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$19(r, a) : void 0; } }
|
|
840
|
+
function _arrayLikeToArray$19(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; }
|
|
841
|
+
var LOG$z = getLogger('RealTimeViewer', 'AccGrid');
|
|
842
842
|
var CM$2 = 1 / 100;
|
|
843
843
|
|
|
844
844
|
/** Calibration knobs — flip these against placed-accessory ground truth. */
|
|
@@ -873,7 +873,7 @@ function freePlaceMatchesNode(nodeName, freeElementId, gridSetId) {
|
|
|
873
873
|
function resolveFreeCellsForElement(freePlaces, allGrids, elementNodeName, gridSetId) {
|
|
874
874
|
if (!freePlaces || !allGrids) return [];
|
|
875
875
|
var cells = [];
|
|
876
|
-
var _iterator = _createForOfIteratorHelper$
|
|
876
|
+
var _iterator = _createForOfIteratorHelper$19(freePlaces),
|
|
877
877
|
_step;
|
|
878
878
|
try {
|
|
879
879
|
var _loop = function _loop() {
|
|
@@ -884,7 +884,7 @@ function resolveFreeCellsForElement(freePlaces, allGrids, elementNodeName, gridS
|
|
|
884
884
|
return g.elementId === free.elementId;
|
|
885
885
|
});
|
|
886
886
|
if (!gridsForElement) {
|
|
887
|
-
LOG$
|
|
887
|
+
LOG$z.debug("[ACCGRID] resolve \"".concat(elementNodeName, "\": matched free.elementId=").concat(free.elementId, " but NO geometry entry for it (geometry has [").concat(allGrids.map(function (g) {
|
|
888
888
|
return g.elementId;
|
|
889
889
|
}).join(','), "])"));
|
|
890
890
|
return 0; // continue
|
|
@@ -893,7 +893,7 @@ function resolveFreeCellsForElement(freePlaces, allGrids, elementNodeName, gridS
|
|
|
893
893
|
return a.artNr === free.accessoire3DName;
|
|
894
894
|
})) === null || _gridsForElement$acce === void 0 ? void 0 : _gridsForElement$acce.geo;
|
|
895
895
|
if (!geo) {
|
|
896
|
-
LOG$
|
|
896
|
+
LOG$z.debug("[ACCGRID] resolve \"".concat(elementNodeName, "\": no accessory geo for \"").concat(free.accessoire3DName, "\" (have [").concat(gridsForElement.accessories.map(function (a) {
|
|
897
897
|
return a.artNr;
|
|
898
898
|
}).join(','), "])"));
|
|
899
899
|
return 0; // continue
|
|
@@ -907,12 +907,12 @@ function resolveFreeCellsForElement(freePlaces, allGrids, elementNodeName, gridS
|
|
|
907
907
|
return g.gridName === gridName;
|
|
908
908
|
});
|
|
909
909
|
if (!gridDef) {
|
|
910
|
-
LOG$
|
|
910
|
+
LOG$z.debug("[ACCGRID] resolve \"".concat(elementNodeName, "\": no gridDef for gridName=\"").concat(gridName, "\" (have [").concat(gridsForElement.grids.map(function (g) {
|
|
911
911
|
return g.gridName;
|
|
912
912
|
}).join(','), "])"));
|
|
913
913
|
return 0; // continue
|
|
914
914
|
}
|
|
915
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
915
|
+
var _iterator2 = _createForOfIteratorHelper$19(freeGrid.freeCells),
|
|
916
916
|
_step2;
|
|
917
917
|
try {
|
|
918
918
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -966,7 +966,7 @@ function resolveNestedPreview(preview, geometry) {
|
|
|
966
966
|
return g.gridName === gridName;
|
|
967
967
|
});
|
|
968
968
|
if (!gridDef) return 1; // continue
|
|
969
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
969
|
+
var _iterator3 = _createForOfIteratorHelper$19(grid.accessories),
|
|
970
970
|
_step3;
|
|
971
971
|
try {
|
|
972
972
|
var _loop4 = function _loop4() {
|
|
@@ -1026,7 +1026,7 @@ function pickDefaultPlacementCell(cells, allGrids) {
|
|
|
1026
1026
|
// Group by element+grid, preserving first-seen order (the order free cells arrive in).
|
|
1027
1027
|
var groups = new Map();
|
|
1028
1028
|
var order = [];
|
|
1029
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
1029
|
+
var _iterator4 = _createForOfIteratorHelper$19(cells),
|
|
1030
1030
|
_step4;
|
|
1031
1031
|
try {
|
|
1032
1032
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -1071,7 +1071,7 @@ function pickDefaultPlacementCell(cells, allGrids) {
|
|
|
1071
1071
|
}))) + 1;
|
|
1072
1072
|
var gapCells = requireGap ? Math.max(1, Math.round(count * PLACEMENT.gapFraction)) : 0;
|
|
1073
1073
|
var freeByIdx = new Map();
|
|
1074
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
1074
|
+
var _iterator5 = _createForOfIteratorHelper$19(g),
|
|
1075
1075
|
_step5;
|
|
1076
1076
|
try {
|
|
1077
1077
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -1112,7 +1112,7 @@ function pickDefaultPlacementCell(cells, allGrids) {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
// Last resort (no geometry, or every grid full under the constraints): topmost free cell.
|
|
1114
1114
|
var best = null;
|
|
1115
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
1115
|
+
var _iterator6 = _createForOfIteratorHelper$19(cells),
|
|
1116
1116
|
_step6;
|
|
1117
1117
|
try {
|
|
1118
1118
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -1139,7 +1139,7 @@ function pickArmedPlacementCell(freePlaces, allGrids, armedCodex) {
|
|
|
1139
1139
|
var codexes = new Set([armedCodex].concat(_toConsumableArray(freePlaces.map(function (f) {
|
|
1140
1140
|
return f.articleCodex;
|
|
1141
1141
|
}))));
|
|
1142
|
-
var _iterator7 = _createForOfIteratorHelper$
|
|
1142
|
+
var _iterator7 = _createForOfIteratorHelper$19(codexes),
|
|
1143
1143
|
_step7;
|
|
1144
1144
|
try {
|
|
1145
1145
|
var _loop5 = function _loop5() {
|
|
@@ -1241,11 +1241,166 @@ function resolveCell(elementId, gridDef, geo, cellIdx, gridIdx, gridName, parent
|
|
|
1241
1241
|
};
|
|
1242
1242
|
}
|
|
1243
1243
|
|
|
1244
|
-
function
|
|
1245
|
-
function
|
|
1246
|
-
|
|
1244
|
+
function ownKeys$F(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1245
|
+
function _objectSpread$F(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$F(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$F(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1246
|
+
var LOG$y = getLogger('RealTimeViewer', 'RTV-Next');
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* What a planner operation does to the planning: an element or accessory moved or turned, added (also a copy), deleted,
|
|
1250
|
+
* or an option of it changed in the configurator.
|
|
1251
|
+
*/
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* What an operation callback returns, or its promise resolves to: `false` when the host changed nothing, so no new scene
|
|
1255
|
+
* follows (e.g. the accessory it names is gone); anything else when a re-render follows.
|
|
1256
|
+
*/
|
|
1257
|
+
|
|
1258
|
+
/** How {@link PlannerOperationSlice.sendOperation} sends an operation. */
|
|
1259
|
+
|
|
1260
|
+
/** The planner operation the host is still answering (see {@link PlannerOperationSlice}). */
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* One planner operation at a time. The host answers a move, an add or a delete asynchronously (the configurator
|
|
1264
|
+
* recalculates, the view re-assembles the scene); a second operation sent meanwhile is built on the planning the first
|
|
1265
|
+
* one is still changing, and the two undock articles or drop elements from the planning. So each operation sent to the
|
|
1266
|
+
* host holds the others back until the host has finished it (its promise settled) and the view shows its answer. A
|
|
1267
|
+
* failure ends it at once; a re-render that does not arrive is waited for `OPERATION_TIMEOUT_MS` at most. A drag, turn
|
|
1268
|
+
* or accessory move in progress holds new operations back as well: its END would otherwise reach a changed planning.
|
|
1269
|
+
*/
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* The longest the planner waits for the re-render once the host has finished an operation: the render script and the
|
|
1273
|
+
* re-assembly of a large planning can take several seconds, and a lock released before the answer lets the conflict
|
|
1274
|
+
* through again. While the host still works on the operation, nothing releases the lock but the host's own answer.
|
|
1275
|
+
*/
|
|
1276
|
+
var OPERATION_TIMEOUT_MS = 10000;
|
|
1277
|
+
var operationTimer = null;
|
|
1278
|
+
var lastOperationId = 0;
|
|
1279
|
+
function isThenable(value) {
|
|
1280
|
+
return _typeof(value) === 'object' && value !== null && 'then' in value && typeof value.then === 'function';
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/** A drag, turn or accessory move in progress: its END is still to come. */
|
|
1284
|
+
function gestureInProgress(s) {
|
|
1285
|
+
return s.isDragging || s.isRotating || s.accessoryMove != null;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
/** Whether a new operation is held back: one is pending, or a gesture is in progress. */
|
|
1289
|
+
function isOperationBlocked(s) {
|
|
1290
|
+
return s.pendingOperation != null || gestureInProgress(s);
|
|
1291
|
+
}
|
|
1292
|
+
var createPlannerOperationSlice = function createPlannerOperationSlice(set, get) {
|
|
1293
|
+
/** Marks the operation `id` settled or answered; it ends once it is both. */
|
|
1294
|
+
var progress = function progress(id, patch) {
|
|
1295
|
+
var op = get().pendingOperation;
|
|
1296
|
+
if ((op === null || op === void 0 ? void 0 : op.id) !== id) return;
|
|
1297
|
+
var next = _objectSpread$F(_objectSpread$F({}, op), patch);
|
|
1298
|
+
if (next.settled && next.answered) {
|
|
1299
|
+
get().endOperation();
|
|
1300
|
+
return;
|
|
1301
|
+
}
|
|
1302
|
+
set({
|
|
1303
|
+
pendingOperation: next
|
|
1304
|
+
});
|
|
1305
|
+
// The host has finished: from here only the re-render is awaited, and not forever.
|
|
1306
|
+
if (next.settled && !op.settled) {
|
|
1307
|
+
operationTimer = setTimeout(function () {
|
|
1308
|
+
var _get$pendingOperation;
|
|
1309
|
+
LOG$y.warn("[OP] ".concat(op.kind, ": no re-render within ").concat(OPERATION_TIMEOUT_MS, " ms, the planner takes the next operation"));
|
|
1310
|
+
if (((_get$pendingOperation = get().pendingOperation) === null || _get$pendingOperation === void 0 ? void 0 : _get$pendingOperation.id) === id) get().endOperation();
|
|
1311
|
+
}, OPERATION_TIMEOUT_MS);
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1314
|
+
/** The host has finished the operation `id`; `result` false: it changed nothing, no re-render follows. */
|
|
1315
|
+
var settle = function settle(id, result) {
|
|
1316
|
+
return progress(id, result === false ? {
|
|
1317
|
+
settled: true,
|
|
1318
|
+
answered: true
|
|
1319
|
+
} : {
|
|
1320
|
+
settled: true
|
|
1321
|
+
});
|
|
1322
|
+
};
|
|
1323
|
+
var fail = function fail(id, err) {
|
|
1324
|
+
var _get$pendingOperation2;
|
|
1325
|
+
LOG$y.error(err instanceof Error ? err : new Error("planner operation failed: ".concat(String(err))));
|
|
1326
|
+
if (((_get$pendingOperation2 = get().pendingOperation) === null || _get$pendingOperation2 === void 0 ? void 0 : _get$pendingOperation2.id) === id) get().endOperation();
|
|
1327
|
+
};
|
|
1328
|
+
return {
|
|
1329
|
+
pendingOperation: null,
|
|
1330
|
+
sendOperation: function sendOperation(kind, send, options) {
|
|
1331
|
+
var _options$expectsScene;
|
|
1332
|
+
var pending = get().pendingOperation;
|
|
1333
|
+
if (pending) {
|
|
1334
|
+
LOG$y.debug("[OP] ".concat(kind, " refused: the host is still answering a ").concat(pending.kind));
|
|
1335
|
+
return false;
|
|
1336
|
+
}
|
|
1337
|
+
if (!(options !== null && options !== void 0 && options.endsGesture) && gestureInProgress(get())) {
|
|
1338
|
+
LOG$y.debug("[OP] ".concat(kind, " refused: a drag, turn or accessory move is in progress"));
|
|
1339
|
+
return false;
|
|
1340
|
+
}
|
|
1341
|
+
var id = ++lastOperationId;
|
|
1342
|
+
var scene = get().scene;
|
|
1343
|
+
var expectsScene = (_options$expectsScene = options === null || options === void 0 ? void 0 : options.expectsScene) !== null && _options$expectsScene !== void 0 ? _options$expectsScene : true;
|
|
1344
|
+
set({
|
|
1345
|
+
pendingOperation: {
|
|
1346
|
+
id: id,
|
|
1347
|
+
kind: kind,
|
|
1348
|
+
scene: scene,
|
|
1349
|
+
settled: false,
|
|
1350
|
+
answered: scene === null || !expectsScene
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
if (operationTimer) clearTimeout(operationTimer);
|
|
1354
|
+
operationTimer = null;
|
|
1355
|
+
var result;
|
|
1356
|
+
try {
|
|
1357
|
+
result = send();
|
|
1358
|
+
} catch (err) {
|
|
1359
|
+
fail(id, err);
|
|
1360
|
+
return true;
|
|
1361
|
+
}
|
|
1362
|
+
if (isThenable(result)) {
|
|
1363
|
+
result.then(function (value) {
|
|
1364
|
+
return settle(id, value);
|
|
1365
|
+
}, function (err) {
|
|
1366
|
+
return fail(id, err);
|
|
1367
|
+
});
|
|
1368
|
+
} else {
|
|
1369
|
+
settle(id, result);
|
|
1370
|
+
}
|
|
1371
|
+
return true;
|
|
1372
|
+
},
|
|
1373
|
+
endOperation: function endOperation() {
|
|
1374
|
+
if (operationTimer) clearTimeout(operationTimer);
|
|
1375
|
+
operationTimer = null;
|
|
1376
|
+
if (!get().pendingOperation) return;
|
|
1377
|
+
set({
|
|
1378
|
+
pendingOperation: null
|
|
1379
|
+
});
|
|
1380
|
+
},
|
|
1381
|
+
operationSceneRendered: function operationSceneRendered(scene) {
|
|
1382
|
+
var op = get().pendingOperation;
|
|
1383
|
+
// Only the store's newest scene counts: an older one still loading behind the shown one is not the answer.
|
|
1384
|
+
if (!op || op.answered || scene === op.scene || scene !== get().scene) return;
|
|
1385
|
+
progress(op.id, {
|
|
1386
|
+
answered: true
|
|
1387
|
+
});
|
|
1388
|
+
},
|
|
1389
|
+
operationSceneUnchanged: function operationSceneUnchanged() {
|
|
1390
|
+
var op = get().pendingOperation;
|
|
1391
|
+
if (op && !op.answered) progress(op.id, {
|
|
1392
|
+
answered: true
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
};
|
|
1396
|
+
};
|
|
1397
|
+
|
|
1398
|
+
function _createForOfIteratorHelper$18(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$18(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; } } }; }
|
|
1399
|
+
function _unsupportedIterableToArray$18(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$18(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$18(r, a) : void 0; } }
|
|
1400
|
+
function _arrayLikeToArray$18(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; }
|
|
1247
1401
|
function ownKeys$E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1248
1402
|
function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1403
|
+
|
|
1249
1404
|
/** Dedicated logger for the ShelfPlanner accessory-grid pipeline. Filter the console for `[ACCGRID]`. */
|
|
1250
1405
|
var ACCGRID_LOG = getLogger('RealTimeViewer', 'AccGrid');
|
|
1251
1406
|
|
|
@@ -1494,35 +1649,44 @@ var createAccessoryMoveSlice = function createAccessoryMoveSlice(set, get) {
|
|
|
1494
1649
|
return _regeneratorRuntime.wrap(function _callee3$(_context4) {
|
|
1495
1650
|
while (1) switch (_context4.prev = _context4.next) {
|
|
1496
1651
|
case 0:
|
|
1497
|
-
if (!
|
|
1652
|
+
if (!get().pendingOperation) {
|
|
1498
1653
|
_context4.next = 3;
|
|
1499
1654
|
break;
|
|
1500
1655
|
}
|
|
1501
|
-
ACCGRID_LOG.debug('[ACCMOVE] startAccessoryMove: refused while the
|
|
1656
|
+
ACCGRID_LOG.debug('[ACCMOVE] startAccessoryMove: refused while the host answers another operation', {
|
|
1502
1657
|
ref: ref
|
|
1503
1658
|
});
|
|
1504
1659
|
return _context4.abrupt("return", false);
|
|
1505
1660
|
case 3:
|
|
1661
|
+
if (!(get().committedMove || get().committedVariant)) {
|
|
1662
|
+
_context4.next = 6;
|
|
1663
|
+
break;
|
|
1664
|
+
}
|
|
1665
|
+
ACCGRID_LOG.debug('[ACCMOVE] startAccessoryMove: refused while the last move waits for its re-render', {
|
|
1666
|
+
ref: ref
|
|
1667
|
+
});
|
|
1668
|
+
return _context4.abrupt("return", false);
|
|
1669
|
+
case 6:
|
|
1506
1670
|
// `accessoryMove` stays null for the whole host round trip below, so "was this cancelled while
|
|
1507
1671
|
// we awaited?" cannot be answered from the state itself - a cancel and a never-started move look
|
|
1508
1672
|
// identical. The generation counter makes them distinguishable.
|
|
1509
1673
|
startedGeneration = ++accessoryMoveGeneration;
|
|
1510
|
-
_context4.next =
|
|
1674
|
+
_context4.next = 9;
|
|
1511
1675
|
return Promise.resolve((_getHostCallbacks$onA = (_getHostCallbacks = getHostCallbacks()).onAccessoryMoveStart) === null || _getHostCallbacks$onA === void 0 ? void 0 : _getHostCallbacks$onA.call(_getHostCallbacks, ref))["catch"](function (err) {
|
|
1512
1676
|
ACCGRID_LOG.error(err instanceof Error ? err : new Error("[ACCMOVE] onAccessoryMoveStart failed: ".concat(String(err))));
|
|
1513
1677
|
return undefined;
|
|
1514
1678
|
});
|
|
1515
|
-
case
|
|
1679
|
+
case 9:
|
|
1516
1680
|
raw = _context4.sent;
|
|
1517
1681
|
if (raw) {
|
|
1518
|
-
_context4.next =
|
|
1682
|
+
_context4.next = 13;
|
|
1519
1683
|
break;
|
|
1520
1684
|
}
|
|
1521
1685
|
ACCGRID_LOG.debug('[ACCMOVE] startAccessoryMove: no free-to-move data', {
|
|
1522
1686
|
ref: ref
|
|
1523
1687
|
});
|
|
1524
1688
|
return _context4.abrupt("return", false);
|
|
1525
|
-
case
|
|
1689
|
+
case 13:
|
|
1526
1690
|
// Deep-copy (we mutate freeCells) and inject the accessory's CURRENT cell so it can be dropped
|
|
1527
1691
|
// back onto its original spot. `getFreeToMovePlacesOnGrids` excludes the occupied cell. The
|
|
1528
1692
|
// result holds the OWN variant's cells first, then the other family members' (each tagged with
|
|
@@ -1548,70 +1712,76 @@ var createAccessoryMoveSlice = function createAccessoryMoveSlice(set, get) {
|
|
|
1548
1712
|
});
|
|
1549
1713
|
ownArticleCodex = (_raw$ = raw[0]) === null || _raw$ === void 0 ? void 0 : _raw$.articleCodex;
|
|
1550
1714
|
// Only the OWN entry gets the current cell; whether a family sibling fits it is the host's call.
|
|
1551
|
-
_iterator = _createForOfIteratorHelper$
|
|
1552
|
-
_context4.prev =
|
|
1715
|
+
_iterator = _createForOfIteratorHelper$18(freePlaces);
|
|
1716
|
+
_context4.prev = 17;
|
|
1553
1717
|
_iterator.s();
|
|
1554
|
-
case
|
|
1718
|
+
case 19:
|
|
1555
1719
|
if ((_step = _iterator.n()).done) {
|
|
1556
|
-
_context4.next =
|
|
1720
|
+
_context4.next = 28;
|
|
1557
1721
|
break;
|
|
1558
1722
|
}
|
|
1559
1723
|
entry = _step.value;
|
|
1560
1724
|
if (!(shelfElementKey(entry.elementId) !== ref.parentElementKey || entry.articleCodex !== ownArticleCodex)) {
|
|
1561
|
-
_context4.next =
|
|
1725
|
+
_context4.next = 23;
|
|
1562
1726
|
break;
|
|
1563
1727
|
}
|
|
1564
|
-
return _context4.abrupt("continue",
|
|
1565
|
-
case
|
|
1728
|
+
return _context4.abrupt("continue", 26);
|
|
1729
|
+
case 23:
|
|
1566
1730
|
originBasketId = entry.basketId;
|
|
1567
1731
|
grid = Object.values(entry.grids).find(function (g) {
|
|
1568
1732
|
return g.idx === ref.gridId;
|
|
1569
1733
|
});
|
|
1570
1734
|
if (grid && !grid.freeCells.includes(ref.cellIdx)) grid.freeCells.push(ref.cellIdx);
|
|
1571
|
-
case
|
|
1572
|
-
_context4.next =
|
|
1735
|
+
case 26:
|
|
1736
|
+
_context4.next = 19;
|
|
1573
1737
|
break;
|
|
1574
|
-
case
|
|
1575
|
-
_context4.next =
|
|
1738
|
+
case 28:
|
|
1739
|
+
_context4.next = 33;
|
|
1576
1740
|
break;
|
|
1577
|
-
case 27:
|
|
1578
|
-
_context4.prev = 27;
|
|
1579
|
-
_context4.t0 = _context4["catch"](14);
|
|
1580
|
-
_iterator.e(_context4.t0);
|
|
1581
1741
|
case 30:
|
|
1582
1742
|
_context4.prev = 30;
|
|
1583
|
-
|
|
1584
|
-
|
|
1743
|
+
_context4.t0 = _context4["catch"](17);
|
|
1744
|
+
_iterator.e(_context4.t0);
|
|
1585
1745
|
case 33:
|
|
1746
|
+
_context4.prev = 33;
|
|
1747
|
+
_iterator.f();
|
|
1748
|
+
return _context4.finish(33);
|
|
1749
|
+
case 36:
|
|
1586
1750
|
hasCells = freePlaces.some(function (f) {
|
|
1587
1751
|
return Object.values(f.grids).some(function (g) {
|
|
1588
1752
|
return g.freeCells.length > 0;
|
|
1589
1753
|
});
|
|
1590
1754
|
});
|
|
1591
1755
|
if (hasCells) {
|
|
1592
|
-
_context4.next =
|
|
1756
|
+
_context4.next = 40;
|
|
1593
1757
|
break;
|
|
1594
1758
|
}
|
|
1595
1759
|
ACCGRID_LOG.debug('[ACCMOVE] startAccessoryMove: no free-to-move cells', {
|
|
1596
1760
|
ref: ref
|
|
1597
1761
|
});
|
|
1598
1762
|
return _context4.abrupt("return", false);
|
|
1599
|
-
case
|
|
1763
|
+
case 40:
|
|
1600
1764
|
if (!(startedGeneration !== accessoryMoveGeneration)) {
|
|
1601
|
-
_context4.next =
|
|
1765
|
+
_context4.next = 43;
|
|
1602
1766
|
break;
|
|
1603
1767
|
}
|
|
1604
1768
|
ACCGRID_LOG.debug('[ACCMOVE] startAccessoryMove: superseded or cancelled while awaiting the host', {
|
|
1605
1769
|
ref: ref
|
|
1606
1770
|
});
|
|
1607
1771
|
return _context4.abrupt("return", false);
|
|
1608
|
-
case
|
|
1772
|
+
case 43:
|
|
1773
|
+
if (!get().pendingOperation) {
|
|
1774
|
+
_context4.next = 45;
|
|
1775
|
+
break;
|
|
1776
|
+
}
|
|
1777
|
+
return _context4.abrupt("return", false);
|
|
1778
|
+
case 45:
|
|
1609
1779
|
if (!(get().accessoryMove && ((_get$accessoryMove = get().accessoryMove) === null || _get$accessoryMove === void 0 ? void 0 : _get$accessoryMove.ref) !== ref)) {
|
|
1610
|
-
_context4.next =
|
|
1780
|
+
_context4.next = 47;
|
|
1611
1781
|
break;
|
|
1612
1782
|
}
|
|
1613
1783
|
return _context4.abrupt("return", false);
|
|
1614
|
-
case
|
|
1784
|
+
case 47:
|
|
1615
1785
|
ACCGRID_LOG.debug("[ACCMOVE] startAccessoryMove \"".concat(ref.elementKey, "\" \u2192 free places on ").concat(freePlaces.length, " entry/-ies"));
|
|
1616
1786
|
set({
|
|
1617
1787
|
accessoryMove: {
|
|
@@ -1635,8 +1805,8 @@ var createAccessoryMoveSlice = function createAccessoryMoveSlice(set, get) {
|
|
|
1635
1805
|
if (variantEntries.length > 0) void get().loadGridGeometry(variantEntries);
|
|
1636
1806
|
// What a switch to each sibling carries over of the accessory's own accessories (one preview per codex).
|
|
1637
1807
|
previews = [];
|
|
1638
|
-
_iterator2 = _createForOfIteratorHelper$
|
|
1639
|
-
_context4.prev =
|
|
1808
|
+
_iterator2 = _createForOfIteratorHelper$18(variantEntries);
|
|
1809
|
+
_context4.prev = 53;
|
|
1640
1810
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
1641
1811
|
var _step2$value, articleCodex, nestedPreview;
|
|
1642
1812
|
return _regeneratorRuntime.wrap(function _loop$(_context3) {
|
|
@@ -1656,36 +1826,36 @@ var createAccessoryMoveSlice = function createAccessoryMoveSlice(set, get) {
|
|
|
1656
1826
|
}, _loop);
|
|
1657
1827
|
});
|
|
1658
1828
|
_iterator2.s();
|
|
1659
|
-
case
|
|
1829
|
+
case 56:
|
|
1660
1830
|
if ((_step2 = _iterator2.n()).done) {
|
|
1661
|
-
_context4.next =
|
|
1831
|
+
_context4.next = 60;
|
|
1662
1832
|
break;
|
|
1663
1833
|
}
|
|
1664
|
-
return _context4.delegateYield(_loop(), "t1",
|
|
1665
|
-
case
|
|
1666
|
-
_context4.next =
|
|
1834
|
+
return _context4.delegateYield(_loop(), "t1", 58);
|
|
1835
|
+
case 58:
|
|
1836
|
+
_context4.next = 56;
|
|
1667
1837
|
break;
|
|
1668
|
-
case
|
|
1669
|
-
_context4.next =
|
|
1838
|
+
case 60:
|
|
1839
|
+
_context4.next = 65;
|
|
1670
1840
|
break;
|
|
1671
|
-
case
|
|
1672
|
-
_context4.prev =
|
|
1673
|
-
_context4.t2 = _context4["catch"](
|
|
1841
|
+
case 62:
|
|
1842
|
+
_context4.prev = 62;
|
|
1843
|
+
_context4.t2 = _context4["catch"](53);
|
|
1674
1844
|
_iterator2.e(_context4.t2);
|
|
1675
|
-
case
|
|
1676
|
-
_context4.prev =
|
|
1845
|
+
case 65:
|
|
1846
|
+
_context4.prev = 65;
|
|
1677
1847
|
_iterator2.f();
|
|
1678
|
-
return _context4.finish(
|
|
1679
|
-
case
|
|
1848
|
+
return _context4.finish(65);
|
|
1849
|
+
case 68:
|
|
1680
1850
|
if (previews.length > 0) {
|
|
1681
1851
|
void get().loadNestedPreviewGeometry(previews);
|
|
1682
1852
|
}
|
|
1683
1853
|
return _context4.abrupt("return", true);
|
|
1684
|
-
case
|
|
1854
|
+
case 70:
|
|
1685
1855
|
case "end":
|
|
1686
1856
|
return _context4.stop();
|
|
1687
1857
|
}
|
|
1688
|
-
}, _callee3, null, [[
|
|
1858
|
+
}, _callee3, null, [[17, 30, 33, 36], [53, 62, 65, 68]]);
|
|
1689
1859
|
}));
|
|
1690
1860
|
function startAccessoryMove(_x3, _x4) {
|
|
1691
1861
|
return _startAccessoryMove.apply(this, arguments);
|
|
@@ -1736,9 +1906,17 @@ var createAccessoryMoveSlice = function createAccessoryMoveSlice(set, get) {
|
|
|
1736
1906
|
});
|
|
1737
1907
|
},
|
|
1738
1908
|
commitAccessoryMove: function commitAccessoryMove() {
|
|
1739
|
-
var _getHostCallbacks$onA2, _getHostCallbacks2;
|
|
1740
1909
|
var mv = get().accessoryMove;
|
|
1741
1910
|
if (!mv) return;
|
|
1911
|
+
// An operation sent or a gesture begun while the accessory was dragged (e.g. a turn with a second finger): the move
|
|
1912
|
+
// goes back. The accessory move itself ends here, so only the others count.
|
|
1913
|
+
if (get().pendingOperation || get().isDragging || get().isRotating) {
|
|
1914
|
+
ACCGRID_LOG.debug('[ACCMOVE] commit refused while the host answers another operation');
|
|
1915
|
+
set({
|
|
1916
|
+
accessoryMove: null
|
|
1917
|
+
});
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1742
1920
|
var t = mv.target;
|
|
1743
1921
|
// "Original" requires the same article too — same cell + family sibling is an in-place swap.
|
|
1744
1922
|
var isOriginal = !!t && t.parentBasketId === mv.originBasketId && t.gridIdx === mv.ref.gridId && t.cellIdx === mv.ref.cellIdx && (!t.articleCodex || t.articleCodex === mv.ownArticleCodex);
|
|
@@ -1769,7 +1947,10 @@ var createAccessoryMoveSlice = function createAccessoryMoveSlice(set, get) {
|
|
|
1769
1947
|
return;
|
|
1770
1948
|
}
|
|
1771
1949
|
ACCGRID_LOG.debug("[ACCMOVE] commit \"".concat(mv.ref.elementKey, "\" \u2192 ").concat(t.parentBasketId, " ").concat(t.gridName, " cell ").concat(t.cellIdx));
|
|
1772
|
-
(
|
|
1950
|
+
get().sendOperation('move', function () {
|
|
1951
|
+
var _getHostCallbacks$onA2, _getHostCallbacks2;
|
|
1952
|
+
return (_getHostCallbacks$onA2 = (_getHostCallbacks2 = getHostCallbacks()).onAccessoryMove) === null || _getHostCallbacks$onA2 === void 0 ? void 0 : _getHostCallbacks$onA2.call(_getHostCallbacks2, mv.ref, t);
|
|
1953
|
+
});
|
|
1773
1954
|
},
|
|
1774
1955
|
cancelAccessoryMove: function cancelAccessoryMove() {
|
|
1775
1956
|
// Bumped unconditionally: the move being cancelled may still be awaiting its host round trip,
|
|
@@ -1900,9 +2081,15 @@ var createAccessoryDropSlice = function createAccessoryDropSlice(set, get) {
|
|
|
1900
2081
|
if (!t !== !cell) (_getHostCallbacks$onA4 = (_getHostCallbacks4 = getHostCallbacks()).onAccessoryDragOver) === null || _getHostCallbacks$onA4 === void 0 || _getHostCallbacks$onA4.call(_getHostCallbacks4, !!cell);
|
|
1901
2082
|
},
|
|
1902
2083
|
commitAccessoryDrop: function commitAccessoryDrop(clientX, clientY) {
|
|
1903
|
-
var _getHostCallbacks$onA5, _getHostCallbacks5
|
|
2084
|
+
var _getHostCallbacks$onA5, _getHostCallbacks5;
|
|
1904
2085
|
var cur = get().accessoryDrag;
|
|
1905
2086
|
if (!cur) return;
|
|
2087
|
+
// The host is still answering a move, add or delete, or a gesture is in progress: the drop adds nothing.
|
|
2088
|
+
if (isOperationBlocked(get())) {
|
|
2089
|
+
ACCGRID_LOG.debug('[ACCDROP] drop refused while the host answers another operation');
|
|
2090
|
+
get().setAccessoryDragCodex(null);
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
1906
2093
|
set({
|
|
1907
2094
|
accessoryDrag: null
|
|
1908
2095
|
});
|
|
@@ -1923,18 +2110,28 @@ var createAccessoryDropSlice = function createAccessoryDropSlice(set, get) {
|
|
|
1923
2110
|
});
|
|
1924
2111
|
holdUntilRerender(get().clearCommittedHolds);
|
|
1925
2112
|
(_getHostCallbacks$onA5 = (_getHostCallbacks5 = getHostCallbacks()).onAccessoryDragOver) === null || _getHostCallbacks$onA5 === void 0 || _getHostCallbacks$onA5.call(_getHostCallbacks5, false);
|
|
1926
|
-
(
|
|
2113
|
+
get().sendOperation('add', function () {
|
|
2114
|
+
var _getHostCallbacks$onA6, _getHostCallbacks6;
|
|
2115
|
+
return (_getHostCallbacks$onA6 = (_getHostCallbacks6 = getHostCallbacks()).onAccessoryPlace) === null || _getHostCallbacks$onA6 === void 0 ? void 0 : _getHostCallbacks$onA6.call(_getHostCallbacks6, t.gridIdx, t.cellIdx, t.parentBasketId, t.articleCodex);
|
|
2116
|
+
});
|
|
1927
2117
|
},
|
|
1928
2118
|
commitPendingAccessoryDrop: function commitPendingAccessoryDrop(cell) {
|
|
1929
|
-
var _getHostCallbacks$onA7, _getHostCallbacks7;
|
|
1930
2119
|
var p = get().pendingAccessoryDrop;
|
|
1931
2120
|
if (!p) return;
|
|
2121
|
+
// Same as `commitAccessoryDrop`.
|
|
2122
|
+
if (isOperationBlocked(get())) {
|
|
2123
|
+
get().discardPendingAccessoryDrop('another operation is pending');
|
|
2124
|
+
return;
|
|
2125
|
+
}
|
|
1932
2126
|
set({
|
|
1933
2127
|
pendingAccessoryDrop: null,
|
|
1934
2128
|
committedDrop: cell
|
|
1935
2129
|
});
|
|
1936
2130
|
holdUntilRerender(get().clearCommittedHolds);
|
|
1937
|
-
(
|
|
2131
|
+
get().sendOperation('add', function () {
|
|
2132
|
+
var _getHostCallbacks$onA7, _getHostCallbacks7;
|
|
2133
|
+
return (_getHostCallbacks$onA7 = (_getHostCallbacks7 = getHostCallbacks()).onAccessoryPlace) === null || _getHostCallbacks$onA7 === void 0 ? void 0 : _getHostCallbacks$onA7.call(_getHostCallbacks7, cell.gridIdx, cell.cellIdx, cell.parentBasketId, cell.articleCodex);
|
|
2134
|
+
});
|
|
1938
2135
|
},
|
|
1939
2136
|
discardPendingAccessoryDrop: function discardPendingAccessoryDrop(reason) {
|
|
1940
2137
|
if (!get().pendingAccessoryDrop) return;
|
|
@@ -1969,9 +2166,9 @@ var createAnalyzerGateSlice = function createAnalyzerGateSlice(set) {
|
|
|
1969
2166
|
};
|
|
1970
2167
|
};
|
|
1971
2168
|
|
|
1972
|
-
function _createForOfIteratorHelper$
|
|
1973
|
-
function _unsupportedIterableToArray$
|
|
1974
|
-
function _arrayLikeToArray$
|
|
2169
|
+
function _createForOfIteratorHelper$17(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$17(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; } } }; }
|
|
2170
|
+
function _unsupportedIterableToArray$17(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$17(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$17(r, a) : void 0; } }
|
|
2171
|
+
function _arrayLikeToArray$17(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; }
|
|
1975
2172
|
|
|
1976
2173
|
/**
|
|
1977
2174
|
* Failure channel for asset loads: failures reach the host's `onAssetError`, blocking ones also block the view
|
|
@@ -2021,7 +2218,7 @@ var createAssetErrorsSlice = function createAssetErrorsSlice(set, get) {
|
|
|
2021
2218
|
});
|
|
2022
2219
|
var onAssetError = getHostCallbacks().onAssetError;
|
|
2023
2220
|
if (!onAssetError) return;
|
|
2024
|
-
var _iterator = _createForOfIteratorHelper$
|
|
2221
|
+
var _iterator = _createForOfIteratorHelper$17(get().failedAssets),
|
|
2025
2222
|
_step;
|
|
2026
2223
|
try {
|
|
2027
2224
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -2034,7 +2231,7 @@ var createAssetErrorsSlice = function createAssetErrorsSlice(set, get) {
|
|
|
2034
2231
|
} finally {
|
|
2035
2232
|
_iterator.f();
|
|
2036
2233
|
}
|
|
2037
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
2234
|
+
var _iterator2 = _createForOfIteratorHelper$17(standingErrors.values()),
|
|
2038
2235
|
_step2;
|
|
2039
2236
|
try {
|
|
2040
2237
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -2127,9 +2324,9 @@ var createGLGenerationSlice = function createGLGenerationSlice(set, get) {
|
|
|
2127
2324
|
/** Module-level on purpose: the timestamp must survive the Canvas remount a restore triggers. */
|
|
2128
2325
|
var lastRestoreAt = Number.NEGATIVE_INFINITY;
|
|
2129
2326
|
|
|
2130
|
-
function _createForOfIteratorHelper$
|
|
2131
|
-
function _unsupportedIterableToArray$
|
|
2132
|
-
function _arrayLikeToArray$
|
|
2327
|
+
function _createForOfIteratorHelper$16(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$16(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; } } }; }
|
|
2328
|
+
function _unsupportedIterableToArray$16(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$16(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$16(r, a) : void 0; } }
|
|
2329
|
+
function _arrayLikeToArray$16(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; }
|
|
2133
2330
|
function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2134
2331
|
function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2135
2332
|
/**
|
|
@@ -2275,7 +2472,7 @@ function rowsInOrder(ctx) {
|
|
|
2275
2472
|
* so a caller can always act on the answer.
|
|
2276
2473
|
*/
|
|
2277
2474
|
function resolveStepIntent(moment, ctx) {
|
|
2278
|
-
var _iterator = _createForOfIteratorHelper$
|
|
2475
|
+
var _iterator = _createForOfIteratorHelper$16(rowsInOrder(ctx)),
|
|
2279
2476
|
_step;
|
|
2280
2477
|
try {
|
|
2281
2478
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -2315,11 +2512,34 @@ function resolveStepIntent(moment, ctx) {
|
|
|
2315
2512
|
};
|
|
2316
2513
|
}
|
|
2317
2514
|
|
|
2515
|
+
/**
|
|
2516
|
+
* Whether `intent` frames the element the moment is about, so another element gives another pose: a focus, a front-on
|
|
2517
|
+
* view turned to the selected element, an angle measured from it, a pivot on it. An overview, a hold, a fixed angle and
|
|
2518
|
+
* a front-on view kept on an earlier element do not.
|
|
2519
|
+
*/
|
|
2520
|
+
function intentFollowsSubject(intent) {
|
|
2521
|
+
var _intent$pivot, _intent$anchor;
|
|
2522
|
+
if (intent.kind === 'hold') return false;
|
|
2523
|
+
var pivotOf = (_intent$pivot = intent.pivot) === null || _intent$pivot === void 0 ? void 0 : _intent$pivot.of;
|
|
2524
|
+
if (pivotOf !== undefined && pivotOf !== 'scene') return true;
|
|
2525
|
+
switch (intent.kind) {
|
|
2526
|
+
case 'focusElement':
|
|
2527
|
+
case 'focusGeo':
|
|
2528
|
+
return true;
|
|
2529
|
+
case 'sceneFrontOn':
|
|
2530
|
+
return ((_intent$anchor = intent.anchor) !== null && _intent$anchor !== void 0 ? _intent$anchor : 'selected') === 'selected';
|
|
2531
|
+
case 'angle':
|
|
2532
|
+
return intent.relativeTo === 'subject';
|
|
2533
|
+
default:
|
|
2534
|
+
return false;
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
|
|
2318
2538
|
/** The behaviours (orbit cage, idle rotation, water) of the active step — first key that declares them wins. */
|
|
2319
2539
|
|
|
2320
2540
|
/** The first row declaring behaviour `field` (an option row before its step row) and the row's name. */
|
|
2321
2541
|
function firstDeclared(rows, optionCodex, field) {
|
|
2322
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
2542
|
+
var _iterator2 = _createForOfIteratorHelper$16(rows),
|
|
2323
2543
|
_step2;
|
|
2324
2544
|
try {
|
|
2325
2545
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -5612,9 +5832,9 @@ var OVERRIDE_PROFILE_TIERS = PROFILE_TIERS.flatMap(function (_ref) {
|
|
|
5612
5832
|
* classified as X?").
|
|
5613
5833
|
*/
|
|
5614
5834
|
|
|
5615
|
-
function _createForOfIteratorHelper$
|
|
5616
|
-
function _unsupportedIterableToArray$
|
|
5617
|
-
function _arrayLikeToArray$
|
|
5835
|
+
function _createForOfIteratorHelper$15(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$15(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; } } }; }
|
|
5836
|
+
function _unsupportedIterableToArray$15(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$15(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$15(r, a) : void 0; } }
|
|
5837
|
+
function _arrayLikeToArray$15(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; }
|
|
5618
5838
|
function ownKeys$y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5619
5839
|
function _objectSpread$y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$y(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5620
5840
|
function isPlainMergeableObject(v) {
|
|
@@ -5744,7 +5964,7 @@ function mergeProfile(profiles, tier) {
|
|
|
5744
5964
|
var override = profiles[tier];
|
|
5745
5965
|
if (override) result = deepMergePartial(result, override);
|
|
5746
5966
|
}
|
|
5747
|
-
var _iterator = _createForOfIteratorHelper$
|
|
5967
|
+
var _iterator = _createForOfIteratorHelper$15(TIERED_ASSET_PATHS),
|
|
5748
5968
|
_step;
|
|
5749
5969
|
try {
|
|
5750
5970
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -5925,14 +6145,14 @@ function propagateHighEditAndCollectClearedOverrides(profiles, highPatch, priorH
|
|
|
5925
6145
|
return !leavesEqual(getValueByPath(priorHigh, p), getValueByPath(profiles.high, p));
|
|
5926
6146
|
});
|
|
5927
6147
|
var cleared = [];
|
|
5928
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
6148
|
+
var _iterator2 = _createForOfIteratorHelper$15(OVERRIDE_PROFILE_TIERS),
|
|
5929
6149
|
_step2;
|
|
5930
6150
|
try {
|
|
5931
6151
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
5932
6152
|
var tierKey = _step2.value;
|
|
5933
6153
|
var override = profiles[tierKey];
|
|
5934
6154
|
if (!override) continue;
|
|
5935
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
6155
|
+
var _iterator3 = _createForOfIteratorHelper$15(leafPaths),
|
|
5936
6156
|
_step3;
|
|
5937
6157
|
try {
|
|
5938
6158
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -6290,7 +6510,7 @@ function LazyBoundary(_ref) {
|
|
|
6290
6510
|
}
|
|
6291
6511
|
|
|
6292
6512
|
var loadChunk$5 = memoChunk(function () {
|
|
6293
|
-
return import('./WaterSurface-
|
|
6513
|
+
return import('./WaterSurface-aa2471d6.js');
|
|
6294
6514
|
});
|
|
6295
6515
|
|
|
6296
6516
|
/**
|
|
@@ -6320,7 +6540,7 @@ function WaterSurfaceLazy() {
|
|
|
6320
6540
|
}
|
|
6321
6541
|
|
|
6322
6542
|
var loadChunk$4 = memoChunk(function () {
|
|
6323
|
-
return import('./DeckCutoutSubsystem-
|
|
6543
|
+
return import('./DeckCutoutSubsystem-6aca7b92.js');
|
|
6324
6544
|
});
|
|
6325
6545
|
|
|
6326
6546
|
/**
|
|
@@ -6350,7 +6570,7 @@ function DeckCutoutLazy() {
|
|
|
6350
6570
|
}
|
|
6351
6571
|
|
|
6352
6572
|
var loadChunk$3 = memoChunk(function () {
|
|
6353
|
-
return import('./SunLensflare-
|
|
6573
|
+
return import('./SunLensflare-8e6b2ccb.js');
|
|
6354
6574
|
});
|
|
6355
6575
|
|
|
6356
6576
|
/**
|
|
@@ -6381,7 +6601,7 @@ function SunLensflareLazy(props) {
|
|
|
6381
6601
|
}
|
|
6382
6602
|
|
|
6383
6603
|
var loadChunk$2 = memoChunk(function () {
|
|
6384
|
-
return import('./RoomShell-
|
|
6604
|
+
return import('./RoomShell-e9d62ae3.js');
|
|
6385
6605
|
});
|
|
6386
6606
|
|
|
6387
6607
|
/**
|
|
@@ -6451,9 +6671,9 @@ function preloadLazySubsystems(env, room) {
|
|
|
6451
6671
|
|
|
6452
6672
|
function ownKeys$v(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6453
6673
|
function _objectSpread$v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$v(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6454
|
-
function _createForOfIteratorHelper$
|
|
6455
|
-
function _unsupportedIterableToArray$
|
|
6456
|
-
function _arrayLikeToArray$
|
|
6674
|
+
function _createForOfIteratorHelper$14(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$14(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; } } }; }
|
|
6675
|
+
function _unsupportedIterableToArray$14(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$14(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$14(r, a) : void 0; } }
|
|
6676
|
+
function _arrayLikeToArray$14(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; }
|
|
6457
6677
|
var LOG$w = getLogger('RealTimeViewer', 'cameraSteps');
|
|
6458
6678
|
|
|
6459
6679
|
/** The warnings already given: a host that hands the same table again does not repeat them. */
|
|
@@ -6498,7 +6718,7 @@ function isPivot(value) {
|
|
|
6498
6718
|
var at = value.at;
|
|
6499
6719
|
if (at !== undefined) {
|
|
6500
6720
|
if (!isObject(at)) return false;
|
|
6501
|
-
var _iterator = _createForOfIteratorHelper$
|
|
6721
|
+
var _iterator = _createForOfIteratorHelper$14(['x', 'y', 'z']),
|
|
6502
6722
|
_step;
|
|
6503
6723
|
try {
|
|
6504
6724
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -6578,7 +6798,7 @@ function autoRotateProblem(autoRotate) {
|
|
|
6578
6798
|
/** Why a row (a step's, or an option's inside it) cannot be read, or null when it can. */
|
|
6579
6799
|
function rowProblem(row) {
|
|
6580
6800
|
if (!isObject(row)) return 'the row is not an object';
|
|
6581
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
6801
|
+
var _iterator2 = _createForOfIteratorHelper$14(MOMENTS),
|
|
6582
6802
|
_step2;
|
|
6583
6803
|
try {
|
|
6584
6804
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -6666,9 +6886,9 @@ function readStepTable(table) {
|
|
|
6666
6886
|
return read;
|
|
6667
6887
|
}
|
|
6668
6888
|
|
|
6669
|
-
function _createForOfIteratorHelper$
|
|
6670
|
-
function _unsupportedIterableToArray$
|
|
6671
|
-
function _arrayLikeToArray$
|
|
6889
|
+
function _createForOfIteratorHelper$13(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$13(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; } } }; }
|
|
6890
|
+
function _unsupportedIterableToArray$13(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$13(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$13(r, a) : void 0; } }
|
|
6891
|
+
function _arrayLikeToArray$13(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; }
|
|
6672
6892
|
var LOG$v = getLogger('RealTimeViewer', 'BootPhase');
|
|
6673
6893
|
var hasPerformanceNow = typeof performance !== 'undefined' && typeof performance.now === 'function';
|
|
6674
6894
|
var dateClockOrigin = Date.now();
|
|
@@ -6840,7 +7060,7 @@ function installBootChannel() {
|
|
|
6840
7060
|
var buffered = globalThis.__rtvBootBuffer;
|
|
6841
7061
|
globalThis.__rtvBoot = channel;
|
|
6842
7062
|
if (!buffered) return;
|
|
6843
|
-
var _iterator = _createForOfIteratorHelper$
|
|
7063
|
+
var _iterator = _createForOfIteratorHelper$13(buffered),
|
|
6844
7064
|
_step;
|
|
6845
7065
|
try {
|
|
6846
7066
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -6920,7 +7140,7 @@ function formatBootReport(revealT, lastGateId) {
|
|
|
6920
7140
|
lines.push(" reveal is +".concat(ms$1(revealT - bootT0), " on the viewer's own boot clock."));
|
|
6921
7141
|
lines.push('', 'TIMELINE');
|
|
6922
7142
|
var prev = null;
|
|
6923
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
7143
|
+
var _iterator2 = _createForOfIteratorHelper$13(events),
|
|
6924
7144
|
_step2;
|
|
6925
7145
|
try {
|
|
6926
7146
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -6939,7 +7159,7 @@ function formatBootReport(revealT, lastGateId) {
|
|
|
6939
7159
|
var rows = _toConsumableArray(gates.entries()).sort(function (a, b) {
|
|
6940
7160
|
return a[1].begin - b[1].begin;
|
|
6941
7161
|
});
|
|
6942
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
7162
|
+
var _iterator3 = _createForOfIteratorHelper$13(rows),
|
|
6943
7163
|
_step3;
|
|
6944
7164
|
try {
|
|
6945
7165
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -6996,9 +7216,9 @@ function logBootReport(lastGateId) {
|
|
|
6996
7216
|
LOG$v.debug("\n".concat(formatBootReport(pageClockMs(), lastGateId)));
|
|
6997
7217
|
}
|
|
6998
7218
|
|
|
6999
|
-
function _createForOfIteratorHelper$
|
|
7000
|
-
function _unsupportedIterableToArray$
|
|
7001
|
-
function _arrayLikeToArray$
|
|
7219
|
+
function _createForOfIteratorHelper$12(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$12(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; } } }; }
|
|
7220
|
+
function _unsupportedIterableToArray$12(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$12(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$12(r, a) : void 0; } }
|
|
7221
|
+
function _arrayLikeToArray$12(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; }
|
|
7002
7222
|
var LOG$u = getLogger('RealTimeViewer', 'SceneLoad');
|
|
7003
7223
|
|
|
7004
7224
|
// The two anomaly diagnostics below (reveal timing, RE-HIDE warning) read the shared boot clock,
|
|
@@ -7136,7 +7356,7 @@ var createSceneLoadSlice = function createSceneLoadSlice(set, get) {
|
|
|
7136
7356
|
}
|
|
7137
7357
|
},
|
|
7138
7358
|
resetSceneLoads: function resetSceneLoads() {
|
|
7139
|
-
var _iterator = _createForOfIteratorHelper$
|
|
7359
|
+
var _iterator = _createForOfIteratorHelper$12(timers.keys()),
|
|
7140
7360
|
_step;
|
|
7141
7361
|
try {
|
|
7142
7362
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -7258,6 +7478,14 @@ function releaseSettledBootGates(s) {
|
|
|
7258
7478
|
function ownKeys$t(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7259
7479
|
function _objectSpread$t(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$t(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$t(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7260
7480
|
var LOG$t = getLogger('RealTimeViewer', 'RTV-Next');
|
|
7481
|
+
/**
|
|
7482
|
+
* Whether the camera still stands where a click centred it after `action`: a hold within the step and a refit (it
|
|
7483
|
+
* follows the planning's change) leave it there; a flight, a reframe and a step's entry take it away.
|
|
7484
|
+
*/
|
|
7485
|
+
function keepsClickCentring(action) {
|
|
7486
|
+
if (action.type === 'applyIntent') return action.intent.kind === 'hold' && !action.anchorsEntry;
|
|
7487
|
+
return action.type !== 'focus' && action.type !== 'reframe';
|
|
7488
|
+
}
|
|
7261
7489
|
|
|
7262
7490
|
/** How a moment's flight is applied — see the `applyIntent` action. */
|
|
7263
7491
|
|
|
@@ -7277,6 +7505,7 @@ var createCameraSlice = function createCameraSlice(set, get) {
|
|
|
7277
7505
|
},
|
|
7278
7506
|
cameraDevelopmentMode: false,
|
|
7279
7507
|
cameraActionQueue: [],
|
|
7508
|
+
clickCentredOn: null,
|
|
7280
7509
|
setCameraConfig: function setCameraConfig(partial) {
|
|
7281
7510
|
return set(function (s) {
|
|
7282
7511
|
return {
|
|
@@ -7299,7 +7528,8 @@ var createCameraSlice = function createCameraSlice(set, get) {
|
|
|
7299
7528
|
LOG$t.debug('camera action enqueued:', action.type);
|
|
7300
7529
|
set(function (s) {
|
|
7301
7530
|
return {
|
|
7302
|
-
cameraActionQueue: [].concat(_toConsumableArray(s.cameraActionQueue), [action])
|
|
7531
|
+
cameraActionQueue: [].concat(_toConsumableArray(s.cameraActionQueue), [action]),
|
|
7532
|
+
clickCentredOn: keepsClickCentring(action) ? s.clickCentredOn : null
|
|
7303
7533
|
};
|
|
7304
7534
|
});
|
|
7305
7535
|
},
|
|
@@ -7417,9 +7647,9 @@ function textureSourceUrl(tex) {
|
|
|
7417
7647
|
return sourceUrls.get(tex);
|
|
7418
7648
|
}
|
|
7419
7649
|
|
|
7420
|
-
function _createForOfIteratorHelper$
|
|
7421
|
-
function _unsupportedIterableToArray$
|
|
7422
|
-
function _arrayLikeToArray$
|
|
7650
|
+
function _createForOfIteratorHelper$11(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$11(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; } } }; }
|
|
7651
|
+
function _unsupportedIterableToArray$11(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$11(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$11(r, a) : void 0; } }
|
|
7652
|
+
function _arrayLikeToArray$11(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; }
|
|
7423
7653
|
var LOG$s = getLogger('RealTimeViewer', 'ModelExport');
|
|
7424
7654
|
|
|
7425
7655
|
/*
|
|
@@ -7468,7 +7698,7 @@ function collectArticleMeshes(object, element, out) {
|
|
|
7468
7698
|
mesh: mesh,
|
|
7469
7699
|
setId: parseElementSetId(inElement)
|
|
7470
7700
|
});
|
|
7471
|
-
var _iterator = _createForOfIteratorHelper$
|
|
7701
|
+
var _iterator = _createForOfIteratorHelper$11(object.children),
|
|
7472
7702
|
_step;
|
|
7473
7703
|
try {
|
|
7474
7704
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -7605,7 +7835,7 @@ function _applyExportableTextures() {
|
|
|
7605
7835
|
case 0:
|
|
7606
7836
|
resolved = new Map();
|
|
7607
7837
|
assignments = [];
|
|
7608
|
-
_iterator3 = _createForOfIteratorHelper$
|
|
7838
|
+
_iterator3 = _createForOfIteratorHelper$11(materials);
|
|
7609
7839
|
_context4.prev = 3;
|
|
7610
7840
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
7611
7841
|
var material, _loop2, _i, _Object$entries;
|
|
@@ -7728,7 +7958,7 @@ function _buildArticleExportRoot() {
|
|
|
7728
7958
|
return _context5.abrupt("return", null);
|
|
7729
7959
|
case 7:
|
|
7730
7960
|
box = new Box3();
|
|
7731
|
-
_iterator4 = _createForOfIteratorHelper$
|
|
7961
|
+
_iterator4 = _createForOfIteratorHelper$11(meshes);
|
|
7732
7962
|
try {
|
|
7733
7963
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
7734
7964
|
mesh = _step4.value;
|
|
@@ -7749,7 +7979,7 @@ function _buildArticleExportRoot() {
|
|
|
7749
7979
|
recenter = new Matrix4().makeTranslation(-center.x, -box.min.y, -center.z);
|
|
7750
7980
|
root = new Scene();
|
|
7751
7981
|
materials = new Map();
|
|
7752
|
-
_iterator5 = _createForOfIteratorHelper$
|
|
7982
|
+
_iterator5 = _createForOfIteratorHelper$11(meshes);
|
|
7753
7983
|
try {
|
|
7754
7984
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
7755
7985
|
_mesh = _step5.value;
|
|
@@ -7784,7 +8014,7 @@ function _buildArticleExportRoot() {
|
|
|
7784
8014
|
return _buildArticleExportRoot.apply(this, arguments);
|
|
7785
8015
|
}
|
|
7786
8016
|
function disposeArticleExportRoot(exportRoot) {
|
|
7787
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
8017
|
+
var _iterator2 = _createForOfIteratorHelper$11(exportRoot.materials.values()),
|
|
7788
8018
|
_step2;
|
|
7789
8019
|
try {
|
|
7790
8020
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -7885,9 +8115,9 @@ function _exportSceneGlb() {
|
|
|
7885
8115
|
return _exportSceneGlb.apply(this, arguments);
|
|
7886
8116
|
}
|
|
7887
8117
|
|
|
7888
|
-
function _createForOfIteratorHelper
|
|
7889
|
-
function _unsupportedIterableToArray
|
|
7890
|
-
function _arrayLikeToArray
|
|
8118
|
+
function _createForOfIteratorHelper$10(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$10(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; } } }; }
|
|
8119
|
+
function _unsupportedIterableToArray$10(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$10(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$10(r, a) : void 0; } }
|
|
8120
|
+
function _arrayLikeToArray$10(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; }
|
|
7891
8121
|
/** Same chunk boundary as the glTF exporter: only loaded when someone opens AR. */
|
|
7892
8122
|
var exporterChunk;
|
|
7893
8123
|
function loadExporterChunk() {
|
|
@@ -7917,7 +8147,7 @@ var TEXTURE_SLOTS = ['map', 'normalMap', 'roughnessMap', 'metalnessMap', 'aoMap'
|
|
|
7917
8147
|
// The exporter draws every map onto a canvas: KTX2/basis GPU payloads and raw-data textures (the missing-texture
|
|
7918
8148
|
// placeholder) cannot be drawn, so the export keeps the colour without them.
|
|
7919
8149
|
function dropUndrawableTextures(material) {
|
|
7920
|
-
var _iterator = _createForOfIteratorHelper
|
|
8150
|
+
var _iterator = _createForOfIteratorHelper$10(TEXTURE_SLOTS),
|
|
7921
8151
|
_step;
|
|
7922
8152
|
try {
|
|
7923
8153
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -8013,7 +8243,7 @@ function _exportSceneUsdz() {
|
|
|
8013
8243
|
convertedMaterials = [];
|
|
8014
8244
|
bakedGeometries = [];
|
|
8015
8245
|
_context.prev = 8;
|
|
8016
|
-
_iterator2 = _createForOfIteratorHelper
|
|
8246
|
+
_iterator2 = _createForOfIteratorHelper$10(exportRoot.root.children);
|
|
8017
8247
|
_context.prev = 10;
|
|
8018
8248
|
_iterator2.s();
|
|
8019
8249
|
case 12:
|
|
@@ -8100,9 +8330,9 @@ function _exportSceneUsdz() {
|
|
|
8100
8330
|
|
|
8101
8331
|
function ownKeys$s(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8102
8332
|
function _objectSpread$s(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$s(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$s(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8103
|
-
function _createForOfIteratorHelper
|
|
8104
|
-
function _unsupportedIterableToArray
|
|
8105
|
-
function _arrayLikeToArray
|
|
8333
|
+
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; } } }; }
|
|
8334
|
+
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; } }
|
|
8335
|
+
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; }
|
|
8106
8336
|
|
|
8107
8337
|
/**
|
|
8108
8338
|
* The COMPLETE set of store fields a capture shot may override, and the only way it may write them
|
|
@@ -8239,7 +8469,7 @@ var createCaptureSlice = function createCaptureSlice(set, get, api) {
|
|
|
8239
8469
|
frozenFrame: null,
|
|
8240
8470
|
_freezeRequests: []
|
|
8241
8471
|
});
|
|
8242
|
-
var _iterator = _createForOfIteratorHelper
|
|
8472
|
+
var _iterator = _createForOfIteratorHelper$$(pending),
|
|
8243
8473
|
_step;
|
|
8244
8474
|
try {
|
|
8245
8475
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -8662,9 +8892,9 @@ function applySnapMove(x, z, rotY, snap) {
|
|
|
8662
8892
|
return [orbitX + snap.deltaPos[0], orbitZ + snap.deltaPos[1], rotY + snap.deltaRot];
|
|
8663
8893
|
}
|
|
8664
8894
|
|
|
8665
|
-
function _createForOfIteratorHelper$
|
|
8666
|
-
function _unsupportedIterableToArray$
|
|
8667
|
-
function _arrayLikeToArray$
|
|
8895
|
+
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; } } }; }
|
|
8896
|
+
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; } }
|
|
8897
|
+
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; }
|
|
8668
8898
|
|
|
8669
8899
|
/**
|
|
8670
8900
|
* Partition the elements into independent blocks, as qualified element keys (`qualifiedElementKey`):
|
|
@@ -8679,7 +8909,7 @@ function partitionGroups(scene2d) {
|
|
|
8679
8909
|
var present = new Set(scene2d.elements.map(keyOf));
|
|
8680
8910
|
var groups = [];
|
|
8681
8911
|
var grouped = new Set();
|
|
8682
|
-
var _iterator = _createForOfIteratorHelper$
|
|
8912
|
+
var _iterator = _createForOfIteratorHelper$_((_scene2d$dockingGroup = scene2d.dockingGroups) !== null && _scene2d$dockingGroup !== void 0 ? _scene2d$dockingGroup : []),
|
|
8683
8913
|
_step;
|
|
8684
8914
|
try {
|
|
8685
8915
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -8698,7 +8928,7 @@ function partitionGroups(scene2d) {
|
|
|
8698
8928
|
} finally {
|
|
8699
8929
|
_iterator.f();
|
|
8700
8930
|
}
|
|
8701
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
8931
|
+
var _iterator2 = _createForOfIteratorHelper$_(scene2d.elements),
|
|
8702
8932
|
_step2;
|
|
8703
8933
|
try {
|
|
8704
8934
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -8741,7 +8971,7 @@ function followerKeysOf(scene2d, unitKeys) {
|
|
|
8741
8971
|
return group.guests;
|
|
8742
8972
|
});
|
|
8743
8973
|
var next = [];
|
|
8744
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
8974
|
+
var _iterator3 = _createForOfIteratorHelper$_(guests.flatMap(function (guest) {
|
|
8745
8975
|
return dockingGroupOf(scene2d, guest);
|
|
8746
8976
|
})),
|
|
8747
8977
|
_step3;
|
|
@@ -8765,9 +8995,9 @@ function followerKeysOf(scene2d, unitKeys) {
|
|
|
8765
8995
|
|
|
8766
8996
|
function ownKeys$p(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8767
8997
|
function _objectSpread$p(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$p(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$p(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8768
|
-
function _createForOfIteratorHelper$
|
|
8769
|
-
function _unsupportedIterableToArray$
|
|
8770
|
-
function _arrayLikeToArray$
|
|
8998
|
+
function _createForOfIteratorHelper$Z(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$Z(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; } } }; }
|
|
8999
|
+
function _unsupportedIterableToArray$Z(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$Z(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$Z(r, a) : void 0; } }
|
|
9000
|
+
function _arrayLikeToArray$Z(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; }
|
|
8771
9001
|
var LOG$r = getLogger('RealTimeViewer', 'RTV-Next');
|
|
8772
9002
|
var STORE_LOG$1 = getLogger('RealTimeViewer', 'Store');
|
|
8773
9003
|
|
|
@@ -8824,7 +9054,7 @@ function isSettlingMove(s, in2D) {
|
|
|
8824
9054
|
/** Sends the interaction group's rotation by `deltaDeg` (planner degrees) about the shared turning point. */
|
|
8825
9055
|
function broadcastRotation(s, deltaDeg) {
|
|
8826
9056
|
if (s.interactionSetName == null || Math.abs(deltaDeg) <= 0.001) return;
|
|
8827
|
-
var _iterator = _createForOfIteratorHelper$
|
|
9057
|
+
var _iterator = _createForOfIteratorHelper$Z(s.interactionGroupMembers),
|
|
8828
9058
|
_step;
|
|
8829
9059
|
try {
|
|
8830
9060
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -8914,13 +9144,13 @@ function buildInteractionGroup(scene2d, elementId, parentSetName, keyToNames, ge
|
|
|
8914
9144
|
setId = _elementRefOf.setId,
|
|
8915
9145
|
id = _elementRefOf.elementId;
|
|
8916
9146
|
followerNames.add(element2DName(setId, id));
|
|
8917
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
9147
|
+
var _iterator2 = _createForOfIteratorHelper$Z((_keyToNames$get = keyToNames.get(key)) !== null && _keyToNames$get !== void 0 ? _keyToNames$get : []),
|
|
8918
9148
|
_step2;
|
|
8919
9149
|
try {
|
|
8920
9150
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
8921
9151
|
var n = _step2.value;
|
|
8922
9152
|
followerNames.add(n);
|
|
8923
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
9153
|
+
var _iterator3 = _createForOfIteratorHelper$Z(getAllDescendantNames(n)),
|
|
8924
9154
|
_step3;
|
|
8925
9155
|
try {
|
|
8926
9156
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -8975,6 +9205,8 @@ var createInteractionSlice = function createInteractionSlice(set, get) {
|
|
|
8975
9205
|
},
|
|
8976
9206
|
startDrag: function startDrag(elementName, parentSetName, elementId) {
|
|
8977
9207
|
var _get$scene2d, _getHostCallbacks$upd2, _getHostCallbacks2;
|
|
9208
|
+
// The host is still answering a move, add or delete: a drag now would conflict with it.
|
|
9209
|
+
if (get().pendingOperation) return;
|
|
8978
9210
|
var elem = get().elements.find(function (e) {
|
|
8979
9211
|
return e.name === elementName;
|
|
8980
9212
|
});
|
|
@@ -9037,7 +9269,7 @@ var createInteractionSlice = function createInteractionSlice(set, get) {
|
|
|
9037
9269
|
|
|
9038
9270
|
// Broadcast the same incremental delta to every group member so the docked group translates
|
|
9039
9271
|
// rigidly. UPDATE performs no docking change (no reconfigure), so N cheap calls per move are fine.
|
|
9040
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
9272
|
+
var _iterator4 = _createForOfIteratorHelper$Z(interactionGroupMembers),
|
|
9041
9273
|
_step4;
|
|
9042
9274
|
try {
|
|
9043
9275
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -9106,17 +9338,24 @@ var createInteractionSlice = function createInteractionSlice(set, get) {
|
|
|
9106
9338
|
interactionTargetName = _get3.interactionTargetName,
|
|
9107
9339
|
scene2d = _get3.scene2d;
|
|
9108
9340
|
var pose = liveDragPose(get());
|
|
9341
|
+
var moved = pose != null && leavesStart(pose);
|
|
9109
9342
|
var callbacks = getHostCallbacks();
|
|
9110
9343
|
if (interactionSetName != null) {
|
|
9111
|
-
var
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9344
|
+
var sendEnd = function sendEnd() {
|
|
9345
|
+
var _callbacks$updatePlan2;
|
|
9346
|
+
return (_callbacks$updatePlan2 = callbacks.updatePlannerTrans) === null || _callbacks$updatePlan2 === void 0 ? void 0 : _callbacks$updatePlan2.call(callbacks, interactionSetName, interactionElementId, {
|
|
9347
|
+
x: 0,
|
|
9348
|
+
y: 0,
|
|
9349
|
+
z: 0
|
|
9350
|
+
}, 0, 0, 'END', AUTO_DOCKING_DISTANCE);
|
|
9351
|
+
};
|
|
9352
|
+
// The drag's own END: nothing else can be pending while it runs. A release on its start awaits no re-render.
|
|
9353
|
+
get().sendOperation('move', sendEnd, {
|
|
9354
|
+
endsGesture: true,
|
|
9355
|
+
expectsScene: moved
|
|
9356
|
+
});
|
|
9117
9357
|
}
|
|
9118
9358
|
var movedFocused = interactionTargetName != null && get().focusedElementName === interactionTargetName;
|
|
9119
|
-
var moved = pose != null && leavesStart(pose);
|
|
9120
9359
|
clearHeldDragTimer();
|
|
9121
9360
|
if (moved) heldDragTimer = setTimeout(function () {
|
|
9122
9361
|
return set({
|
|
@@ -9156,6 +9395,8 @@ var createInteractionSlice = function createInteractionSlice(set, get) {
|
|
|
9156
9395
|
},
|
|
9157
9396
|
startRotate: function startRotate(elementName, parentSetName, elementId) {
|
|
9158
9397
|
var _getHostCallbacks$upd3, _getHostCallbacks3, _turningPoint;
|
|
9398
|
+
// Same as `startDrag`.
|
|
9399
|
+
if (get().pendingOperation) return;
|
|
9159
9400
|
var elem = get().elements.find(function (e) {
|
|
9160
9401
|
return e.name === elementName;
|
|
9161
9402
|
});
|
|
@@ -9279,15 +9520,24 @@ var createInteractionSlice = function createInteractionSlice(set, get) {
|
|
|
9279
9520
|
var _get6 = get(),
|
|
9280
9521
|
interactionSetName = _get6.interactionSetName,
|
|
9281
9522
|
interactionElementId = _get6.interactionElementId,
|
|
9282
|
-
interactionTurningPoint = _get6.interactionTurningPoint
|
|
9523
|
+
interactionTurningPoint = _get6.interactionTurningPoint,
|
|
9524
|
+
interactionRotationY = _get6.interactionRotationY;
|
|
9283
9525
|
var callbacks = getHostCallbacks();
|
|
9284
9526
|
if (interactionSetName != null) {
|
|
9285
|
-
var
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9527
|
+
var sendEnd = function sendEnd() {
|
|
9528
|
+
var _callbacks$updatePlan3;
|
|
9529
|
+
return (_callbacks$updatePlan3 = callbacks.updatePlannerTrans) === null || _callbacks$updatePlan3 === void 0 ? void 0 : _callbacks$updatePlan3.call(callbacks, interactionSetName, interactionElementId, {
|
|
9530
|
+
x: 0,
|
|
9531
|
+
y: 0,
|
|
9532
|
+
z: 0
|
|
9533
|
+
}, 0, ROT_CORRECTION, 'END', AUTO_DOCKING_DISTANCE, interactionTurningPoint !== null && interactionTurningPoint !== void 0 ? interactionTurningPoint : undefined);
|
|
9534
|
+
};
|
|
9535
|
+
// Same as `endDrag`.
|
|
9536
|
+
var turned = Math.abs(interactionRotationY) > AT_START_EPS;
|
|
9537
|
+
get().sendOperation('move', sendEnd, {
|
|
9538
|
+
endsGesture: true,
|
|
9539
|
+
expectsScene: turned
|
|
9540
|
+
});
|
|
9291
9541
|
}
|
|
9292
9542
|
set({
|
|
9293
9543
|
isRotating: false,
|
|
@@ -9318,6 +9568,7 @@ var createInteractionSlice = function createInteractionSlice(set, get) {
|
|
|
9318
9568
|
get().endRotate();
|
|
9319
9569
|
},
|
|
9320
9570
|
scene3DRendered: function scene3DRendered(scene) {
|
|
9571
|
+
get().operationSceneRendered(scene);
|
|
9321
9572
|
var _get7 = get(),
|
|
9322
9573
|
heldDrag = _get7.heldDrag,
|
|
9323
9574
|
elements = _get7.elements;
|
|
@@ -9329,6 +9580,7 @@ var createInteractionSlice = function createInteractionSlice(set, get) {
|
|
|
9329
9580
|
});
|
|
9330
9581
|
},
|
|
9331
9582
|
hostSceneUnchanged: function hostSceneUnchanged() {
|
|
9583
|
+
get().operationSceneUnchanged();
|
|
9332
9584
|
if (!get().heldDrag) return;
|
|
9333
9585
|
clearHeldDragTimer();
|
|
9334
9586
|
set({
|
|
@@ -9350,9 +9602,9 @@ var LOG$q = getLogger('RealTimeViewer', 'detectDeviceTier');
|
|
|
9350
9602
|
var CACHE_KEY = 'rtv-detected-tier';
|
|
9351
9603
|
// Bumped whenever `classifyTier` changes, so a cache entry written by an older
|
|
9352
9604
|
// classifier is discarded rather than pinning a device to a stale tier.
|
|
9353
|
-
var CACHE_VERSION =
|
|
9354
|
-
/**
|
|
9355
|
-
var
|
|
9605
|
+
var CACHE_VERSION = 5;
|
|
9606
|
+
/** A WebGL renderer without a real GPU: it draws on the CPU. */
|
|
9607
|
+
var SOFTWARE_RENDERER = /swiftshader|llvmpipe|softpipe|basic render driver|software/i;
|
|
9356
9608
|
/** How long a remembered runtime tier stays authoritative; after that the device is measured again. */
|
|
9357
9609
|
var RUNTIME_TIER_TTL_MS = 14 * 24 * 60 * 60 * 1000;
|
|
9358
9610
|
var URL_PARAM_NAME = 'profile';
|
|
@@ -9385,16 +9637,38 @@ function readCache() {
|
|
|
9385
9637
|
var _readCacheEntry$detec, _readCacheEntry;
|
|
9386
9638
|
return (_readCacheEntry$detec = (_readCacheEntry = readCacheEntry()) === null || _readCacheEntry === void 0 ? void 0 : _readCacheEntry.detected) !== null && _readCacheEntry$detec !== void 0 ? _readCacheEntry$detec : null;
|
|
9387
9639
|
}
|
|
9640
|
+
|
|
9641
|
+
/**
|
|
9642
|
+
* The runtime memory of an entry an older classifier wrote, when it records demotions: a classifier change discards the
|
|
9643
|
+
* old detection, not the slow frames measured on this device. A memory that climbed and was never demoted again only
|
|
9644
|
+
* records the climb from an older classifier's lower start, so it goes with that detection.
|
|
9645
|
+
*/
|
|
9646
|
+
function carriedRuntimeMemory() {
|
|
9647
|
+
try {
|
|
9648
|
+
var raw = localStorage.getItem(CACHE_KEY);
|
|
9649
|
+
var old = raw ? JSON.parse(raw) : null;
|
|
9650
|
+
if (!old || old.runtimeReclimbed === true && old.runtimeLocked !== true) return {};
|
|
9651
|
+
// `liveRuntimeTier` validates the carried values on every read.
|
|
9652
|
+
return {
|
|
9653
|
+
runtimeTier: old.runtimeTier,
|
|
9654
|
+
runtimeTierTs: old.runtimeTierTs,
|
|
9655
|
+
runtimeReclimbed: old.runtimeReclimbed,
|
|
9656
|
+
runtimeLocked: old.runtimeLocked
|
|
9657
|
+
};
|
|
9658
|
+
} catch (_unused3) {
|
|
9659
|
+
return {};
|
|
9660
|
+
}
|
|
9661
|
+
}
|
|
9388
9662
|
function writeCache(detected) {
|
|
9389
9663
|
try {
|
|
9390
|
-
// Only ever reached when `readCache` found nothing usable
|
|
9391
|
-
var entry = {
|
|
9664
|
+
// Only ever reached when `readCache` found nothing usable: no entry, or one an older classifier wrote.
|
|
9665
|
+
var entry = _objectSpread$o({
|
|
9392
9666
|
v: CACHE_VERSION,
|
|
9393
9667
|
detected: detected,
|
|
9394
9668
|
ts: Date.now()
|
|
9395
|
-
};
|
|
9669
|
+
}, carriedRuntimeMemory());
|
|
9396
9670
|
localStorage.setItem(CACHE_KEY, JSON.stringify(entry));
|
|
9397
|
-
} catch (
|
|
9671
|
+
} catch (_unused4) {
|
|
9398
9672
|
// localStorage quota / disabled — fine to swallow; we'll just re-detect next load.
|
|
9399
9673
|
}
|
|
9400
9674
|
}
|
|
@@ -9445,10 +9719,19 @@ function writeRuntimeTier(tier, direction) {
|
|
|
9445
9719
|
runtimeReclimbed: runtimeReclimbed,
|
|
9446
9720
|
runtimeLocked: runtimeLocked
|
|
9447
9721
|
})));
|
|
9448
|
-
} catch (
|
|
9722
|
+
} catch (_unused5) {
|
|
9449
9723
|
// A failed write only loses the remembered tier.
|
|
9450
9724
|
}
|
|
9451
9725
|
}
|
|
9726
|
+
|
|
9727
|
+
/**
|
|
9728
|
+
* Phones and tablets by user agent, for browsers without `userAgentData` (Safari, Firefox). iPadOS reports a Mac
|
|
9729
|
+
* platform, so a Mac with touch points counts as well (the same rule detect-gpu applies).
|
|
9730
|
+
*/
|
|
9731
|
+
function userAgentLooksMobile(nav) {
|
|
9732
|
+
var _nav$userAgent, _nav$maxTouchPoints;
|
|
9733
|
+
return /iphone|ipod|ipad|android/i.test((_nav$userAgent = nav.userAgent) !== null && _nav$userAgent !== void 0 ? _nav$userAgent : '') || nav.platform === 'MacIntel' && ((_nav$maxTouchPoints = nav.maxTouchPoints) !== null && _nav$maxTouchPoints !== void 0 ? _nav$maxTouchPoints : 0) > 0;
|
|
9734
|
+
}
|
|
9452
9735
|
function readNavigatorSignals() {
|
|
9453
9736
|
var _deviceMemory;
|
|
9454
9737
|
var nav = typeof navigator !== 'undefined' ? navigator : {};
|
|
@@ -9457,7 +9740,7 @@ function readNavigatorSignals() {
|
|
|
9457
9740
|
return {
|
|
9458
9741
|
hardwareConcurrency: typeof nav.hardwareConcurrency === 'number' ? nav.hardwareConcurrency : 0,
|
|
9459
9742
|
deviceMemoryGB: typeof nav.deviceMemory === 'number' ? (_deviceMemory = nav.deviceMemory) !== null && _deviceMemory !== void 0 ? _deviceMemory : null : null,
|
|
9460
|
-
isMobile: typeof (ua === null || ua === void 0 ? void 0 : ua.mobile) === 'boolean' ? ua.mobile :
|
|
9743
|
+
isMobile: typeof (ua === null || ua === void 0 ? void 0 : ua.mobile) === 'boolean' ? ua.mobile : userAgentLooksMobile(nav),
|
|
9461
9744
|
reducedMotion: reducedMotion
|
|
9462
9745
|
};
|
|
9463
9746
|
}
|
|
@@ -9475,12 +9758,17 @@ function readNavigatorSignals() {
|
|
|
9475
9758
|
* is reliable on iOS Safari, where `navigator.userAgentData` does not exist.
|
|
9476
9759
|
* The navigator signal is kept as a backup (OR'd in).
|
|
9477
9760
|
*
|
|
9478
|
-
*
|
|
9479
|
-
*
|
|
9480
|
-
*
|
|
9761
|
+
* Desktops start on `high`, and the runtime adjuster steps them down once it
|
|
9762
|
+
* measures slow frames. Only a clearly weak desktop starts on `medium`: a
|
|
9763
|
+
* software renderer, or a GPU detect-gpu benchmarks below 30 fps at this screen
|
|
9764
|
+
* size (its tier 0/1). Softer hints never lower the start, since each one hits
|
|
9765
|
+
* normal laptops: an integrated GPU (tier 2), a 4-core CPU, 4 GB of memory, and
|
|
9766
|
+
* a GPU newer than detect-gpu's data, which it reports as tier 1 `FALLBACK`.
|
|
9767
|
+
* `prefers-reduced-motion` does not lower it either: it asks for less motion,
|
|
9768
|
+
* not for less detail, and says nothing about the device's speed.
|
|
9481
9769
|
*/
|
|
9482
9770
|
function classifyTier(gpu, signals) {
|
|
9483
|
-
var
|
|
9771
|
+
var _gpu$gpu, _gpu$device4;
|
|
9484
9772
|
var isMobile = gpu.isMobile === true || signals.isMobile;
|
|
9485
9773
|
if (gpu.tier === 0 || gpu.isMobile === undefined) {
|
|
9486
9774
|
if (gpu.type === 'BLOCKLISTED') {
|
|
@@ -9512,23 +9800,10 @@ function classifyTier(gpu, signals) {
|
|
|
9512
9800
|
isMobile: isMobile
|
|
9513
9801
|
};
|
|
9514
9802
|
}
|
|
9515
|
-
var
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
// detect-gpu over-rates integrated GPUs by name; step down once per weak
|
|
9519
|
-
// signal (capped at two). Never promotes. CPU/memory signals do not count against a strong GPU.
|
|
9520
|
-
var strongGpu = gpu.tier >= 3 && typeof gpu.fps === 'number' && gpu.fps >= STRONG_GPU_FPS;
|
|
9521
|
-
var weak = 0;
|
|
9522
|
-
if (typeof gpu.fps === 'number' && gpu.fps < 30) weak++;
|
|
9523
|
-
if (!strongGpu && signals.hardwareConcurrency > 0 && signals.hardwareConcurrency <= 4) weak++;
|
|
9524
|
-
if (!strongGpu && signals.deviceMemoryGB != null && signals.deviceMemoryGB <= 4) weak++;
|
|
9525
|
-
if (weak >= 1) baseTier = (_stepTier = stepTier(baseTier, 'down')) !== null && _stepTier !== void 0 ? _stepTier : baseTier;
|
|
9526
|
-
if (weak >= 2) baseTier = (_stepTier2 = stepTier(baseTier, 'down')) !== null && _stepTier2 !== void 0 ? _stepTier2 : baseTier;
|
|
9527
|
-
if (baseTier === 'high' && signals.reducedMotion) {
|
|
9528
|
-
baseTier = 'medium';
|
|
9529
|
-
}
|
|
9803
|
+
var softwareRenderer = SOFTWARE_RENDERER.test((_gpu$gpu = gpu.gpu) !== null && _gpu$gpu !== void 0 ? _gpu$gpu : '');
|
|
9804
|
+
var benchmarkedSlow = gpu.type === 'BENCHMARK' && gpu.tier <= 1;
|
|
9530
9805
|
return {
|
|
9531
|
-
tier:
|
|
9806
|
+
tier: softwareRenderer || benchmarkedSlow ? 'medium' : 'high',
|
|
9532
9807
|
device: (_gpu$device4 = gpu.device) !== null && _gpu$device4 !== void 0 ? _gpu$device4 : null,
|
|
9533
9808
|
isMobile: isMobile
|
|
9534
9809
|
};
|
|
@@ -9545,7 +9820,7 @@ function detectDeviceTier() {
|
|
|
9545
9820
|
function _detectDeviceTier() {
|
|
9546
9821
|
_detectDeviceTier = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
9547
9822
|
var _detected$signals$gpu;
|
|
9548
|
-
var urlOverride, cached, _cached$signals$gpu$d, gpu, navSignals, classified, detected, _classified$reason;
|
|
9823
|
+
var urlOverride, cached, _cached$signals$gpu$d, gpu, _navSignals, navSignals, classified, detected, _classified$reason;
|
|
9549
9824
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
9550
9825
|
while (1) switch (_context.prev = _context.next) {
|
|
9551
9826
|
case 0:
|
|
@@ -9605,26 +9880,27 @@ function _detectDeviceTier() {
|
|
|
9605
9880
|
return getGPUTier();
|
|
9606
9881
|
case 15:
|
|
9607
9882
|
gpu = _context.sent;
|
|
9608
|
-
_context.next =
|
|
9883
|
+
_context.next = 23;
|
|
9609
9884
|
break;
|
|
9610
9885
|
case 18:
|
|
9611
9886
|
_context.prev = 18;
|
|
9612
9887
|
_context.t0 = _context["catch"](12);
|
|
9613
9888
|
LOG$q.warn("getGPUTier failed: ".concat(_context.t0));
|
|
9614
|
-
//
|
|
9615
|
-
|
|
9889
|
+
// Nothing says this device is weak: start on the top tier of its ladder, the runtime adjuster steps down if needed.
|
|
9890
|
+
_navSignals = readNavigatorSignals();
|
|
9616
9891
|
return _context.abrupt("return", {
|
|
9617
|
-
tier: '
|
|
9892
|
+
tier: _navSignals.isMobile ? 'mobileHigh' : 'high',
|
|
9618
9893
|
signals: _objectSpread$o(_objectSpread$o({
|
|
9894
|
+
// 0 = unknown: nothing was measured.
|
|
9619
9895
|
gpu: {
|
|
9620
|
-
tier:
|
|
9896
|
+
tier: 0,
|
|
9621
9897
|
device: null
|
|
9622
9898
|
}
|
|
9623
|
-
},
|
|
9899
|
+
}, _navSignals), {}, {
|
|
9624
9900
|
source: 'detect'
|
|
9625
9901
|
})
|
|
9626
9902
|
});
|
|
9627
|
-
case
|
|
9903
|
+
case 23:
|
|
9628
9904
|
navSignals = readNavigatorSignals();
|
|
9629
9905
|
classified = classifyTier(gpu, navSignals);
|
|
9630
9906
|
if (classified.tier === 'unsupported') {
|
|
@@ -9655,7 +9931,7 @@ function _detectDeviceTier() {
|
|
|
9655
9931
|
LOG$q.debug(detected.tier === 'unsupported' ? "detected tier: unsupported (".concat(detected.reason, ")") : "detected tier: ".concat(detected.tier, " (").concat((_detected$signals$gpu = detected.signals.gpu.device) !== null && _detected$signals$gpu !== void 0 ? _detected$signals$gpu : 'unknown gpu', ")"));
|
|
9656
9932
|
writeCache(detected);
|
|
9657
9933
|
return _context.abrupt("return", detected);
|
|
9658
|
-
case
|
|
9934
|
+
case 29:
|
|
9659
9935
|
case "end":
|
|
9660
9936
|
return _context.stop();
|
|
9661
9937
|
}
|
|
@@ -9666,9 +9942,9 @@ function _detectDeviceTier() {
|
|
|
9666
9942
|
|
|
9667
9943
|
function ownKeys$n(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9668
9944
|
function _objectSpread$n(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$n(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$n(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9669
|
-
function _createForOfIteratorHelper$
|
|
9670
|
-
function _unsupportedIterableToArray$
|
|
9671
|
-
function _arrayLikeToArray$
|
|
9945
|
+
function _createForOfIteratorHelper$Y(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$Y(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; } } }; }
|
|
9946
|
+
function _unsupportedIterableToArray$Y(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$Y(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$Y(r, a) : void 0; } }
|
|
9947
|
+
function _arrayLikeToArray$Y(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; }
|
|
9672
9948
|
var STORE_LOG = getLogger('RealTimeViewer', 'Store');
|
|
9673
9949
|
|
|
9674
9950
|
/**
|
|
@@ -9858,7 +10134,7 @@ var createPerformanceProfileSlice = function createPerformanceProfileSlice(set,
|
|
|
9858
10134
|
var nextProfiles = {
|
|
9859
10135
|
high: structuredClone(state.profiles.high)
|
|
9860
10136
|
};
|
|
9861
|
-
var _iterator = _createForOfIteratorHelper$
|
|
10137
|
+
var _iterator = _createForOfIteratorHelper$Y(OVERRIDE_PROFILE_TIERS),
|
|
9862
10138
|
_step;
|
|
9863
10139
|
try {
|
|
9864
10140
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -9950,9 +10226,9 @@ var createPerformanceProfileSlice = function createPerformanceProfileSlice(set,
|
|
|
9950
10226
|
};
|
|
9951
10227
|
};
|
|
9952
10228
|
|
|
9953
|
-
function _createForOfIteratorHelper$
|
|
9954
|
-
function _unsupportedIterableToArray$
|
|
9955
|
-
function _arrayLikeToArray$
|
|
10229
|
+
function _createForOfIteratorHelper$X(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$X(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; } } }; }
|
|
10230
|
+
function _unsupportedIterableToArray$X(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$X(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$X(r, a) : void 0; } }
|
|
10231
|
+
function _arrayLikeToArray$X(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; }
|
|
9956
10232
|
/**
|
|
9957
10233
|
* Planner overlay data — posNr, delete, copy, move/rotate capability flags.
|
|
9958
10234
|
* Host builds a Map keyed by `qualifiedElementKey(setId, elementKey)` — the element key is
|
|
@@ -9993,7 +10269,7 @@ function isMainType(t) {
|
|
|
9993
10269
|
/** How many MAIN elements the planning holds. */
|
|
9994
10270
|
function countMainElements(info) {
|
|
9995
10271
|
var count = 0;
|
|
9996
|
-
var _iterator = _createForOfIteratorHelper$
|
|
10272
|
+
var _iterator = _createForOfIteratorHelper$X(info.values()),
|
|
9997
10273
|
_step;
|
|
9998
10274
|
try {
|
|
9999
10275
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -10015,7 +10291,7 @@ function countMainElements(info) {
|
|
|
10015
10291
|
*/
|
|
10016
10292
|
function isSelectionPossible(info) {
|
|
10017
10293
|
var hasMain = false;
|
|
10018
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
10294
|
+
var _iterator2 = _createForOfIteratorHelper$X(info.values()),
|
|
10019
10295
|
_step2;
|
|
10020
10296
|
try {
|
|
10021
10297
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -10030,7 +10306,7 @@ function isSelectionPossible(info) {
|
|
|
10030
10306
|
_iterator2.f();
|
|
10031
10307
|
}
|
|
10032
10308
|
if (hasMain) return false;
|
|
10033
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
10309
|
+
var _iterator3 = _createForOfIteratorHelper$X(info.values()),
|
|
10034
10310
|
_step3;
|
|
10035
10311
|
try {
|
|
10036
10312
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -10048,7 +10324,7 @@ function isSelectionPossible(info) {
|
|
|
10048
10324
|
/** Avoids store churn when the host passes a new Map with identical entries each render. */
|
|
10049
10325
|
function elementOverlayMapsEqual(a, b) {
|
|
10050
10326
|
if (a.size !== b.size) return false;
|
|
10051
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
10327
|
+
var _iterator4 = _createForOfIteratorHelper$X(a),
|
|
10052
10328
|
_step4;
|
|
10053
10329
|
try {
|
|
10054
10330
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -10078,9 +10354,9 @@ function selectionScopeNames(rootName, getDescendants) {
|
|
|
10078
10354
|
return [rootName].concat(_toConsumableArray(getDescendants(rootName)));
|
|
10079
10355
|
}
|
|
10080
10356
|
|
|
10081
|
-
function _createForOfIteratorHelper$
|
|
10082
|
-
function _unsupportedIterableToArray$
|
|
10083
|
-
function _arrayLikeToArray$
|
|
10357
|
+
function _createForOfIteratorHelper$W(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$W(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; } } }; }
|
|
10358
|
+
function _unsupportedIterableToArray$W(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$W(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$W(r, a) : void 0; } }
|
|
10359
|
+
function _arrayLikeToArray$W(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; }
|
|
10084
10360
|
function ownKeys$m(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10085
10361
|
function _objectSpread$m(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$m(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$m(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10086
10362
|
var createPlannerUiSlice = function createPlannerUiSlice(set, get) {
|
|
@@ -10149,7 +10425,7 @@ var createPlannerUiSlice = function createPlannerUiSlice(set, get) {
|
|
|
10149
10425
|
var current = stack.pop();
|
|
10150
10426
|
var children = childrenOfName.get(current);
|
|
10151
10427
|
if (children) {
|
|
10152
|
-
var _iterator = _createForOfIteratorHelper$
|
|
10428
|
+
var _iterator = _createForOfIteratorHelper$W(children),
|
|
10153
10429
|
_step;
|
|
10154
10430
|
try {
|
|
10155
10431
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -10299,7 +10575,7 @@ var createDoorSwapSlice = function createDoorSwapSlice(set, get) {
|
|
|
10299
10575
|
},
|
|
10300
10576
|
doorSwapCommitted: null,
|
|
10301
10577
|
commitDoorSwap: function commitDoorSwap(source, target) {
|
|
10302
|
-
var _s$doorSwap
|
|
10578
|
+
var _s$doorSwap;
|
|
10303
10579
|
var s = get();
|
|
10304
10580
|
var doors = (_s$doorSwap = s.doorSwap) === null || _s$doorSwap === void 0 ? void 0 : _s$doorSwap.doors;
|
|
10305
10581
|
var from = doors === null || doors === void 0 ? void 0 : doors.find(function (door) {
|
|
@@ -10309,6 +10585,16 @@ var createDoorSwapSlice = function createDoorSwapSlice(set, get) {
|
|
|
10309
10585
|
return door.doorKey === target;
|
|
10310
10586
|
});
|
|
10311
10587
|
if (!from || !to) return;
|
|
10588
|
+
// The host still answers another operation: the door goes back instead of swapping.
|
|
10589
|
+
if (isOperationBlocked(s)) {
|
|
10590
|
+
set({
|
|
10591
|
+
doorSwapLifted: null,
|
|
10592
|
+
doorSwapTarget: null,
|
|
10593
|
+
doorSwapHint: null,
|
|
10594
|
+
doorSwapHover: null
|
|
10595
|
+
});
|
|
10596
|
+
return;
|
|
10597
|
+
}
|
|
10312
10598
|
var commit = {
|
|
10313
10599
|
source: source,
|
|
10314
10600
|
target: target,
|
|
@@ -10327,7 +10613,10 @@ var createDoorSwapSlice = function createDoorSwapSlice(set, get) {
|
|
|
10327
10613
|
doorSwapCommitted: null
|
|
10328
10614
|
});
|
|
10329
10615
|
}, COMMIT_HOLD_MAX_MS);
|
|
10330
|
-
(
|
|
10616
|
+
get().sendOperation('move', function () {
|
|
10617
|
+
var _getHostCallbacks$onD, _getHostCallbacks;
|
|
10618
|
+
return (_getHostCallbacks$onD = (_getHostCallbacks = getHostCallbacks()).onDoorSwap) === null || _getHostCallbacks$onD === void 0 ? void 0 : _getHostCallbacks$onD.call(_getHostCallbacks, from.slotKey, to.slotKey);
|
|
10619
|
+
});
|
|
10331
10620
|
},
|
|
10332
10621
|
clearDoorSwapCommitted: function clearDoorSwapCommitted() {
|
|
10333
10622
|
if (get().doorSwapCommitted) set({
|
|
@@ -10347,9 +10636,9 @@ var createDoorSwapSlice = function createDoorSwapSlice(set, get) {
|
|
|
10347
10636
|
|
|
10348
10637
|
function ownKeys$l(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10349
10638
|
function _objectSpread$l(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$l(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$l(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10350
|
-
function _createForOfIteratorHelper$
|
|
10351
|
-
function _unsupportedIterableToArray$
|
|
10352
|
-
function _arrayLikeToArray$
|
|
10639
|
+
function _createForOfIteratorHelper$V(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$V(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; } } }; }
|
|
10640
|
+
function _unsupportedIterableToArray$V(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$V(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$V(r, a) : void 0; } }
|
|
10641
|
+
function _arrayLikeToArray$V(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; }
|
|
10353
10642
|
var LOG$p = getLogger('RealTimeViewer', 'RTV-Next');
|
|
10354
10643
|
/** Releases {@link ROOM_SHELL_LOAD_ID} when the room chunk never mounts (a failed download, a canvas that is not up). */
|
|
10355
10644
|
var ROOM_SHELL_TIMEOUT_MS = 10000;
|
|
@@ -10381,7 +10670,7 @@ function deriveParentElementName(name, knownNames) {
|
|
|
10381
10670
|
function collectElements$1(node) {
|
|
10382
10671
|
var result = [];
|
|
10383
10672
|
if (node.isElement) result.push(node);
|
|
10384
|
-
var _iterator = _createForOfIteratorHelper$
|
|
10673
|
+
var _iterator = _createForOfIteratorHelper$V(node.children),
|
|
10385
10674
|
_step;
|
|
10386
10675
|
try {
|
|
10387
10676
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -10428,7 +10717,7 @@ function computeSceneMetrics(scene) {
|
|
|
10428
10717
|
max[1] = Math.max(max[1], wy);
|
|
10429
10718
|
max[2] = Math.max(max[2], wz);
|
|
10430
10719
|
}
|
|
10431
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
10720
|
+
var _iterator2 = _createForOfIteratorHelper$V(node.geoRefs),
|
|
10432
10721
|
_step2;
|
|
10433
10722
|
try {
|
|
10434
10723
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -10448,7 +10737,7 @@ function computeSceneMetrics(scene) {
|
|
|
10448
10737
|
} finally {
|
|
10449
10738
|
_iterator2.f();
|
|
10450
10739
|
}
|
|
10451
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
10740
|
+
var _iterator3 = _createForOfIteratorHelper$V(node.children),
|
|
10452
10741
|
_step3;
|
|
10453
10742
|
try {
|
|
10454
10743
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -10508,7 +10797,7 @@ var createSceneSlice = function createSceneSlice(set, get) {
|
|
|
10508
10797
|
var elementNames = new Set(elements.map(function (el) {
|
|
10509
10798
|
return el.name;
|
|
10510
10799
|
}));
|
|
10511
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
10800
|
+
var _iterator4 = _createForOfIteratorHelper$V(elements),
|
|
10512
10801
|
_step4;
|
|
10513
10802
|
try {
|
|
10514
10803
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -10538,7 +10827,7 @@ var createSceneSlice = function createSceneSlice(set, get) {
|
|
|
10538
10827
|
_iterator4.f();
|
|
10539
10828
|
}
|
|
10540
10829
|
var descendantsOfName = new Map();
|
|
10541
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
10830
|
+
var _iterator5 = _createForOfIteratorHelper$V(elements),
|
|
10542
10831
|
_step5;
|
|
10543
10832
|
try {
|
|
10544
10833
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -10753,20 +11042,72 @@ function applyHostElement(get, set, elementId, setId) {
|
|
|
10753
11042
|
})) !== null && _get$scene2d$elements !== void 0 ? _get$scene2d$elements : false : get().elements.some(function (e) {
|
|
10754
11043
|
return e.name === resolvedName;
|
|
10755
11044
|
}));
|
|
10756
|
-
|
|
11045
|
+
var previous = get().selectedElementName;
|
|
11046
|
+
if (resolvedName && isRealNode && previous !== resolvedName) {
|
|
11047
|
+
var _get$stepIdentity$key, _get$stepIdentity;
|
|
11048
|
+
var stepKey = (_get$stepIdentity$key = (_get$stepIdentity = get().stepIdentity) === null || _get$stepIdentity === void 0 ? void 0 : _get$stepIdentity.key) !== null && _get$stepIdentity$key !== void 0 ? _get$stepIdentity$key : null;
|
|
11049
|
+
var stepChanged = stepKey !== get().hostSelectionStepKey;
|
|
10757
11050
|
set({
|
|
10758
|
-
selectedElementName: resolvedName
|
|
11051
|
+
selectedElementName: resolvedName,
|
|
11052
|
+
hostSelectionStepKey: stepKey
|
|
10759
11053
|
});
|
|
10760
11054
|
// Selection alone must NOT move the camera (otherwise placing an accessory — which
|
|
10761
11055
|
// re-selects via this prop — reorients the view and shifts the orbit point even though
|
|
10762
|
-
// nothing about the framing changed). The camera
|
|
10763
|
-
// host-driven selection follows focus (sticky).
|
|
11056
|
+
// nothing about the framing changed). The camera moves while in focus mode, where
|
|
11057
|
+
// host-driven selection follows focus (sticky), and when the host switches to another article.
|
|
10764
11058
|
if (get().focusedElementName != null) {
|
|
10765
11059
|
get().focusOnElement(resolvedName);
|
|
11060
|
+
} else if (stepChanged && previous && articleKeyOf(previous) !== articleKeyOf(resolvedName)) {
|
|
11061
|
+
followArticleSwitch(get, set, resolvedName);
|
|
10766
11062
|
}
|
|
10767
11063
|
}
|
|
10768
11064
|
}
|
|
10769
11065
|
|
|
11066
|
+
/** A single click's centring on `elementName` (`cameraRetarget`): the camera now stands at that element. */
|
|
11067
|
+
function requestRetarget(get, set, elementName) {
|
|
11068
|
+
var _get$cameraRetarget$i, _get$cameraRetarget;
|
|
11069
|
+
set({
|
|
11070
|
+
cameraRetarget: {
|
|
11071
|
+
elementName: elementName,
|
|
11072
|
+
id: ((_get$cameraRetarget$i = (_get$cameraRetarget = get().cameraRetarget) === null || _get$cameraRetarget === void 0 ? void 0 : _get$cameraRetarget.id) !== null && _get$cameraRetarget$i !== void 0 ? _get$cameraRetarget$i : 0) + 1
|
|
11073
|
+
},
|
|
11074
|
+
clickCentredOn: elementName
|
|
11075
|
+
});
|
|
11076
|
+
}
|
|
11077
|
+
|
|
11078
|
+
/** The qualified key of the article an element belongs to: its own, an accessory's carcass's. */
|
|
11079
|
+
function articleKeyOf(name) {
|
|
11080
|
+
var _splitQualifiedElemen = splitQualifiedElementKey(parseQualifiedElementKey(name)),
|
|
11081
|
+
setId = _splitQualifiedElemen.setId,
|
|
11082
|
+
elementKey = _splitQualifiedElemen.elementKey;
|
|
11083
|
+
return "".concat(setId, "|").concat(elementKey.split('.')[0]);
|
|
11084
|
+
}
|
|
11085
|
+
|
|
11086
|
+
/**
|
|
11087
|
+
* The host switched to another article (the step's article buttons, which change the step key but not its rule). Centred
|
|
11088
|
+
* on an element by a click, the camera centres on the new article the same way; else the step's `enter` pose is flown
|
|
11089
|
+
* again when it depends on the subject (front-on to the selected article, a focus). An overview, a hold or a fixed angle
|
|
11090
|
+
* stays.
|
|
11091
|
+
*/
|
|
11092
|
+
function followArticleSwitch(get, set, elementName) {
|
|
11093
|
+
var s = get();
|
|
11094
|
+
if (!selectionMovesCamera(s)) return;
|
|
11095
|
+
if (s.clickCentredOn !== null) {
|
|
11096
|
+
requestRetarget(get, set, elementName);
|
|
11097
|
+
return;
|
|
11098
|
+
}
|
|
11099
|
+
var _resolveStepIntent = resolveStepIntent('enter', {
|
|
11100
|
+
step: s.stepIdentity,
|
|
11101
|
+
table: s.cameraConfig.steps
|
|
11102
|
+
}),
|
|
11103
|
+
intent = _resolveStepIntent.intent;
|
|
11104
|
+
if (intentFollowsSubject(intent)) s.applyCameraMoment('enter', {
|
|
11105
|
+
elementName: elementName
|
|
11106
|
+
}, 'article switch', {
|
|
11107
|
+
anchorsEntry: true
|
|
11108
|
+
});
|
|
11109
|
+
}
|
|
11110
|
+
|
|
10770
11111
|
/** Resolve the host's accessory selection (qualified key) against the current element list. */
|
|
10771
11112
|
function applyHostAccessory(get, set, accessoryKey) {
|
|
10772
11113
|
if (accessoryKey === null) {
|
|
@@ -10815,7 +11156,7 @@ var createSelectionSlice = function createSelectionSlice(set, get) {
|
|
|
10815
11156
|
selectedDpId: null
|
|
10816
11157
|
});
|
|
10817
11158
|
if (name && parentSetName) {
|
|
10818
|
-
var _get$elementsInfo$get
|
|
11159
|
+
var _get$elementsInfo$get;
|
|
10819
11160
|
var elementKey = parseElementKey(name);
|
|
10820
11161
|
var type = (_get$elementsInfo$get = get().elementsInfo.get(parseQualifiedElementKey(name))) === null || _get$elementsInfo$get === void 0 ? void 0 : _get$elementsInfo$get.type;
|
|
10821
11162
|
var accPath = type === 'accessoire' || type === 'shelfAccessoire' ? parseAccessoryPath(elementKey) : null;
|
|
@@ -10863,12 +11204,7 @@ var createSelectionSlice = function createSelectionSlice(set, get) {
|
|
|
10863
11204
|
pendingFocusName: name
|
|
10864
11205
|
});
|
|
10865
11206
|
if (!selectionMovesCamera(get())) return;
|
|
10866
|
-
set
|
|
10867
|
-
cameraRetarget: {
|
|
10868
|
-
elementName: name,
|
|
10869
|
-
id: ((_get$cameraRetarget$i = (_get$cameraRetarget = get().cameraRetarget) === null || _get$cameraRetarget === void 0 ? void 0 : _get$cameraRetarget.id) !== null && _get$cameraRetarget$i !== void 0 ? _get$cameraRetarget$i : 0) + 1
|
|
10870
|
-
}
|
|
10871
|
-
});
|
|
11207
|
+
requestRetarget(get, set, name);
|
|
10872
11208
|
} else if (name === null) {
|
|
10873
11209
|
// Mirror the select asymmetry: an accessory deselect routes through the dedicated callback
|
|
10874
11210
|
// (the host clears its accessory selection via selectShelfAccessorie(undefined)), not the
|
|
@@ -10906,6 +11242,7 @@ var createSelectionSlice = function createSelectionSlice(set, get) {
|
|
|
10906
11242
|
hostSelectedElementId: undefined,
|
|
10907
11243
|
hostSelectedSetId: null,
|
|
10908
11244
|
hostSelectedAccessoryKey: undefined,
|
|
11245
|
+
hostSelectionStepKey: undefined,
|
|
10909
11246
|
setSelectedElementFromProp: function setSelectedElementFromProp(elementId) {
|
|
10910
11247
|
var setId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
10911
11248
|
set({
|
|
@@ -11064,7 +11401,7 @@ var createViewModeSlice = function createViewModeSlice(set, get) {
|
|
|
11064
11401
|
function ownKeys$j(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11065
11402
|
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$j(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$j(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11066
11403
|
var useRTVStore$1 = create()(subscribeWithSelector(function () {
|
|
11067
|
-
return _objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j({}, createSceneSlice.apply(void 0, arguments)), createSelectionSlice.apply(void 0, arguments)), createInteractionSlice.apply(void 0, arguments)), createBlockedDragSlice.apply(void 0, arguments)), createViewModeSlice.apply(void 0, arguments)), createCameraSlice.apply(void 0, arguments)), createEnvironmentSlice.apply(void 0, arguments)), createAnalyzerGateSlice.apply(void 0, arguments)), createAssetErrorsSlice.apply(void 0, arguments)), createCaptureSlice.apply(void 0, arguments)), createPlannerUiSlice.apply(void 0, arguments)), createGLGenerationSlice.apply(void 0, arguments)), createVersionsSlice.apply(void 0, arguments)), createSceneLoadSlice.apply(void 0, arguments)), createDeckCutoutSlice.apply(void 0, arguments)), createDoorSwapSlice.apply(void 0, arguments)), createCoachSlice.apply(void 0, arguments)), createPerformanceProfileSlice.apply(void 0, arguments)), createAccessoryGridSlice.apply(void 0, arguments)), createAccessoryMoveSlice.apply(void 0, arguments)), createAccessoryDropSlice.apply(void 0, arguments)), createConfigSlice.apply(void 0, arguments));
|
|
11404
|
+
return _objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j(_objectSpread$j({}, createSceneSlice.apply(void 0, arguments)), createSelectionSlice.apply(void 0, arguments)), createInteractionSlice.apply(void 0, arguments)), createBlockedDragSlice.apply(void 0, arguments)), createPlannerOperationSlice.apply(void 0, arguments)), createViewModeSlice.apply(void 0, arguments)), createCameraSlice.apply(void 0, arguments)), createEnvironmentSlice.apply(void 0, arguments)), createAnalyzerGateSlice.apply(void 0, arguments)), createAssetErrorsSlice.apply(void 0, arguments)), createCaptureSlice.apply(void 0, arguments)), createPlannerUiSlice.apply(void 0, arguments)), createGLGenerationSlice.apply(void 0, arguments)), createVersionsSlice.apply(void 0, arguments)), createSceneLoadSlice.apply(void 0, arguments)), createDeckCutoutSlice.apply(void 0, arguments)), createDoorSwapSlice.apply(void 0, arguments)), createCoachSlice.apply(void 0, arguments)), createPerformanceProfileSlice.apply(void 0, arguments)), createAccessoryGridSlice.apply(void 0, arguments)), createAccessoryMoveSlice.apply(void 0, arguments)), createAccessoryDropSlice.apply(void 0, arguments)), createConfigSlice.apply(void 0, arguments));
|
|
11068
11405
|
}));
|
|
11069
11406
|
|
|
11070
11407
|
/** An average colour, each channel 0–1 as stored in the image. */
|
|
@@ -11168,9 +11505,9 @@ function releaseTextureSource(tex) {
|
|
|
11168
11505
|
*/
|
|
11169
11506
|
var TEXTURE_LOAD_RETRY_DELAYS_MS = [1000, 3000];
|
|
11170
11507
|
|
|
11171
|
-
function _createForOfIteratorHelper$
|
|
11172
|
-
function _unsupportedIterableToArray$
|
|
11173
|
-
function _arrayLikeToArray$
|
|
11508
|
+
function _createForOfIteratorHelper$U(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$U(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; } } }; }
|
|
11509
|
+
function _unsupportedIterableToArray$U(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$U(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$U(r, a) : void 0; } }
|
|
11510
|
+
function _arrayLikeToArray$U(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; }
|
|
11174
11511
|
var LOG$m = getLogger('RealTimeViewer', 'MaterialManager');
|
|
11175
11512
|
|
|
11176
11513
|
/**
|
|
@@ -11358,7 +11695,7 @@ function loadTexture(url, srgb, repeatU, repeatV) {
|
|
|
11358
11695
|
* and forgets the texture reports, so a map still missing is reported again.
|
|
11359
11696
|
*/
|
|
11360
11697
|
function evictFailedTextures() {
|
|
11361
|
-
var _iterator = _createForOfIteratorHelper$
|
|
11698
|
+
var _iterator = _createForOfIteratorHelper$U(textureCache),
|
|
11362
11699
|
_step;
|
|
11363
11700
|
try {
|
|
11364
11701
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -11372,7 +11709,7 @@ function evictFailedTextures() {
|
|
|
11372
11709
|
} finally {
|
|
11373
11710
|
_iterator.f();
|
|
11374
11711
|
}
|
|
11375
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
11712
|
+
var _iterator2 = _createForOfIteratorHelper$U(reportedFailures),
|
|
11376
11713
|
_step2;
|
|
11377
11714
|
try {
|
|
11378
11715
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -11402,7 +11739,7 @@ function recapCachedTextures() {
|
|
|
11402
11739
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
11403
11740
|
while (1) switch (_context.prev = _context.next) {
|
|
11404
11741
|
case 0:
|
|
11405
|
-
_iterator3 = _createForOfIteratorHelper$
|
|
11742
|
+
_iterator3 = _createForOfIteratorHelper$U(entries);
|
|
11406
11743
|
_context.prev = 1;
|
|
11407
11744
|
_iterator3.s();
|
|
11408
11745
|
case 3:
|
|
@@ -11474,7 +11811,7 @@ var COLOUR_MAP_SLOTS = new Set(['map', 'emissiveMap', 'sheenColorMap']);
|
|
|
11474
11811
|
*/
|
|
11475
11812
|
function reportMissingMaps(materialName, maps) {
|
|
11476
11813
|
var dataSlotsByUrl = new Map();
|
|
11477
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
11814
|
+
var _iterator4 = _createForOfIteratorHelper$U(maps),
|
|
11478
11815
|
_step4;
|
|
11479
11816
|
try {
|
|
11480
11817
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -11631,9 +11968,9 @@ function disposeTextures() {
|
|
|
11631
11968
|
reportedFailures.clear();
|
|
11632
11969
|
}
|
|
11633
11970
|
|
|
11634
|
-
function _createForOfIteratorHelper$
|
|
11635
|
-
function _unsupportedIterableToArray$
|
|
11636
|
-
function _arrayLikeToArray$
|
|
11971
|
+
function _createForOfIteratorHelper$T(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$T(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; } } }; }
|
|
11972
|
+
function _unsupportedIterableToArray$T(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$T(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$T(r, a) : void 0; } }
|
|
11973
|
+
function _arrayLikeToArray$T(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; }
|
|
11637
11974
|
|
|
11638
11975
|
/**
|
|
11639
11976
|
* Traverse a loaded Object3D graph (e.g. from GLTFLoader) and enable max
|
|
@@ -11645,7 +11982,7 @@ function enableAnisotropy(root) {
|
|
|
11645
11982
|
if (!child.isMesh) return;
|
|
11646
11983
|
var mesh = child;
|
|
11647
11984
|
var materials = Array.isArray(mesh.material) ? mesh.material : [mesh.material];
|
|
11648
|
-
var _iterator = _createForOfIteratorHelper$
|
|
11985
|
+
var _iterator = _createForOfIteratorHelper$T(materials),
|
|
11649
11986
|
_step;
|
|
11650
11987
|
try {
|
|
11651
11988
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -11673,7 +12010,7 @@ function enableAnisotropy(root) {
|
|
|
11673
12010
|
* to which sub-node (by name, or '' / 'ALL' for all meshes).
|
|
11674
12011
|
*/
|
|
11675
12012
|
function applyMaterials(object, matRefs, materialMap) {
|
|
11676
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
12013
|
+
var _iterator2 = _createForOfIteratorHelper$T(matRefs),
|
|
11677
12014
|
_step2;
|
|
11678
12015
|
try {
|
|
11679
12016
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -11719,9 +12056,9 @@ function applyMaterialToNamedNode(object, nodeName, mat) {
|
|
|
11719
12056
|
});
|
|
11720
12057
|
}
|
|
11721
12058
|
|
|
11722
|
-
function _createForOfIteratorHelper$
|
|
11723
|
-
function _unsupportedIterableToArray$
|
|
11724
|
-
function _arrayLikeToArray$
|
|
12059
|
+
function _createForOfIteratorHelper$S(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$S(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; } } }; }
|
|
12060
|
+
function _unsupportedIterableToArray$S(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$S(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$S(r, a) : void 0; } }
|
|
12061
|
+
function _arrayLikeToArray$S(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; }
|
|
11725
12062
|
|
|
11726
12063
|
// The archive's /draco/ folder contains Babylon.js-specific decoders (draco_decoder_gltf.*)
|
|
11727
12064
|
// which are incompatible with Three.js DRACOLoader. Always use the Google CDN which hosts
|
|
@@ -11804,7 +12141,7 @@ var previewGltfCache = new Map();
|
|
|
11804
12141
|
* evicting WITHOUT disposing would orphan whatever was uploaded until context loss.
|
|
11805
12142
|
*/
|
|
11806
12143
|
function evictPreviewGLTFs() {
|
|
11807
|
-
var _iterator = _createForOfIteratorHelper$
|
|
12144
|
+
var _iterator = _createForOfIteratorHelper$S(previewGltfCache),
|
|
11808
12145
|
_step;
|
|
11809
12146
|
try {
|
|
11810
12147
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -11831,7 +12168,7 @@ function disposeGltfResources(gltf) {
|
|
|
11831
12168
|
if (mesh.isMesh !== true) return;
|
|
11832
12169
|
(_mesh$geometry = mesh.geometry) === null || _mesh$geometry === void 0 || _mesh$geometry.dispose();
|
|
11833
12170
|
var materials = Array.isArray(mesh.material) ? mesh.material : [mesh.material];
|
|
11834
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
12171
|
+
var _iterator2 = _createForOfIteratorHelper$S(materials),
|
|
11835
12172
|
_step2;
|
|
11836
12173
|
try {
|
|
11837
12174
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -12039,9 +12376,9 @@ function applyRoomAo(material, surface) {
|
|
|
12039
12376
|
};
|
|
12040
12377
|
}
|
|
12041
12378
|
|
|
12042
|
-
function _createForOfIteratorHelper$
|
|
12043
|
-
function _unsupportedIterableToArray$
|
|
12044
|
-
function _arrayLikeToArray$
|
|
12379
|
+
function _createForOfIteratorHelper$R(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$R(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; } } }; }
|
|
12380
|
+
function _unsupportedIterableToArray$R(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$R(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(r, a) : void 0; } }
|
|
12381
|
+
function _arrayLikeToArray$R(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; }
|
|
12045
12382
|
function ownKeys$i(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12046
12383
|
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12047
12384
|
var LOG$l = getLogger('RealTimeViewer', 'MaterialManager');
|
|
@@ -12455,7 +12792,7 @@ function replaceFailedMaps(mat, failed, repeatU, repeatV) {
|
|
|
12455
12792
|
});
|
|
12456
12793
|
return COLOUR_MAP_SLOTS.has(slot) ? missingTexturePlaceholder(repeatU, repeatV) : null;
|
|
12457
12794
|
};
|
|
12458
|
-
var _iterator = _createForOfIteratorHelper$
|
|
12795
|
+
var _iterator = _createForOfIteratorHelper$R(STANDARD_MAP_SLOTS),
|
|
12459
12796
|
_step;
|
|
12460
12797
|
try {
|
|
12461
12798
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -12468,7 +12805,7 @@ function replaceFailedMaps(mat, failed, repeatU, repeatV) {
|
|
|
12468
12805
|
_iterator.f();
|
|
12469
12806
|
}
|
|
12470
12807
|
if (!(mat instanceof MeshPhysicalMaterial)) return swapped;
|
|
12471
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
12808
|
+
var _iterator2 = _createForOfIteratorHelper$R(PHYSICAL_MAP_SLOTS),
|
|
12472
12809
|
_step2;
|
|
12473
12810
|
try {
|
|
12474
12811
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -12525,9 +12862,9 @@ function adoptPristineFadeState(mat) {
|
|
|
12525
12862
|
clearFadeOriginal(mat);
|
|
12526
12863
|
}
|
|
12527
12864
|
|
|
12528
|
-
function _createForOfIteratorHelper$
|
|
12529
|
-
function _unsupportedIterableToArray$
|
|
12530
|
-
function _arrayLikeToArray$
|
|
12865
|
+
function _createForOfIteratorHelper$Q(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$Q(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; } } }; }
|
|
12866
|
+
function _unsupportedIterableToArray$Q(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$Q(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$Q(r, a) : void 0; } }
|
|
12867
|
+
function _arrayLikeToArray$Q(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; }
|
|
12531
12868
|
function ownKeys$h(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12532
12869
|
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12533
12870
|
var LOG$k = getLogger('RealTimeViewer', 'CausticReceiver');
|
|
@@ -12764,7 +13101,7 @@ function acquireCausticReceiver(source, uniforms) {
|
|
|
12764
13101
|
|
|
12765
13102
|
/** Drop every cached receiver clone (disposeTextureCache) — keyed on sources that just died. */
|
|
12766
13103
|
function clearCausticReceiverCache() {
|
|
12767
|
-
var _iterator = _createForOfIteratorHelper$
|
|
13104
|
+
var _iterator = _createForOfIteratorHelper$Q(receiverCache.values()),
|
|
12768
13105
|
_step;
|
|
12769
13106
|
try {
|
|
12770
13107
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -12790,9 +13127,9 @@ function releaseCausticReceiver(source) {
|
|
|
12790
13127
|
}
|
|
12791
13128
|
}
|
|
12792
13129
|
|
|
12793
|
-
function _createForOfIteratorHelper$
|
|
12794
|
-
function _unsupportedIterableToArray$
|
|
12795
|
-
function _arrayLikeToArray$
|
|
13130
|
+
function _createForOfIteratorHelper$P(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$P(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; } } }; }
|
|
13131
|
+
function _unsupportedIterableToArray$P(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$P(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$P(r, a) : void 0; } }
|
|
13132
|
+
function _arrayLikeToArray$P(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; }
|
|
12796
13133
|
var LOG$j = getLogger('RealTimeViewer', 'MaterialManager');
|
|
12797
13134
|
|
|
12798
13135
|
// Standard materials (DivaStandardMaterials library) are fetched by name and
|
|
@@ -12959,7 +13296,7 @@ function reportStandardMaterials(root) {
|
|
|
12959
13296
|
var shownName = (_name = (_mesh$material = mesh.material) === null || _mesh$material === void 0 ? void 0 : _mesh$material.name) !== null && _name !== void 0 ? _name : '';
|
|
12960
13297
|
if (shownName.startsWith(STD_PREFIX)) {
|
|
12961
13298
|
var _standardReports$get;
|
|
12962
|
-
var _iterator = _createForOfIteratorHelper$
|
|
13299
|
+
var _iterator = _createForOfIteratorHelper$P((_standardReports$get = standardReports.get(shownName.slice(STD_PREFIX.length))) !== null && _standardReports$get !== void 0 ? _standardReports$get : []),
|
|
12963
13300
|
_step;
|
|
12964
13301
|
try {
|
|
12965
13302
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -13070,7 +13407,7 @@ function warmStandardMaterials(geoUrls, archiveBaseUrl, config) {
|
|
|
13070
13407
|
geos: urls.length,
|
|
13071
13408
|
names: names.size
|
|
13072
13409
|
});
|
|
13073
|
-
_iterator2 = _createForOfIteratorHelper$
|
|
13410
|
+
_iterator2 = _createForOfIteratorHelper$P(names);
|
|
13074
13411
|
try {
|
|
13075
13412
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
13076
13413
|
name = _step2.value;
|
|
@@ -13142,7 +13479,7 @@ function retryFailedTextures(matAssets) {
|
|
|
13142
13479
|
if (retriedMaterialSet !== null && materialSet !== retriedMaterialSet) {
|
|
13143
13480
|
evictFailedTextures();
|
|
13144
13481
|
if (productKeysMissingMaps.size > 0) {
|
|
13145
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
13482
|
+
var _iterator3 = _createForOfIteratorHelper$P(productKeysMissingMaps),
|
|
13146
13483
|
_step3;
|
|
13147
13484
|
try {
|
|
13148
13485
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -13165,13 +13502,13 @@ function retryFailedTextures(matAssets) {
|
|
|
13165
13502
|
|
|
13166
13503
|
/** Sends the reports of the product materials of `matAssets` (built by {@link loadMaterials}) once per `assetErrorEpoch`. */
|
|
13167
13504
|
function reportProductMaterials(matAssets) {
|
|
13168
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
13505
|
+
var _iterator4 = _createForOfIteratorHelper$P(new Set(matAssets.map(productMaterialKey))),
|
|
13169
13506
|
_step4;
|
|
13170
13507
|
try {
|
|
13171
13508
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
13172
13509
|
var _productReports$get;
|
|
13173
13510
|
var key = _step4.value;
|
|
13174
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
13511
|
+
var _iterator5 = _createForOfIteratorHelper$P((_productReports$get = productReports.get(key)) !== null && _productReports$get !== void 0 ? _productReports$get : []),
|
|
13175
13512
|
_step5;
|
|
13176
13513
|
try {
|
|
13177
13514
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -13694,9 +14031,9 @@ function resolveShadowFlags(kind, config) {
|
|
|
13694
14031
|
};
|
|
13695
14032
|
}
|
|
13696
14033
|
|
|
13697
|
-
function _createForOfIteratorHelper$
|
|
13698
|
-
function _unsupportedIterableToArray$
|
|
13699
|
-
function _arrayLikeToArray$
|
|
14034
|
+
function _createForOfIteratorHelper$O(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$O(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; } } }; }
|
|
14035
|
+
function _unsupportedIterableToArray$O(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$O(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$O(r, a) : void 0; } }
|
|
14036
|
+
function _arrayLikeToArray$O(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; }
|
|
13700
14037
|
/*
|
|
13701
14038
|
* 2D polygon primitives — area, simplification, self-intersection guard, hull.
|
|
13702
14039
|
*/
|
|
@@ -13730,7 +14067,7 @@ function polygonBounds(points) {
|
|
|
13730
14067
|
minZ: Infinity,
|
|
13731
14068
|
maxZ: -Infinity
|
|
13732
14069
|
};
|
|
13733
|
-
var _iterator = _createForOfIteratorHelper$
|
|
14070
|
+
var _iterator = _createForOfIteratorHelper$O(points),
|
|
13734
14071
|
_step;
|
|
13735
14072
|
try {
|
|
13736
14073
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -13867,7 +14204,7 @@ function convexHull(points) {
|
|
|
13867
14204
|
};
|
|
13868
14205
|
var build = function build(input) {
|
|
13869
14206
|
var chain = [];
|
|
13870
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
14207
|
+
var _iterator2 = _createForOfIteratorHelper$O(input),
|
|
13871
14208
|
_step2;
|
|
13872
14209
|
try {
|
|
13873
14210
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -13918,9 +14255,9 @@ function ensureSimplePolygon(points) {
|
|
|
13918
14255
|
};
|
|
13919
14256
|
}
|
|
13920
14257
|
|
|
13921
|
-
function _createForOfIteratorHelper$
|
|
13922
|
-
function _unsupportedIterableToArray$
|
|
13923
|
-
function _arrayLikeToArray$
|
|
14258
|
+
function _createForOfIteratorHelper$N(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$N(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; } } }; }
|
|
14259
|
+
function _unsupportedIterableToArray$N(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$N(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$N(r, a) : void 0; } }
|
|
14260
|
+
function _arrayLikeToArray$N(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; }
|
|
13924
14261
|
|
|
13925
14262
|
/** One wall in world metres: inner face a → b, unit direction d, outward normal n, and its mitred outer ends along d. */
|
|
13926
14263
|
|
|
@@ -14005,7 +14342,7 @@ function buildWallPieces(wall, height) {
|
|
|
14005
14342
|
return a.offset - b.offset;
|
|
14006
14343
|
});
|
|
14007
14344
|
var cursor = 0;
|
|
14008
|
-
var _iterator = _createForOfIteratorHelper$
|
|
14345
|
+
var _iterator = _createForOfIteratorHelper$N(openings),
|
|
14009
14346
|
_step;
|
|
14010
14347
|
try {
|
|
14011
14348
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -14129,9 +14466,9 @@ function pushPrism(pos, nor, quad, y0, y1) {
|
|
|
14129
14466
|
}
|
|
14130
14467
|
}
|
|
14131
14468
|
|
|
14132
|
-
function _createForOfIteratorHelper$
|
|
14133
|
-
function _unsupportedIterableToArray$
|
|
14134
|
-
function _arrayLikeToArray$
|
|
14469
|
+
function _createForOfIteratorHelper$M(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$M(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; } } }; }
|
|
14470
|
+
function _unsupportedIterableToArray$M(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$M(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$M(r, a) : void 0; } }
|
|
14471
|
+
function _arrayLikeToArray$M(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; }
|
|
14135
14472
|
/** The sphere around the scene and the room's walls, so the sun's frustum reaches every wall and the whole floor. */
|
|
14136
14473
|
function withRoomBounds(center, radius, room) {
|
|
14137
14474
|
if (!(room !== null && room !== void 0 && room.footprint.length)) return {
|
|
@@ -14179,7 +14516,7 @@ function MovingElementShadowGate() {
|
|
|
14179
14516
|
// The grabbed element's accessories (nested ones too) are sibling nodes, not three.js children.
|
|
14180
14517
|
var names = new Set([targetName].concat(_toConsumableArray(useRTVStore$1.getState().getAllDescendantNames(targetName)), _toConsumableArray(followerNames)));
|
|
14181
14518
|
var disabled = [];
|
|
14182
|
-
var _iterator = _createForOfIteratorHelper$
|
|
14519
|
+
var _iterator = _createForOfIteratorHelper$M(names),
|
|
14183
14520
|
_step;
|
|
14184
14521
|
try {
|
|
14185
14522
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -14289,9 +14626,9 @@ function SceneShadowSystem() {
|
|
|
14289
14626
|
});
|
|
14290
14627
|
}
|
|
14291
14628
|
|
|
14292
|
-
function _createForOfIteratorHelper$
|
|
14293
|
-
function _unsupportedIterableToArray$
|
|
14294
|
-
function _arrayLikeToArray$
|
|
14629
|
+
function _createForOfIteratorHelper$L(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$L(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; } } }; }
|
|
14630
|
+
function _unsupportedIterableToArray$L(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$L(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$L(r, a) : void 0; } }
|
|
14631
|
+
function _arrayLikeToArray$L(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; }
|
|
14295
14632
|
function resolveTarget(target) {
|
|
14296
14633
|
if (!target) return null;
|
|
14297
14634
|
if ('current' in target) {
|
|
@@ -14352,7 +14689,7 @@ function useShadowFlags(target, kind) {
|
|
|
14352
14689
|
if (flagsChanged) {
|
|
14353
14690
|
var mats = mesh.material;
|
|
14354
14691
|
if (Array.isArray(mats)) {
|
|
14355
|
-
var _iterator = _createForOfIteratorHelper$
|
|
14692
|
+
var _iterator = _createForOfIteratorHelper$L(mats),
|
|
14356
14693
|
_step;
|
|
14357
14694
|
try {
|
|
14358
14695
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -14392,9 +14729,9 @@ function disableWaterUniforms() {
|
|
|
14392
14729
|
waterUniforms.causticTex = null;
|
|
14393
14730
|
}
|
|
14394
14731
|
|
|
14395
|
-
function _createForOfIteratorHelper$
|
|
14396
|
-
function _unsupportedIterableToArray$
|
|
14397
|
-
function _arrayLikeToArray$
|
|
14732
|
+
function _createForOfIteratorHelper$K(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$K(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; } } }; }
|
|
14733
|
+
function _unsupportedIterableToArray$K(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$K(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$K(r, a) : void 0; } }
|
|
14734
|
+
function _arrayLikeToArray$K(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; }
|
|
14398
14735
|
|
|
14399
14736
|
/** Restore record for one mesh whose material was swapped for a receiver clone. */
|
|
14400
14737
|
|
|
@@ -14454,7 +14791,7 @@ function useCausticReceivers(root, enabled) {
|
|
|
14454
14791
|
// Release rather than dispose — the cache disposes the clone once the
|
|
14455
14792
|
// last hook holding it lets go; `original` is a shared MaterialManager
|
|
14456
14793
|
// instance other geos are still drawing with either way.
|
|
14457
|
-
var _iterator = _createForOfIteratorHelper$
|
|
14794
|
+
var _iterator = _createForOfIteratorHelper$K(acquiredSources),
|
|
14458
14795
|
_step;
|
|
14459
14796
|
try {
|
|
14460
14797
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -14476,7 +14813,7 @@ function useCausticReceivers(root, enabled) {
|
|
|
14476
14813
|
// `enabled` flag through, which is what stops receivers from sampling
|
|
14477
14814
|
// disposed textures once the water unmounts.
|
|
14478
14815
|
useFrame(function () {
|
|
14479
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
14816
|
+
var _iterator2 = _createForOfIteratorHelper$K(patchedRef.current),
|
|
14480
14817
|
_step2;
|
|
14481
14818
|
try {
|
|
14482
14819
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -14632,9 +14969,9 @@ var FRAME_ORDER = {
|
|
|
14632
14969
|
|
|
14633
14970
|
function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14634
14971
|
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14635
|
-
function _createForOfIteratorHelper$
|
|
14636
|
-
function _unsupportedIterableToArray$
|
|
14637
|
-
function _arrayLikeToArray$
|
|
14972
|
+
function _createForOfIteratorHelper$J(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$J(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; } } }; }
|
|
14973
|
+
function _unsupportedIterableToArray$J(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$J(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$J(r, a) : void 0; } }
|
|
14974
|
+
function _arrayLikeToArray$J(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; }
|
|
14638
14975
|
/* What the planar reflections must leave out of each other's renders. */
|
|
14639
14976
|
|
|
14640
14977
|
/** Mirror overlays (`mirrorSurfaces`), each with the matte stand-in its glass wears while another reflection renders. */
|
|
@@ -14666,7 +15003,7 @@ function isFloorReflectionCapturing() {
|
|
|
14666
15003
|
*/
|
|
14667
15004
|
function withMirrorsMatte(render) {
|
|
14668
15005
|
var swapped = [];
|
|
14669
|
-
var _iterator = _createForOfIteratorHelper$
|
|
15006
|
+
var _iterator = _createForOfIteratorHelper$J(mirrorOverlays),
|
|
14670
15007
|
_step;
|
|
14671
15008
|
try {
|
|
14672
15009
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -14710,7 +15047,7 @@ function withMirrorsMatte(render) {
|
|
|
14710
15047
|
function renderFloorReflection(render) {
|
|
14711
15048
|
floorCapturing = true;
|
|
14712
15049
|
var hidden = [];
|
|
14713
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
15050
|
+
var _iterator2 = _createForOfIteratorHelper$J(floorUnreflected),
|
|
14714
15051
|
_step2;
|
|
14715
15052
|
try {
|
|
14716
15053
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -14759,7 +15096,7 @@ function renderMirrorReflection(render) {
|
|
|
14759
15096
|
mixStrength: material.mixStrength
|
|
14760
15097
|
};
|
|
14761
15098
|
});
|
|
14762
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
15099
|
+
var _iterator3 = _createForOfIteratorHelper$J(saved),
|
|
14763
15100
|
_step3;
|
|
14764
15101
|
try {
|
|
14765
15102
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -14778,7 +15115,7 @@ function renderMirrorReflection(render) {
|
|
|
14778
15115
|
var squared = _toConsumableArray(cameraSquaredWallEnds).filter(function (end) {
|
|
14779
15116
|
return end.visible;
|
|
14780
15117
|
});
|
|
14781
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
15118
|
+
var _iterator4 = _createForOfIteratorHelper$J(shown),
|
|
14782
15119
|
_step4;
|
|
14783
15120
|
try {
|
|
14784
15121
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -14790,7 +15127,7 @@ function renderMirrorReflection(render) {
|
|
|
14790
15127
|
} finally {
|
|
14791
15128
|
_iterator4.f();
|
|
14792
15129
|
}
|
|
14793
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
15130
|
+
var _iterator5 = _createForOfIteratorHelper$J(squared),
|
|
14794
15131
|
_step5;
|
|
14795
15132
|
try {
|
|
14796
15133
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -14806,7 +15143,7 @@ function renderMirrorReflection(render) {
|
|
|
14806
15143
|
withMirrorsMatte(render);
|
|
14807
15144
|
} finally {
|
|
14808
15145
|
mirrorRendering = false;
|
|
14809
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
15146
|
+
var _iterator6 = _createForOfIteratorHelper$J(saved),
|
|
14810
15147
|
_step6;
|
|
14811
15148
|
try {
|
|
14812
15149
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -14822,7 +15159,7 @@ function renderMirrorReflection(render) {
|
|
|
14822
15159
|
} finally {
|
|
14823
15160
|
_iterator6.f();
|
|
14824
15161
|
}
|
|
14825
|
-
var _iterator7 = _createForOfIteratorHelper$
|
|
15162
|
+
var _iterator7 = _createForOfIteratorHelper$J(shown),
|
|
14826
15163
|
_step7;
|
|
14827
15164
|
try {
|
|
14828
15165
|
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
@@ -14834,7 +15171,7 @@ function renderMirrorReflection(render) {
|
|
|
14834
15171
|
} finally {
|
|
14835
15172
|
_iterator7.f();
|
|
14836
15173
|
}
|
|
14837
|
-
var _iterator8 = _createForOfIteratorHelper$
|
|
15174
|
+
var _iterator8 = _createForOfIteratorHelper$J(squared),
|
|
14838
15175
|
_step8;
|
|
14839
15176
|
try {
|
|
14840
15177
|
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
@@ -14858,7 +15195,7 @@ function lendMirrorOverlays(from, to) {
|
|
|
14858
15195
|
var lent = from.children.filter(function (child) {
|
|
14859
15196
|
return mirrorOverlays.has(child);
|
|
14860
15197
|
});
|
|
14861
|
-
var _iterator9 = _createForOfIteratorHelper$
|
|
15198
|
+
var _iterator9 = _createForOfIteratorHelper$J(lent),
|
|
14862
15199
|
_step9;
|
|
14863
15200
|
try {
|
|
14864
15201
|
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
@@ -14875,7 +15212,7 @@ function lendMirrorOverlays(from, to) {
|
|
|
14875
15212
|
_iterator9.f();
|
|
14876
15213
|
}
|
|
14877
15214
|
return function () {
|
|
14878
|
-
var _iterator10 = _createForOfIteratorHelper$
|
|
15215
|
+
var _iterator10 = _createForOfIteratorHelper$J(lent),
|
|
14879
15216
|
_step10;
|
|
14880
15217
|
try {
|
|
14881
15218
|
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
@@ -14930,7 +15267,7 @@ function planeRenderFor(planeKey, frame) {
|
|
|
14930
15267
|
|
|
14931
15268
|
/** Records `leader`'s reflection for its plane in `frame`; earlier frames' records go. */
|
|
14932
15269
|
function notePlaneRender(planeKey, render) {
|
|
14933
|
-
var _iterator11 = _createForOfIteratorHelper$
|
|
15270
|
+
var _iterator11 = _createForOfIteratorHelper$J(planeRenders),
|
|
14934
15271
|
_step11;
|
|
14935
15272
|
try {
|
|
14936
15273
|
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
@@ -15249,9 +15586,9 @@ function useMirrorSurfaces(root) {
|
|
|
15249
15586
|
}, [root, invalidate, scale, maxSize, multisample]);
|
|
15250
15587
|
}
|
|
15251
15588
|
|
|
15252
|
-
function _createForOfIteratorHelper$
|
|
15253
|
-
function _unsupportedIterableToArray$
|
|
15254
|
-
function _arrayLikeToArray$
|
|
15589
|
+
function _createForOfIteratorHelper$I(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$I(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; } } }; }
|
|
15590
|
+
function _unsupportedIterableToArray$I(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$I(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$I(r, a) : void 0; } }
|
|
15591
|
+
function _arrayLikeToArray$I(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; }
|
|
15255
15592
|
|
|
15256
15593
|
/*
|
|
15257
15594
|
* Material crossfade: a geo re-cloned with the same geometry but other materials (a fabric, colour or wood picked in
|
|
@@ -15383,7 +15720,7 @@ var MaterialCrossfade = /*#__PURE__*/function () {
|
|
|
15383
15720
|
this.group.position.copy(root.position);
|
|
15384
15721
|
this.group.quaternion.copy(root.quaternion);
|
|
15385
15722
|
this.group.scale.copy(root.scale);
|
|
15386
|
-
var _iterator = _createForOfIteratorHelper$
|
|
15723
|
+
var _iterator = _createForOfIteratorHelper$I(targets),
|
|
15387
15724
|
_step;
|
|
15388
15725
|
try {
|
|
15389
15726
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -15461,7 +15798,7 @@ var MaterialCrossfade = /*#__PURE__*/function () {
|
|
|
15461
15798
|
return false;
|
|
15462
15799
|
}
|
|
15463
15800
|
var weight = this.weight;
|
|
15464
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
15801
|
+
var _iterator2 = _createForOfIteratorHelper$I(this.copies.values()),
|
|
15465
15802
|
_step2;
|
|
15466
15803
|
try {
|
|
15467
15804
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -15473,7 +15810,7 @@ var MaterialCrossfade = /*#__PURE__*/function () {
|
|
|
15473
15810
|
} finally {
|
|
15474
15811
|
_iterator2.f();
|
|
15475
15812
|
}
|
|
15476
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
15813
|
+
var _iterator3 = _createForOfIteratorHelper$I(this.overlays),
|
|
15477
15814
|
_step3;
|
|
15478
15815
|
try {
|
|
15479
15816
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -15504,7 +15841,7 @@ var MaterialCrossfade = /*#__PURE__*/function () {
|
|
|
15504
15841
|
key: "dispose",
|
|
15505
15842
|
value: function dispose() {
|
|
15506
15843
|
this.group.removeFromParent();
|
|
15507
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
15844
|
+
var _iterator4 = _createForOfIteratorHelper$I(this.copies.values()),
|
|
15508
15845
|
_step4;
|
|
15509
15846
|
try {
|
|
15510
15847
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -15551,7 +15888,7 @@ function hasMaterialCrossfades() {
|
|
|
15551
15888
|
* @returns whether any still runs (and needs another frame).
|
|
15552
15889
|
*/
|
|
15553
15890
|
function advanceMaterialCrossfades(deltaMs) {
|
|
15554
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
15891
|
+
var _iterator5 = _createForOfIteratorHelper$I(runningFades),
|
|
15555
15892
|
_step5;
|
|
15556
15893
|
try {
|
|
15557
15894
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -15568,7 +15905,7 @@ function advanceMaterialCrossfades(deltaMs) {
|
|
|
15568
15905
|
|
|
15569
15906
|
/** Ends every fade at once: the new materials show. */
|
|
15570
15907
|
function finishMaterialCrossfades() {
|
|
15571
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
15908
|
+
var _iterator6 = _createForOfIteratorHelper$I(runningFades),
|
|
15572
15909
|
_step6;
|
|
15573
15910
|
try {
|
|
15574
15911
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -15690,9 +16027,9 @@ function MaterialCrossfadeClock() {
|
|
|
15690
16027
|
return null;
|
|
15691
16028
|
}
|
|
15692
16029
|
|
|
15693
|
-
function _createForOfIteratorHelper$
|
|
15694
|
-
function _unsupportedIterableToArray$
|
|
15695
|
-
function _arrayLikeToArray$
|
|
16030
|
+
function _createForOfIteratorHelper$H(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$H(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; } } }; }
|
|
16031
|
+
function _unsupportedIterableToArray$H(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$H(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$H(r, a) : void 0; } }
|
|
16032
|
+
function _arrayLikeToArray$H(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; }
|
|
15696
16033
|
function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15697
16034
|
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15698
16035
|
var LOG$i = getLogger('RealTimeViewer', 'GeoInstance');
|
|
@@ -15872,7 +16209,7 @@ function GeoScene(_ref2) {
|
|
|
15872
16209
|
// internal GLTF transforms are discarded. Scale is preserved.
|
|
15873
16210
|
clone.position.set(0, 0, 0);
|
|
15874
16211
|
clone.rotation.set(0, 0, 0);
|
|
15875
|
-
var _iterator = _createForOfIteratorHelper$
|
|
16212
|
+
var _iterator = _createForOfIteratorHelper$H(clone.children),
|
|
15876
16213
|
_step;
|
|
15877
16214
|
try {
|
|
15878
16215
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -15957,9 +16294,9 @@ function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
15957
16294
|
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15958
16295
|
function _callSuper$2(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15959
16296
|
function _isNativeReflectConstruct$2() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15960
|
-
function _createForOfIteratorHelper$
|
|
15961
|
-
function _unsupportedIterableToArray$
|
|
15962
|
-
function _arrayLikeToArray$
|
|
16297
|
+
function _createForOfIteratorHelper$G(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$G(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; } } }; }
|
|
16298
|
+
function _unsupportedIterableToArray$G(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$G(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$G(r, a) : void 0; } }
|
|
16299
|
+
function _arrayLikeToArray$G(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; }
|
|
15963
16300
|
var LOG$h = getLogger('RealTimeViewer', 'AccGrid');
|
|
15964
16301
|
var CM = 1 / 100;
|
|
15965
16302
|
var ZERO = [0, 0, 0];
|
|
@@ -16034,7 +16371,7 @@ function geoOf(grids, name) {
|
|
|
16034
16371
|
seenGeos.clear();
|
|
16035
16372
|
seenCatalog = catalog;
|
|
16036
16373
|
}
|
|
16037
|
-
var _iterator = _createForOfIteratorHelper$
|
|
16374
|
+
var _iterator = _createForOfIteratorHelper$G(grids !== null && grids !== void 0 ? grids : []),
|
|
16038
16375
|
_step;
|
|
16039
16376
|
try {
|
|
16040
16377
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -16140,7 +16477,7 @@ function glbFolderOf(asset) {
|
|
|
16140
16477
|
* variant mesh reuses this anchor (the group is already snapped to the target by SceneTree). */
|
|
16141
16478
|
function findBaseMesh(node, geoAssets) {
|
|
16142
16479
|
var accPos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ZERO;
|
|
16143
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
16480
|
+
var _iterator2 = _createForOfIteratorHelper$G(node.geoRefs),
|
|
16144
16481
|
_step2;
|
|
16145
16482
|
try {
|
|
16146
16483
|
var _loop = function _loop() {
|
|
@@ -16166,7 +16503,7 @@ function findBaseMesh(node, geoAssets) {
|
|
|
16166
16503
|
} finally {
|
|
16167
16504
|
_iterator2.f();
|
|
16168
16505
|
}
|
|
16169
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
16506
|
+
var _iterator3 = _createForOfIteratorHelper$G(node.children),
|
|
16170
16507
|
_step3;
|
|
16171
16508
|
try {
|
|
16172
16509
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -16503,9 +16840,9 @@ function useViewModeRuntime() {
|
|
|
16503
16840
|
}
|
|
16504
16841
|
|
|
16505
16842
|
var _excluded$4 = ["out"];
|
|
16506
|
-
function _createForOfIteratorHelper$
|
|
16507
|
-
function _unsupportedIterableToArray$
|
|
16508
|
-
function _arrayLikeToArray$
|
|
16843
|
+
function _createForOfIteratorHelper$F(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$F(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; } } }; }
|
|
16844
|
+
function _unsupportedIterableToArray$F(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$F(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$F(r, a) : void 0; } }
|
|
16845
|
+
function _arrayLikeToArray$F(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; }
|
|
16509
16846
|
var _inv = new Matrix4();
|
|
16510
16847
|
var _toLocal = new Matrix4();
|
|
16511
16848
|
var _meshBox = new Box3();
|
|
@@ -16557,7 +16894,7 @@ function visitLocalGeometry(object, visit, visibleOnly, ownOnly) {
|
|
|
16557
16894
|
var geoBBox = mesh.geometry.boundingBox;
|
|
16558
16895
|
if (geoBBox && !geoBBox.isEmpty()) visit(_meshBox.copy(geoBBox).applyMatrix4(_toLocal.multiplyMatrices(_inv, mesh.matrixWorld)));
|
|
16559
16896
|
}
|
|
16560
|
-
var _iterator = _createForOfIteratorHelper$
|
|
16897
|
+
var _iterator = _createForOfIteratorHelper$F(object.children),
|
|
16561
16898
|
_step;
|
|
16562
16899
|
try {
|
|
16563
16900
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -16761,6 +17098,17 @@ function usePlanAnchors(setId, elementId, isBox) {
|
|
|
16761
17098
|
};
|
|
16762
17099
|
}
|
|
16763
17100
|
|
|
17101
|
+
/**
|
|
17102
|
+
* Whether the element overlay may show its copy arrows. They anchor to the planner's plan (`scene2d`, the AVL / AVR
|
|
17103
|
+
* docking points) relative to where the element shows; while a drag or turn runs, and until the answer to a move, add,
|
|
17104
|
+
* delete or option change shows, the two disagree (a released move is held at its drop, the plan or the 3D scene still
|
|
17105
|
+
* has the other pose), so the arrows would stand at the old place. They wait for the answer; they could not be used
|
|
17106
|
+
* meanwhile anyway.
|
|
17107
|
+
*/
|
|
17108
|
+
function copyArrowsAllowed(s) {
|
|
17109
|
+
return !s.isDragging && !s.isRotating && s.pendingOperation == null;
|
|
17110
|
+
}
|
|
17111
|
+
|
|
16764
17112
|
/*
|
|
16765
17113
|
* The handles drawn into the scene in 3D (the copy arrows): they foreshorten with the view, at one size and with one
|
|
16766
17114
|
* visibility rule (`<Html transform>`, or `planeSpriteMatrix`).
|
|
@@ -16854,14 +17202,14 @@ var groupUp = "group-up-i-uhH";
|
|
|
16854
17202
|
var groupRight = "group-right-dt8dl";
|
|
16855
17203
|
var groupLeft = "group-left-ZGK9o";
|
|
16856
17204
|
var toolbarRow = "toolbar-row-IPYtC";
|
|
16857
|
-
var css_248z$5 = "/* One-shot fade-in for the billboards. They mount the moment a 2D↔3D fly\n settles (gated on `!viewModeTransitioning`), so this plays exactly when the\n buttons reappear after the transition — no JS timing needed. */\n@keyframes rtvOverlayFadeIn--cHFl {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n.pos-nr-badge-Snzgu {\n pointer-events: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n box-sizing: border-box;\n width: 22px;\n height: 22px;\n min-width: 22px;\n min-height: 22px;\n padding: 0;\n aspect-ratio: 1 / 1;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 11px;\n font-weight: 600;\n font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;\n line-height: 1;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n cursor: pointer;\n border: none;\n transition: background 0.15s, transform 0.15s;\n}\n\n.pos-nr-badge-standard-xNUE4 {\n background: #dfdfdf;\n color: #111;\n}\n\n.pos-nr-badge-gold-3Cn3W {\n border-radius: 2px;\n background: #dfdfdf;\n color: #111;\n}\n\n.pos-nr-badge-selected-3YPyP {\n background: #db3433;\n background: var(--diva-theme-palette-primary-main, #db3433);\n color: #fff;\n}\n\n.pos-nr-badge-unselectable-qXZTj {\n background: transparent;\n color: rgb(175, 172, 172);\n cursor: default;\n box-shadow: none;\n}\n\n.pos-nr-badge-hidden-3d4fU {\n display: none;\n}\n\n.pos-nr-badge-hover-GMJaj:hover:not(.pos-nr-badge-selected-3YPyP):not(.pos-nr-badge-unselectable-qXZTj) {\n background: #e8e8e8;\n background: var(--diva-theme-palette-primary-light, #e8e8e8);\n transform: scale(1.05);\n}\n\n/* Billboard wrapper for the trash and directional copy buttons. */\n.overlay-wrap-87mtA {\n pointer-events: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n animation: rtvOverlayFadeIn--cHFl 0.35s ease-out;\n}\n\n/* Chrome-less arrow button for the directional copy buttons — matches the old\n RTV's bare 20x40 arrow glyph (no circle, no border, no shadow). */\n.copy-arrow-btn-XjFZc {\n box-sizing: content-box;\n width: 20px;\n height: 40px;\n padding: 0;\n border: none;\n background: transparent;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.15s;\n}\n\n/* Hover devices only: on iOS a :hover effect makes the first tap a hover, and only a second one clicks. */\n@media (hover: hover) {\n .copy-arrow-btn-XjFZc:hover {\n transform: scale(1.1);\n }\n}\n\n/* A finger needs more than the 20x40 glyph: a larger, invisible hit area around the same visual. */\n@media (pointer: coarse) {\n .copy-arrow-btn-XjFZc {\n padding: 12px;\n margin: -12px;\n touch-action: manipulation;\n }\n}\n\n.button-rmNZf {\n box-sizing: border-box;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n border: 1px solid rgba(0, 0, 0, 0.08);\n background: rgba(255, 255, 255, 0.94);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #333;\n color: var(--diva-theme-palette-primary-dark, #333);\n transition: background 0.15s, border-color 0.15s, transform 0.15s;\n padding: 0;\n}\n\n.button-rmNZf:hover {\n background: #fff;\n border-color: rgba(0, 0, 0, 0.12);\n border-color: var(--diva-theme-palette-primary-main, rgba(0, 0, 0, 0.12));\n transform: scale(1.08);\n}\n\n.button-rmNZf:active {\n transform: scale(0.96);\n}\n\n/* Phones draw the chrome smaller than a fingertip: an invisible ring keeps the hit target. */\n@media (pointer: coarse) {\n .button-rmNZf,\n .pos-nr-badge-Snzgu {\n position: relative;\n }\n .button-rmNZf::after,\n .pos-nr-badge-Snzgu::after {\n content: '';\n position: absolute;\n top: -8px;\n right: -8px;\n bottom: -8px;\n left: -8px;\n }\n}\n\n.article-tooltip-uiY9n {\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n white-space: nowrap;\n font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;\n font-size: 10px;\n font-weight: 500;\n line-height: 1.2;\n padding: 2px 5px;\n border-radius: 3px;\n background: rgba(30, 30, 30, 0.85);\n color: #f0f0f0;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n margin-top: 3px;\n}\n\n.primary-group-N4ocr {\n display: flex;\n align-items: center;\n gap: 3px;\n pointer-events: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n animation: rtvOverlayFadeIn--cHFl 0.35s ease-out;\n}\n\n.group-down-144Ep { flex-direction: column; }\n.group-up-i-uhH { flex-direction: column-reverse; }\n.group-right-dt8dl { flex-direction: row; }\n.group-left-ZGK9o { flex-direction: row-reverse; }\n\n.toolbar-row-IPYtC {\n display: flex;\n gap: 2px;\n}\n";
|
|
17205
|
+
var css_248z$5 = "/* One-shot fade-in for the billboards. They mount the moment a 2D↔3D fly\n settles (gated on `!viewModeTransitioning`), so this plays exactly when the\n buttons reappear after the transition — no JS timing needed. */\n@keyframes rtvOverlayFadeIn--cHFl {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n.pos-nr-badge-Snzgu {\n pointer-events: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n box-sizing: border-box;\n width: 22px;\n height: 22px;\n min-width: 22px;\n min-height: 22px;\n padding: 0;\n aspect-ratio: 1 / 1;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 11px;\n font-weight: 600;\n font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;\n line-height: 1;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n cursor: pointer;\n border: none;\n transition: background 0.15s, transform 0.15s;\n}\n\n.pos-nr-badge-standard-xNUE4 {\n background: #dfdfdf;\n color: #111;\n}\n\n.pos-nr-badge-gold-3Cn3W {\n border-radius: 2px;\n background: #dfdfdf;\n color: #111;\n}\n\n.pos-nr-badge-selected-3YPyP {\n background: #db3433;\n background: var(--diva-theme-palette-primary-main, #db3433);\n color: #fff;\n}\n\n.pos-nr-badge-unselectable-qXZTj {\n background: transparent;\n color: rgb(175, 172, 172);\n cursor: default;\n box-shadow: none;\n}\n\n.pos-nr-badge-hidden-3d4fU {\n display: none;\n}\n\n.pos-nr-badge-hover-GMJaj:hover:not(.pos-nr-badge-selected-3YPyP):not(.pos-nr-badge-unselectable-qXZTj) {\n background: #e8e8e8;\n background: var(--diva-theme-palette-primary-light, #e8e8e8);\n transform: scale(1.05);\n}\n\n/* Billboard wrapper for the trash and directional copy buttons. */\n.overlay-wrap-87mtA {\n pointer-events: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n animation: rtvOverlayFadeIn--cHFl 0.35s ease-out;\n}\n\n/* Chrome-less arrow button for the directional copy buttons — matches the old\n RTV's bare 20x40 arrow glyph (no circle, no border, no shadow). */\n.copy-arrow-btn-XjFZc {\n box-sizing: content-box;\n width: 20px;\n height: 40px;\n padding: 0;\n border: none;\n background: transparent;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.15s;\n}\n\n/* Hover devices only: on iOS a :hover effect makes the first tap a hover, and only a second one clicks. */\n@media (hover: hover) {\n .copy-arrow-btn-XjFZc:hover {\n transform: scale(1.1);\n }\n}\n\n/* A finger needs more than the 20x40 glyph: a larger, invisible hit area around the same visual. */\n@media (pointer: coarse) {\n .copy-arrow-btn-XjFZc {\n padding: 12px;\n margin: -12px;\n touch-action: manipulation;\n }\n}\n\n.button-rmNZf {\n box-sizing: border-box;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n border: 1px solid rgba(0, 0, 0, 0.08);\n background: rgba(255, 255, 255, 0.94);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #333;\n color: var(--diva-theme-palette-primary-dark, #333);\n transition: background 0.15s, border-color 0.15s, transform 0.15s;\n padding: 0;\n}\n\n.button-rmNZf:hover {\n background: #fff;\n border-color: rgba(0, 0, 0, 0.12);\n border-color: var(--diva-theme-palette-primary-main, rgba(0, 0, 0, 0.12));\n transform: scale(1.08);\n}\n\n.button-rmNZf:active {\n transform: scale(0.96);\n}\n\n/* The host is still answering a move, add or delete: the button waits for it. */\n.button-rmNZf:disabled,\n.copy-arrow-btn-XjFZc:disabled {\n opacity: 0.4;\n cursor: progress;\n transform: none;\n}\n\n/* Phones draw the chrome smaller than a fingertip: an invisible ring keeps the hit target. */\n@media (pointer: coarse) {\n .button-rmNZf,\n .pos-nr-badge-Snzgu {\n position: relative;\n }\n .button-rmNZf::after,\n .pos-nr-badge-Snzgu::after {\n content: '';\n position: absolute;\n top: -8px;\n right: -8px;\n bottom: -8px;\n left: -8px;\n }\n}\n\n.article-tooltip-uiY9n {\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n white-space: nowrap;\n font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;\n font-size: 10px;\n font-weight: 500;\n line-height: 1.2;\n padding: 2px 5px;\n border-radius: 3px;\n background: rgba(30, 30, 30, 0.85);\n color: #f0f0f0;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n margin-top: 3px;\n}\n\n.primary-group-N4ocr {\n display: flex;\n align-items: center;\n gap: 3px;\n pointer-events: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n animation: rtvOverlayFadeIn--cHFl 0.35s ease-out;\n}\n\n.group-down-144Ep { flex-direction: column; }\n.group-up-i-uhH { flex-direction: column-reverse; }\n.group-right-dt8dl { flex-direction: row; }\n.group-left-ZGK9o { flex-direction: row-reverse; }\n\n.toolbar-row-IPYtC {\n display: flex;\n gap: 2px;\n}\n";
|
|
16858
17206
|
styleInject(css_248z$5);
|
|
16859
17207
|
|
|
16860
17208
|
function ownKeys$d(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16861
17209
|
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16862
|
-
function _createForOfIteratorHelper$
|
|
16863
|
-
function _unsupportedIterableToArray$
|
|
16864
|
-
function _arrayLikeToArray$
|
|
17210
|
+
function _createForOfIteratorHelper$E(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$E(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; } } }; }
|
|
17211
|
+
function _unsupportedIterableToArray$E(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$E(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$E(r, a) : void 0; } }
|
|
17212
|
+
function _arrayLikeToArray$E(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; }
|
|
16865
17213
|
var DIRECTION_CLASS = {
|
|
16866
17214
|
down: groupDown,
|
|
16867
17215
|
up: groupUp,
|
|
@@ -16979,6 +17327,10 @@ function ElementOverlay(_ref) {
|
|
|
16979
17327
|
var isRotating = useRTVStore$1(function (s) {
|
|
16980
17328
|
return s.isRotating;
|
|
16981
17329
|
});
|
|
17330
|
+
// While the host answers a move, add or delete, the rotate, delete and copy buttons show unavailable.
|
|
17331
|
+
var operationPending = useRTVStore$1(function (s) {
|
|
17332
|
+
return s.pendingOperation != null;
|
|
17333
|
+
});
|
|
16982
17334
|
var selectElement = useRTVStore$1(function (s) {
|
|
16983
17335
|
return s.selectElement;
|
|
16984
17336
|
});
|
|
@@ -17049,7 +17401,8 @@ function ElementOverlay(_ref) {
|
|
|
17049
17401
|
// The host owns WHEN copying is available — it only sets `canCopyLeft/Right/Top` where the feature
|
|
17050
17402
|
// applies, so there's no `isPlannerMode` gate here. Box copy renders on the selected element only;
|
|
17051
17403
|
// `copyAlwaysVisible` (AVL/AVR copy) shows the buttons regardless of selection.
|
|
17052
|
-
var
|
|
17404
|
+
var copyArrowsFree = useRTVStore$1(copyArrowsAllowed);
|
|
17405
|
+
var copyGateBase = (isSelected || (overlayInfo === null || overlayInfo === void 0 ? void 0 : overlayInfo.copyAlwaysVisible) === true) && copyArrowsFree && !hideChrome;
|
|
17053
17406
|
// Parallel to `COPY_SIDES` — both the per-frame placement and the JSX iterate that same table.
|
|
17054
17407
|
var showCopy = COPY_SIDES.map(function (spec) {
|
|
17055
17408
|
return copyGateBase && (overlayInfo === null || overlayInfo === void 0 ? void 0 : overlayInfo[spec.gate]) === true;
|
|
@@ -17090,7 +17443,7 @@ function ElementOverlay(_ref) {
|
|
|
17090
17443
|
var anyShown = showPrimaryGroup || showTrash || anyCopyShown;
|
|
17091
17444
|
if (!anyShown) {
|
|
17092
17445
|
if (anyShownLastFrameRef.current) {
|
|
17093
|
-
var _iterator = _createForOfIteratorHelper$
|
|
17446
|
+
var _iterator = _createForOfIteratorHelper$E(COPY_SIDES),
|
|
17094
17447
|
_step;
|
|
17095
17448
|
try {
|
|
17096
17449
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -17166,7 +17519,7 @@ function ElementOverlay(_ref) {
|
|
|
17166
17519
|
root.getWorldQuaternion(_rootQuat);
|
|
17167
17520
|
_rootAxisY.setFromMatrixColumn(root.matrixWorld, 1).normalize();
|
|
17168
17521
|
var metresPerPx = SIDE_HANDLE_DISTANCE_FACTOR / 400 * (IS_PHONE ? PHONE_ARROW_SCALE : 1);
|
|
17169
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
17522
|
+
var _iterator2 = _createForOfIteratorHelper$E(COPY_SIDES),
|
|
17170
17523
|
_step2;
|
|
17171
17524
|
try {
|
|
17172
17525
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -17203,34 +17556,42 @@ function ElementOverlay(_ref) {
|
|
|
17203
17556
|
selectElement(elementName, setId, 'single');
|
|
17204
17557
|
};
|
|
17205
17558
|
var onTrashClick = function onTrashClick(e) {
|
|
17206
|
-
var _callbacks$onElementD;
|
|
17207
17559
|
e.stopPropagation();
|
|
17208
17560
|
var callbacks = getHostCallbacks();
|
|
17561
|
+
var _useRTVStore$getState = useRTVStore$1.getState(),
|
|
17562
|
+
sendOperation = _useRTVStore$getState.sendOperation;
|
|
17209
17563
|
// Accessories route delete through the dedicated callback (host keys by parent/grid/cell).
|
|
17210
17564
|
if ((overlayInfo === null || overlayInfo === void 0 ? void 0 : overlayInfo.type) === 'accessoire' || (overlayInfo === null || overlayInfo === void 0 ? void 0 : overlayInfo.type) === 'shelfAccessoire') {
|
|
17211
17565
|
var accPath = parseAccessoryPath(elementKey);
|
|
17212
17566
|
if (accPath) {
|
|
17213
|
-
|
|
17214
|
-
|
|
17215
|
-
|
|
17216
|
-
|
|
17217
|
-
|
|
17567
|
+
if (!sendOperation('delete', function () {
|
|
17568
|
+
var _callbacks$onAccessor;
|
|
17569
|
+
return (_callbacks$onAccessor = callbacks.onAccessoryDelete) === null || _callbacks$onAccessor === void 0 ? void 0 : _callbacks$onAccessor.call(callbacks, _objectSpread$d({
|
|
17570
|
+
setId: setId,
|
|
17571
|
+
elementKey: elementKey
|
|
17572
|
+
}, accPath));
|
|
17573
|
+
})) return;
|
|
17218
17574
|
// The node is about to disappear — drop selection + fly the camera back. (Mains get this for
|
|
17219
17575
|
// free via the host's `selectedElementId → null` echo, but that path is guarded for accessories.)
|
|
17220
17576
|
selectElement(null);
|
|
17221
17577
|
return;
|
|
17222
17578
|
}
|
|
17223
17579
|
}
|
|
17224
|
-
(
|
|
17580
|
+
sendOperation('delete', function () {
|
|
17581
|
+
var _callbacks$onElementD;
|
|
17582
|
+
return (_callbacks$onElementD = callbacks.onElementDeleted) === null || _callbacks$onElementD === void 0 ? void 0 : _callbacks$onElementD.call(callbacks, setId, elementId);
|
|
17583
|
+
});
|
|
17225
17584
|
};
|
|
17226
17585
|
var onCopyClick = function onCopyClick(vec) {
|
|
17227
17586
|
return function (e) {
|
|
17228
|
-
var _getHostCallbacks$onE, _getHostCallbacks;
|
|
17229
17587
|
e.stopPropagation();
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
|
|
17233
|
-
|
|
17588
|
+
useRTVStore$1.getState().sendOperation('add', function () {
|
|
17589
|
+
var _getHostCallbacks$onE, _getHostCallbacks;
|
|
17590
|
+
return (_getHostCallbacks$onE = (_getHostCallbacks = getHostCallbacks()).onElementCopy) === null || _getHostCallbacks$onE === void 0 ? void 0 : _getHostCallbacks$onE.call(_getHostCallbacks, setId, elementId, {
|
|
17591
|
+
x: vec[0],
|
|
17592
|
+
y: vec[1],
|
|
17593
|
+
z: vec[2]
|
|
17594
|
+
});
|
|
17234
17595
|
});
|
|
17235
17596
|
};
|
|
17236
17597
|
};
|
|
@@ -17279,6 +17640,7 @@ function ElementOverlay(_ref) {
|
|
|
17279
17640
|
className: button,
|
|
17280
17641
|
style: btnStyle,
|
|
17281
17642
|
title: "Rotate",
|
|
17643
|
+
disabled: operationPending,
|
|
17282
17644
|
onPointerDown: function onPointerDown(e) {
|
|
17283
17645
|
e.stopPropagation();
|
|
17284
17646
|
onStartRotate();
|
|
@@ -17304,6 +17666,7 @@ function ElementOverlay(_ref) {
|
|
|
17304
17666
|
className: button,
|
|
17305
17667
|
style: btnStyle,
|
|
17306
17668
|
title: "Delete",
|
|
17669
|
+
disabled: operationPending,
|
|
17307
17670
|
onClick: onTrashClick,
|
|
17308
17671
|
children: /*#__PURE__*/jsx(TrashSVG, {
|
|
17309
17672
|
size: iconSize
|
|
@@ -17331,6 +17694,7 @@ function ElementOverlay(_ref) {
|
|
|
17331
17694
|
type: "button",
|
|
17332
17695
|
className: copyArrowBtn,
|
|
17333
17696
|
title: spec.title,
|
|
17697
|
+
disabled: operationPending,
|
|
17334
17698
|
onClick: onCopyClick(spec.vec),
|
|
17335
17699
|
children: /*#__PURE__*/jsx(CopyArrowSVG, {
|
|
17336
17700
|
rotateDeg: spec.glyphRotateDeg
|
|
@@ -17549,9 +17913,11 @@ function FreeGridLayer(_ref) {
|
|
|
17549
17913
|
if (cells.length === 0) return null;
|
|
17550
17914
|
var handlePlace = function handlePlace(cell) {
|
|
17551
17915
|
return function (e) {
|
|
17552
|
-
var _getHostCallbacks$onA, _getHostCallbacks;
|
|
17553
17916
|
e.stopPropagation();
|
|
17554
|
-
|
|
17917
|
+
useRTVStore$1.getState().sendOperation('add', function () {
|
|
17918
|
+
var _getHostCallbacks$onA, _getHostCallbacks;
|
|
17919
|
+
return (_getHostCallbacks$onA = (_getHostCallbacks = getHostCallbacks()).onAccessoryPlace) === null || _getHostCallbacks$onA === void 0 ? void 0 : _getHostCallbacks$onA.call(_getHostCallbacks, cell.gridIdx, cell.cellIdx, cell.parentBasketId, cell.articleCodex);
|
|
17920
|
+
});
|
|
17555
17921
|
};
|
|
17556
17922
|
};
|
|
17557
17923
|
|
|
@@ -18572,9 +18938,9 @@ function useElementInteraction(_ref) {
|
|
|
18572
18938
|
};
|
|
18573
18939
|
}
|
|
18574
18940
|
|
|
18575
|
-
function _createForOfIteratorHelper$
|
|
18576
|
-
function _unsupportedIterableToArray$
|
|
18577
|
-
function _arrayLikeToArray$
|
|
18941
|
+
function _createForOfIteratorHelper$D(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$D(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; } } }; }
|
|
18942
|
+
function _unsupportedIterableToArray$D(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$D(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$D(r, a) : void 0; } }
|
|
18943
|
+
function _arrayLikeToArray$D(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; }
|
|
18578
18944
|
var _inverse = new Matrix4();
|
|
18579
18945
|
var _origin = new Vector3();
|
|
18580
18946
|
var _direction$1 = new Vector3();
|
|
@@ -18585,7 +18951,7 @@ var _signature = 0;
|
|
|
18585
18951
|
function forOwnMeshes(object, root, visit) {
|
|
18586
18952
|
if (object !== root && (object.name.startsWith('Element#') || object.userData.outlineExclude === true)) return;
|
|
18587
18953
|
if (object instanceof Mesh) visit(object);
|
|
18588
|
-
var _iterator = _createForOfIteratorHelper$
|
|
18954
|
+
var _iterator = _createForOfIteratorHelper$D(object.children),
|
|
18589
18955
|
_step;
|
|
18590
18956
|
try {
|
|
18591
18957
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -19036,9 +19402,9 @@ function GeoBBoxReporter(_ref) {
|
|
|
19036
19402
|
return null;
|
|
19037
19403
|
}
|
|
19038
19404
|
|
|
19039
|
-
function _createForOfIteratorHelper$
|
|
19040
|
-
function _unsupportedIterableToArray$
|
|
19041
|
-
function _arrayLikeToArray$
|
|
19405
|
+
function _createForOfIteratorHelper$C(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$C(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; } } }; }
|
|
19406
|
+
function _unsupportedIterableToArray$C(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$C(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$C(r, a) : void 0; } }
|
|
19407
|
+
function _arrayLikeToArray$C(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; }
|
|
19042
19408
|
/** Roots handed to {@link enableBVHWhenIdle} whose trees have not been built yet. */
|
|
19043
19409
|
var pendingRoots = new Set();
|
|
19044
19410
|
/** Cancels the scheduled idle build, or null when nothing is scheduled. */
|
|
@@ -19110,7 +19476,7 @@ function flushPendingBVH() {
|
|
|
19110
19476
|
(_cancelScheduledBuild = cancelScheduledBuild) === null || _cancelScheduledBuild === void 0 || _cancelScheduledBuild();
|
|
19111
19477
|
cancelScheduledBuild = null;
|
|
19112
19478
|
if (pendingRoots.size === 0) return;
|
|
19113
|
-
var _iterator = _createForOfIteratorHelper$
|
|
19479
|
+
var _iterator = _createForOfIteratorHelper$C(pendingRoots),
|
|
19114
19480
|
_step;
|
|
19115
19481
|
try {
|
|
19116
19482
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -19441,7 +19807,7 @@ function DragController() {
|
|
|
19441
19807
|
return null;
|
|
19442
19808
|
}
|
|
19443
19809
|
|
|
19444
|
-
var DEG_TO_RAD$
|
|
19810
|
+
var DEG_TO_RAD$7 = Math.PI / 180;
|
|
19445
19811
|
|
|
19446
19812
|
/** Most corners one zone polygon hands the shader; a longer one loses its flattest corners first. */
|
|
19447
19813
|
var ZONE_MAX_POINTS = 64;
|
|
@@ -19496,7 +19862,7 @@ function isDragWarned(state, setId, elementId) {
|
|
|
19496
19862
|
|
|
19497
19863
|
/** The pose of `element`'s zone: where the element stands, or with `move` where the drag shows it (as `Element2DPlane` does). */
|
|
19498
19864
|
function zonePose(element, move) {
|
|
19499
|
-
var rotY = -element.rotation * DEG_TO_RAD$
|
|
19865
|
+
var rotY = -element.rotation * DEG_TO_RAD$7;
|
|
19500
19866
|
if (!move) return {
|
|
19501
19867
|
x: element.position[0] / 100,
|
|
19502
19868
|
z: element.position[1] / 100,
|
|
@@ -19837,9 +20203,9 @@ function DragZonePatches(_ref2) {
|
|
|
19837
20203
|
});
|
|
19838
20204
|
}
|
|
19839
20205
|
|
|
19840
|
-
function _createForOfIteratorHelper$
|
|
19841
|
-
function _unsupportedIterableToArray$
|
|
19842
|
-
function _arrayLikeToArray$
|
|
20206
|
+
function _createForOfIteratorHelper$B(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$B(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; } } }; }
|
|
20207
|
+
function _unsupportedIterableToArray$B(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$B(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$B(r, a) : void 0; } }
|
|
20208
|
+
function _arrayLikeToArray$B(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; }
|
|
19843
20209
|
var _screen = {
|
|
19844
20210
|
x: 0,
|
|
19845
20211
|
y: 0
|
|
@@ -19879,7 +20245,7 @@ function collectFreeCellWorldPositions(scene, freePlaces, grids, gridSetId) {
|
|
|
19879
20245
|
var cells = resolveFreeCellsForElement(freePlaces, grids, obj.name, gridSetId);
|
|
19880
20246
|
if (cells.length === 0) return;
|
|
19881
20247
|
obj.updateWorldMatrix(true, false);
|
|
19882
|
-
var _iterator = _createForOfIteratorHelper$
|
|
20248
|
+
var _iterator = _createForOfIteratorHelper$B(cells),
|
|
19883
20249
|
_step;
|
|
19884
20250
|
try {
|
|
19885
20251
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -19909,7 +20275,7 @@ function collectFreeCellWorldPositions(scene, freePlaces, grids, gridSetId) {
|
|
|
19909
20275
|
function nearestCellByScreenDistance(list, clientX, clientY, rect, camera) {
|
|
19910
20276
|
var best = null;
|
|
19911
20277
|
var bestDistSq = Infinity;
|
|
19912
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
20278
|
+
var _iterator2 = _createForOfIteratorHelper$B(list),
|
|
19913
20279
|
_step2;
|
|
19914
20280
|
try {
|
|
19915
20281
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -20221,7 +20587,7 @@ function AccessoryDropController() {
|
|
|
20221
20587
|
}
|
|
20222
20588
|
|
|
20223
20589
|
var loadChunk$1 = memoChunk(function () {
|
|
20224
|
-
return import('./doorSwapChunk-
|
|
20590
|
+
return import('./doorSwapChunk-4ba535c4.js');
|
|
20225
20591
|
});
|
|
20226
20592
|
|
|
20227
20593
|
/** Starts the door swap chunk download; idempotent. */
|
|
@@ -20273,9 +20639,9 @@ function DoorSwapHudLazy() {
|
|
|
20273
20639
|
});
|
|
20274
20640
|
}
|
|
20275
20641
|
|
|
20276
|
-
function _createForOfIteratorHelper$
|
|
20277
|
-
function _unsupportedIterableToArray$
|
|
20278
|
-
function _arrayLikeToArray$
|
|
20642
|
+
function _createForOfIteratorHelper$A(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$A(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; } } }; }
|
|
20643
|
+
function _unsupportedIterableToArray$A(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$A(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$A(r, a) : void 0; } }
|
|
20644
|
+
function _arrayLikeToArray$A(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; }
|
|
20279
20645
|
|
|
20280
20646
|
/**
|
|
20281
20647
|
* What the viewer's coach hints (DOM, outside the canvas) need from inside it: the canvas element, the camera and the
|
|
@@ -20304,7 +20670,7 @@ function hasViewerCoachSinks() {
|
|
|
20304
20670
|
|
|
20305
20671
|
/** Hands the frame to every subscribed coach mark. */
|
|
20306
20672
|
function notifyViewerCoachFrame() {
|
|
20307
|
-
var _iterator = _createForOfIteratorHelper$
|
|
20673
|
+
var _iterator = _createForOfIteratorHelper$A(sinks),
|
|
20308
20674
|
_step;
|
|
20309
20675
|
try {
|
|
20310
20676
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -20400,7 +20766,7 @@ function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
20400
20766
|
|
|
20401
20767
|
/** One chunk request for the viewer's hints and every host mark. */
|
|
20402
20768
|
var loadChunk = memoChunk(function () {
|
|
20403
|
-
return import('./coachChunk-
|
|
20769
|
+
return import('./coachChunk-f22b1ed4.js');
|
|
20404
20770
|
});
|
|
20405
20771
|
var loadHints = function loadHints() {
|
|
20406
20772
|
return loadChunk().then(function (m) {
|
|
@@ -20477,7 +20843,7 @@ function getObjectTopY(scene, name, fallbackY) {
|
|
|
20477
20843
|
}
|
|
20478
20844
|
return fallbackY;
|
|
20479
20845
|
}
|
|
20480
|
-
var DEG_TO_RAD$
|
|
20846
|
+
var DEG_TO_RAD$6 = Math.PI / 180;
|
|
20481
20847
|
var FLAT_ROT = new Euler(-Math.PI / 2, 0, 0, 'YXZ');
|
|
20482
20848
|
var ROT_COLOR = '#4488ff';
|
|
20483
20849
|
var ROT_COLOR_START = '#88aacc';
|
|
@@ -20689,7 +21055,7 @@ function RotationGuide() {
|
|
|
20689
21055
|
var d = elem2d ? elem2d.depth / 100 : 0.5;
|
|
20690
21056
|
var radius = Math.max(0.15, Math.sqrt(w * w + d * d) / 2 + 0.08);
|
|
20691
21057
|
var degrees = Math.round(-rotationY * (180 / Math.PI));
|
|
20692
|
-
var elemRotY = elem2d ? -elem2d.rotation * DEG_TO_RAD$
|
|
21058
|
+
var elemRotY = elem2d ? -elem2d.rotation * DEG_TO_RAD$6 : 0;
|
|
20693
21059
|
var startAngle = elemRotY;
|
|
20694
21060
|
var endAngle = elemRotY + rotationY;
|
|
20695
21061
|
var rawEndAngle = elemRotY + rawRotationY;
|
|
@@ -20730,7 +21096,7 @@ function RotationGuide() {
|
|
|
20730
21096
|
if (absTick < minAbsDeg - 45) continue;
|
|
20731
21097
|
var deltaDeg = absTick - startDeg;
|
|
20732
21098
|
if (Math.sign(deltaDeg) !== 0 && Math.sign(deltaDeg) !== rawDir) continue;
|
|
20733
|
-
var tickRad = -deltaDeg * DEG_TO_RAD$
|
|
21099
|
+
var tickRad = -deltaDeg * DEG_TO_RAD$6;
|
|
20734
21100
|
var angle = startAngle + tickRad;
|
|
20735
21101
|
var is90 = (absTick % 90 + 90) % 90 === 0;
|
|
20736
21102
|
var active90 = Math.abs(currentAbsDeg - absTick) <= snapDeg;
|
|
@@ -20765,9 +21131,9 @@ function RotationGuide() {
|
|
|
20765
21131
|
});
|
|
20766
21132
|
}
|
|
20767
21133
|
|
|
20768
|
-
function _createForOfIteratorHelper$
|
|
20769
|
-
function _unsupportedIterableToArray$
|
|
20770
|
-
function _arrayLikeToArray$
|
|
21134
|
+
function _createForOfIteratorHelper$z(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$z(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; } } }; }
|
|
21135
|
+
function _unsupportedIterableToArray$z(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$z(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$z(r, a) : void 0; } }
|
|
21136
|
+
function _arrayLikeToArray$z(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; }
|
|
20771
21137
|
/** A focus keeps its preferred view while at least this share of the subject's sample points is in sight. */
|
|
20772
21138
|
var CLEAR_VIEW_SHARE = 0.55;
|
|
20773
21139
|
/** The best level view wins over every raised one while it sees at least this share. */
|
|
@@ -20777,30 +21143,28 @@ var RAISED_ELEVATION_DEG = 20;
|
|
|
20777
21143
|
var MAX_ELEVATION_DEG = 50;
|
|
20778
21144
|
/** Diagonal views off the front: straight into a corner unit between two wings. */
|
|
20779
21145
|
var DIAGONAL_DEG = 45;
|
|
20780
|
-
/** Sample points sit this share of the way from the centre to the
|
|
21146
|
+
/** Sample points sit this share of the way from the centre to the edges: inside the silhouette, off its rims. */
|
|
20781
21147
|
var SAMPLE_INSET = 0.7;
|
|
20782
21148
|
var _raycaster = new Raycaster();
|
|
20783
21149
|
var _direction = new Vector3();
|
|
20784
21150
|
|
|
20785
21151
|
/**
|
|
20786
|
-
* The meshes that can hide `subject`: the visible meshes of
|
|
20787
|
-
*
|
|
21152
|
+
* The meshes that can hide `subject`: the visible meshes of every `Element#` group but its own, `outlineExclude` subtrees
|
|
21153
|
+
* left out. The element it sits in counts: a garden house's walls hide the shelf inside, while an open carcass leaves its
|
|
21154
|
+
* accessory's front in view.
|
|
20788
21155
|
*/
|
|
20789
21156
|
function occludersOf(root, subject) {
|
|
20790
|
-
var around = new Set();
|
|
20791
|
-
for (var parent = subject.parent; parent; parent = parent.parent) around.add(parent);
|
|
20792
21157
|
var meshes = [];
|
|
20793
|
-
|
|
20794
|
-
var _visit = function visit(object, owner) {
|
|
21158
|
+
var _visit = function visit(object, inElement) {
|
|
20795
21159
|
if (object === subject || object.userData.outlineExclude === true || !object.visible) return;
|
|
20796
|
-
var
|
|
20797
|
-
if (
|
|
20798
|
-
var _iterator = _createForOfIteratorHelper$
|
|
21160
|
+
var inside = inElement || object.name.startsWith('Element#');
|
|
21161
|
+
if (inside && object instanceof Mesh) meshes.push(object);
|
|
21162
|
+
var _iterator = _createForOfIteratorHelper$z(object.children),
|
|
20799
21163
|
_step;
|
|
20800
21164
|
try {
|
|
20801
21165
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
20802
21166
|
var child = _step.value;
|
|
20803
|
-
_visit(child,
|
|
21167
|
+
_visit(child, inside);
|
|
20804
21168
|
}
|
|
20805
21169
|
} catch (err) {
|
|
20806
21170
|
_iterator.e(err);
|
|
@@ -20808,7 +21172,7 @@ function occludersOf(root, subject) {
|
|
|
20808
21172
|
_iterator.f();
|
|
20809
21173
|
}
|
|
20810
21174
|
};
|
|
20811
|
-
_visit(root,
|
|
21175
|
+
_visit(root, false);
|
|
20812
21176
|
return meshes;
|
|
20813
21177
|
}
|
|
20814
21178
|
|
|
@@ -20835,13 +21199,46 @@ function samplePoints(box, viewDir) {
|
|
|
20835
21199
|
return points;
|
|
20836
21200
|
}
|
|
20837
21201
|
|
|
21202
|
+
/**
|
|
21203
|
+
* The points of `box` a camera at `from` looks at: a 3 × 3 grid on the face that turns most towards it, its centre first.
|
|
21204
|
+
* What the camera sees of a thin board is its edge, not the middle of the board behind it.
|
|
21205
|
+
*/
|
|
21206
|
+
function facingPoints(box, from) {
|
|
21207
|
+
var centre = box.getCenter(new Vector3());
|
|
21208
|
+
var half = box.getSize(new Vector3()).multiplyScalar(0.5);
|
|
21209
|
+
var toCamera = from.clone().sub(centre).toArray();
|
|
21210
|
+
var axis = [0, 1, 2].reduce(function (best, a) {
|
|
21211
|
+
return Math.abs(toCamera[a]) > Math.abs(toCamera[best]) ? a : best;
|
|
21212
|
+
}, 0);
|
|
21213
|
+
var _filter = [0, 1, 2].filter(function (a) {
|
|
21214
|
+
return a !== axis;
|
|
21215
|
+
}),
|
|
21216
|
+
_filter2 = _slicedToArray(_filter, 2),
|
|
21217
|
+
u = _filter2[0],
|
|
21218
|
+
v = _filter2[1];
|
|
21219
|
+
var faceCentre = centre.clone().setComponent(axis, centre.getComponent(axis) + Math.sign(toCamera[axis]) * half.getComponent(axis));
|
|
21220
|
+
var points = [faceCentre];
|
|
21221
|
+
for (var _i3 = 0, _arr3 = [-1, 0, 1]; _i3 < _arr3.length; _i3++) {
|
|
21222
|
+
var i = _arr3[_i3];
|
|
21223
|
+
for (var _i4 = 0, _arr4 = [-1, 0, 1]; _i4 < _arr4.length; _i4++) {
|
|
21224
|
+
var j = _arr4[_i4];
|
|
21225
|
+
if (i === 0 && j === 0) continue;
|
|
21226
|
+
var point = faceCentre.clone();
|
|
21227
|
+
point.setComponent(u, point.getComponent(u) + i * half.getComponent(u) * SAMPLE_INSET);
|
|
21228
|
+
point.setComponent(v, point.getComponent(v) + j * half.getComponent(v) * SAMPLE_INSET);
|
|
21229
|
+
points.push(point);
|
|
21230
|
+
}
|
|
21231
|
+
}
|
|
21232
|
+
return points;
|
|
21233
|
+
}
|
|
21234
|
+
|
|
20838
21235
|
/** Every visible mesh of `subject`, placement boxes and previews (`outlineExclude`) left out. */
|
|
20839
21236
|
function meshesOf(subject) {
|
|
20840
21237
|
var meshes = [];
|
|
20841
21238
|
var _visit2 = function visit(object) {
|
|
20842
21239
|
if (object.userData.outlineExclude === true || !object.visible) return;
|
|
20843
21240
|
if (object instanceof Mesh) meshes.push(object);
|
|
20844
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
21241
|
+
var _iterator2 = _createForOfIteratorHelper$z(object.children),
|
|
20845
21242
|
_step2;
|
|
20846
21243
|
try {
|
|
20847
21244
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -20905,12 +21302,12 @@ function isBetter(a, b) {
|
|
|
20905
21302
|
function focusAngleCandidates(preferred, frontYawDeg, offsetDeg) {
|
|
20906
21303
|
var azimuths = [];
|
|
20907
21304
|
var _loop = function _loop() {
|
|
20908
|
-
var azimuth =
|
|
21305
|
+
var azimuth = _arr5[_i5];
|
|
20909
21306
|
if (!azimuths.some(function (other) {
|
|
20910
21307
|
return Math.abs(other - azimuth) < 1e-6;
|
|
20911
21308
|
})) azimuths.push(azimuth);
|
|
20912
21309
|
};
|
|
20913
|
-
for (var
|
|
21310
|
+
for (var _i5 = 0, _arr5 = [preferred.azimuth, frontYawDeg - offsetDeg, frontYawDeg, frontYawDeg + DIAGONAL_DEG, frontYawDeg - DIAGONAL_DEG]; _i5 < _arr5.length; _i5++) {
|
|
20914
21311
|
_loop();
|
|
20915
21312
|
}
|
|
20916
21313
|
var raisedElevation = Math.min(MAX_ELEVATION_DEG, preferred.elevation + RAISED_ELEVATION_DEG);
|
|
@@ -20931,17 +21328,18 @@ function focusAngleCandidates(preferred, frontYawDeg, offsetDeg) {
|
|
|
20931
21328
|
}
|
|
20932
21329
|
|
|
20933
21330
|
/**
|
|
20934
|
-
* The view a
|
|
21331
|
+
* The view a camera takes on a subject — a focus, and a click that centres on it: the preferred one while it sees
|
|
21332
|
+
* {@link CLEAR_VIEW_SHARE} of the subject ({@link viewPoints}), else the best level view
|
|
20935
21333
|
* (centre in sight first, then share) while it sees the centre and {@link LEVEL_VIEW_SHARE}, else the best of all views.
|
|
20936
|
-
* Earlier ones win ties
|
|
21334
|
+
* Earlier ones win ties; a best view that sees none of it ({@link seesNothing}) leaves the subject shut in.
|
|
21335
|
+
* `cameraAt` gives the camera position a view would take.
|
|
20937
21336
|
*/
|
|
20938
21337
|
function pickVisibleAngle(candidates, cameraAt, box, occluders, subjectMeshes) {
|
|
20939
|
-
var centre = box.getCenter(new Vector3());
|
|
20940
21338
|
var scoreOf = function scoreOf(angle) {
|
|
20941
21339
|
var from = cameraAt(angle);
|
|
20942
21340
|
return {
|
|
20943
21341
|
angle: angle,
|
|
20944
|
-
score: viewScore(from,
|
|
21342
|
+
score: viewScore(from, viewPoints(box, from), occluders, subjectMeshes)
|
|
20945
21343
|
};
|
|
20946
21344
|
};
|
|
20947
21345
|
var bestOf = function bestOf(angles, from) {
|
|
@@ -20960,10 +21358,144 @@ function pickVisibleAngle(candidates, cameraAt, box, occluders, subjectMeshes) {
|
|
|
20960
21358
|
return bestOf(candidates.raised, level);
|
|
20961
21359
|
}
|
|
20962
21360
|
|
|
21361
|
+
/**
|
|
21362
|
+
* The points a camera at `from` is scored on for `box`: the cross-section through its centre ({@link samplePoints}, the
|
|
21363
|
+
* centre first) and its face towards the camera ({@link facingPoints}): a deep body by its middle, a thin board by its
|
|
21364
|
+
* edge.
|
|
21365
|
+
*/
|
|
21366
|
+
function viewPoints(box, from) {
|
|
21367
|
+
return [].concat(_toConsumableArray(samplePoints(box, box.getCenter(new Vector3()).sub(from))), _toConsumableArray(facingPoints(box, from)));
|
|
21368
|
+
}
|
|
21369
|
+
|
|
21370
|
+
/** Whether a view sees none of the subject: every ray to it meets something else first. */
|
|
21371
|
+
function seesNothing(score) {
|
|
21372
|
+
return score.share === 0;
|
|
21373
|
+
}
|
|
21374
|
+
|
|
21375
|
+
/**
|
|
21376
|
+
* How much closer than `landing` a camera looking at `goal` must stand to see it: in front of the first of `obstacles`
|
|
21377
|
+
* between them, `clearance` off; 0 for a free line.
|
|
21378
|
+
*/
|
|
21379
|
+
function pullInPast(goal, landing, obstacles, clearance) {
|
|
21380
|
+
var distance = _direction.subVectors(landing, goal).length();
|
|
21381
|
+
if (distance <= clearance) return 0;
|
|
21382
|
+
_raycaster.set(goal, _direction.divideScalar(distance));
|
|
21383
|
+
_raycaster.near = 0;
|
|
21384
|
+
_raycaster.far = distance + clearance;
|
|
21385
|
+
var hit = _raycaster.intersectObjects(obstacles, false)[0];
|
|
21386
|
+
if (!hit) return 0;
|
|
21387
|
+
return Math.max(0, distance - Math.max(hit.distance - clearance, clearance));
|
|
21388
|
+
}
|
|
21389
|
+
|
|
21390
|
+
/** Where a camera looks at a subject from: the view angle, and how far it moved in from its framed distance. */
|
|
21391
|
+
|
|
21392
|
+
/**
|
|
21393
|
+
* The view a camera takes on a subject — shared by a focus and by a click that centres on it: the view
|
|
21394
|
+
* {@link pickVisibleAngle} picks among `candidates` (the first is kept while it sees the subject, else the camera turns);
|
|
21395
|
+
* when no view sees any of it, it moves in along the picked view past the first of `obstacles`, `clearance` off — only
|
|
21396
|
+
* where that leaves it `neededDistance` (m) or more from `goal`: a shelf inside a garden house, which the camera can
|
|
21397
|
+
* stand in, not one behind a wardrobe's door, where it would end at the door. There it keeps the framed view.
|
|
21398
|
+
* `cameraAt` gives the camera position a view would take at the framed distance.
|
|
21399
|
+
*/
|
|
21400
|
+
function viewOfSubject(candidates, cameraAt, goal, subject, obstacles, neededDistance, clearance) {
|
|
21401
|
+
var _pickVisibleAngle = pickVisibleAngle(candidates, cameraAt, subject.box, obstacles, subject.meshes),
|
|
21402
|
+
angle = _pickVisibleAngle.angle,
|
|
21403
|
+
score = _pickVisibleAngle.score;
|
|
21404
|
+
if (!seesNothing(score)) return {
|
|
21405
|
+
angle: angle,
|
|
21406
|
+
pullIn: 0
|
|
21407
|
+
};
|
|
21408
|
+
var landing = cameraAt(angle);
|
|
21409
|
+
var pullIn = pullInPast(goal, landing, obstacles, clearance);
|
|
21410
|
+
var roomy = goal.distanceTo(landing) - pullIn >= neededDistance;
|
|
21411
|
+
return {
|
|
21412
|
+
angle: angle,
|
|
21413
|
+
pullIn: pullIn > 0 && roomy ? pullIn : 0
|
|
21414
|
+
};
|
|
21415
|
+
}
|
|
21416
|
+
|
|
21417
|
+
function _createForOfIteratorHelper$y(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$y(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; } } }; }
|
|
21418
|
+
function _unsupportedIterableToArray$y(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$y(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$y(r, a) : void 0; } }
|
|
21419
|
+
function _arrayLikeToArray$y(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; }
|
|
21420
|
+
var ELEMENT_PREFIX = 'Element#';
|
|
21421
|
+
|
|
21422
|
+
/** The least distance (m) the camera keeps to collidable geometry: the collision probe's floor, and a pulled-in focus's. */
|
|
21423
|
+
var MIN_COLLISION_CLEARANCE = 0.25;
|
|
21424
|
+
|
|
21425
|
+
/** `boundsTree` is set by `enableBVHWhenIdle` (core/meshBVH.ts); the type is irrelevant here, its presence is the signal. */
|
|
21426
|
+
|
|
21427
|
+
/**
|
|
21428
|
+
* Collidable geometry — the shared target set of the camera-collision probe in
|
|
21429
|
+
* `useCameraConstraints` and the sun-lensflare occlusion taps in `SunLensflare`.
|
|
21430
|
+
*
|
|
21431
|
+
* Raycasting `scene.children` instead costs a full graph walk plus a per-mesh bounding-sphere test
|
|
21432
|
+
* every sampling frame, and three's sphere test is against the infinite ray — so geometry far beyond
|
|
21433
|
+
* `raycaster.far` (ground plane, backdrop, the 2D overlay) still reaches triangle level. Restricting
|
|
21434
|
+
* the set is what makes both consumers affordable; it also stops visual aids from shoving the
|
|
21435
|
+
* camera or dimming the flare.
|
|
21436
|
+
*
|
|
21437
|
+
* Two things are collidable, and nothing else:
|
|
21438
|
+
* - the article: every mesh under a planner `Element#` group (mains and their accessories).
|
|
21439
|
+
* `SceneRenderer` queues these for a `boundsTree` per assembly — pure raycast acceleration,
|
|
21440
|
+
* membership here comes from the name prefix alone;
|
|
21441
|
+
* - the environment decor GLB: meshes whose geometry carries a three-mesh-bvh `boundsTree`
|
|
21442
|
+
* (queued by `EnvironmentSceneLoader`, see `core/meshBVH.ts`) — so for decor the bounds tree is
|
|
21443
|
+
* the opt-in to blocking the camera, which the walkthrough-style presets rely on for their
|
|
21444
|
+
* walls. Trees are built lazily, which is why both consumers flush the queue before calling
|
|
21445
|
+
* this: a pending decor tree here reads as "not collidable".
|
|
21446
|
+
*
|
|
21447
|
+
* `userData.outlineExclude` subtrees are pruned: those are the placement boxes and drag previews
|
|
21448
|
+
* that sit inside an element group only to inherit its transform (see `SceneTree`).
|
|
21449
|
+
*/
|
|
21450
|
+
function collectCollisionTargets(scene) {
|
|
21451
|
+
var meshes = [];
|
|
21452
|
+
collect(scene, false, meshes);
|
|
21453
|
+
var box = new Box3();
|
|
21454
|
+
for (var _i = 0, _meshes = meshes; _i < _meshes.length; _i++) {
|
|
21455
|
+
var mesh = _meshes[_i];
|
|
21456
|
+
box.expandByObject(mesh);
|
|
21457
|
+
}
|
|
21458
|
+
return {
|
|
21459
|
+
meshes: meshes,
|
|
21460
|
+
bounds: box.isEmpty() ? null : box.getBoundingSphere(new Sphere())
|
|
21461
|
+
};
|
|
21462
|
+
}
|
|
21463
|
+
function collect(obj, insideArticle, out) {
|
|
21464
|
+
if (obj.userData.outlineExclude === true) return;
|
|
21465
|
+
var inArticle = insideArticle || obj.name.startsWith(ELEMENT_PREFIX);
|
|
21466
|
+
var mesh = obj;
|
|
21467
|
+
if (mesh.isMesh === true) {
|
|
21468
|
+
var geometry = mesh.geometry;
|
|
21469
|
+
if (inArticle || geometry.boundsTree !== undefined) out.push(mesh);
|
|
21470
|
+
}
|
|
21471
|
+
var _iterator = _createForOfIteratorHelper$y(obj.children),
|
|
21472
|
+
_step;
|
|
21473
|
+
try {
|
|
21474
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
21475
|
+
var child = _step.value;
|
|
21476
|
+
collect(child, inArticle, out);
|
|
21477
|
+
}
|
|
21478
|
+
} catch (err) {
|
|
21479
|
+
_iterator.e(err);
|
|
21480
|
+
} finally {
|
|
21481
|
+
_iterator.f();
|
|
21482
|
+
}
|
|
21483
|
+
}
|
|
21484
|
+
|
|
21485
|
+
/**
|
|
21486
|
+
* True when no ray of length `probeRange` cast from `cameraPos` can reach `bounds` — the cheap
|
|
21487
|
+
* per-frame reason to skip the collision raycasts outright while the camera orbits at a distance.
|
|
21488
|
+
*/
|
|
21489
|
+
function isOutOfCollisionRange(cameraPos, bounds, probeRange) {
|
|
21490
|
+
if (!bounds) return true;
|
|
21491
|
+
var reach = bounds.radius + probeRange;
|
|
21492
|
+
return cameraPos.distanceToSquared(bounds.center) > reach * reach;
|
|
21493
|
+
}
|
|
21494
|
+
|
|
20963
21495
|
function _createForOfIteratorHelper$x(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$x(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; } } }; }
|
|
20964
21496
|
function _unsupportedIterableToArray$x(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$x(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$x(r, a) : void 0; } }
|
|
20965
21497
|
function _arrayLikeToArray$x(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; }
|
|
20966
|
-
var DEG_TO_RAD$
|
|
21498
|
+
var DEG_TO_RAD$5 = Math.PI / 180;
|
|
20967
21499
|
var _tri = new Triangle();
|
|
20968
21500
|
var _va = new Vector3();
|
|
20969
21501
|
var _vb = new Vector3();
|
|
@@ -20977,9 +21509,9 @@ var CANDIDATE_DIRS = function () {
|
|
|
20977
21509
|
var azimuthStep = 30;
|
|
20978
21510
|
for (var _i = 0, _elevations = elevations; _i < _elevations.length; _i++) {
|
|
20979
21511
|
var el = _elevations[_i];
|
|
20980
|
-
var elRad = el * DEG_TO_RAD$
|
|
21512
|
+
var elRad = el * DEG_TO_RAD$5;
|
|
20981
21513
|
for (var az = 0; az < 360; az += azimuthStep) {
|
|
20982
|
-
var azRad = az * DEG_TO_RAD$
|
|
21514
|
+
var azRad = az * DEG_TO_RAD$5;
|
|
20983
21515
|
candidates.push({
|
|
20984
21516
|
dir: new Vector3(Math.cos(elRad) * Math.sin(azRad), Math.sin(elRad), Math.cos(elRad) * Math.cos(azRad)),
|
|
20985
21517
|
azimuth: az,
|
|
@@ -21136,7 +21668,7 @@ function frameGeoObject(obj, baseAngle, padding, aspect) {
|
|
|
21136
21668
|
var halfH = bboxSize.y / 2;
|
|
21137
21669
|
var halfW = Math.max(bboxSize.x, bboxSize.z) / 2;
|
|
21138
21670
|
var effectiveAspect = aspect !== null && aspect !== void 0 ? aspect : 16 / 9;
|
|
21139
|
-
var vertRadius = halfH / Math.cos(angle.elevation * DEG_TO_RAD$
|
|
21671
|
+
var vertRadius = halfH / Math.cos(angle.elevation * DEG_TO_RAD$5);
|
|
21140
21672
|
var horizRadius = halfW / effectiveAspect;
|
|
21141
21673
|
var radius = Math.max(vertRadius, horizRadius, bboxSize.length() * 0.35);
|
|
21142
21674
|
return {
|
|
@@ -21152,15 +21684,15 @@ function _unsupportedIterableToArray$w(r, a) { if (r) { if ("string" == typeof r
|
|
|
21152
21684
|
function _arrayLikeToArray$w(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; }
|
|
21153
21685
|
function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21154
21686
|
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21155
|
-
var DEG_TO_RAD$
|
|
21687
|
+
var DEG_TO_RAD$4 = Math.PI / 180;
|
|
21156
21688
|
|
|
21157
21689
|
/**
|
|
21158
21690
|
* Computes a world-space camera position on a sphere around `center`.
|
|
21159
21691
|
* Azimuth: degrees around Y axis (0 = +Z, 90 = +X). Elevation: degrees above XZ plane.
|
|
21160
21692
|
*/
|
|
21161
21693
|
function sphericalPosition(center, angle, distance) {
|
|
21162
|
-
var az = angle.azimuth * DEG_TO_RAD$
|
|
21163
|
-
var el = angle.elevation * DEG_TO_RAD$
|
|
21694
|
+
var az = angle.azimuth * DEG_TO_RAD$4;
|
|
21695
|
+
var el = angle.elevation * DEG_TO_RAD$4;
|
|
21164
21696
|
return new Vector3(center.x + distance * Math.cos(el) * Math.sin(az), center.y + distance * Math.sin(el), center.z + distance * Math.cos(el) * Math.cos(az));
|
|
21165
21697
|
}
|
|
21166
21698
|
var _frameQuat = new Quaternion();
|
|
@@ -21182,12 +21714,14 @@ function worldYawDeg(obj) {
|
|
|
21182
21714
|
*/
|
|
21183
21715
|
/** The world height (m) a camera with the vertical field of view `fovDeg` sees at `distance` along its view axis. */
|
|
21184
21716
|
function viewHeightAt(fovDeg, distance) {
|
|
21185
|
-
return 2 * distance * Math.tan(fovDeg * DEG_TO_RAD$
|
|
21717
|
+
return 2 * distance * Math.tan(fovDeg * DEG_TO_RAD$4 / 2);
|
|
21186
21718
|
}
|
|
21187
|
-
function
|
|
21719
|
+
function fovDegOf(cfg) {
|
|
21188
21720
|
var _ref, _cfg$fov;
|
|
21189
|
-
|
|
21190
|
-
|
|
21721
|
+
return (_ref = (_cfg$fov = cfg.fov) !== null && _cfg$fov !== void 0 ? _cfg$fov : DEFAULT_CAMERA_CONFIG.fov) !== null && _ref !== void 0 ? _ref : CAMERA_FOV;
|
|
21722
|
+
}
|
|
21723
|
+
function fovHalfTan(cfg) {
|
|
21724
|
+
return Math.tan(fovDegOf(cfg) * DEG_TO_RAD$4 / 2);
|
|
21191
21725
|
}
|
|
21192
21726
|
|
|
21193
21727
|
/** 2D camera height before padding, in metres, for a scene with no planned content yet. */
|
|
@@ -21274,11 +21808,27 @@ function frameObject(ctx, obj, baseAngle, padding, elevationOverrideDeg) {
|
|
|
21274
21808
|
// Another article in front of it (the other wing of an L): turn to a view that sees it.
|
|
21275
21809
|
var occluders = occludersOf(ctx.threeScene, obj);
|
|
21276
21810
|
if (occluders.length === 0) return frameAt(preferred);
|
|
21277
|
-
var
|
|
21278
|
-
|
|
21279
|
-
|
|
21280
|
-
|
|
21281
|
-
|
|
21811
|
+
var cameraAt = function cameraAt(candidate) {
|
|
21812
|
+
return frameToResult(frameAt(candidate), ctx.aspect, ctx.cameraConfig).position;
|
|
21813
|
+
};
|
|
21814
|
+
var view = viewOfSubject(focusAngleCandidates(preferred, yawDeg, offsetDeg), cameraAt, center, {
|
|
21815
|
+
box: bbox,
|
|
21816
|
+
meshes: meshesOf(obj)
|
|
21817
|
+
}, occluders,
|
|
21818
|
+
// Moved in, the camera must still get the whole element into the picture.
|
|
21819
|
+
boxFitDistance(bbox, center, preferred, ctx.aspect, fovDegOf(ctx.cameraConfig)), MIN_COLLISION_CLEARANCE);
|
|
21820
|
+
return _objectSpread$9(_objectSpread$9({}, frameAt(view.angle)), {}, {
|
|
21821
|
+
pullIn: view.pullIn
|
|
21822
|
+
});
|
|
21823
|
+
}
|
|
21824
|
+
|
|
21825
|
+
/**
|
|
21826
|
+
* The distance (m) from `center` at which a camera looking from `angle` gets `box` exactly into the picture, without
|
|
21827
|
+
* padding: how close a camera may come and still show the whole element.
|
|
21828
|
+
*/
|
|
21829
|
+
function boxFitDistance(box, center, angle, aspect, fovDeg) {
|
|
21830
|
+
var halfTan = Math.tan(fovDeg * DEG_TO_RAD$4 / 2);
|
|
21831
|
+
return projectedFramingRadius(box, center, angle, aspect, halfTan) / halfTan;
|
|
21282
21832
|
}
|
|
21283
21833
|
|
|
21284
21834
|
/** The point a focus looks at in `bbox`: its centre, at `heightFraction` of its height plus `yOffset` (m). */
|
|
@@ -21381,8 +21931,8 @@ function contentBoxOf(root, insideElement) {
|
|
|
21381
21931
|
* large border around a flat object.
|
|
21382
21932
|
*/
|
|
21383
21933
|
function projectedFramingRadius(box, center, angle, aspect, halfTan) {
|
|
21384
|
-
var az = angle.azimuth * DEG_TO_RAD$
|
|
21385
|
-
var el = angle.elevation * DEG_TO_RAD$
|
|
21934
|
+
var az = angle.azimuth * DEG_TO_RAD$4;
|
|
21935
|
+
var el = angle.elevation * DEG_TO_RAD$4;
|
|
21386
21936
|
// Direction from look-at point toward the camera (see `sphericalPosition`).
|
|
21387
21937
|
var dirToCam = new Vector3(Math.cos(el) * Math.sin(az), Math.sin(el), Math.cos(el) * Math.cos(az));
|
|
21388
21938
|
var forward = dirToCam.clone().negate();
|
|
@@ -21473,8 +22023,8 @@ function computeCamera3DAtAngle(ctx, azimuth, elevation, paddingScale) {
|
|
|
21473
22023
|
function viewAngleOf(pose) {
|
|
21474
22024
|
var dir = pose.position.clone().sub(pose.target).normalize();
|
|
21475
22025
|
return {
|
|
21476
|
-
azimuth: Math.atan2(dir.x, dir.z) / DEG_TO_RAD$
|
|
21477
|
-
elevation: Math.asin(Math.min(1, Math.max(-1, dir.y))) / DEG_TO_RAD$
|
|
22026
|
+
azimuth: Math.atan2(dir.x, dir.z) / DEG_TO_RAD$4,
|
|
22027
|
+
elevation: Math.asin(Math.min(1, Math.max(-1, dir.y))) / DEG_TO_RAD$4
|
|
21478
22028
|
};
|
|
21479
22029
|
}
|
|
21480
22030
|
|
|
@@ -21485,10 +22035,14 @@ function viewAngleOf(pose) {
|
|
|
21485
22035
|
function repivotPose(ctx, pose, pivot, fitBox) {
|
|
21486
22036
|
var offset = pose.position.clone().sub(pose.target);
|
|
21487
22037
|
var distance = offset.length();
|
|
21488
|
-
|
|
22038
|
+
// A pose moved in past what shuts its element in stays below the orbit's floor (`pulledIn`).
|
|
22039
|
+
var pulledIn = pose.pulledIn ? {
|
|
22040
|
+
pulledIn: true
|
|
22041
|
+
} : {};
|
|
22042
|
+
if (distance < 1e-6) return _objectSpread$9({
|
|
21489
22043
|
position: pose.position.clone(),
|
|
21490
22044
|
target: pivot.clone()
|
|
21491
|
-
};
|
|
22045
|
+
}, pulledIn);
|
|
21492
22046
|
var dir = offset.divideScalar(distance);
|
|
21493
22047
|
var scale = 1;
|
|
21494
22048
|
if (fitBox && !fitBox.isEmpty()) {
|
|
@@ -21497,19 +22051,25 @@ function repivotPose(ctx, pose, pivot, fitBox) {
|
|
|
21497
22051
|
var around = projectedFramingRadius(fitBox, pose.target, angle, ctx.aspect, halfTan);
|
|
21498
22052
|
if (around > 1e-6) scale = projectedFramingRadius(fitBox, pivot, angle, ctx.aspect, halfTan) / around;
|
|
21499
22053
|
}
|
|
21500
|
-
return {
|
|
22054
|
+
return _objectSpread$9({
|
|
21501
22055
|
position: pivot.clone().addScaledVector(dir, distance * scale),
|
|
21502
22056
|
target: pivot.clone()
|
|
21503
|
-
};
|
|
22057
|
+
}, pulledIn);
|
|
21504
22058
|
}
|
|
21505
22059
|
|
|
21506
22060
|
/**
|
|
21507
22061
|
* `reframeOnSceneChange: 'follow'`: the camera keeps its current view direction and its zoom
|
|
21508
22062
|
* relative to the recipe's fit, around the recipe's (re-derived) look-at point. `basisDistance` is the
|
|
21509
22063
|
* fit distance the recipe produced before the change — a camera at half of that stays at half of the
|
|
21510
|
-
* new one.
|
|
22064
|
+
* new one. A recipe moved in past what shuts its element in (`pulledIn`) is taken as it is: from the user's direction and
|
|
22065
|
+
* zoom the camera would stand in or behind that geometry again.
|
|
21511
22066
|
*/
|
|
21512
22067
|
function followPose(recipe, current, basisDistance) {
|
|
22068
|
+
if (recipe.pulledIn) return {
|
|
22069
|
+
position: recipe.position.clone(),
|
|
22070
|
+
target: recipe.target.clone(),
|
|
22071
|
+
pulledIn: true
|
|
22072
|
+
};
|
|
21513
22073
|
var offset = current.position.clone().sub(current.target);
|
|
21514
22074
|
var currentDistance = offset.length();
|
|
21515
22075
|
// Negated `>` so a NaN basis (a fit stored while the canvas had no size) falls back instead of poisoning the pose.
|
|
@@ -21536,15 +22096,19 @@ function clampPoseDistance(pose, minDistance, maxDistance) {
|
|
|
21536
22096
|
};
|
|
21537
22097
|
}
|
|
21538
22098
|
function frameToResult(frame, aspect, cfg) {
|
|
22099
|
+
var _frame$pullIn;
|
|
21539
22100
|
var dist = frame.radius / fovHalfTan(cfg);
|
|
21540
22101
|
// The portrait fudge only applies to the isotropic sphere radius; the box-projected
|
|
21541
22102
|
// radius already folds in the horizontal extent for the current aspect.
|
|
21542
22103
|
if (aspect < 1 && !frame.aspectResolved) dist /= aspect;
|
|
21543
22104
|
dist *= frame.padding;
|
|
21544
|
-
|
|
21545
|
-
|
|
22105
|
+
var pullIn = (_frame$pullIn = frame.pullIn) !== null && _frame$pullIn !== void 0 ? _frame$pullIn : 0;
|
|
22106
|
+
return _objectSpread$9({
|
|
22107
|
+
position: sphericalPosition(frame.center, frame.angle, dist - pullIn),
|
|
21546
22108
|
target: frame.center.clone()
|
|
21547
|
-
}
|
|
22109
|
+
}, pullIn > 0 ? {
|
|
22110
|
+
pulledIn: true
|
|
22111
|
+
} : {});
|
|
21548
22112
|
}
|
|
21549
22113
|
|
|
21550
22114
|
/**
|
|
@@ -23049,7 +23613,7 @@ function formatValue(valueCm, unit) {
|
|
|
23049
23613
|
|
|
23050
23614
|
// OBB (oriented bounding box) helpers, shared by the 2D and 3D dimension lines.
|
|
23051
23615
|
|
|
23052
|
-
var DEG_TO_RAD$
|
|
23616
|
+
var DEG_TO_RAD$3 = Math.PI / 180;
|
|
23053
23617
|
var AXIS_ALIGNED_TOLERANCE_DEG = 2;
|
|
23054
23618
|
function computeElementBounds(el) {
|
|
23055
23619
|
var _el$pivotOffset$, _el$pivotOffset, _el$pivotOffset$2, _el$pivotOffset2;
|
|
@@ -23061,7 +23625,7 @@ function computeElementBounds(el) {
|
|
|
23061
23625
|
var depthM = el.depth / 100;
|
|
23062
23626
|
// Planner rotations turn the opposite way from the three.js Y axis the shared
|
|
23063
23627
|
// primitives use, so the angle is negated here (exact: cos is even, sin odd).
|
|
23064
|
-
var rotY = -el.rotation * DEG_TO_RAD$
|
|
23628
|
+
var rotY = -el.rotation * DEG_TO_RAD$3;
|
|
23065
23629
|
var _rotateXZ = rotateXZ(offsetX, offsetZ, rotY),
|
|
23066
23630
|
_rotateXZ2 = _slicedToArray(_rotateXZ, 2),
|
|
23067
23631
|
rotOx = _rotateXZ2[0],
|
|
@@ -23408,7 +23972,12 @@ function useCameraActions(controlsRef, animate, opts) {
|
|
|
23408
23972
|
var c = controlsRef.current;
|
|
23409
23973
|
if (c) {
|
|
23410
23974
|
c.target.copy(landing.target);
|
|
23975
|
+
// `update()` clamps to `minDistance`: a 3D focus moved in below it (`landInCage`) would be pushed back out
|
|
23976
|
+
// before the constraints lower the floor to its landing (`resetAfterAnimation`).
|
|
23977
|
+
var floor = c.minDistance;
|
|
23978
|
+
if (!(flyOpts !== null && flyOpts !== void 0 && flyOpts.up2D)) c.minDistance = Math.min(floor, landing.position.distanceTo(landing.target));
|
|
23411
23979
|
c.update();
|
|
23980
|
+
c.minDistance = floor;
|
|
23412
23981
|
}
|
|
23413
23982
|
}
|
|
23414
23983
|
}, flyOpts !== null && flyOpts !== void 0 && flyOpts.up2D ? TWO_D_UP_HINTS : undefined);
|
|
@@ -23481,7 +24050,8 @@ function useCameraActions(controlsRef, animate, opts) {
|
|
|
23481
24050
|
}),
|
|
23482
24051
|
minDistance = _evaluateCameraLimits.minDistance,
|
|
23483
24052
|
maxDistance = _evaluateCameraLimits.maxDistance;
|
|
23484
|
-
|
|
24053
|
+
// A focus that moved in past what shuts its element in keeps its distance below the floor.
|
|
24054
|
+
return clampPoseDistance(pose, pose.pulledIn ? 0 : minDistance, maxDistance);
|
|
23485
24055
|
}, [orbitLimits]);
|
|
23486
24056
|
|
|
23487
24057
|
/**
|
|
@@ -23937,45 +24507,67 @@ function smoothDampVec3(current, target, vel, smoothTime, dt) {
|
|
|
23937
24507
|
vel.z = _smoothVelTmp.value;
|
|
23938
24508
|
}
|
|
23939
24509
|
|
|
24510
|
+
var DEG_TO_RAD$2 = Math.PI / 180;
|
|
24511
|
+
|
|
23940
24512
|
/** Time (s) the glide takes to close most of its way: the critically damped spring's smooth time. */
|
|
23941
24513
|
var RETARGET_SMOOTH_TIME = 0.2;
|
|
23942
24514
|
/** Within this (m) of the goal, and slower than {@link RETARGET_SETTLE_SPEED} (m/s), the glide lands on it. */
|
|
23943
24515
|
var RETARGET_SETTLE = 1e-3;
|
|
23944
24516
|
var RETARGET_SETTLE_SPEED = 1e-2;
|
|
23945
24517
|
|
|
24518
|
+
/** A turn of the view around the orbit target, in radians: `azimuth` around the world's up axis, `polar` down from it. */
|
|
24519
|
+
|
|
24520
|
+
var NO_TURN = {
|
|
24521
|
+
azimuth: 0,
|
|
24522
|
+
polar: 0
|
|
24523
|
+
};
|
|
24524
|
+
|
|
23946
24525
|
/** A retarget under way. Open loop: it moves its own point, so a clamp of the real target cannot keep it from arriving. */
|
|
23947
24526
|
|
|
23948
|
-
/** A glide from `from` (the orbit target now) to `goal`, starting at rest; `pullIn` metres closer on landing. */
|
|
24527
|
+
/** A glide from `from` (the orbit target now) to `goal`, starting at rest; `pullIn` metres closer and turned by `turn` on landing. */
|
|
23949
24528
|
function startRetarget(from, goal) {
|
|
23950
24529
|
var pullIn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
24530
|
+
var turn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : NO_TURN;
|
|
23951
24531
|
return {
|
|
23952
24532
|
point: from.clone(),
|
|
23953
24533
|
goal: goal.clone(),
|
|
23954
24534
|
velocity: new Vector3(),
|
|
23955
24535
|
settledTarget: from.clone(),
|
|
23956
24536
|
pullIn: pullIn,
|
|
23957
|
-
|
|
24537
|
+
turn: turn,
|
|
24538
|
+
length: from.distanceTo(goal),
|
|
24539
|
+
progress: 0
|
|
23958
24540
|
};
|
|
23959
24541
|
}
|
|
23960
24542
|
|
|
23961
24543
|
/**
|
|
23962
|
-
*
|
|
23963
|
-
*
|
|
23964
|
-
* element
|
|
24544
|
+
* Where a click's camera lands, looking from `current` at `distance` (m) off the element's focus point `goal` (the rig's
|
|
24545
|
+
* plain move): the turn and the pull-in of {@link viewOfSubject}, shared with a focus — it keeps the view while it sees
|
|
24546
|
+
* the element (`subject`) past `obstacles`, else turns to a focus view around the element's front `frontYawDeg` that
|
|
24547
|
+
* does, else moves in where the camera can stand at `neededDistance` (m) or more from the element.
|
|
23965
24548
|
*/
|
|
23966
|
-
function
|
|
23967
|
-
|
|
23968
|
-
|
|
23969
|
-
|
|
23970
|
-
|
|
23971
|
-
|
|
23972
|
-
var
|
|
23973
|
-
|
|
23974
|
-
|
|
23975
|
-
|
|
23976
|
-
|
|
23977
|
-
|
|
23978
|
-
|
|
24549
|
+
function retargetLanding(goal, current, distance, frontYawDeg, subject, obstacles, neededDistance, clearance) {
|
|
24550
|
+
if (distance < 1e-6) return {
|
|
24551
|
+
turn: NO_TURN,
|
|
24552
|
+
pullIn: 0
|
|
24553
|
+
};
|
|
24554
|
+
// The first level candidate is the camera's own view: where the user put the camera.
|
|
24555
|
+
var candidates = focusAngleCandidates(current, frontYawDeg, current.azimuth - frontYawDeg);
|
|
24556
|
+
var view = viewOfSubject(candidates, function (angle) {
|
|
24557
|
+
return sphericalPosition(goal, angle, distance);
|
|
24558
|
+
}, goal, subject, obstacles, neededDistance, clearance);
|
|
24559
|
+
if (view.angle === candidates.level[0]) return {
|
|
24560
|
+
turn: NO_TURN,
|
|
24561
|
+
pullIn: view.pullIn
|
|
24562
|
+
};
|
|
24563
|
+
var azimuth = ((view.angle.azimuth - current.azimuth + 180) % 360 + 360) % 360 - 180;
|
|
24564
|
+
return {
|
|
24565
|
+
turn: {
|
|
24566
|
+
azimuth: azimuth * DEG_TO_RAD$2,
|
|
24567
|
+
polar: (current.elevation - view.angle.elevation) * DEG_TO_RAD$2
|
|
24568
|
+
},
|
|
24569
|
+
pullIn: view.pullIn
|
|
24570
|
+
};
|
|
23979
24571
|
}
|
|
23980
24572
|
|
|
23981
24573
|
/**
|
|
@@ -24005,10 +24597,6 @@ function releaseDistanceFloor(controls, floor, cameraDistance) {
|
|
|
24005
24597
|
controls.minDistance = floor.presetMin;
|
|
24006
24598
|
return true;
|
|
24007
24599
|
}
|
|
24008
|
-
function isWithin(object, root) {
|
|
24009
|
-
for (var node = object; node; node = node.parent) if (node === root) return true;
|
|
24010
|
-
return false;
|
|
24011
|
-
}
|
|
24012
24600
|
|
|
24013
24601
|
/** Whether the orbit target `target` moved since the last frame ended without the glide: the user's pan. */
|
|
24014
24602
|
function retargetPanned(glide, target) {
|
|
@@ -24023,21 +24611,27 @@ function progressOf(glide) {
|
|
|
24023
24611
|
|
|
24024
24612
|
/**
|
|
24025
24613
|
* One frame (`dt` seconds) of the glide: how far the rig moves, how many metres the camera moves in towards the target
|
|
24026
|
-
* this frame (
|
|
24614
|
+
* and how far the view turns this frame (their shares of `pullIn` and `turn`), and whether the glide has arrived.
|
|
24615
|
+
* Frame-rate independent.
|
|
24027
24616
|
*/
|
|
24028
24617
|
function stepRetarget(glide, dt) {
|
|
24029
24618
|
var before = glide.point.clone();
|
|
24030
|
-
var progressBefore = progressOf(glide);
|
|
24031
24619
|
smoothDampVec3(glide.point, glide.goal, glide.velocity, RETARGET_SMOOTH_TIME, dt);
|
|
24032
24620
|
var arrived = glide.point.distanceTo(glide.goal) < RETARGET_SETTLE && glide.velocity.length() < RETARGET_SETTLE_SPEED;
|
|
24033
24621
|
if (arrived) {
|
|
24034
24622
|
glide.point.copy(glide.goal);
|
|
24035
24623
|
glide.velocity.set(0, 0, 0);
|
|
24036
24624
|
}
|
|
24037
|
-
var
|
|
24625
|
+
var progress = arrived ? 1 : Math.max(glide.progress, progressOf(glide));
|
|
24626
|
+
var share = progress - glide.progress;
|
|
24627
|
+
glide.progress = progress;
|
|
24038
24628
|
return {
|
|
24039
24629
|
shift: glide.point.clone().sub(before),
|
|
24040
|
-
pull:
|
|
24630
|
+
pull: glide.pullIn * share,
|
|
24631
|
+
turn: {
|
|
24632
|
+
azimuth: glide.turn.azimuth * share,
|
|
24633
|
+
polar: glide.turn.polar * share
|
|
24634
|
+
},
|
|
24041
24635
|
arrived: arrived
|
|
24042
24636
|
};
|
|
24043
24637
|
}
|
|
@@ -24074,78 +24668,6 @@ function restoreOrbit(camera, controls, pose) {
|
|
|
24074
24668
|
function _createForOfIteratorHelper$o(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$o(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; } } }; }
|
|
24075
24669
|
function _unsupportedIterableToArray$o(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$o(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$o(r, a) : void 0; } }
|
|
24076
24670
|
function _arrayLikeToArray$o(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; }
|
|
24077
|
-
var ELEMENT_PREFIX = 'Element#';
|
|
24078
|
-
|
|
24079
|
-
/** `boundsTree` is set by `enableBVHWhenIdle` (core/meshBVH.ts); the type is irrelevant here, its presence is the signal. */
|
|
24080
|
-
|
|
24081
|
-
/**
|
|
24082
|
-
* Collidable geometry — the shared target set of the camera-collision probe in
|
|
24083
|
-
* `useCameraConstraints` and the sun-lensflare occlusion taps in `SunLensflare`.
|
|
24084
|
-
*
|
|
24085
|
-
* Raycasting `scene.children` instead costs a full graph walk plus a per-mesh bounding-sphere test
|
|
24086
|
-
* every sampling frame, and three's sphere test is against the infinite ray — so geometry far beyond
|
|
24087
|
-
* `raycaster.far` (ground plane, backdrop, the 2D overlay) still reaches triangle level. Restricting
|
|
24088
|
-
* the set is what makes both consumers affordable; it also stops visual aids from shoving the
|
|
24089
|
-
* camera or dimming the flare.
|
|
24090
|
-
*
|
|
24091
|
-
* Two things are collidable, and nothing else:
|
|
24092
|
-
* - the article: every mesh under a planner `Element#` group (mains and their accessories).
|
|
24093
|
-
* `SceneRenderer` queues these for a `boundsTree` per assembly — pure raycast acceleration,
|
|
24094
|
-
* membership here comes from the name prefix alone;
|
|
24095
|
-
* - the environment decor GLB: meshes whose geometry carries a three-mesh-bvh `boundsTree`
|
|
24096
|
-
* (queued by `EnvironmentSceneLoader`, see `core/meshBVH.ts`) — so for decor the bounds tree is
|
|
24097
|
-
* the opt-in to blocking the camera, which the walkthrough-style presets rely on for their
|
|
24098
|
-
* walls. Trees are built lazily, which is why both consumers flush the queue before calling
|
|
24099
|
-
* this: a pending decor tree here reads as "not collidable".
|
|
24100
|
-
*
|
|
24101
|
-
* `userData.outlineExclude` subtrees are pruned: those are the placement boxes and drag previews
|
|
24102
|
-
* that sit inside an element group only to inherit its transform (see `SceneTree`).
|
|
24103
|
-
*/
|
|
24104
|
-
function collectCollisionTargets(scene) {
|
|
24105
|
-
var meshes = [];
|
|
24106
|
-
collect(scene, false, meshes);
|
|
24107
|
-
var box = new Box3();
|
|
24108
|
-
for (var _i = 0, _meshes = meshes; _i < _meshes.length; _i++) {
|
|
24109
|
-
var mesh = _meshes[_i];
|
|
24110
|
-
box.expandByObject(mesh);
|
|
24111
|
-
}
|
|
24112
|
-
return {
|
|
24113
|
-
meshes: meshes,
|
|
24114
|
-
bounds: box.isEmpty() ? null : box.getBoundingSphere(new Sphere())
|
|
24115
|
-
};
|
|
24116
|
-
}
|
|
24117
|
-
function collect(obj, insideArticle, out) {
|
|
24118
|
-
if (obj.userData.outlineExclude === true) return;
|
|
24119
|
-
var inArticle = insideArticle || obj.name.startsWith(ELEMENT_PREFIX);
|
|
24120
|
-
var mesh = obj;
|
|
24121
|
-
if (mesh.isMesh === true) {
|
|
24122
|
-
var geometry = mesh.geometry;
|
|
24123
|
-
if (inArticle || geometry.boundsTree !== undefined) out.push(mesh);
|
|
24124
|
-
}
|
|
24125
|
-
var _iterator = _createForOfIteratorHelper$o(obj.children),
|
|
24126
|
-
_step;
|
|
24127
|
-
try {
|
|
24128
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
24129
|
-
var child = _step.value;
|
|
24130
|
-
collect(child, inArticle, out);
|
|
24131
|
-
}
|
|
24132
|
-
} catch (err) {
|
|
24133
|
-
_iterator.e(err);
|
|
24134
|
-
} finally {
|
|
24135
|
-
_iterator.f();
|
|
24136
|
-
}
|
|
24137
|
-
}
|
|
24138
|
-
|
|
24139
|
-
/**
|
|
24140
|
-
* True when no ray of length `probeRange` cast from `cameraPos` can reach `bounds` — the cheap
|
|
24141
|
-
* per-frame reason to skip the collision raycasts outright while the camera orbits at a distance.
|
|
24142
|
-
*/
|
|
24143
|
-
function isOutOfCollisionRange(cameraPos, bounds, probeRange) {
|
|
24144
|
-
if (!bounds) return true;
|
|
24145
|
-
var reach = bounds.radius + probeRange;
|
|
24146
|
-
return cameraPos.distanceToSquared(bounds.center) > reach * reach;
|
|
24147
|
-
}
|
|
24148
|
-
|
|
24149
24671
|
var CAM_LOG = getLogger('RealTimeViewer', 'useCameraConstraints');
|
|
24150
24672
|
|
|
24151
24673
|
/**
|
|
@@ -24153,7 +24675,6 @@ var CAM_LOG = getLogger('RealTimeViewer', 'useCameraConstraints');
|
|
|
24153
24675
|
* plane is what the user sees through. Deriving it from `camera.near` keeps passages narrower than a
|
|
24154
24676
|
* metre traversable — a fixed metre-scale bubble makes them impassable, since both walls push at once.
|
|
24155
24677
|
*/
|
|
24156
|
-
var MIN_CLEARANCE = 0.25;
|
|
24157
24678
|
var NEAR_CLEARANCE_FACTOR = 4;
|
|
24158
24679
|
/** Soft-brake zone as a multiple of clearance. Larger values make narrow passages feel sticky. */
|
|
24159
24680
|
var BRAKE_RATIO = 3;
|
|
@@ -24186,7 +24707,7 @@ var TWO_PI = Math.PI * 2;
|
|
|
24186
24707
|
*/
|
|
24187
24708
|
/** The camera's collision clearance (m): how close it may come to geometry. */
|
|
24188
24709
|
function collisionClearance(camera) {
|
|
24189
|
-
return Math.max(
|
|
24710
|
+
return Math.max(MIN_COLLISION_CLEARANCE, camera.near * NEAR_CLEARANCE_FACTOR);
|
|
24190
24711
|
}
|
|
24191
24712
|
function probeObstacle(raycaster, camera, targets, dir, range) {
|
|
24192
24713
|
raycaster.set(camera.position, dir);
|
|
@@ -24244,6 +24765,9 @@ function useCameraConstraints(camera, controlsRef, opts) {
|
|
|
24244
24765
|
var retargetTaken = useRef((_useRTVStore$getState = (_useRTVStore$getState2 = useRTVStore$1.getState().cameraRetarget) === null || _useRTVStore$getState2 === void 0 ? void 0 : _useRTVStore$getState2.id) !== null && _useRTVStore$getState !== void 0 ? _useRTVStore$getState : 0);
|
|
24245
24766
|
/** The controls' `minDistance` a pulled-in landing lowered (`lowerDistanceFloor`), until the camera is out at it again. */
|
|
24246
24767
|
var retargetFloor = useRef(null);
|
|
24768
|
+
/** Scratch for the glide's turn of the view. */
|
|
24769
|
+
var retargetOffset = useRef(new Vector3());
|
|
24770
|
+
var retargetSpherical = useRef(new Spherical());
|
|
24247
24771
|
var dropRetargetFloor = useCallback(function () {
|
|
24248
24772
|
var floor = retargetFloor.current;
|
|
24249
24773
|
retargetFloor.current = null;
|
|
@@ -24316,6 +24840,11 @@ function useCameraConstraints(camera, controlsRef, opts) {
|
|
|
24316
24840
|
// A flight re-frames the scene outright, so any rig displacement it left behind is stale.
|
|
24317
24841
|
rigOffset.current.set(0, 0, 0);
|
|
24318
24842
|
dropRetargetFloor();
|
|
24843
|
+
// Only a focus that moved in past what shuts its element in lands closer than `minDistance` (`landInCage` holds every
|
|
24844
|
+
// other flight at it): the floor is lowered to it, or `update()` would push the camera back out.
|
|
24845
|
+
if (controlsRef.current) {
|
|
24846
|
+
retargetFloor.current = lowerDistanceFloor(controlsRef.current, camera.position.distanceTo(controlsRef.current.target));
|
|
24847
|
+
}
|
|
24319
24848
|
rearContact.current = false;
|
|
24320
24849
|
// Same for the sector spring-back: the flight's end pose is the new desire.
|
|
24321
24850
|
desiredDistance.current = null;
|
|
@@ -24343,31 +24872,48 @@ function useCameraConstraints(camera, controlsRef, opts) {
|
|
|
24343
24872
|
var bounds = plan ? planBounds : sceneBBox;
|
|
24344
24873
|
if (bounds) goal.clamp(bounds.min, bounds.max);
|
|
24345
24874
|
if (plan) poseBook.movePlanFraming(goal);
|
|
24346
|
-
// The rig moves as a whole, so the camera could land
|
|
24875
|
+
// The rig moves as a whole, so the camera could land where other geometry hides the element: it turns to a view
|
|
24876
|
+
// that sees it, and only where none does (the element is shut in) it moves in front of that geometry.
|
|
24347
24877
|
var pullIn = 0;
|
|
24348
|
-
|
|
24349
|
-
|
|
24350
|
-
|
|
24351
|
-
|
|
24352
|
-
var
|
|
24353
|
-
|
|
24354
|
-
|
|
24355
|
-
|
|
24356
|
-
|
|
24357
|
-
|
|
24358
|
-
|
|
24359
|
-
|
|
24360
|
-
|
|
24361
|
-
|
|
24878
|
+
var turn = NO_TURN;
|
|
24879
|
+
var element = !plan && limits.collision ? threeScene.getObjectByName(request.elementName) : undefined;
|
|
24880
|
+
var own = element ? meshesOf(element) : [];
|
|
24881
|
+
if (element && own.length > 0) {
|
|
24882
|
+
var box = new Box3();
|
|
24883
|
+
var _iterator = _createForOfIteratorHelper$o(own),
|
|
24884
|
+
_step;
|
|
24885
|
+
try {
|
|
24886
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
24887
|
+
var mesh = _step.value;
|
|
24888
|
+
box.expandByObject(mesh);
|
|
24889
|
+
}
|
|
24890
|
+
} catch (err) {
|
|
24891
|
+
_iterator.e(err);
|
|
24892
|
+
} finally {
|
|
24893
|
+
_iterator.f();
|
|
24894
|
+
}
|
|
24895
|
+
var angle = viewAngleOf({
|
|
24896
|
+
position: camera.position,
|
|
24897
|
+
target: controls.target
|
|
24898
|
+
});
|
|
24899
|
+
var landing = retargetLanding(goal, angle, camera.position.distanceTo(controls.target), worldYawDeg(element), {
|
|
24900
|
+
box: box,
|
|
24901
|
+
meshes: own
|
|
24902
|
+
}, occludersOf(threeScene, element), boxFitDistance(box, goal, angle, camera.aspect, baseFov), MIN_COLLISION_CLEARANCE);
|
|
24903
|
+
turn = landing.turn;
|
|
24904
|
+
pullIn = landing.pullIn;
|
|
24905
|
+
}
|
|
24906
|
+
retargetGlide.current = startRetarget(controls.target, goal, pullIn, turn);
|
|
24362
24907
|
dropRetargetFloor();
|
|
24363
24908
|
retargetFloor.current = lowerDistanceFloor(controls, camera.position.distanceTo(controls.target) - pullIn);
|
|
24364
24909
|
userMoved.current = true;
|
|
24365
|
-
|
|
24366
|
-
|
|
24910
|
+
var turned = turn !== NO_TURN ? " \u2014 turned ".concat((turn.azimuth * 180 / Math.PI).toFixed(0), "\xB0 / ").concat((-turn.polar * 180 / Math.PI).toFixed(0), "\xB0 up to see it") : '';
|
|
24911
|
+
CAM_LOG.debug("retarget \u2192 ".concat(request.elementName).concat(plan ? ' (2D plan)' : '').concat(turned).concat(pullIn > 0 ? " \u2014 ".concat(pullIn.toFixed(2), " m closer, past geometry") : ''));
|
|
24912
|
+
}, [camera, controlsRef, controlsMode, threeScene, planBounds, sceneBBox, userMoved, limits.collision, baseFov, dropRetargetFloor, poseBook]);
|
|
24367
24913
|
|
|
24368
24914
|
/**
|
|
24369
|
-
* One frame of the retarget glide: the rig moves as a whole, so the distance and the angles stay
|
|
24370
|
-
* the view meanwhile goes on top. A pan ends it.
|
|
24915
|
+
* One frame of the retarget glide: the rig moves as a whole, so the distance and the angles stay but for the glide's own
|
|
24916
|
+
* pull-in and turn, and a turn or zoom of the view meanwhile goes on top. A pan ends it.
|
|
24371
24917
|
*/
|
|
24372
24918
|
var applyRetarget = useCallback(function (frame, dt) {
|
|
24373
24919
|
var glide = retargetGlide.current;
|
|
@@ -24380,9 +24926,18 @@ function useCameraConstraints(camera, controlsRef, opts) {
|
|
|
24380
24926
|
var _stepRetarget = stepRetarget(glide, dt),
|
|
24381
24927
|
shift = _stepRetarget.shift,
|
|
24382
24928
|
pull = _stepRetarget.pull,
|
|
24929
|
+
turn = _stepRetarget.turn,
|
|
24383
24930
|
arrived = _stepRetarget.arrived;
|
|
24384
24931
|
controls.target.add(shift);
|
|
24385
24932
|
camera.position.add(shift);
|
|
24933
|
+
if (turn.azimuth !== 0 || turn.polar !== 0) {
|
|
24934
|
+
var offset = retargetOffset.current.subVectors(camera.position, controls.target);
|
|
24935
|
+
var spherical = retargetSpherical.current.setFromVector3(offset);
|
|
24936
|
+
spherical.theta += turn.azimuth;
|
|
24937
|
+
spherical.phi += turn.polar;
|
|
24938
|
+
spherical.makeSafe();
|
|
24939
|
+
camera.position.copy(controls.target).add(offset.setFromSpherical(spherical));
|
|
24940
|
+
}
|
|
24386
24941
|
if (pull !== 0) camera.position.addScaledVector(controls.target.clone().sub(camera.position).normalize(), pull);
|
|
24387
24942
|
if (arrived) retargetGlide.current = null;else frame.invalidate();
|
|
24388
24943
|
}, [camera, controlsRef]);
|
|
@@ -24408,6 +24963,7 @@ function useCameraConstraints(camera, controlsRef, opts) {
|
|
|
24408
24963
|
camera.position.z += dz;
|
|
24409
24964
|
}, [camera, controlsRef, planBounds]);
|
|
24410
24965
|
useFrame(function (state, delta) {
|
|
24966
|
+
var _retargetGlide$curren, _retargetGlide$curren2;
|
|
24411
24967
|
// A NaN or an infinity in the orbit draws nothing and never recovers by itself: put it back where it was last finite.
|
|
24412
24968
|
var orbitControls = controlsRef.current;
|
|
24413
24969
|
if (orbitControls) {
|
|
@@ -24612,7 +25168,10 @@ function useCameraConstraints(camera, controlsRef, opts) {
|
|
|
24612
25168
|
// Probe only while the camera is actually moving, and only when the host wants collision at all —
|
|
24613
25169
|
// this is the expensive part of the hook, two raycasts per moving frame.
|
|
24614
25170
|
if (!limits.collision) rearContact.current = false;
|
|
24615
|
-
|
|
25171
|
+
// A glide that pulls the camera in passes the geometry it lands in front of (a garden house's wall): its landing is
|
|
25172
|
+
// clear by construction, and the probe would stop it outside, the wall filling the view.
|
|
25173
|
+
var pullingIn = ((_retargetGlide$curren = (_retargetGlide$curren2 = retargetGlide.current) === null || _retargetGlide$curren2 === void 0 ? void 0 : _retargetGlide$curren2.pullIn) !== null && _retargetGlide$curren !== void 0 ? _retargetGlide$curren : 0) > 0;
|
|
25174
|
+
var targets = limits.collision && moveDist > 0.001 && !pullingIn ? ensureCollisionTargets() : null;
|
|
24616
25175
|
// Cheap early-out: outside the collidable bounds plus the probe's own reach, no ray can hit
|
|
24617
25176
|
// anything — and nothing is behind us either, so the rig is free to ease back.
|
|
24618
25177
|
var inReach = targets !== null && !isOutOfCollisionRange(camera.position, targets.bounds, probeRange);
|
|
@@ -25881,9 +26440,11 @@ function DockingPoints2D(_ref) {
|
|
|
25881
26440
|
e.stopPropagation();
|
|
25882
26441
|
var callbacks = getHostCallbacks();
|
|
25883
26442
|
if (btn.isDocking) {
|
|
25884
|
-
var _callbacks$onDockingP;
|
|
25885
26443
|
// Occupied point: delete the attached accessory (the handler ignores `isSelected` here).
|
|
25886
|
-
|
|
26444
|
+
useRTVStore$1.getState().sendOperation('delete', function () {
|
|
26445
|
+
var _callbacks$onDockingP;
|
|
26446
|
+
return (_callbacks$onDockingP = callbacks.onDockingPointInteraction) === null || _callbacks$onDockingP === void 0 ? void 0 : _callbacks$onDockingP.call(callbacks, element.setId, element.elementId, btn.dpId, false, btn.onElementId);
|
|
26447
|
+
});
|
|
25887
26448
|
return;
|
|
25888
26449
|
}
|
|
25889
26450
|
var nowSelected = selectedDpId !== btn.dpId;
|
|
@@ -30631,7 +31192,7 @@ function registerOutlineTiming(label, effect) {
|
|
|
30631
31192
|
if (effect) gpuTimingTargets.outlines.set(label, effect);else gpuTimingTargets.outlines["delete"](label);
|
|
30632
31193
|
}
|
|
30633
31194
|
var GpuPassTiming = /*#__PURE__*/lazy(function () {
|
|
30634
|
-
return import('./GpuPassTiming-
|
|
31195
|
+
return import('./GpuPassTiming-47d7d14b.js').then(function (m) {
|
|
30635
31196
|
return {
|
|
30636
31197
|
"default": m.GpuPassTiming
|
|
30637
31198
|
};
|
|
@@ -33148,8 +33709,10 @@ function applyShotConfig(ctx, shot) {
|
|
|
33148
33709
|
}
|
|
33149
33710
|
|
|
33150
33711
|
/**
|
|
33151
|
-
* (Re)frames the proxy camera for a 2d shot: the planning
|
|
33152
|
-
*
|
|
33712
|
+
* (Re)frames the proxy camera for a 2d shot: the planning with its dimension lines, padded by the shot's padding (else
|
|
33713
|
+
* `initialZoomPadding2D`). In a room too: the saved plan image is about the planning, and the whole room would shrink it
|
|
33714
|
+
* to a strip at a wall; the live plan, which also shows where the room leaves space, frames the room. A room without a
|
|
33715
|
+
* planning yet is framed whole. Reads the store fresh: it runs after `applyShotConfig` may have overridden `viewMode`.
|
|
33153
33716
|
*/
|
|
33154
33717
|
function apply2DShotFraming(_ref3, shot) {
|
|
33155
33718
|
var _shot$viewMode2, _state$scene2d, _state$sceneMetrics$c3, _state$sceneMetrics5, _state$sceneMetrics$r3, _state$sceneMetrics6, _shot$camera;
|
|
@@ -33164,10 +33727,12 @@ function apply2DShotFraming(_ref3, shot) {
|
|
|
33164
33727
|
var size = sizeRef.current;
|
|
33165
33728
|
var resolution = clampShotResolution(shot.resolution, state.activeProfileTier);
|
|
33166
33729
|
var aspect = resolution ? resolution.width / resolution.height : size.width / size.height;
|
|
33730
|
+
var planning = (_state$scene2d = state.scene2d) === null || _state$scene2d === void 0 ? void 0 : _state$scene2d.boundingBox;
|
|
33731
|
+
var hasPlanning = isFinitePlanBox(planning) && (planning.width > 0 || planning.depth > 0);
|
|
33167
33732
|
var frameCtx = {
|
|
33168
33733
|
threeScene: scene,
|
|
33169
|
-
bounds2d:
|
|
33170
|
-
roomBounds2d: roomFrameBounds(state.room),
|
|
33734
|
+
bounds2d: planning,
|
|
33735
|
+
roomBounds2d: hasPlanning ? undefined : roomFrameBounds(state.room),
|
|
33171
33736
|
sceneCenter: (_state$sceneMetrics$c3 = (_state$sceneMetrics5 = state.sceneMetrics) === null || _state$sceneMetrics5 === void 0 ? void 0 : _state$sceneMetrics5.center) !== null && _state$sceneMetrics$c3 !== void 0 ? _state$sceneMetrics$c3 : [0, 0, 0],
|
|
33172
33737
|
sceneRadius: (_state$sceneMetrics$r3 = (_state$sceneMetrics6 = state.sceneMetrics) === null || _state$sceneMetrics6 === void 0 ? void 0 : _state$sceneMetrics6.radius) !== null && _state$sceneMetrics$r3 !== void 0 ? _state$sceneMetrics$r3 : 2,
|
|
33173
33738
|
aspect: aspect,
|
|
@@ -34663,6 +35228,66 @@ function PerfLogController() {
|
|
|
34663
35228
|
return null;
|
|
34664
35229
|
}
|
|
34665
35230
|
|
|
35231
|
+
/**
|
|
35232
|
+
* The digest the viewer tells scenes apart by. A digest, not the serialized scene: the full text of a pool scene kept
|
|
35233
|
+
* for comparison would sit in memory for the page's lifetime.
|
|
35234
|
+
*/
|
|
35235
|
+
function sceneSignature(scene) {
|
|
35236
|
+
return hashString(JSON.stringify(scene));
|
|
35237
|
+
}
|
|
35238
|
+
function renderScriptSignature(script) {
|
|
35239
|
+
try {
|
|
35240
|
+
// The base URL is the same for both sides of a comparison, so any one gives the same answer.
|
|
35241
|
+
return sceneSignature(parseRenderScript(JSON.parse(script), ''));
|
|
35242
|
+
} catch (_unused) {
|
|
35243
|
+
return undefined;
|
|
35244
|
+
}
|
|
35245
|
+
}
|
|
35246
|
+
|
|
35247
|
+
/**
|
|
35248
|
+
* Whether the viewer shows the same scene for both render scripts. The host re-emits the script for every render
|
|
35249
|
+
* request (a different `_id`, render size or camera); for such a script the viewer assembles nothing new and reports no
|
|
35250
|
+
* `onSceneReady`. Scripts that do not parse are the same only as identical strings.
|
|
35251
|
+
*/
|
|
35252
|
+
function isSameRenderScene(a, b) {
|
|
35253
|
+
if (a === b) return true;
|
|
35254
|
+
if (!a || !b) return false;
|
|
35255
|
+
var signature = renderScriptSignature(a);
|
|
35256
|
+
return signature !== undefined && signature === renderScriptSignature(b);
|
|
35257
|
+
}
|
|
35258
|
+
|
|
35259
|
+
/**
|
|
35260
|
+
* The render script each assembled scene came from. A script re-emitted for the same scene keeps the scene object, so
|
|
35261
|
+
* the entry follows the newest script of that scene.
|
|
35262
|
+
*/
|
|
35263
|
+
var scriptOfScene = new WeakMap();
|
|
35264
|
+
|
|
35265
|
+
/** The scene the viewer last reported ready (`onSceneReady`). */
|
|
35266
|
+
var shownScene = null;
|
|
35267
|
+
|
|
35268
|
+
/** `scene` is what the viewer assembles from the host's `script`. */
|
|
35269
|
+
function sceneAssembledFrom(scene, script) {
|
|
35270
|
+
scriptOfScene.set(scene, script);
|
|
35271
|
+
}
|
|
35272
|
+
|
|
35273
|
+
/**
|
|
35274
|
+
* The viewer shows `scene`: its geometry and materials are loaded and it replaced the scene before. Null: it shows none
|
|
35275
|
+
* (the scene was removed or the viewer unmounted), so a scene assembled again later counts only once it reports ready.
|
|
35276
|
+
*/
|
|
35277
|
+
function sceneShown(scene) {
|
|
35278
|
+
shownScene = scene;
|
|
35279
|
+
}
|
|
35280
|
+
|
|
35281
|
+
/**
|
|
35282
|
+
* Whether the 3D view shows the scene of `script`. A host that hands the viewer a new script cannot take the next
|
|
35283
|
+
* `onSceneReady` for its scene: a scene still loading from an earlier script reports ready too, and a script of the scene
|
|
35284
|
+
* already set may not be shown yet.
|
|
35285
|
+
*/
|
|
35286
|
+
function isRenderSceneShown(script) {
|
|
35287
|
+
var shownScript = shownScene ? scriptOfScene.get(shownScene) : undefined;
|
|
35288
|
+
return shownScript !== undefined && isSameRenderScene(shownScript, script);
|
|
35289
|
+
}
|
|
35290
|
+
|
|
34666
35291
|
var BOOT_LOG = getLogger('RealTimeViewer', 'SceneRenderer.boot');
|
|
34667
35292
|
var CONTEXT_LOG = getLogger('RealTimeViewer', 'SceneRenderer.glcontext');
|
|
34668
35293
|
var RTV_POINTER_EVENTS = createRTVPointerEvents(function () {
|
|
@@ -34997,9 +35622,16 @@ function SceneReadyNotifier(_ref) {
|
|
|
34997
35622
|
// scene swaps are a no-op here).
|
|
34998
35623
|
bootPhase('article-geo ready');
|
|
34999
35624
|
useRTVStore$1.getState().endSceneLoad(ARTICLE_GEO_LOAD_ID);
|
|
35625
|
+
sceneShown(scene);
|
|
35000
35626
|
(_getHostCallbacks$onS = (_getHostCallbacks = getHostCallbacks()).onSceneReady) === null || _getHostCallbacks$onS === void 0 || _getHostCallbacks$onS.call(_getHostCallbacks);
|
|
35001
35627
|
}
|
|
35002
35628
|
}, [scene]);
|
|
35629
|
+
// Unmounts with the scene (removed, e.g. for the 2D view) and with the viewer.
|
|
35630
|
+
useEffect(function () {
|
|
35631
|
+
return function () {
|
|
35632
|
+
return sceneShown(null);
|
|
35633
|
+
};
|
|
35634
|
+
}, []);
|
|
35003
35635
|
return null;
|
|
35004
35636
|
}
|
|
35005
35637
|
function useExposureSync() {
|
|
@@ -35451,34 +36083,6 @@ function _preloadGeoAssets() {
|
|
|
35451
36083
|
return _preloadGeoAssets.apply(this, arguments);
|
|
35452
36084
|
}
|
|
35453
36085
|
|
|
35454
|
-
/**
|
|
35455
|
-
* The digest the viewer tells scenes apart by. A digest, not the serialized scene: the full text of a pool scene kept
|
|
35456
|
-
* for comparison would sit in memory for the page's lifetime.
|
|
35457
|
-
*/
|
|
35458
|
-
function sceneSignature(scene) {
|
|
35459
|
-
return hashString(JSON.stringify(scene));
|
|
35460
|
-
}
|
|
35461
|
-
function renderScriptSignature(script) {
|
|
35462
|
-
try {
|
|
35463
|
-
// The base URL is the same for both sides of a comparison, so any one gives the same answer.
|
|
35464
|
-
return sceneSignature(parseRenderScript(JSON.parse(script), ''));
|
|
35465
|
-
} catch (_unused) {
|
|
35466
|
-
return undefined;
|
|
35467
|
-
}
|
|
35468
|
-
}
|
|
35469
|
-
|
|
35470
|
-
/**
|
|
35471
|
-
* Whether the viewer shows the same scene for both render scripts. The host re-emits the script for every render
|
|
35472
|
-
* request (a different `_id`, render size or camera); for such a script the viewer assembles nothing new and reports no
|
|
35473
|
-
* `onSceneReady`. Scripts that do not parse are the same only as identical strings.
|
|
35474
|
-
*/
|
|
35475
|
-
function isSameRenderScene(a, b) {
|
|
35476
|
-
if (a === b) return true;
|
|
35477
|
-
if (!a || !b) return false;
|
|
35478
|
-
var signature = renderScriptSignature(a);
|
|
35479
|
-
return signature !== undefined && signature === renderScriptSignature(b);
|
|
35480
|
-
}
|
|
35481
|
-
|
|
35482
36086
|
var LOG$1 = getLogger('RealTimeViewer', 'RTVNext');
|
|
35483
36087
|
|
|
35484
36088
|
/** Never hide the scene longer than this waiting for the boot article's geometry. */
|
|
@@ -35624,6 +36228,11 @@ function useAssembledScene(_ref) {
|
|
|
35624
36228
|
settleFirstArticle();
|
|
35625
36229
|
}, [parsed]);
|
|
35626
36230
|
|
|
36231
|
+
// Ties the scene to its script, so `isRenderSceneShown` tells this script's scene apart from one of an earlier script.
|
|
36232
|
+
useEffect(function () {
|
|
36233
|
+
if (parsed && hqRenderScriptProp) sceneAssembledFrom(parsed, hqRenderScriptProp);
|
|
36234
|
+
}, [parsed, hqRenderScriptProp]);
|
|
36235
|
+
|
|
35627
36236
|
// The store is the single channel the renderer reads the scene from.
|
|
35628
36237
|
useEffect(function () {
|
|
35629
36238
|
setScene(parsed);
|
|
@@ -35704,6 +36313,22 @@ function useContentSync(value, setterOf) {
|
|
|
35704
36313
|
}, [signature]);
|
|
35705
36314
|
}
|
|
35706
36315
|
|
|
36316
|
+
/**
|
|
36317
|
+
* Ends a drag, turn or accessory move still running when the viewer unmounts (its pointer listeners go with it): the
|
|
36318
|
+
* store outlives the viewer, and a gesture left open would keep every host operation blocked for the rest of the page.
|
|
36319
|
+
* The gesture is cancelled, so the planner gets its END at the start pose.
|
|
36320
|
+
*/
|
|
36321
|
+
function useEndGesturesOnUnmount() {
|
|
36322
|
+
useEffect(function () {
|
|
36323
|
+
return function () {
|
|
36324
|
+
var s = useRTVStore$1.getState();
|
|
36325
|
+
if (s.isDragging) s.cancelDrag();
|
|
36326
|
+
if (s.isRotating) s.cancelRotate();
|
|
36327
|
+
if (s.accessoryMove) s.cancelAccessoryMove();
|
|
36328
|
+
};
|
|
36329
|
+
}, []);
|
|
36330
|
+
}
|
|
36331
|
+
|
|
35707
36332
|
var LOG = getLogger('RealTimeViewer', 'RTVNext');
|
|
35708
36333
|
var ACC_LOG = getLogger('RealTimeViewer', 'AccGrid');
|
|
35709
36334
|
/**
|
|
@@ -35838,6 +36463,7 @@ function useHostPropsSync(_ref2) {
|
|
|
35838
36463
|
var accessoryPlacement = useRTVStore$1(function (s) {
|
|
35839
36464
|
return s.uiConfig.accessoryPlacement;
|
|
35840
36465
|
});
|
|
36466
|
+
var operationBlocked = useRTVStore$1(isOperationBlocked);
|
|
35841
36467
|
var setSelectedElementFromProp = useRTVStore$1(function (s) {
|
|
35842
36468
|
return s.setSelectedElementFromProp;
|
|
35843
36469
|
});
|
|
@@ -35850,6 +36476,7 @@ function useHostPropsSync(_ref2) {
|
|
|
35850
36476
|
var setRenderStopped = useRTVStore$1(function (s) {
|
|
35851
36477
|
return s.setRenderStopped;
|
|
35852
36478
|
});
|
|
36479
|
+
useEndGesturesOnUnmount();
|
|
35853
36480
|
/** Last applied `enter` RULE (row + intent); `null` until the first resolution. */
|
|
35854
36481
|
var stepRuleRef = useRef(null);
|
|
35855
36482
|
useEffect(function () {
|
|
@@ -35872,7 +36499,6 @@ function useHostPropsSync(_ref2) {
|
|
|
35872
36499
|
// post-placement `freePlacesOnGrids` refresh does NOT re-trigger (place→refresh→place loop).
|
|
35873
36500
|
var armedHandledRef = useRef(undefined);
|
|
35874
36501
|
useEffect(function () {
|
|
35875
|
-
var _callbacks$onAccessor;
|
|
35876
36502
|
if (accessoryPlacement !== 'autoPlaceDrag') return;
|
|
35877
36503
|
// Nothing armed → reset the latch so re-arming the same article later re-triggers.
|
|
35878
36504
|
if (!armedAccessoryCodex) {
|
|
@@ -35881,6 +36507,9 @@ function useHostPropsSync(_ref2) {
|
|
|
35881
36507
|
}
|
|
35882
36508
|
// One-shot per arm-token: ignore the post-placement free-cell refresh (token unchanged).
|
|
35883
36509
|
if (armedHandledRef.current === armedAccessoryCodex) return;
|
|
36510
|
+
// An article armed while another operation is pending or a drag runs places once that is over (`operationBlocked`
|
|
36511
|
+
// re-runs this effect then).
|
|
36512
|
+
if (isOperationBlocked(useRTVStore$1.getState())) return;
|
|
35884
36513
|
// Both geometry and free cells load async — wait until a placement cell is resolvable.
|
|
35885
36514
|
if (!accessoryGrids || !freePlacesOnGrids || freePlacesOnGrids.length === 0) return;
|
|
35886
36515
|
// The arm token is `<codex>#<nonce>`. Without a cell the latch stays unset: the refresh is in flight, or the article
|
|
@@ -35891,8 +36520,11 @@ function useHostPropsSync(_ref2) {
|
|
|
35891
36520
|
if (!cell) return;
|
|
35892
36521
|
armedHandledRef.current = armedAccessoryCodex;
|
|
35893
36522
|
ACC_LOG.debug("[ACCGRID] autoPlace: armed=".concat(armedAccessoryCodex, " \u2192 grid=").concat(cell.gridIdx, " cell=").concat(cell.cellIdx, " parent=").concat(cell.parentBasketId));
|
|
35894
|
-
|
|
35895
|
-
|
|
36523
|
+
useRTVStore$1.getState().sendOperation('add', function () {
|
|
36524
|
+
var _callbacks$onAccessor;
|
|
36525
|
+
return callbacks === null || callbacks === void 0 || (_callbacks$onAccessor = callbacks.onAccessoryPlace) === null || _callbacks$onAccessor === void 0 ? void 0 : _callbacks$onAccessor.call(callbacks, cell.gridIdx, cell.cellIdx, cell.parentBasketId, cell.articleCodex);
|
|
36526
|
+
});
|
|
36527
|
+
}, [accessoryPlacement, armedAccessoryCodex, accessoryGrids, freePlacesOnGrids, callbacks, operationBlocked]);
|
|
35896
36528
|
useEffect(function () {
|
|
35897
36529
|
setAccessoryDragCodex(draggedAccessoryCodex !== null && draggedAccessoryCodex !== void 0 ? draggedAccessoryCodex : null, draggedAccessoryPointerId !== null && draggedAccessoryPointerId !== void 0 ? draggedAccessoryPointerId : null);
|
|
35898
36530
|
}, [setAccessoryDragCodex, draggedAccessoryCodex, draggedAccessoryPointerId]);
|
|
@@ -36520,11 +37152,14 @@ var WHITE_ROOM_PRESET = {
|
|
|
36520
37152
|
color: '#ffffff'
|
|
36521
37153
|
},
|
|
36522
37154
|
backLight: false,
|
|
37155
|
+
// The sun is the only shadow caster, and the floor is an invisible shadow catcher: a shadow that lands
|
|
37156
|
+
// far from the footprint has nothing to sit on and reads as a plane in mid-air. Steep like the old
|
|
37157
|
+
// viewer's top light (0.133, -1, -0.249), so a shadow stays within ~0.3 × the article's height of it.
|
|
36523
37158
|
sun: {
|
|
36524
37159
|
enabled: true,
|
|
36525
37160
|
intensity: 0.7,
|
|
36526
37161
|
azimuth: 332,
|
|
36527
|
-
elevation:
|
|
37162
|
+
elevation: 74,
|
|
36528
37163
|
color: '#ffffff',
|
|
36529
37164
|
lensflare: {
|
|
36530
37165
|
enabled: false
|
|
@@ -37627,4 +38262,4 @@ var internals = /*#__PURE__*/Object.freeze({
|
|
|
37627
38262
|
mergePresetBundle: mergePresetBundle
|
|
37628
38263
|
});
|
|
37629
38264
|
|
|
37630
|
-
export { getHostCallbacks as $, convexHull as A, TOUCH_CLICK_SLOP_PX as B, COARSE_POINTER as C, CLICK_SLOP_PX as D, acquireCursor as E, acquireControlsLock as F, rayAtClient as G, HIDDEN_FOR_STAND_IN as H, FRAME_ORDER as I, useAccentColor as J, isCoachHintSeen as K, floorReflections as L, withRenderTarget as M, renderFloorReflection as N, sceneEpoch as O, roomAoUniforms as P, sameMatrix as Q, collectElements as R, partBoxes as S, TOUCH_LIFT_PX as T, articleImportance as U, articleAoBoxes as V, ROOM_AO_BOX_BUDGETS as W, packArticleBoxes as X, rotateXZ as Y, parseElementId as Z, findElement2D as _, isAccessoryKey as a, buildRoomWalls as a0, ROOM_SHELL_LOAD_ID as a1, ROOM_PLAN_2D as a2, R3FAssetBoundary as a3, useTextureSizeCap as a4, CM$1 as a5, useShadowFlags as a6, applyRoomAo as a7, setRoomAoWalls as a8, setRoomAoWallVisible as a9, effectsOf as aA, flushPendingBVH as aB, collectCollisionTargets as aC, internals as aD, RealTimeRendererNext as aE,
|
|
38265
|
+
export { getHostCallbacks as $, convexHull as A, TOUCH_CLICK_SLOP_PX as B, COARSE_POINTER as C, CLICK_SLOP_PX as D, acquireCursor as E, acquireControlsLock as F, rayAtClient as G, HIDDEN_FOR_STAND_IN as H, FRAME_ORDER as I, useAccentColor as J, isCoachHintSeen as K, floorReflections as L, withRenderTarget as M, renderFloorReflection as N, sceneEpoch as O, roomAoUniforms as P, sameMatrix as Q, collectElements as R, partBoxes as S, TOUCH_LIFT_PX as T, articleImportance as U, articleAoBoxes as V, ROOM_AO_BOX_BUDGETS as W, packArticleBoxes as X, rotateXZ as Y, parseElementId as Z, findElement2D as _, isAccessoryKey as a, buildRoomWalls as a0, ROOM_SHELL_LOAD_ID as a1, ROOM_PLAN_2D as a2, R3FAssetBoundary as a3, useTextureSizeCap as a4, CM$1 as a5, useShadowFlags as a6, applyRoomAo as a7, setRoomAoWalls as a8, setRoomAoWallVisible as a9, effectsOf as aA, flushPendingBVH as aB, collectCollisionTargets as aC, internals as aD, RealTimeRendererNext as aE, isOperationBlocked as aF, buildScene2D as aG, getDimensionConfigs as aH, CoachMark as aI, findPlannedAccessory as aJ, parseAccessoryPath as aK, isSameRenderScene as aL, isRenderSceneShown as aM, WHITE_ROOM_PRESET as aN, ENVIRONMENT_CONFIG as aO, emitConfig as aP, squareEndQuad as aa, buildWallPieces as ab, pushPrism as ac, pieceQuad as ad, openingSpan as ae, floorUnreflected as af, cameraHiddenWalls as ag, cameraSquaredWallEnds as ah, parseQualifiedElementKey as ai, resolveGeoNodes as aj, polygonSignedArea as ak, simplifyClosedPolygon as al, ensureSimplePolygon as am, useStableEnvSlice as an, bootPhase as ao, adoptPristineFadeState as ap, DECK_COLLAR_LOAD_ID as aq, setCausticReceiversSuspended as ar, waterUniforms as as, useContinuousFrames as at, disableWaterUniforms as au, sunAnglesToDirection as av, lightingSunTowardDirection as aw, outlineSubPasses as ax, isOutlineDrawSkipped as ay, gpuTimingTargets as az, parseElementKey as b, canPressDrag as c, canMoveAccessory as d, isElementVisibleAt as e, viewerElementOf as f, collectFreeCellWorldPositions as g, shelfElementKey as h, isElementNodeName as i, isDescendantElementKey as j, getLocalBoundingBox as k, parseElementSetId as l, markCoachHintSeen as m, useCoachHint as n, viewerCoachFrame as o, prefersReducedMotion as p, subscribeViewerCoachFrames as q, splitQualifiedElementKey as r, styleInject as s, textFor as t, useRTVStore$1 as u, visibleElementCentre as v, worldToClientPxOnScreen as w, doorKeyOf as x, qualifiedElementKey as y, lendMirrorOverlays as z };
|