@spatial-elements/core 1.0.0-beta.10 → 1.0.0-beta.11
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/dist/catalog/CatalogEndpointRegistry.d.ts +2 -2
- package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -1
- package/dist/catalog/CatalogEndpointRegistry.js.map +1 -1
- package/dist/catalog/CatalogModelOutline.d.ts.map +1 -1
- package/dist/catalog/CatalogModelOutline.js +4 -3
- package/dist/catalog/CatalogModelOutline.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts +1 -1
- package/dist/catalog/CatalogTransition.js +1 -1
- package/dist/catalog/CatalogTransition.js.map +1 -1
- package/dist/catalog/catalogRecipes.js +2 -2
- package/dist/catalog/catalogRecipes.js.map +1 -1
- package/dist/catalog/listDeviceOrientation.d.ts +3 -0
- package/dist/catalog/listDeviceOrientation.d.ts.map +1 -1
- package/dist/catalog/listDeviceOrientation.js +15 -4
- package/dist/catalog/listDeviceOrientation.js.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts +1 -1
- package/dist/spatial-element/SpatialElementPaneController.js +1 -1
- package/dist/spatial-element/SpatialElementPaneController.js.map +1 -1
- package/dist/spatial-element/messages.d.ts +12 -0
- package/dist/spatial-element/messages.d.ts.map +1 -1
- package/dist/spatial-element/messages.js +12 -0
- package/dist/spatial-element/messages.js.map +1 -1
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +5 -2
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +5 -5
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/SpaceMouseAdapter.d.ts +10 -2
- package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -1
- package/dist/stage/SpaceMouseAdapter.js +50 -8
- package/dist/stage/SpaceMouseAdapter.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +5 -1
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +64 -32
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +3 -1
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +23 -7
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageRenderPipeline.js +1 -2
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/minimap/MinimapState.d.ts +3 -3
- package/dist/stage/minimap/MinimapState.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapState.js.map +1 -1
- package/dist/stage/panelContext.d.ts +6 -0
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/panelFocusMath.d.ts +34 -0
- package/dist/stage/panelFocusMath.d.ts.map +1 -0
- package/dist/stage/panelFocusMath.js +79 -0
- package/dist/stage/panelFocusMath.js.map +1 -0
- package/dist/stage/scalarMath.d.ts +6 -0
- package/dist/stage/scalarMath.d.ts.map +1 -0
- package/dist/stage/scalarMath.js +6 -0
- package/dist/stage/scalarMath.js.map +1 -0
- package/dist/stage/spaceMousePermission.d.ts +11 -0
- package/dist/stage/spaceMousePermission.d.ts.map +1 -0
- package/dist/stage/spaceMousePermission.js +63 -0
- package/dist/stage/spaceMousePermission.js.map +1 -0
- package/dist/stage/spaceMousePlatform.d.ts +12 -0
- package/dist/stage/spaceMousePlatform.d.ts.map +1 -0
- package/dist/stage/spaceMousePlatform.js +13 -0
- package/dist/stage/spaceMousePlatform.js.map +1 -0
- package/dist/stage/stageConstants.d.ts.map +1 -1
- package/dist/stage/stageConstants.js +4 -4
- package/dist/stage/stageConstants.js.map +1 -1
- package/dist/stage/stageMath.d.ts +1 -29
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +24 -97
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +2 -1
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/dist/stage/webgpuSupport.d.ts +3 -0
- package/dist/stage/webgpuSupport.d.ts.map +1 -0
- package/dist/stage/webgpuSupport.js +14 -0
- package/dist/stage/webgpuSupport.js.map +1 -0
- package/logo.svg +90 -53
- package/package.json +1 -1
package/dist/stage/stageMath.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { smoothstep, getPerspectiveDistance, getPanelFocusPerspectiveOffset, getPanelFocusOffset, getPanelFocusDirection, getPanelFocusProgress, getPanelFocusOpacity, getPanelFocusBlur } from './panelFocusMath.js';
|
|
2
|
+
export { smoothstep, getPerspectiveDistance, getPanelFocusPerspectiveOffset, getPanelFocusOffset, getPanelFocusDirection, getPanelFocusProgress, getPanelFocusOpacity, getPanelFocusBlur } from './panelFocusMath.js';
|
|
3
|
+
import * as ScalarMath from './scalarMath.js';
|
|
1
4
|
import * as THREE from 'three/webgpu';
|
|
2
|
-
import { DEFAULT_CAMERA_AZIMUTH, DEFAULT_CAMERA_ELEVATION, MINIMAP_DEFAULT_MODEL_SCALE,
|
|
5
|
+
import { DEFAULT_CAMERA_AZIMUTH, DEFAULT_CAMERA_ELEVATION, MINIMAP_DEFAULT_MODEL_SCALE, PANEL_POINTER_MAX_TILT, PANEL_POINTER_PROXIMITY_ASPECT_LIMIT, PANEL_POINTER_PROXIMITY_MAX, PANEL_POINTER_PROXIMITY_MIN, PANEL_POINTER_PROXIMITY_SCALE, VIEW_RESET_MAX_DURATION, VIEW_RESET_MIN_DURATION } from './stageConstants.js';
|
|
3
6
|
/** Resolves declarative orbit angles to a normalized direction from element to camera. */
|
|
4
7
|
export function getCameraOrbitDirection(azimuth, elevation) {
|
|
5
8
|
const safeAzimuth = Number.isFinite(azimuth) ? azimuth : DEFAULT_CAMERA_AZIMUTH;
|
|
6
|
-
const safeElevation =
|
|
7
|
-
const azimuthRadians =
|
|
8
|
-
const elevationRadians =
|
|
9
|
+
const safeElevation = ScalarMath.clamp(Number.isFinite(elevation) ? elevation : DEFAULT_CAMERA_ELEVATION, -89, 89);
|
|
10
|
+
const azimuthRadians = ScalarMath.degToRad(safeAzimuth);
|
|
11
|
+
const elevationRadians = ScalarMath.degToRad(safeElevation);
|
|
9
12
|
const horizontalScale = Math.cos(elevationRadians);
|
|
10
13
|
return new THREE.Vector3(Math.sin(azimuthRadians) * horizontalScale, Math.sin(elevationRadians), Math.cos(azimuthRadians) * horizontalScale).normalize();
|
|
11
14
|
}
|
|
@@ -15,16 +18,9 @@ export function getCameraOrbitQuaternion(azimuth, elevation) {
|
|
|
15
18
|
const lookAtMatrix = new THREE.Matrix4().lookAt(direction, new THREE.Vector3(), new THREE.Vector3(0, 1, 0));
|
|
16
19
|
return new THREE.Quaternion().setFromRotationMatrix(lookAtMatrix);
|
|
17
20
|
}
|
|
18
|
-
/** Applies the cubic Hermite smoothstep curve with clamped endpoints. */
|
|
19
|
-
export function smoothstep(edge0, edge1, value) {
|
|
20
|
-
if (edge0 === edge1)
|
|
21
|
-
return value < edge0 ? 0 : 1;
|
|
22
|
-
const t = THREE.MathUtils.clamp((value - edge0) / (edge1 - edge0), 0, 1);
|
|
23
|
-
return t * t * (3 - 2 * t);
|
|
24
|
-
}
|
|
25
21
|
/** Lets close-up resets travel longer while keeping small corrections responsive. */
|
|
26
22
|
export function getViewResetDuration(focus) {
|
|
27
|
-
return
|
|
23
|
+
return ScalarMath.lerp(VIEW_RESET_MIN_DURATION, VIEW_RESET_MAX_DURATION, smoothstep(0, 1, focus));
|
|
28
24
|
}
|
|
29
25
|
/** Provides a zero-velocity start and finish for the fitted-view return. */
|
|
30
26
|
export function getViewResetInterpolation(elapsed, duration) {
|
|
@@ -61,13 +57,13 @@ export function getSequencedMinimapFocus(focus, uiFocus) {
|
|
|
61
57
|
* corner to the requested inset independently of the expanded dimensions.
|
|
62
58
|
*/
|
|
63
59
|
export function getMinimapFocusPositionOffset(basePosition, baseSize, visualSize, viewportSize, focus, inset) {
|
|
64
|
-
const progress =
|
|
60
|
+
const progress = ScalarMath.clamp(focus, 0, 1);
|
|
65
61
|
const baseCenterX = viewportSize.width * 0.5 + basePosition.x;
|
|
66
62
|
const baseCenterY = viewportSize.height * 0.5 - basePosition.y;
|
|
67
63
|
const restingLeft = baseCenterX - baseSize.width * 0.5;
|
|
68
64
|
const restingTop = baseCenterY - baseSize.height * 0.5;
|
|
69
|
-
const focusedLeft =
|
|
70
|
-
const focusedTop =
|
|
65
|
+
const focusedLeft = ScalarMath.lerp(restingLeft, inset, progress);
|
|
66
|
+
const focusedTop = ScalarMath.lerp(restingTop, inset, progress);
|
|
71
67
|
return {
|
|
72
68
|
x: focusedLeft + visualSize.width * 0.5 - baseCenterX,
|
|
73
69
|
y: baseCenterY - (focusedTop + visualSize.height * 0.5)
|
|
@@ -86,12 +82,12 @@ export function normalizeWheelZoomDelta(deltaY, deltaMode, ctrlKey) {
|
|
|
86
82
|
}
|
|
87
83
|
/** Accumulates an OrbitControls-compatible wheel gesture into a clamped zoom target. */
|
|
88
84
|
export function getWheelZoomTargetDistance(currentTargetDistance, deltaY, zoomSpeed, minDistance, maxDistance) {
|
|
89
|
-
const currentDistance =
|
|
85
|
+
const currentDistance = ScalarMath.clamp(currentTargetDistance, minDistance, maxDistance);
|
|
90
86
|
if (!Number.isFinite(deltaY) || deltaY === 0)
|
|
91
87
|
return currentDistance;
|
|
92
88
|
const scale = Math.pow(0.95, Math.max(zoomSpeed, 0) * Math.abs(deltaY * 0.01));
|
|
93
89
|
const targetDistance = deltaY < 0 ? currentDistance * scale : currentDistance / scale;
|
|
94
|
-
return
|
|
90
|
+
return ScalarMath.clamp(targetDistance, minDistance, maxDistance);
|
|
95
91
|
}
|
|
96
92
|
/** Resolves the authored minimap scale without imposing an upper creative limit. */
|
|
97
93
|
export function resolveMinimapModelScale(modelScale, fallback = MINIMAP_DEFAULT_MODEL_SCALE) {
|
|
@@ -106,7 +102,7 @@ export function resolveMinimapModelScale(modelScale, fallback = MINIMAP_DEFAULT_
|
|
|
106
102
|
}
|
|
107
103
|
/** Blends the configured model multiplier through the damped minimap hover state. */
|
|
108
104
|
export function getMinimapHoverScale(hoverModelScale, pointerReveal) {
|
|
109
|
-
return
|
|
105
|
+
return ScalarMath.lerp(1, hoverModelScale, ScalarMath.clamp(pointerReveal, 0, 1));
|
|
110
106
|
}
|
|
111
107
|
/**
|
|
112
108
|
* Returns the same opacity used by ordinary panels during close-up focus.
|
|
@@ -135,11 +131,11 @@ export function getZoomFocusDistanceRange(maxDistance, modelRadius) {
|
|
|
135
131
|
* perspective FOV while ordinary OrbitControls continue to dolly the camera.
|
|
136
132
|
*/
|
|
137
133
|
export function getEffectiveCameraDistance(distance, currentFov, referenceFov) {
|
|
138
|
-
const safeCurrentFov =
|
|
139
|
-
const safeReferenceFov =
|
|
134
|
+
const safeCurrentFov = ScalarMath.clamp(currentFov, 0.01, 179);
|
|
135
|
+
const safeReferenceFov = ScalarMath.clamp(referenceFov, 0.01, 179);
|
|
140
136
|
return (distance *
|
|
141
|
-
(Math.tan(
|
|
142
|
-
Math.tan(
|
|
137
|
+
(Math.tan(ScalarMath.degToRad(safeCurrentFov * 0.5)) /
|
|
138
|
+
Math.tan(ScalarMath.degToRad(safeReferenceFov * 0.5))));
|
|
143
139
|
}
|
|
144
140
|
/** Maps dolly and perspective-FOV zoom to the same normalized element focus. */
|
|
145
141
|
export function getCameraZoomFocus(distance, currentFov, referenceFov, closeDistance, restDistance) {
|
|
@@ -154,10 +150,6 @@ export function getCameraZoomFocus(distance, currentFov, referenceFov, closeDist
|
|
|
154
150
|
export function getCameraZoomReferenceDistance(viewTargetDistance, spatialElementCenterDistance) {
|
|
155
151
|
return Math.min(viewTargetDistance, spatialElementCenterDistance);
|
|
156
152
|
}
|
|
157
|
-
/** Returns the perspective camera distance that maps viewport pixels to world units. */
|
|
158
|
-
export function getPerspectiveDistance(viewportHeight, fov) {
|
|
159
|
-
return (viewportHeight * 0.5) / Math.tan(THREE.MathUtils.degToRad(fov * 0.5));
|
|
160
|
-
}
|
|
161
153
|
/**
|
|
162
154
|
* Places an untransformed panel around its stage-space center and aligns its
|
|
163
155
|
* top-left corner to the device pixel grid for crisp native DOM text.
|
|
@@ -178,25 +170,9 @@ export function getNativePanelDomPosition(center, size, viewport, devicePixelRat
|
|
|
178
170
|
*/
|
|
179
171
|
export function getPerspectiveAnchoredPanelPosition(targetX, targetY, currentZ, cameraDistance) {
|
|
180
172
|
const safeCameraDistance = Math.max(cameraDistance, 1);
|
|
181
|
-
const depthScale =
|
|
173
|
+
const depthScale = ScalarMath.clamp((safeCameraDistance - currentZ) / safeCameraDistance, 0.05, 2);
|
|
182
174
|
return { x: targetX * depthScale, y: targetY * depthScale };
|
|
183
175
|
}
|
|
184
|
-
/**
|
|
185
|
-
* Restores the outward screen-space drift that an off-axis panel would receive
|
|
186
|
-
* from the shared perspective while leaving its hover projection panel-local.
|
|
187
|
-
*/
|
|
188
|
-
export function getPanelFocusPerspectiveOffset(position, advance, cameraDistance) {
|
|
189
|
-
const safeCameraDistance = Math.max(Number.isFinite(cameraDistance) ? cameraDistance : 1, 1);
|
|
190
|
-
const safeAdvance = Math.max(Number.isFinite(advance) ? advance : 0, 0);
|
|
191
|
-
if (safeAdvance <= 0)
|
|
192
|
-
return { x: 0, y: 0 };
|
|
193
|
-
const projectionScale = THREE.MathUtils.clamp(safeCameraDistance / Math.max(safeCameraDistance - safeAdvance, 1), 1, PANEL_FOCUS_PERSPECTIVE_MAX_SCALE);
|
|
194
|
-
const egressScale = projectionScale - 1;
|
|
195
|
-
return {
|
|
196
|
-
x: position.x * egressScale,
|
|
197
|
-
y: position.y * egressScale
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
176
|
/**
|
|
201
177
|
* Builds a local projection root for a panel rendered by the shared stage camera.
|
|
202
178
|
*
|
|
@@ -226,7 +202,7 @@ export function getCameraFitDistance(bounds, viewDirection, camera, margin = 1,
|
|
|
226
202
|
if (right.lengthSq() < 0.0001)
|
|
227
203
|
right.set(1, 0, 0);
|
|
228
204
|
const up = new THREE.Vector3().crossVectors(forward, right).normalize();
|
|
229
|
-
const verticalFov =
|
|
205
|
+
const verticalFov = ScalarMath.degToRad(camera.fov);
|
|
230
206
|
const horizontalFov = 2 * Math.atan(Math.tan(verticalFov * 0.5) * camera.aspect);
|
|
231
207
|
const tanY = Math.tan(verticalFov * 0.5) * viewportScale.y;
|
|
232
208
|
const tanX = Math.tan(horizontalFov * 0.5) * viewportScale.x;
|
|
@@ -254,55 +230,6 @@ export function getBoxCorners(bounds) {
|
|
|
254
230
|
new THREE.Vector3(max.x, max.y, max.z)
|
|
255
231
|
];
|
|
256
232
|
}
|
|
257
|
-
/** Computes the camera-facing travel used to clear panels during close-up zoom. */
|
|
258
|
-
export function getPanelFocusOffset(options, focus, viewportWidth, viewportHeight) {
|
|
259
|
-
if (focus <= 0.001)
|
|
260
|
-
return { x: 0, y: 0, z: 0 };
|
|
261
|
-
const edgeDistanceX = Math.max(viewportWidth * 0.5 - options.width * 0.5, 1);
|
|
262
|
-
const edgeDistanceY = Math.max(viewportHeight * 0.5 - options.height * 0.5, 1);
|
|
263
|
-
const normalizedX = options.position.x / edgeDistanceX;
|
|
264
|
-
const normalizedY = options.position.y / edgeDistanceY;
|
|
265
|
-
const direction = getPanelFocusDirection(options, normalizedX, normalizedY);
|
|
266
|
-
const horizontal = Math.abs(direction.x) > Math.abs(direction.y);
|
|
267
|
-
const axisSize = horizontal ? options.width : options.height;
|
|
268
|
-
const travel = THREE.MathUtils.clamp(axisSize * (horizontal ? 0.16 : 0.42), horizontal ? 48 : 18, PANEL_FOCUS_MAX_OFFSET);
|
|
269
|
-
const easedFocus = getPanelFocusProgress(focus);
|
|
270
|
-
return {
|
|
271
|
-
x: direction.x * travel * easedFocus,
|
|
272
|
-
y: direction.y * travel * easedFocus,
|
|
273
|
-
z: PANEL_FOCUS_MAX_ADVANCE * easedFocus
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
/** Chooses the least disruptive edge toward which a focused panel should travel. */
|
|
277
|
-
export function getPanelFocusDirection(options, normalizedX, normalizedY) {
|
|
278
|
-
const aspect = options.width / Math.max(options.height, 1);
|
|
279
|
-
const absX = Math.abs(normalizedX);
|
|
280
|
-
const absY = Math.abs(normalizedY);
|
|
281
|
-
if (aspect >= 2.4 && absY > 0.12)
|
|
282
|
-
return new THREE.Vector2(0, Math.sign(normalizedY) || 1);
|
|
283
|
-
if (absX > absY * 0.8)
|
|
284
|
-
return new THREE.Vector2(Math.sign(normalizedX) || 1, 0);
|
|
285
|
-
if (absY > absX * 0.8)
|
|
286
|
-
return new THREE.Vector2(0, Math.sign(normalizedY) || 1);
|
|
287
|
-
const direction = new THREE.Vector2(normalizedX, normalizedY);
|
|
288
|
-
if (direction.lengthSq() < 0.02)
|
|
289
|
-
direction.set(0, options.position.y >= 0 ? 1 : -1);
|
|
290
|
-
return direction.normalize();
|
|
291
|
-
}
|
|
292
|
-
/** Shared, eased progress for panel motion, blur, opacity and corner controls. */
|
|
293
|
-
export function getPanelFocusProgress(focus) {
|
|
294
|
-
return smoothstep(0.08, 0.96, focus);
|
|
295
|
-
}
|
|
296
|
-
/** Returns panel opacity at a normalized stage UI focus level. */
|
|
297
|
-
export function getPanelFocusOpacity(focus) {
|
|
298
|
-
return THREE.MathUtils.lerp(1, PANEL_FOCUS_MIN_OPACITY, getPanelFocusProgress(focus));
|
|
299
|
-
}
|
|
300
|
-
/** Returns CSS content blur at a normalized stage focus level. */
|
|
301
|
-
export function getPanelFocusBlur(focus, options) {
|
|
302
|
-
const shortSide = Math.max(Math.min(options.width, options.height), 1);
|
|
303
|
-
const sizeScale = THREE.MathUtils.clamp(Math.sqrt(shortSide / 240), 0.34, 1);
|
|
304
|
-
return PANEL_FOCUS_MAX_BLUR * sizeScale * getPanelFocusProgress(focus);
|
|
305
|
-
}
|
|
306
233
|
/**
|
|
307
234
|
* Reduces only the rotation axis amplified by an elongated panel.
|
|
308
235
|
* Square panels keep the full response on both axes.
|
|
@@ -322,7 +249,7 @@ export function getPanelPointerProximity(width, height) {
|
|
|
322
249
|
const shortSide = Math.min(safeWidth, safeHeight);
|
|
323
250
|
const longSide = Math.max(safeWidth, safeHeight);
|
|
324
251
|
const aspectCorrection = Math.min(Math.sqrt(longSide / shortSide), PANEL_POINTER_PROXIMITY_ASPECT_LIMIT);
|
|
325
|
-
return
|
|
252
|
+
return ScalarMath.clamp(shortSide * PANEL_POINTER_PROXIMITY_SCALE * aspectCorrection, PANEL_POINTER_PROXIMITY_MIN, PANEL_POINTER_PROXIMITY_MAX);
|
|
326
253
|
}
|
|
327
254
|
/** Converts distance from a panel edge into a smooth zero-to-one hover influence. */
|
|
328
255
|
export function getPanelPointerInfluence(distance, width, height) {
|
|
@@ -330,11 +257,11 @@ export function getPanelPointerInfluence(distance, width, height) {
|
|
|
330
257
|
}
|
|
331
258
|
/** Resolves a pointer-relative pose with axis-specific aspect-ratio attenuation. */
|
|
332
259
|
export function getPanelPointerRotation(lookX, lookY, influence, width, height) {
|
|
333
|
-
const tilt = PANEL_POINTER_MAX_TILT *
|
|
260
|
+
const tilt = PANEL_POINTER_MAX_TILT * ScalarMath.clamp(influence, 0, 1);
|
|
334
261
|
const aspectScale = getPanelAspectTiltScale(width, height);
|
|
335
262
|
return {
|
|
336
|
-
x: -
|
|
337
|
-
y: -
|
|
263
|
+
x: -ScalarMath.clamp(lookY, -1, 1) * tilt * aspectScale.elevation,
|
|
264
|
+
y: -ScalarMath.clamp(lookX, -1, 1) * tilt * aspectScale.azimuth
|
|
338
265
|
};
|
|
339
266
|
}
|
|
340
267
|
/** Detects panel geometry changes that require a WebGPU mesh rebuild. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageMath.js","sourceRoot":"","sources":["../../src/stage/stageMath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EACN,sBAAsB,E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a,EACb,KAAa,EACb,SAAiB,EACjB,KAAa,EACb,MAAc;IAEd,MAAM,IAAI,GAAG,sBAAsB,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7E,MAAM,WAAW,GAAG,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3D,OAAO;QACN,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,WAAW,CAAC,SAAS;QACtE,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,WAAW,CAAC,OAAO;KACpE,CAAC;AACH,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,uBAAuB,CACtC,OAA0C,EAC1C,IAA6B;IAE7B,OAAO,CACN,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG;QAC7D,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG;QAChE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,CAChE,CAAC;AACH,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport {\n\tDEFAULT_CAMERA_AZIMUTH,\n\tDEFAULT_CAMERA_ELEVATION,\n\tMINIMAP_DEFAULT_MODEL_SCALE,\n\tPANEL_FOCUS_MAX_ADVANCE,\n\tPANEL_FOCUS_MAX_BLUR,\n\tPANEL_FOCUS_MAX_OFFSET,\n\tPANEL_FOCUS_PERSPECTIVE_MAX_SCALE,\n\tPANEL_FOCUS_MIN_OPACITY,\n\tPANEL_POINTER_MAX_TILT,\n\tPANEL_POINTER_PROXIMITY_ASPECT_LIMIT,\n\tPANEL_POINTER_PROXIMITY_MAX,\n\tPANEL_POINTER_PROXIMITY_MIN,\n\tPANEL_POINTER_PROXIMITY_SCALE,\n\tVIEW_RESET_MAX_DURATION,\n\tVIEW_RESET_MIN_DURATION\n} from './stageConstants.js';\n\n/** Resolves declarative orbit angles to a normalized direction from element to camera. */\nexport function getCameraOrbitDirection(azimuth?: number, elevation?: number) {\n\tconst safeAzimuth = Number.isFinite(azimuth) ? (azimuth as number) : DEFAULT_CAMERA_AZIMUTH;\n\tconst safeElevation = THREE.MathUtils.clamp(\n\t\tNumber.isFinite(elevation) ? (elevation as number) : DEFAULT_CAMERA_ELEVATION,\n\t\t-89,\n\t\t89\n\t);\n\tconst azimuthRadians = THREE.MathUtils.degToRad(safeAzimuth);\n\tconst elevationRadians = THREE.MathUtils.degToRad(safeElevation);\n\tconst horizontalScale = Math.cos(elevationRadians);\n\n\treturn new THREE.Vector3(\n\t\tMath.sin(azimuthRadians) * horizontalScale,\n\t\tMath.sin(elevationRadians),\n\t\tMath.cos(azimuthRadians) * horizontalScale\n\t).normalize();\n}\n\n/** Resolves orbit angles to the world-space orientation of a camera looking at the element. */\nexport function getCameraOrbitQuaternion(azimuth?: number, elevation?: number) {\n\tconst direction = getCameraOrbitDirection(azimuth, elevation);\n\tconst lookAtMatrix = new THREE.Matrix4().lookAt(\n\t\tdirection,\n\t\tnew THREE.Vector3(),\n\t\tnew THREE.Vector3(0, 1, 0)\n\t);\n\treturn new THREE.Quaternion().setFromRotationMatrix(lookAtMatrix);\n}\n\n/** Applies the cubic Hermite smoothstep curve with clamped endpoints. */\nexport function smoothstep(edge0: number, edge1: number, value: number) {\n\tif (edge0 === edge1) return value < edge0 ? 0 : 1;\n\tconst t = THREE.MathUtils.clamp((value - edge0) / (edge1 - edge0), 0, 1);\n\treturn t * t * (3 - 2 * t);\n}\n\n/** Lets close-up resets travel longer while keeping small corrections responsive. */\nexport function getViewResetDuration(focus: number) {\n\treturn THREE.MathUtils.lerp(\n\t\tVIEW_RESET_MIN_DURATION,\n\t\tVIEW_RESET_MAX_DURATION,\n\t\tsmoothstep(0, 1, focus)\n\t);\n}\n\n/** Provides a zero-velocity start and finish for the fitted-view return. */\nexport function getViewResetInterpolation(elapsed: number, duration: number) {\n\treturn smoothstep(0, Math.max(duration, Number.EPSILON), elapsed);\n}\n\n/**\n * Remaps camera focus to the earlier UI-clearance phase.\n *\n * Page content and ordinary panels lead the minimap, with one shared clearance endpoint.\n */\nexport function getStageUiFocus(focus: number) {\n\treturn smoothstep(0.02, 0.82, focus);\n}\n\n/**\n * Starts minimap expansion after the surrounding UI begins to clear, but completes\n * at exactly the same focus as the panel fade. No peripheral movement trails it.\n */\nexport function getMinimapFocus(focus: number) {\n\treturn smoothstep(0.12, 1, getPanelFocusProgress(getStageUiFocus(focus)));\n}\n\n/**\n * Gates minimap expansion behind the UI-clearance phase.\n *\n * Both values originate from the same smoothed camera focus. The gate retains the\n * intentional lead of ordinary content without adding another temporal lag.\n */\nexport function getSequencedMinimapFocus(focus: number, uiFocus: number) {\n\tconst clearance = smoothstep(0.14, 0.46, uiFocus);\n\treturn getMinimapFocus(focus) * clearance;\n}\n\n/**\n * Moves an expanding minimap from its authored panel position to a viewport inset.\n * A zero focus returns the exact resting position; a full focus pins its top-left\n * corner to the requested inset independently of the expanded dimensions.\n */\nexport function getMinimapFocusPositionOffset(\n\tbasePosition: { x: number; y: number },\n\tbaseSize: { width: number; height: number },\n\tvisualSize: { width: number; height: number },\n\tviewportSize: { width: number; height: number },\n\tfocus: number,\n\tinset: number\n) {\n\tconst progress = THREE.MathUtils.clamp(focus, 0, 1);\n\tconst baseCenterX = viewportSize.width * 0.5 + basePosition.x;\n\tconst baseCenterY = viewportSize.height * 0.5 - basePosition.y;\n\tconst restingLeft = baseCenterX - baseSize.width * 0.5;\n\tconst restingTop = baseCenterY - baseSize.height * 0.5;\n\tconst focusedLeft = THREE.MathUtils.lerp(restingLeft, inset, progress);\n\tconst focusedTop = THREE.MathUtils.lerp(restingTop, inset, progress);\n\n\treturn {\n\t\tx: focusedLeft + visualSize.width * 0.5 - baseCenterX,\n\t\ty: baseCenterY - (focusedTop + visualSize.height * 0.5)\n\t};\n}\n\n/** Normalizes browser wheel units to the pixel-based delta used by OrbitControls. */\nexport function normalizeWheelZoomDelta(deltaY: number, deltaMode: number, ctrlKey: boolean) {\n\tlet normalizedDelta = deltaY;\n\tif (deltaMode === 1) normalizedDelta *= 16;\n\tif (deltaMode === 2) normalizedDelta *= 100;\n\tif (ctrlKey) normalizedDelta *= 10;\n\treturn normalizedDelta;\n}\n\n/** Accumulates an OrbitControls-compatible wheel gesture into a clamped zoom target. */\nexport function getWheelZoomTargetDistance(\n\tcurrentTargetDistance: number,\n\tdeltaY: number,\n\tzoomSpeed: number,\n\tminDistance: number,\n\tmaxDistance: number\n) {\n\tconst currentDistance = THREE.MathUtils.clamp(currentTargetDistance, minDistance, maxDistance);\n\tif (!Number.isFinite(deltaY) || deltaY === 0) return currentDistance;\n\n\tconst scale = Math.pow(0.95, Math.max(zoomSpeed, 0) * Math.abs(deltaY * 0.01));\n\tconst targetDistance = deltaY < 0 ? currentDistance * scale : currentDistance / scale;\n\treturn THREE.MathUtils.clamp(targetDistance, minDistance, maxDistance);\n}\n\n/** Resolves the authored minimap scale without imposing an upper creative limit. */\nexport function resolveMinimapModelScale(\n\tmodelScale?: number,\n\tfallback = MINIMAP_DEFAULT_MODEL_SCALE\n) {\n\tconst safeFallback = Number.isFinite(fallback)\n\t\t? Math.max(fallback, 0.2)\n\t\t: MINIMAP_DEFAULT_MODEL_SCALE;\n\tif (modelScale === undefined) return safeFallback;\n\tif (!Number.isFinite(modelScale)) return safeFallback;\n\treturn Math.max(modelScale, 0.2);\n}\n\n/** Blends the configured model multiplier through the damped minimap hover state. */\nexport function getMinimapHoverScale(hoverModelScale: number, pointerReveal: number) {\n\treturn THREE.MathUtils.lerp(1, hoverModelScale, THREE.MathUtils.clamp(pointerReveal, 0, 1));\n}\n\n/**\n * Returns the same opacity used by ordinary panels during close-up focus.\n *\n * Keeping DOM content and panel opacity on one curve prevents either layer from\n * disappearing first while the phase-delayed minimap begins to grow.\n */\nexport function getStageDomFocusOpacity(uiFocus: number) {\n\treturn getPanelFocusOpacity(uiFocus);\n}\n\n/**\n * Defines the camera-distance interval used by the shared close-up focus effect.\n * Starting near the fitted view gives panels and page content enough travel to\n * clear progressively before the element fills the viewport.\n */\nexport function getZoomFocusDistanceRange(maxDistance: number, modelRadius: number) {\n\tconst restDistance = maxDistance * 0.84;\n\tlet closeDistance = Math.max(modelRadius * 0.14, maxDistance * 0.1);\n\tif (closeDistance >= restDistance) closeDistance = restDistance * 0.32;\n\n\treturn { closeDistance, restDistance };\n}\n\n/**\n * Converts camera-to-target distance into a FOV-independent visual distance.\n * This keeps focus effects and zoom limits coherent when a SpaceMouse changes\n * perspective FOV while ordinary OrbitControls continue to dolly the camera.\n */\nexport function getEffectiveCameraDistance(\n\tdistance: number,\n\tcurrentFov: number,\n\treferenceFov: number\n) {\n\tconst safeCurrentFov = THREE.MathUtils.clamp(currentFov, 0.01, 179);\n\tconst safeReferenceFov = THREE.MathUtils.clamp(referenceFov, 0.01, 179);\n\treturn (\n\t\tdistance *\n\t\t(Math.tan(THREE.MathUtils.degToRad(safeCurrentFov * 0.5)) /\n\t\t\tMath.tan(THREE.MathUtils.degToRad(safeReferenceFov * 0.5)))\n\t);\n}\n\n/** Maps dolly and perspective-FOV zoom to the same normalized element focus. */\nexport function getCameraZoomFocus(\n\tdistance: number,\n\tcurrentFov: number,\n\treferenceFov: number,\n\tcloseDistance: number,\n\trestDistance: number\n) {\n\treturn (\n\t\t1 -\n\t\tsmoothstep(\n\t\t\tcloseDistance,\n\t\t\trestDistance,\n\t\t\tgetEffectiveCameraDistance(distance, currentFov, referenceFov)\n\t\t)\n\t);\n}\n\n/**\n * Chooses the distance that best represents the element's visible magnification.\n * OrbitControls reduces its target distance, while 3DxWare may dolly camera and\n * target together and only reduce the distance to the element itself.\n */\nexport function getCameraZoomReferenceDistance(\n\tviewTargetDistance: number,\n\tspatialElementCenterDistance: number\n) {\n\treturn Math.min(viewTargetDistance, spatialElementCenterDistance);\n}\n\n/** Returns the perspective camera distance that maps viewport pixels to world units. */\nexport function getPerspectiveDistance(viewportHeight: number, fov: number) {\n\treturn (viewportHeight * 0.5) / Math.tan(THREE.MathUtils.degToRad(fov * 0.5));\n}\n\n/**\n * Places an untransformed panel around its stage-space center and aligns its\n * top-left corner to the device pixel grid for crisp native DOM text.\n */\nexport function getNativePanelDomPosition(\n\tcenter: { x: number; y: number },\n\tsize: { width: number; height: number },\n\tviewport: { width: number; height: number },\n\tdevicePixelRatio = 1\n) {\n\tconst pixelRatio =\n\t\tNumber.isFinite(devicePixelRatio) && devicePixelRatio > 0 ? devicePixelRatio : 1;\n\tconst snap = (value: number) => Math.round(value * pixelRatio) / pixelRatio;\n\n\treturn {\n\t\tleft: snap(viewport.width * 0.5 + center.x - size.width * 0.5),\n\t\ttop: snap(viewport.height * 0.5 - center.y - size.height * 0.5)\n\t};\n}\n\n/**\n * Compensates an x/y panel anchor when it advances toward a perspective camera.\n *\n * Without this correction, a panel appears to drift away from its DOM anchor as its\n * z position changes.\n */\nexport function getPerspectiveAnchoredPanelPosition(\n\ttargetX: number,\n\ttargetY: number,\n\tcurrentZ: number,\n\tcameraDistance: number\n) {\n\tconst safeCameraDistance = Math.max(cameraDistance, 1);\n\tconst depthScale = THREE.MathUtils.clamp(\n\t\t(safeCameraDistance - currentZ) / safeCameraDistance,\n\t\t0.05,\n\t\t2\n\t);\n\n\treturn { x: targetX * depthScale, y: targetY * depthScale };\n}\n\n/**\n * Restores the outward screen-space drift that an off-axis panel would receive\n * from the shared perspective while leaving its hover projection panel-local.\n */\nexport function getPanelFocusPerspectiveOffset(\n\tposition: { x: number; y: number },\n\tadvance: number,\n\tcameraDistance: number\n) {\n\tconst safeCameraDistance = Math.max(Number.isFinite(cameraDistance) ? cameraDistance : 1, 1);\n\tconst safeAdvance = Math.max(Number.isFinite(advance) ? advance : 0, 0);\n\tif (safeAdvance <= 0) return { x: 0, y: 0 };\n\n\tconst projectionScale = THREE.MathUtils.clamp(\n\t\tsafeCameraDistance / Math.max(safeCameraDistance - safeAdvance, 1),\n\t\t1,\n\t\tPANEL_FOCUS_PERSPECTIVE_MAX_SCALE\n\t);\n\tconst egressScale = projectionScale - 1;\n\n\treturn {\n\t\tx: position.x * egressScale,\n\t\ty: position.y * egressScale\n\t};\n}\n\n/**\n * Builds a local projection root for a panel rendered by the shared stage camera.\n *\n * The translation keeps the panel anchored while it moves in depth. The z shear\n * cancels the shared camera's off-axis perspective, so rotated children converge\n * on the panel center instead of the viewport center.\n */\nexport function setPanelLocalPerspectiveMatrix(\n\ttarget: THREE.Matrix4,\n\ttargetX: number,\n\ttargetY: number,\n\tcurrentZ: number,\n\tcameraDistance: number\n) {\n\tconst safeCameraDistance = Math.max(cameraDistance, 1);\n\tconst anchoredPosition = getPerspectiveAnchoredPanelPosition(\n\t\ttargetX,\n\t\ttargetY,\n\t\tcurrentZ,\n\t\tsafeCameraDistance\n\t);\n\n\treturn target.set(\n\t\t1,\n\t\t0,\n\t\t-targetX / safeCameraDistance,\n\t\tanchoredPosition.x,\n\t\t0,\n\t\t1,\n\t\t-targetY / safeCameraDistance,\n\t\tanchoredPosition.y,\n\t\t0,\n\t\t0,\n\t\t1,\n\t\tcurrentZ,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t1\n\t);\n}\n\n/**\n * Calculates the nearest camera distance that contains an oriented bounding box.\n *\n * @param bounds - World-space bounds of the object to frame.\n * @param viewDirection - Direction from the target toward the camera.\n * @param camera - Camera whose FOV and aspect define the frame.\n * @param margin - Multiplicative padding around the fitted object.\n * @param viewportScale - Fraction of the browser viewport available to the element.\n */\nexport function getCameraFitDistance(\n\tbounds: THREE.Box3,\n\tviewDirection: THREE.Vector3,\n\tcamera: THREE.PerspectiveCamera,\n\tmargin = 1,\n\tviewportScale = { x: 1, y: 1 }\n) {\n\tconst corners = getBoxCorners(bounds);\n\tconst center = bounds.getCenter(new THREE.Vector3());\n\tconst forward = viewDirection.clone().normalize().negate();\n\tconst right = new THREE.Vector3().crossVectors(camera.up, forward).normalize();\n\tif (right.lengthSq() < 0.0001) right.set(1, 0, 0);\n\tconst up = new THREE.Vector3().crossVectors(forward, right).normalize();\n\tconst verticalFov = THREE.MathUtils.degToRad(camera.fov);\n\tconst horizontalFov = 2 * Math.atan(Math.tan(verticalFov * 0.5) * camera.aspect);\n\tconst tanY = Math.tan(verticalFov * 0.5) * viewportScale.y;\n\tconst tanX = Math.tan(horizontalFov * 0.5) * viewportScale.x;\n\tlet distance = 0.1;\n\tfor (const corner of corners) {\n\t\tconst offset = corner.sub(center);\n\t\t// Near corners appear larger. Fitting only the flat projected extent lets\n\t\t// deep objects escape the shared media rectangle even with zero padding.\n\t\tconst depth = -offset.dot(forward);\n\t\tdistance = Math.max(distance, depth + Math.abs(offset.dot(right)) / tanX,\n\t\t\tdepth + Math.abs(offset.dot(up)) / tanY);\n\t}\n\treturn distance * margin;\n}\n\n/** Returns the eight corners of an axis-aligned bounding box. */\nexport function getBoxCorners(bounds: THREE.Box3) {\n\tconst { min, max } = bounds;\n\treturn [\n\t\tnew THREE.Vector3(min.x, min.y, min.z),\n\t\tnew THREE.Vector3(min.x, min.y, max.z),\n\t\tnew THREE.Vector3(min.x, max.y, min.z),\n\t\tnew THREE.Vector3(min.x, max.y, max.z),\n\t\tnew THREE.Vector3(max.x, min.y, min.z),\n\t\tnew THREE.Vector3(max.x, min.y, max.z),\n\t\tnew THREE.Vector3(max.x, max.y, min.z),\n\t\tnew THREE.Vector3(max.x, max.y, max.z)\n\t];\n}\n\n/** Computes the camera-facing travel used to clear panels during close-up zoom. */\nexport function getPanelFocusOffset(\n\toptions: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>,\n\tfocus: number,\n\tviewportWidth: number,\n\tviewportHeight: number\n) {\n\tif (focus <= 0.001) return { x: 0, y: 0, z: 0 };\n\tconst edgeDistanceX = Math.max(viewportWidth * 0.5 - options.width * 0.5, 1);\n\tconst edgeDistanceY = Math.max(viewportHeight * 0.5 - options.height * 0.5, 1);\n\tconst normalizedX = options.position.x / edgeDistanceX;\n\tconst normalizedY = options.position.y / edgeDistanceY;\n\tconst direction = getPanelFocusDirection(options, normalizedX, normalizedY);\n\tconst horizontal = Math.abs(direction.x) > Math.abs(direction.y);\n\tconst axisSize = horizontal ? options.width : options.height;\n\tconst travel = THREE.MathUtils.clamp(\n\t\taxisSize * (horizontal ? 0.16 : 0.42),\n\t\thorizontal ? 48 : 18,\n\t\tPANEL_FOCUS_MAX_OFFSET\n\t);\n\tconst easedFocus = getPanelFocusProgress(focus);\n\treturn {\n\t\tx: direction.x * travel * easedFocus,\n\t\ty: direction.y * travel * easedFocus,\n\t\tz: PANEL_FOCUS_MAX_ADVANCE * easedFocus\n\t};\n}\n\n/** Chooses the least disruptive edge toward which a focused panel should travel. */\nexport function getPanelFocusDirection(\n\toptions: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height' | 'position'>,\n\tnormalizedX: number,\n\tnormalizedY: number\n) {\n\tconst aspect = options.width / Math.max(options.height, 1);\n\tconst absX = Math.abs(normalizedX);\n\tconst absY = Math.abs(normalizedY);\n\tif (aspect >= 2.4 && absY > 0.12) return new THREE.Vector2(0, Math.sign(normalizedY) || 1);\n\tif (absX > absY * 0.8) return new THREE.Vector2(Math.sign(normalizedX) || 1, 0);\n\tif (absY > absX * 0.8) return new THREE.Vector2(0, Math.sign(normalizedY) || 1);\n\tconst direction = new THREE.Vector2(normalizedX, normalizedY);\n\tif (direction.lengthSq() < 0.02) direction.set(0, options.position.y >= 0 ? 1 : -1);\n\treturn direction.normalize();\n}\n\n/** Shared, eased progress for panel motion, blur, opacity and corner controls. */\nexport function getPanelFocusProgress(focus: number) {\n\treturn smoothstep(0.08, 0.96, focus);\n}\n\n/** Returns panel opacity at a normalized stage UI focus level. */\nexport function getPanelFocusOpacity(focus: number) {\n\treturn THREE.MathUtils.lerp(1, PANEL_FOCUS_MIN_OPACITY, getPanelFocusProgress(focus));\n}\n\n/** Returns CSS content blur at a normalized stage focus level. */\nexport function getPanelFocusBlur(focus: number, options: Pick<Required<LiquidGlassPanelOptions>, 'width' | 'height'>) {\n\tconst shortSide = Math.max(Math.min(options.width, options.height), 1);\n\tconst sizeScale = THREE.MathUtils.clamp(Math.sqrt(shortSide / 240), 0.34, 1);\n\treturn PANEL_FOCUS_MAX_BLUR * sizeScale * getPanelFocusProgress(focus);\n}\n\n/**\n * Reduces only the rotation axis amplified by an elongated panel.\n * Square panels keep the full response on both axes.\n */\nexport function getPanelAspectTiltScale(width: number, height: number) {\n\tconst safeWidth = Math.max(width, 1);\n\tconst safeHeight = Math.max(height, 1);\n\n\treturn {\n\t\tazimuth: Math.min(1, Math.sqrt(safeHeight / safeWidth)),\n\t\televation: Math.min(1, Math.sqrt(safeWidth / safeHeight))\n\t};\n}\n\n/** Returns the independent approach band for one panel. */\nexport function getPanelPointerProximity(width: number, height: number) {\n\tconst safeWidth = Math.max(width, 1);\n\tconst safeHeight = Math.max(height, 1);\n\tconst shortSide = Math.min(safeWidth, safeHeight);\n\tconst longSide = Math.max(safeWidth, safeHeight);\n\tconst aspectCorrection = Math.min(\n\t\tMath.sqrt(longSide / shortSide),\n\t\tPANEL_POINTER_PROXIMITY_ASPECT_LIMIT\n\t);\n\treturn THREE.MathUtils.clamp(\n\t\tshortSide * PANEL_POINTER_PROXIMITY_SCALE * aspectCorrection,\n\t\tPANEL_POINTER_PROXIMITY_MIN,\n\t\tPANEL_POINTER_PROXIMITY_MAX\n\t);\n}\n\n/** Converts distance from a panel edge into a smooth zero-to-one hover influence. */\nexport function getPanelPointerInfluence(distance: number, width: number, height: number) {\n\treturn 1 - smoothstep(0, getPanelPointerProximity(width, height), Math.max(distance, 0));\n}\n\n/** Resolves a pointer-relative pose with axis-specific aspect-ratio attenuation. */\nexport function getPanelPointerRotation(\n\tlookX: number,\n\tlookY: number,\n\tinfluence: number,\n\twidth: number,\n\theight: number\n) {\n\tconst tilt = PANEL_POINTER_MAX_TILT * THREE.MathUtils.clamp(influence, 0, 1);\n\tconst aspectScale = getPanelAspectTiltScale(width, height);\n\treturn {\n\t\tx: -THREE.MathUtils.clamp(lookY, -1, 1) * tilt * aspectScale.elevation,\n\t\ty: -THREE.MathUtils.clamp(lookX, -1, 1) * tilt * aspectScale.azimuth\n\t};\n}\n\n/** Detects panel geometry changes that require a WebGPU mesh rebuild. */\nexport function hasPanelGeometryChanged(\n\tcurrent: Required<LiquidGlassPanelOptions>,\n\tnext: LiquidGlassPanelOptions\n) {\n\treturn (\n\t\tMath.abs(current.width - (next.width ?? current.width)) > 0.5 ||\n\t\tMath.abs(current.height - (next.height ?? current.height)) > 0.5 ||\n\t\tMath.abs(current.radius - (next.radius ?? current.radius)) > 0.5\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stageMath.js","sourceRoot":"","sources":["../../src/stage/stageMath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtN,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtN,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EACN,sBAAsB,E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,CAAC,CAAC;IAC3D,OAAO;QACN,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,WAAW,CAAC,SAAS;QACjE,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,WAAW,CAAC,OAAO;KAC/D,CAAC;AACH,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,uBAAuB,CACtC,OAA0C,EAC1C,IAA6B;IAE7B,OAAO,CACN,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG;QAC7D,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG;QAChE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,CAChE,CAAC;AACH,CAAC","sourcesContent":["import { smoothstep, getPerspectiveDistance, getPanelFocusPerspectiveOffset, getPanelFocusOffset, getPanelFocusDirection, getPanelFocusProgress, getPanelFocusOpacity, getPanelFocusBlur } from './panelFocusMath.js';\nexport { smoothstep, getPerspectiveDistance, getPanelFocusPerspectiveOffset, getPanelFocusOffset, getPanelFocusDirection, getPanelFocusProgress, getPanelFocusOpacity, getPanelFocusBlur } from './panelFocusMath.js';\nimport * as ScalarMath from './scalarMath.js';\nimport * as THREE from 'three/webgpu';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport {\n\tDEFAULT_CAMERA_AZIMUTH,\n\tDEFAULT_CAMERA_ELEVATION,\n\tMINIMAP_DEFAULT_MODEL_SCALE,\n\tPANEL_POINTER_MAX_TILT,\n\tPANEL_POINTER_PROXIMITY_ASPECT_LIMIT,\n\tPANEL_POINTER_PROXIMITY_MAX,\n\tPANEL_POINTER_PROXIMITY_MIN,\n\tPANEL_POINTER_PROXIMITY_SCALE,\n\tVIEW_RESET_MAX_DURATION,\n\tVIEW_RESET_MIN_DURATION\n} from './stageConstants.js';\n\n/** Resolves declarative orbit angles to a normalized direction from element to camera. */\nexport function getCameraOrbitDirection(azimuth?: number, elevation?: number) {\n\tconst safeAzimuth = Number.isFinite(azimuth) ? (azimuth as number) : DEFAULT_CAMERA_AZIMUTH;\n\tconst safeElevation = ScalarMath.clamp(\n\t\tNumber.isFinite(elevation) ? (elevation as number) : DEFAULT_CAMERA_ELEVATION,\n\t\t-89,\n\t\t89\n\t);\n\tconst azimuthRadians = ScalarMath.degToRad(safeAzimuth);\n\tconst elevationRadians = ScalarMath.degToRad(safeElevation);\n\tconst horizontalScale = Math.cos(elevationRadians);\n\n\treturn new THREE.Vector3(\n\t\tMath.sin(azimuthRadians) * horizontalScale,\n\t\tMath.sin(elevationRadians),\n\t\tMath.cos(azimuthRadians) * horizontalScale\n\t).normalize();\n}\n\n/** Resolves orbit angles to the world-space orientation of a camera looking at the element. */\nexport function getCameraOrbitQuaternion(azimuth?: number, elevation?: number) {\n\tconst direction = getCameraOrbitDirection(azimuth, elevation);\n\tconst lookAtMatrix = new THREE.Matrix4().lookAt(\n\t\tdirection,\n\t\tnew THREE.Vector3(),\n\t\tnew THREE.Vector3(0, 1, 0)\n\t);\n\treturn new THREE.Quaternion().setFromRotationMatrix(lookAtMatrix);\n}\n\n/** Lets close-up resets travel longer while keeping small corrections responsive. */\nexport function getViewResetDuration(focus: number) {\n\treturn ScalarMath.lerp(\n\t\tVIEW_RESET_MIN_DURATION,\n\t\tVIEW_RESET_MAX_DURATION,\n\t\tsmoothstep(0, 1, focus)\n\t);\n}\n\n/** Provides a zero-velocity start and finish for the fitted-view return. */\nexport function getViewResetInterpolation(elapsed: number, duration: number) {\n\treturn smoothstep(0, Math.max(duration, Number.EPSILON), elapsed);\n}\n\n/**\n * Remaps camera focus to the earlier UI-clearance phase.\n *\n * Page content and ordinary panels lead the minimap, with one shared clearance endpoint.\n */\nexport function getStageUiFocus(focus: number) {\n\treturn smoothstep(0.02, 0.82, focus);\n}\n\n/**\n * Starts minimap expansion after the surrounding UI begins to clear, but completes\n * at exactly the same focus as the panel fade. No peripheral movement trails it.\n */\nexport function getMinimapFocus(focus: number) {\n\treturn smoothstep(0.12, 1, getPanelFocusProgress(getStageUiFocus(focus)));\n}\n\n/**\n * Gates minimap expansion behind the UI-clearance phase.\n *\n * Both values originate from the same smoothed camera focus. The gate retains the\n * intentional lead of ordinary content without adding another temporal lag.\n */\nexport function getSequencedMinimapFocus(focus: number, uiFocus: number) {\n\tconst clearance = smoothstep(0.14, 0.46, uiFocus);\n\treturn getMinimapFocus(focus) * clearance;\n}\n\n/**\n * Moves an expanding minimap from its authored panel position to a viewport inset.\n * A zero focus returns the exact resting position; a full focus pins its top-left\n * corner to the requested inset independently of the expanded dimensions.\n */\nexport function getMinimapFocusPositionOffset(\n\tbasePosition: { x: number; y: number },\n\tbaseSize: { width: number; height: number },\n\tvisualSize: { width: number; height: number },\n\tviewportSize: { width: number; height: number },\n\tfocus: number,\n\tinset: number\n) {\n\tconst progress = ScalarMath.clamp(focus, 0, 1);\n\tconst baseCenterX = viewportSize.width * 0.5 + basePosition.x;\n\tconst baseCenterY = viewportSize.height * 0.5 - basePosition.y;\n\tconst restingLeft = baseCenterX - baseSize.width * 0.5;\n\tconst restingTop = baseCenterY - baseSize.height * 0.5;\n\tconst focusedLeft = ScalarMath.lerp(restingLeft, inset, progress);\n\tconst focusedTop = ScalarMath.lerp(restingTop, inset, progress);\n\n\treturn {\n\t\tx: focusedLeft + visualSize.width * 0.5 - baseCenterX,\n\t\ty: baseCenterY - (focusedTop + visualSize.height * 0.5)\n\t};\n}\n\n/** Normalizes browser wheel units to the pixel-based delta used by OrbitControls. */\nexport function normalizeWheelZoomDelta(deltaY: number, deltaMode: number, ctrlKey: boolean) {\n\tlet normalizedDelta = deltaY;\n\tif (deltaMode === 1) normalizedDelta *= 16;\n\tif (deltaMode === 2) normalizedDelta *= 100;\n\tif (ctrlKey) normalizedDelta *= 10;\n\treturn normalizedDelta;\n}\n\n/** Accumulates an OrbitControls-compatible wheel gesture into a clamped zoom target. */\nexport function getWheelZoomTargetDistance(\n\tcurrentTargetDistance: number,\n\tdeltaY: number,\n\tzoomSpeed: number,\n\tminDistance: number,\n\tmaxDistance: number\n) {\n\tconst currentDistance = ScalarMath.clamp(currentTargetDistance, minDistance, maxDistance);\n\tif (!Number.isFinite(deltaY) || deltaY === 0) return currentDistance;\n\n\tconst scale = Math.pow(0.95, Math.max(zoomSpeed, 0) * Math.abs(deltaY * 0.01));\n\tconst targetDistance = deltaY < 0 ? currentDistance * scale : currentDistance / scale;\n\treturn ScalarMath.clamp(targetDistance, minDistance, maxDistance);\n}\n\n/** Resolves the authored minimap scale without imposing an upper creative limit. */\nexport function resolveMinimapModelScale(\n\tmodelScale?: number,\n\tfallback = MINIMAP_DEFAULT_MODEL_SCALE\n) {\n\tconst safeFallback = Number.isFinite(fallback)\n\t\t? Math.max(fallback, 0.2)\n\t\t: MINIMAP_DEFAULT_MODEL_SCALE;\n\tif (modelScale === undefined) return safeFallback;\n\tif (!Number.isFinite(modelScale)) return safeFallback;\n\treturn Math.max(modelScale, 0.2);\n}\n\n/** Blends the configured model multiplier through the damped minimap hover state. */\nexport function getMinimapHoverScale(hoverModelScale: number, pointerReveal: number) {\n\treturn ScalarMath.lerp(1, hoverModelScale, ScalarMath.clamp(pointerReveal, 0, 1));\n}\n\n/**\n * Returns the same opacity used by ordinary panels during close-up focus.\n *\n * Keeping DOM content and panel opacity on one curve prevents either layer from\n * disappearing first while the phase-delayed minimap begins to grow.\n */\nexport function getStageDomFocusOpacity(uiFocus: number) {\n\treturn getPanelFocusOpacity(uiFocus);\n}\n\n/**\n * Defines the camera-distance interval used by the shared close-up focus effect.\n * Starting near the fitted view gives panels and page content enough travel to\n * clear progressively before the element fills the viewport.\n */\nexport function getZoomFocusDistanceRange(maxDistance: number, modelRadius: number) {\n\tconst restDistance = maxDistance * 0.84;\n\tlet closeDistance = Math.max(modelRadius * 0.14, maxDistance * 0.1);\n\tif (closeDistance >= restDistance) closeDistance = restDistance * 0.32;\n\n\treturn { closeDistance, restDistance };\n}\n\n/**\n * Converts camera-to-target distance into a FOV-independent visual distance.\n * This keeps focus effects and zoom limits coherent when a SpaceMouse changes\n * perspective FOV while ordinary OrbitControls continue to dolly the camera.\n */\nexport function getEffectiveCameraDistance(\n\tdistance: number,\n\tcurrentFov: number,\n\treferenceFov: number\n) {\n\tconst safeCurrentFov = ScalarMath.clamp(currentFov, 0.01, 179);\n\tconst safeReferenceFov = ScalarMath.clamp(referenceFov, 0.01, 179);\n\treturn (\n\t\tdistance *\n\t\t(Math.tan(ScalarMath.degToRad(safeCurrentFov * 0.5)) /\n\t\t\tMath.tan(ScalarMath.degToRad(safeReferenceFov * 0.5)))\n\t);\n}\n\n/** Maps dolly and perspective-FOV zoom to the same normalized element focus. */\nexport function getCameraZoomFocus(\n\tdistance: number,\n\tcurrentFov: number,\n\treferenceFov: number,\n\tcloseDistance: number,\n\trestDistance: number\n) {\n\treturn (\n\t\t1 -\n\t\tsmoothstep(\n\t\t\tcloseDistance,\n\t\t\trestDistance,\n\t\t\tgetEffectiveCameraDistance(distance, currentFov, referenceFov)\n\t\t)\n\t);\n}\n\n/**\n * Chooses the distance that best represents the element's visible magnification.\n * OrbitControls reduces its target distance, while 3DxWare may dolly camera and\n * target together and only reduce the distance to the element itself.\n */\nexport function getCameraZoomReferenceDistance(\n\tviewTargetDistance: number,\n\tspatialElementCenterDistance: number\n) {\n\treturn Math.min(viewTargetDistance, spatialElementCenterDistance);\n}\n\n/**\n * Places an untransformed panel around its stage-space center and aligns its\n * top-left corner to the device pixel grid for crisp native DOM text.\n */\nexport function getNativePanelDomPosition(\n\tcenter: { x: number; y: number },\n\tsize: { width: number; height: number },\n\tviewport: { width: number; height: number },\n\tdevicePixelRatio = 1\n) {\n\tconst pixelRatio =\n\t\tNumber.isFinite(devicePixelRatio) && devicePixelRatio > 0 ? devicePixelRatio : 1;\n\tconst snap = (value: number) => Math.round(value * pixelRatio) / pixelRatio;\n\n\treturn {\n\t\tleft: snap(viewport.width * 0.5 + center.x - size.width * 0.5),\n\t\ttop: snap(viewport.height * 0.5 - center.y - size.height * 0.5)\n\t};\n}\n\n/**\n * Compensates an x/y panel anchor when it advances toward a perspective camera.\n *\n * Without this correction, a panel appears to drift away from its DOM anchor as its\n * z position changes.\n */\nexport function getPerspectiveAnchoredPanelPosition(\n\ttargetX: number,\n\ttargetY: number,\n\tcurrentZ: number,\n\tcameraDistance: number\n) {\n\tconst safeCameraDistance = Math.max(cameraDistance, 1);\n\tconst depthScale = ScalarMath.clamp(\n\t\t(safeCameraDistance - currentZ) / safeCameraDistance,\n\t\t0.05,\n\t\t2\n\t);\n\n\treturn { x: targetX * depthScale, y: targetY * depthScale };\n}\n\n/**\n * Builds a local projection root for a panel rendered by the shared stage camera.\n *\n * The translation keeps the panel anchored while it moves in depth. The z shear\n * cancels the shared camera's off-axis perspective, so rotated children converge\n * on the panel center instead of the viewport center.\n */\nexport function setPanelLocalPerspectiveMatrix(\n\ttarget: THREE.Matrix4,\n\ttargetX: number,\n\ttargetY: number,\n\tcurrentZ: number,\n\tcameraDistance: number\n) {\n\tconst safeCameraDistance = Math.max(cameraDistance, 1);\n\tconst anchoredPosition = getPerspectiveAnchoredPanelPosition(\n\t\ttargetX,\n\t\ttargetY,\n\t\tcurrentZ,\n\t\tsafeCameraDistance\n\t);\n\n\treturn target.set(\n\t\t1,\n\t\t0,\n\t\t-targetX / safeCameraDistance,\n\t\tanchoredPosition.x,\n\t\t0,\n\t\t1,\n\t\t-targetY / safeCameraDistance,\n\t\tanchoredPosition.y,\n\t\t0,\n\t\t0,\n\t\t1,\n\t\tcurrentZ,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t1\n\t);\n}\n\n/**\n * Calculates the nearest camera distance that contains an oriented bounding box.\n *\n * @param bounds - World-space bounds of the object to frame.\n * @param viewDirection - Direction from the target toward the camera.\n * @param camera - Camera whose FOV and aspect define the frame.\n * @param margin - Multiplicative padding around the fitted object.\n * @param viewportScale - Fraction of the browser viewport available to the element.\n */\nexport function getCameraFitDistance(\n\tbounds: THREE.Box3,\n\tviewDirection: THREE.Vector3,\n\tcamera: THREE.PerspectiveCamera,\n\tmargin = 1,\n\tviewportScale = { x: 1, y: 1 }\n) {\n\tconst corners = getBoxCorners(bounds);\n\tconst center = bounds.getCenter(new THREE.Vector3());\n\tconst forward = viewDirection.clone().normalize().negate();\n\tconst right = new THREE.Vector3().crossVectors(camera.up, forward).normalize();\n\tif (right.lengthSq() < 0.0001) right.set(1, 0, 0);\n\tconst up = new THREE.Vector3().crossVectors(forward, right).normalize();\n\tconst verticalFov = ScalarMath.degToRad(camera.fov);\n\tconst horizontalFov = 2 * Math.atan(Math.tan(verticalFov * 0.5) * camera.aspect);\n\tconst tanY = Math.tan(verticalFov * 0.5) * viewportScale.y;\n\tconst tanX = Math.tan(horizontalFov * 0.5) * viewportScale.x;\n\tlet distance = 0.1;\n\tfor (const corner of corners) {\n\t\tconst offset = corner.sub(center);\n\t\t// Near corners appear larger. Fitting only the flat projected extent lets\n\t\t// deep objects escape the shared media rectangle even with zero padding.\n\t\tconst depth = -offset.dot(forward);\n\t\tdistance = Math.max(distance, depth + Math.abs(offset.dot(right)) / tanX,\n\t\t\tdepth + Math.abs(offset.dot(up)) / tanY);\n\t}\n\treturn distance * margin;\n}\n\n/** Returns the eight corners of an axis-aligned bounding box. */\nexport function getBoxCorners(bounds: THREE.Box3) {\n\tconst { min, max } = bounds;\n\treturn [\n\t\tnew THREE.Vector3(min.x, min.y, min.z),\n\t\tnew THREE.Vector3(min.x, min.y, max.z),\n\t\tnew THREE.Vector3(min.x, max.y, min.z),\n\t\tnew THREE.Vector3(min.x, max.y, max.z),\n\t\tnew THREE.Vector3(max.x, min.y, min.z),\n\t\tnew THREE.Vector3(max.x, min.y, max.z),\n\t\tnew THREE.Vector3(max.x, max.y, min.z),\n\t\tnew THREE.Vector3(max.x, max.y, max.z)\n\t];\n}\n\n/**\n * Reduces only the rotation axis amplified by an elongated panel.\n * Square panels keep the full response on both axes.\n */\nexport function getPanelAspectTiltScale(width: number, height: number) {\n\tconst safeWidth = Math.max(width, 1);\n\tconst safeHeight = Math.max(height, 1);\n\n\treturn {\n\t\tazimuth: Math.min(1, Math.sqrt(safeHeight / safeWidth)),\n\t\televation: Math.min(1, Math.sqrt(safeWidth / safeHeight))\n\t};\n}\n\n/** Returns the independent approach band for one panel. */\nexport function getPanelPointerProximity(width: number, height: number) {\n\tconst safeWidth = Math.max(width, 1);\n\tconst safeHeight = Math.max(height, 1);\n\tconst shortSide = Math.min(safeWidth, safeHeight);\n\tconst longSide = Math.max(safeWidth, safeHeight);\n\tconst aspectCorrection = Math.min(\n\t\tMath.sqrt(longSide / shortSide),\n\t\tPANEL_POINTER_PROXIMITY_ASPECT_LIMIT\n\t);\n\treturn ScalarMath.clamp(\n\t\tshortSide * PANEL_POINTER_PROXIMITY_SCALE * aspectCorrection,\n\t\tPANEL_POINTER_PROXIMITY_MIN,\n\t\tPANEL_POINTER_PROXIMITY_MAX\n\t);\n}\n\n/** Converts distance from a panel edge into a smooth zero-to-one hover influence. */\nexport function getPanelPointerInfluence(distance: number, width: number, height: number) {\n\treturn 1 - smoothstep(0, getPanelPointerProximity(width, height), Math.max(distance, 0));\n}\n\n/** Resolves a pointer-relative pose with axis-specific aspect-ratio attenuation. */\nexport function getPanelPointerRotation(\n\tlookX: number,\n\tlookY: number,\n\tinfluence: number,\n\twidth: number,\n\theight: number\n) {\n\tconst tilt = PANEL_POINTER_MAX_TILT * ScalarMath.clamp(influence, 0, 1);\n\tconst aspectScale = getPanelAspectTiltScale(width, height);\n\treturn {\n\t\tx: -ScalarMath.clamp(lookY, -1, 1) * tilt * aspectScale.elevation,\n\t\ty: -ScalarMath.clamp(lookX, -1, 1) * tilt * aspectScale.azimuth\n\t};\n}\n\n/** Detects panel geometry changes that require a WebGPU mesh rebuild. */\nexport function hasPanelGeometryChanged(\n\tcurrent: Required<LiquidGlassPanelOptions>,\n\tnext: LiquidGlassPanelOptions\n) {\n\treturn (\n\t\tMath.abs(current.width - (next.width ?? current.width)) > 0.5 ||\n\t\tMath.abs(current.height - (next.height ?? current.height)) > 0.5 ||\n\t\tMath.abs(current.radius - (next.radius ?? current.radius)) > 0.5\n\t);\n}\n"]}
|
|
@@ -198,8 +198,9 @@ export interface StageExperienceOptions {
|
|
|
198
198
|
interactionTheme?: Partial<StageInteractionTheme>;
|
|
199
199
|
panels?: StagePanelTarget[];
|
|
200
200
|
viewport?: StageViewportTarget;
|
|
201
|
-
/**
|
|
201
|
+
/** Connects to the local 3DxWare driver (may prompt for local access). Defaults to false. */
|
|
202
202
|
enableSpaceMouse?: boolean;
|
|
203
|
+
onSpaceMouseStateChange?: (state: import('./spaceMousePlatform.js').SpaceMouseState) => void;
|
|
203
204
|
/** Receives the normalized, sequenced phases of a close-up zoom. */
|
|
204
205
|
onZoomFocusChange?: (state: StageZoomFocusState) => void;
|
|
205
206
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageTypes.d.ts","sourceRoot":"","sources":["../../src/stage/stageTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAErE,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9D,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IA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;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uFAAuF;IACvF,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;CACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageTypes.js","sourceRoot":"","sources":["../../src/stage/stageTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpatialElementLodPair } from '../catalog/spatialElementLodPair.js';\nimport type { ColorRepresentation, Mesh } from 'three';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\n\n/** Selects the rendering backend and visual complexity of a panel surface. */\nexport type StagePanelSurface = 'solid' | 'frosted' | 'glass';\n\n/** Controls how the HDR environment is presented behind the stage. */\nexport interface BackgroundSettings {\n\t/** Three.js background blur amount in the range supported by the active renderer. */\n\tblurriness: number;\n\t/** Color mixed over the HDR background. */\n\ttint: ColorRepresentation;\n\t/** Strength of the background tint, where zero leaves the HDR unchanged. */\n\ttintIntensity: number;\n}\n\n/** Axis rotations, in radians, applied to a loaded model before it is fitted. */\nexport interface StageModelRotation {\n\tx?: number;\n\ty?: number;\n\tz?: number;\n}\n\n/** Controls the fitted camera's initial orbit around the element. */\nexport interface StageCameraSettings {\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n\t/** Empty space in CSS pixels reserved on every side of the automatic element fit. */\n\tfitPadding?: number;\n\t/** Presentation multiplier after padding. Enlargement stops at the detail media rectangle's edges. */\n\tfitScale?: number;\n}\n\n/** Supported blend modes for declarative stage material replacements. */\nexport type StageMaterialBlending = 'normal' | 'additive';\n\n/** Serializable subset used to replace an asset mesh with a physical material. */\nexport interface StagePhysicalMaterialSettings {\n\ttype: 'physical';\n\tcolor?: ColorRepresentation;\n\topacity?: number;\n\ttransparent?: boolean;\n\tmetalness?: number;\n\troughness?: number;\n\tiridescence?: number;\n\tclearcoat?: number;\n\tblending?: StageMaterialBlending;\n}\n\nexport type StageMaterialSettings = StagePhysicalMaterialSettings;\n\n/** Controls the authored model pose and which meshes represent the actual element. */\nexport interface StageModelSettings {\n\t/** Optional rotation applied on top of the GLB scene's authored root rotation. */\n\trotation?: StageModelRotation;\n\t/**\n\t * Exact, case-sensitive mesh names that remain visible on the main stage but do\n\t * not participate in element bounds, picking, outlining, or element minimaps.\n\t */\n\texcludeMeshes?: readonly string[];\n\t/** Physical material replacements keyed by exact, case-sensitive mesh name. */\n\tmaterialOverrides?: Readonly<Record<string, StageMaterialSettings>>;\n}\n\n/** Controls the minimap model presentation while its panel is docked. */\nexport interface StageMinimapDockedView {\n\t/** Model multiplier used only while the minimap is docked. */\n\tscale?: number;\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n}\n\n/** Configures the optional element minimap rendered on top of a panel. */\nexport interface StageMinimapOptions {\n\t/** Panel height, in CSS pixels, at maximum stage zoom. */\n\texpandedHeight?: number;\n\t/** Space, in CSS pixels, reserved around the minimap model. */\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted minimap model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\t/** Color drawn over the blurred area outside the viewport cutout. */\n\toverlayColor?: ColorRepresentation;\n\t/** Overlay alpha using the same zero-to-one convention as CSS/Figma. */\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\t/** Color behind the minimap capture when no stage background is rendered. */\n\tcontextColor?: ColorRepresentation;\n\t/** Alpha of the minimap capture background. */\n\tcontextOpacity?: number;\n\t/** Color of the rectangle describing the main camera viewport. */\n\tviewportColor?: ColorRepresentation;\n}\n\n/** Connects one DOM panel declaration to its WebGPU and CSS3D representations. */\nexport interface StagePanelTarget {\n\t/** Accessible DOM content displayed above the WebGPU panel. */\n\tcontent: HTMLElement;\n\t/** Inner content padding in CSS pixels. */\n\tcontentInset: number;\n\t/** DOM element whose layout determines the panel position and dimensions. */\n\tframe: HTMLElement;\n\t/** Complete DOM surface used by solid and frosted CSS3D panels. */\n\tsurfaceElement: HTMLElement;\n\t/** Enables the panel's minimap rendering mode. */\n\tminimap?: StageMinimapOptions;\n\t/** true: proximity lift and tilt; 'lift': mouse hover raises 2px without tilt; false: still. */\n\tpointerReactive?: boolean | 'lift';\n\t/** true fades/moves with close-up; false keeps its pose; 'top-right' travels to the corner. */\n\tfocusReactive?: boolean | 'top-right';\n\t/** Optional neighbouring panel frame moved with the corner control during UI clearance. */\n\tgetFocusAnchor?: () => HTMLElement | undefined;\n\t/** Keep accessible content in its DOM owner (for example, a native popover). */\n\tnativeContent?: boolean;\n\t/** Position native content after its anchors move, before measuring and drawing its surface. */\n\tupdateNativeLayout?: () => void;\n\t/** Whether an optional panel is currently open. */\n\tgetVisible?: () => boolean;\n\tgetMinimapSelected?: () => boolean;\n\t/** Shared geometry, tint, blur, and shadow configuration. */\n\toptions: LiquidGlassPanelOptions;\n\t/** Visual surface backend. All variants share the same CSS3D transform pipeline. */\n\tsurface: StagePanelSurface;\n\t/** Reads the current opacity of the visual surface independently of its content. */\n\tgetSurfaceOpacity?: () => number;\n\t/** Reads a transient scale applied only to the rendered minimap model. */\n\tgetMinimapModelScale?: () => number;\n\t/** Reads the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress?: () => number;\n\t/** Reads the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop?: () => number | undefined;\n\t/** Minimum viewport-space model edge; only corrects dock overflow, never normal centering. */\n\tgetMinimapModelLeft?: () => number | undefined;\n}\n\n/** Identifies the DOM region used to frame the main element camera. */\nexport interface StageViewportTarget {\n\telement: HTMLElement;\n}\n\n/** Describes the independently animated phases of a close-up zoom. */\nexport interface StageZoomFocusState {\n\t/** Camera-derived close-up amount, from the fitted view to maximum zoom. */\n\tfocus: number;\n\t/** Progress used to fade and move ordinary page content and panels. */\n\tuiFocus: number;\n\t/** Exact opacity applied to ordinary panels and non-stage DOM content. */\n\tuiOpacity: number;\n\t/** Delayed progress used to expand and morph the minimap. */\n\tminimapFocus: number;\n}\n\n/** A deterministic camera pose used by browser-level visual regression tests. */\nexport interface StageVisualTestView {\n\t/** Normalized camera distance, where zero is the fitted view and one is maximum zoom. */\n\tzoom?: number;\n\t/** Horizontal orbit offset from the initial pose, in degrees. */\n\tazimuth?: number;\n\t/** Vertical orbit offset from the initial pose, in degrees. */\n\tpolar?: number;\n\t/** Orbit-target offset expressed as a fraction of the fitted model radius. */\n\ttargetOffset?: Partial<{ x: number; y: number; z: number }>;\n}\n\n/** Bounds WebGPU rasterization cost independently of native DOM text resolution. */\nexport interface StageRenderSettings {\n\t/** Maximum physical pixels per CSS pixel. Defaults to 1. */\n\tmaxPixelRatio?: number;\n\t/** Maximum pixels per full-size canvas/capture. Defaults to 2,073,600; null disables this limit. */\n\tmaxPixels?: number | null;\n}\n\n/** Construction options for a {@link StageExperience}. */\nexport interface StageExperienceOptions {\n\t/** Transient detail selection. It never becomes part of route or asset identity. */\n\tdetailMedia?: import('../spatial-element/types.js').SpatialElementMediaItem['kind'];\n\t/** Shared browser metrics supplied by the adapter; read without DOM measurements per frame. */\n\treadLayoutMetrics?: (mode?: 'stable' | 'visible') => import('../spatial-element/responsiveLayout.js').ResponsiveLayoutInput | undefined;\n\tdeviceOrientation?: boolean;\n\t/** Stage-wide output quality; native DOM content remains at the device pixel ratio. */\n\trenderSettings?: StageRenderSettings;\n\t/** Directory containing Draco decoder files, including trailing slash. */\n\tdracoDecoderPath?: string;\n\t/** Opaque page surface, independent of the HDR environment. */\n\tpageBackground?: string;\n\t/** Reveals semantic content when the device can no longer render. */\n\tonDeviceLost?: () => void;\n\tlodPair?: SpatialElementLodPair;\n\t/** Catalog pages register their own presentations, including an intentionally empty list. */\n\tcatalog?: boolean;\n\t/** A restored dock uses Low only; optional detail preparation resumes when the hero returns. */\n\tdeferDetailPreparation?: boolean;\n\theroIsPresented?: () => boolean;\n\tbackground?: BackgroundSettings;\n\thdr?: string;\n\tglb?: string;\n\tmodel?: StageModelSettings;\n\tcamera?: StageCameraSettings;\n\tinteractionTheme?: Partial<StageInteractionTheme>;\n\tpanels?: StagePanelTarget[];\n\tviewport?: StageViewportTarget;\n\t/** Enables optional 3DxWare/SpaceMouse navigation. Defaults to true. */\n\tenableSpaceMouse?: boolean;\n\t/** Receives the normalized, sequenced phases of a close-up zoom. */\n\tonZoomFocusChange?: (state: StageZoomFocusState) => void;\n}\n\n/** Visual and filtering options for element hover interaction. */\nexport interface StageInteractionTheme {\n\toutlineColor: ColorRepresentation;\n\toutlineOpacity: number;\n\toutlineThickness: number;\n\toutlineGlow: number;\n\toutlineGlowThickness: number;\n\t/** Returns true for model meshes that must not participate in picking or outlining. */\n\texcludeMesh?: (mesh: Mesh) => boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stageTypes.js","sourceRoot":"","sources":["../../src/stage/stageTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpatialElementLodPair } from '../catalog/spatialElementLodPair.js';\nimport type { ColorRepresentation, Mesh } from 'three';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\n\n/** Selects the rendering backend and visual complexity of a panel surface. */\nexport type StagePanelSurface = 'solid' | 'frosted' | 'glass';\n\n/** Controls how the HDR environment is presented behind the stage. */\nexport interface BackgroundSettings {\n\t/** Three.js background blur amount in the range supported by the active renderer. */\n\tblurriness: number;\n\t/** Color mixed over the HDR background. */\n\ttint: ColorRepresentation;\n\t/** Strength of the background tint, where zero leaves the HDR unchanged. */\n\ttintIntensity: number;\n}\n\n/** Axis rotations, in radians, applied to a loaded model before it is fitted. */\nexport interface StageModelRotation {\n\tx?: number;\n\ty?: number;\n\tz?: number;\n}\n\n/** Controls the fitted camera's initial orbit around the element. */\nexport interface StageCameraSettings {\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n\t/** Empty space in CSS pixels reserved on every side of the automatic element fit. */\n\tfitPadding?: number;\n\t/** Presentation multiplier after padding. Enlargement stops at the detail media rectangle's edges. */\n\tfitScale?: number;\n}\n\n/** Supported blend modes for declarative stage material replacements. */\nexport type StageMaterialBlending = 'normal' | 'additive';\n\n/** Serializable subset used to replace an asset mesh with a physical material. */\nexport interface StagePhysicalMaterialSettings {\n\ttype: 'physical';\n\tcolor?: ColorRepresentation;\n\topacity?: number;\n\ttransparent?: boolean;\n\tmetalness?: number;\n\troughness?: number;\n\tiridescence?: number;\n\tclearcoat?: number;\n\tblending?: StageMaterialBlending;\n}\n\nexport type StageMaterialSettings = StagePhysicalMaterialSettings;\n\n/** Controls the authored model pose and which meshes represent the actual element. */\nexport interface StageModelSettings {\n\t/** Optional rotation applied on top of the GLB scene's authored root rotation. */\n\trotation?: StageModelRotation;\n\t/**\n\t * Exact, case-sensitive mesh names that remain visible on the main stage but do\n\t * not participate in element bounds, picking, outlining, or element minimaps.\n\t */\n\texcludeMeshes?: readonly string[];\n\t/** Physical material replacements keyed by exact, case-sensitive mesh name. */\n\tmaterialOverrides?: Readonly<Record<string, StageMaterialSettings>>;\n}\n\n/** Controls the minimap model presentation while its panel is docked. */\nexport interface StageMinimapDockedView {\n\t/** Model multiplier used only while the minimap is docked. */\n\tscale?: number;\n\t/** Horizontal viewing angle in degrees. Positive values view from the right. */\n\tazimuth?: number;\n\t/** Vertical viewing angle in degrees. Positive values view from above. */\n\televation?: number;\n}\n\n/** Configures the optional element minimap rendered on top of a panel. */\nexport interface StageMinimapOptions {\n\t/** Panel height, in CSS pixels, at maximum stage zoom. */\n\texpandedHeight?: number;\n\t/** Space, in CSS pixels, reserved around the minimap model. */\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted minimap model. Values below 0.2 are clamped. */\n\tmodelScale?: number;\n\t/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */\n\thoverModelScale?: number;\n\t/** Hover multiplier used once the minimap is expanded by camera zoom. */\n\texpandedHoverModelScale?: number;\n\t/** Optional spatial-element-specific presentation used while the minimap is docked. */\n\tdockedView?: StageMinimapDockedView;\n\t/** Color drawn over the blurred area outside the viewport cutout. */\n\toverlayColor?: ColorRepresentation;\n\t/** Overlay alpha using the same zero-to-one convention as CSS/Figma. */\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\t/** Color behind the minimap capture when no stage background is rendered. */\n\tcontextColor?: ColorRepresentation;\n\t/** Alpha of the minimap capture background. */\n\tcontextOpacity?: number;\n\t/** Color of the rectangle describing the main camera viewport. */\n\tviewportColor?: ColorRepresentation;\n}\n\n/** Connects one DOM panel declaration to its WebGPU and CSS3D representations. */\nexport interface StagePanelTarget {\n\t/** Accessible DOM content displayed above the WebGPU panel. */\n\tcontent: HTMLElement;\n\t/** Inner content padding in CSS pixels. */\n\tcontentInset: number;\n\t/** DOM element whose layout determines the panel position and dimensions. */\n\tframe: HTMLElement;\n\t/** Complete DOM surface used by solid and frosted CSS3D panels. */\n\tsurfaceElement: HTMLElement;\n\t/** Enables the panel's minimap rendering mode. */\n\tminimap?: StageMinimapOptions;\n\t/** true: proximity lift and tilt; 'lift': mouse hover raises 2px without tilt; false: still. */\n\tpointerReactive?: boolean | 'lift';\n\t/** true fades/moves with close-up; false keeps its pose; 'top-right' travels to the corner. */\n\tfocusReactive?: boolean | 'top-right';\n\t/** Optional neighbouring panel frame moved with the corner control during UI clearance. */\n\tgetFocusAnchor?: () => HTMLElement | undefined;\n\t/** Keep accessible content in its DOM owner (for example, a native popover). */\n\tnativeContent?: boolean;\n\t/** Position native content after its anchors move, before measuring and drawing its surface. */\n\tupdateNativeLayout?: () => void;\n\t/** Whether an optional panel is currently open. */\n\tgetVisible?: () => boolean;\n\tgetMinimapSelected?: () => boolean;\n\t/** Shared geometry, tint, blur, and shadow configuration. */\n\toptions: LiquidGlassPanelOptions;\n\t/** Visual surface backend. All variants share the same CSS3D transform pipeline. */\n\tsurface: StagePanelSurface;\n\t/** Reads the current opacity of the visual surface independently of its content. */\n\tgetSurfaceOpacity?: () => number;\n\t/** Reads a transient scale applied only to the rendered minimap model. */\n\tgetMinimapModelScale?: () => number;\n\t/** Reads the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress?: () => number;\n\t/** Reads the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop?: () => number | undefined;\n\t/** Minimum viewport-space model edge; only corrects dock overflow, never normal centering. */\n\tgetMinimapModelLeft?: () => number | undefined;\n}\n\n/** Identifies the DOM region used to frame the main element camera. */\nexport interface StageViewportTarget {\n\telement: HTMLElement;\n}\n\n/** Describes the independently animated phases of a close-up zoom. */\nexport interface StageZoomFocusState {\n\t/** Camera-derived close-up amount, from the fitted view to maximum zoom. */\n\tfocus: number;\n\t/** Progress used to fade and move ordinary page content and panels. */\n\tuiFocus: number;\n\t/** Exact opacity applied to ordinary panels and non-stage DOM content. */\n\tuiOpacity: number;\n\t/** Delayed progress used to expand and morph the minimap. */\n\tminimapFocus: number;\n}\n\n/** A deterministic camera pose used by browser-level visual regression tests. */\nexport interface StageVisualTestView {\n\t/** Normalized camera distance, where zero is the fitted view and one is maximum zoom. */\n\tzoom?: number;\n\t/** Horizontal orbit offset from the initial pose, in degrees. */\n\tazimuth?: number;\n\t/** Vertical orbit offset from the initial pose, in degrees. */\n\tpolar?: number;\n\t/** Orbit-target offset expressed as a fraction of the fitted model radius. */\n\ttargetOffset?: Partial<{ x: number; y: number; z: number }>;\n}\n\n/** Bounds WebGPU rasterization cost independently of native DOM text resolution. */\nexport interface StageRenderSettings {\n\t/** Maximum physical pixels per CSS pixel. Defaults to 1. */\n\tmaxPixelRatio?: number;\n\t/** Maximum pixels per full-size canvas/capture. Defaults to 2,073,600; null disables this limit. */\n\tmaxPixels?: number | null;\n}\n\n/** Construction options for a {@link StageExperience}. */\nexport interface StageExperienceOptions {\n\t/** Transient detail selection. It never becomes part of route or asset identity. */\n\tdetailMedia?: import('../spatial-element/types.js').SpatialElementMediaItem['kind'];\n\t/** Shared browser metrics supplied by the adapter; read without DOM measurements per frame. */\n\treadLayoutMetrics?: (mode?: 'stable' | 'visible') => import('../spatial-element/responsiveLayout.js').ResponsiveLayoutInput | undefined;\n\tdeviceOrientation?: boolean;\n\t/** Stage-wide output quality; native DOM content remains at the device pixel ratio. */\n\trenderSettings?: StageRenderSettings;\n\t/** Directory containing Draco decoder files, including trailing slash. */\n\tdracoDecoderPath?: string;\n\t/** Opaque page surface, independent of the HDR environment. */\n\tpageBackground?: string;\n\t/** Reveals semantic content when the device can no longer render. */\n\tonDeviceLost?: () => void;\n\tlodPair?: SpatialElementLodPair;\n\t/** Catalog pages register their own presentations, including an intentionally empty list. */\n\tcatalog?: boolean;\n\t/** A restored dock uses Low only; optional detail preparation resumes when the hero returns. */\n\tdeferDetailPreparation?: boolean;\n\theroIsPresented?: () => boolean;\n\tbackground?: BackgroundSettings;\n\thdr?: string;\n\tglb?: string;\n\tmodel?: StageModelSettings;\n\tcamera?: StageCameraSettings;\n\tinteractionTheme?: Partial<StageInteractionTheme>;\n\tpanels?: StagePanelTarget[];\n\tviewport?: StageViewportTarget;\n\t/** Connects to the local 3DxWare driver (may prompt for local access). Defaults to false. */\n\tenableSpaceMouse?: boolean;\n\tonSpaceMouseStateChange?: (state: import('./spaceMousePlatform.js').SpaceMouseState) => void;\n\t/** Receives the normalized, sequenced phases of a close-up zoom. */\n\tonZoomFocusChange?: (state: StageZoomFocusState) => void;\n}\n\n/** Visual and filtering options for element hover interaction. */\nexport interface StageInteractionTheme {\n\toutlineColor: ColorRepresentation;\n\toutlineOpacity: number;\n\toutlineThickness: number;\n\toutlineGlow: number;\n\toutlineGlowThickness: number;\n\t/** Returns true for model meshes that must not participate in picking or outlining. */\n\texcludeMesh?: (mesh: Mesh) => boolean;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpuSupport.d.ts","sourceRoot":"","sources":["../../src/stage/webgpuSupport.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,wBAAsB,eAAe,CAAC,GAAG,MAA4B,GAAG,OAAO,CAAC,OAAO,CAAC,CAUvF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Probe before importing any renderer, shader, geometry or device-driver code. */
|
|
2
|
+
export async function hasUsableWebGPU(gpu = globalThis.navigator?.gpu) {
|
|
3
|
+
try {
|
|
4
|
+
// Match Three's WebGPU backend: compatibility-only adapters can render our stage too.
|
|
5
|
+
const options = {
|
|
6
|
+
featureLevel: 'compatibility'
|
|
7
|
+
};
|
|
8
|
+
return Boolean(await gpu?.requestAdapter(options));
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=webgpuSupport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpuSupport.js","sourceRoot":"","sources":["../../src/stage/webgpuSupport.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAG,GAAG,UAAU,CAAC,SAAS,EAAE,GAAG;IACpE,IAAI,CAAC;QACJ,sFAAsF;QACtF,MAAM,OAAO,GAAiE;YAC7E,YAAY,EAAE,eAAe;SAC7B,CAAC;QACF,OAAO,OAAO,CAAC,MAAM,GAAG,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC","sourcesContent":["/** Probe before importing any renderer, shader, geometry or device-driver code. */\nexport async function hasUsableWebGPU(gpu = globalThis.navigator?.gpu): Promise<boolean> {\n\ttry {\n\t\t// Match Three's WebGPU backend: compatibility-only adapters can render our stage too.\n\t\tconst options: GPURequestAdapterOptions & { featureLevel: 'compatibility' } = {\n\t\t\tfeatureLevel: 'compatibility'\n\t\t};\n\t\treturn Boolean(await gpu?.requestAdapter(options));\n\t} catch {\n\t\treturn false;\n\t}\n}\n"]}
|