@spatial-elements/core 0.1.0-beta.1
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/LICENSE +373 -0
- package/README.md +17 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts +24 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -0
- package/dist/catalog/CarouselGlassCompositor.js +132 -0
- package/dist/catalog/CarouselGlassCompositor.js.map +1 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts +59 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -0
- package/dist/catalog/CatalogEndpointRegistry.js +187 -0
- package/dist/catalog/CatalogEndpointRegistry.js.map +1 -0
- package/dist/catalog/CatalogGeometryFade.d.ts +12 -0
- package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -0
- package/dist/catalog/CatalogGeometryFade.js +67 -0
- package/dist/catalog/CatalogGeometryFade.js.map +1 -0
- package/dist/catalog/CatalogPreparation.d.ts +40 -0
- package/dist/catalog/CatalogPreparation.d.ts.map +1 -0
- package/dist/catalog/CatalogPreparation.js +141 -0
- package/dist/catalog/CatalogPreparation.js.map +1 -0
- package/dist/catalog/CatalogSections.d.ts +36 -0
- package/dist/catalog/CatalogSections.d.ts.map +1 -0
- package/dist/catalog/CatalogSections.js +51 -0
- package/dist/catalog/CatalogSections.js.map +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +149 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.js +920 -0
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -0
- package/dist/catalog/CatalogTransition.d.ts +93 -0
- package/dist/catalog/CatalogTransition.d.ts.map +1 -0
- package/dist/catalog/CatalogTransition.js +1299 -0
- package/dist/catalog/CatalogTransition.js.map +1 -0
- package/dist/catalog/EnvironmentCache.d.ts +30 -0
- package/dist/catalog/EnvironmentCache.d.ts.map +1 -0
- package/dist/catalog/EnvironmentCache.js +128 -0
- package/dist/catalog/EnvironmentCache.js.map +1 -0
- package/dist/catalog/PreparationGate.d.ts +10 -0
- package/dist/catalog/PreparationGate.d.ts.map +1 -0
- package/dist/catalog/PreparationGate.js +66 -0
- package/dist/catalog/PreparationGate.js.map +1 -0
- package/dist/catalog/PresentationLease.d.ts +16 -0
- package/dist/catalog/PresentationLease.d.ts.map +1 -0
- package/dist/catalog/PresentationLease.js +33 -0
- package/dist/catalog/PresentationLease.js.map +1 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts +63 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -0
- package/dist/catalog/SpatialGeometryCapture.js +158 -0
- package/dist/catalog/SpatialGeometryCapture.js.map +1 -0
- package/dist/catalog/assets/SpatialElementAssetManager.d.ts +92 -0
- package/dist/catalog/assets/SpatialElementAssetManager.d.ts.map +1 -0
- package/dist/catalog/assets/SpatialElementAssetManager.js +305 -0
- package/dist/catalog/assets/SpatialElementAssetManager.js.map +1 -0
- package/dist/catalog/assets/assetCosts.d.ts +4 -0
- package/dist/catalog/assets/assetCosts.d.ts.map +1 -0
- package/dist/catalog/assets/assetCosts.js +33 -0
- package/dist/catalog/assets/assetCosts.js.map +1 -0
- package/dist/catalog/assets/spatialElementAssetResources.d.ts +25 -0
- package/dist/catalog/assets/spatialElementAssetResources.d.ts.map +1 -0
- package/dist/catalog/assets/spatialElementAssetResources.js +100 -0
- package/dist/catalog/assets/spatialElementAssetResources.js.map +1 -0
- package/dist/catalog/carouselPanelProjection.d.ts +9 -0
- package/dist/catalog/carouselPanelProjection.d.ts.map +1 -0
- package/dist/catalog/carouselPanelProjection.js +33 -0
- package/dist/catalog/carouselPanelProjection.js.map +1 -0
- package/dist/catalog/carouselSelection.d.ts +7 -0
- package/dist/catalog/carouselSelection.d.ts.map +1 -0
- package/dist/catalog/carouselSelection.js +15 -0
- package/dist/catalog/carouselSelection.js.map +1 -0
- package/dist/catalog/catalogAction.d.ts +4 -0
- package/dist/catalog/catalogAction.d.ts.map +1 -0
- package/dist/catalog/catalogAction.js +9 -0
- package/dist/catalog/catalogAction.js.map +1 -0
- package/dist/catalog/catalogGeometryRequest.d.ts +13 -0
- package/dist/catalog/catalogGeometryRequest.d.ts.map +1 -0
- package/dist/catalog/catalogGeometryRequest.js +8 -0
- package/dist/catalog/catalogGeometryRequest.js.map +1 -0
- package/dist/catalog/catalogItems.d.ts +10 -0
- package/dist/catalog/catalogItems.d.ts.map +1 -0
- package/dist/catalog/catalogItems.js +23 -0
- package/dist/catalog/catalogItems.js.map +1 -0
- package/dist/catalog/catalogJourney.d.ts +38 -0
- package/dist/catalog/catalogJourney.d.ts.map +1 -0
- package/dist/catalog/catalogJourney.js +64 -0
- package/dist/catalog/catalogJourney.js.map +1 -0
- package/dist/catalog/catalogPage.d.ts +11 -0
- package/dist/catalog/catalogPage.d.ts.map +1 -0
- package/dist/catalog/catalogPage.js +2 -0
- package/dist/catalog/catalogPage.js.map +1 -0
- package/dist/catalog/catalogPose.d.ts +30 -0
- package/dist/catalog/catalogPose.d.ts.map +1 -0
- package/dist/catalog/catalogPose.js +35 -0
- package/dist/catalog/catalogPose.js.map +1 -0
- package/dist/catalog/catalogPresentation.d.ts +24 -0
- package/dist/catalog/catalogPresentation.d.ts.map +1 -0
- package/dist/catalog/catalogPresentation.js +56 -0
- package/dist/catalog/catalogPresentation.js.map +1 -0
- package/dist/catalog/catalogRecipes.d.ts +21 -0
- package/dist/catalog/catalogRecipes.d.ts.map +1 -0
- package/dist/catalog/catalogRecipes.js +84 -0
- package/dist/catalog/catalogRecipes.js.map +1 -0
- package/dist/catalog/catalogSurfaceCapture.d.ts +11 -0
- package/dist/catalog/catalogSurfaceCapture.d.ts.map +1 -0
- package/dist/catalog/catalogSurfaceCapture.js +11 -0
- package/dist/catalog/catalogSurfaceCapture.js.map +1 -0
- package/dist/catalog/catalogViewLink.d.ts +8 -0
- package/dist/catalog/catalogViewLink.d.ts.map +1 -0
- package/dist/catalog/catalogViewLink.js +37 -0
- package/dist/catalog/catalogViewLink.js.map +1 -0
- package/dist/catalog/rebasePresentation.d.ts +3 -0
- package/dist/catalog/rebasePresentation.d.ts.map +1 -0
- package/dist/catalog/rebasePresentation.js +26 -0
- package/dist/catalog/rebasePresentation.js.map +1 -0
- package/dist/catalog/spatialElementAssets.d.ts +158 -0
- package/dist/catalog/spatialElementAssets.d.ts.map +1 -0
- package/dist/catalog/spatialElementAssets.js +92 -0
- package/dist/catalog/spatialElementAssets.js.map +1 -0
- package/dist/catalog/spatialElementLodPair.d.ts +17 -0
- package/dist/catalog/spatialElementLodPair.d.ts.map +1 -0
- package/dist/catalog/spatialElementLodPair.js +5 -0
- package/dist/catalog/spatialElementLodPair.js.map +1 -0
- package/dist/catalog/transitionTiming.d.ts +15 -0
- package/dist/catalog/transitionTiming.d.ts.map +1 -0
- package/dist/catalog/transitionTiming.js +22 -0
- package/dist/catalog/transitionTiming.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts +101 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.js +627 -0
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -0
- package/dist/spatial-element/spatialElement.d.ts +28 -0
- package/dist/spatial-element/spatialElement.d.ts.map +1 -0
- package/dist/spatial-element/spatialElement.js +45 -0
- package/dist/spatial-element/spatialElement.js.map +1 -0
- package/dist/spatial-element/spatialElementDock.d.ts +43 -0
- package/dist/spatial-element/spatialElementDock.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementDock.js +126 -0
- package/dist/spatial-element/spatialElementDock.js.map +1 -0
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts +29 -0
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementSectionRegistry.js +67 -0
- package/dist/spatial-element/spatialElementSectionRegistry.js.map +1 -0
- package/dist/spatial-element/types.d.ts +165 -0
- package/dist/spatial-element/types.d.ts.map +1 -0
- package/dist/spatial-element/types.js +2 -0
- package/dist/spatial-element/types.js.map +1 -0
- package/dist/stage/LiquidGlassPanel.d.ts +55 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -0
- package/dist/stage/LiquidGlassPanel.js +447 -0
- package/dist/stage/LiquidGlassPanel.js.map +1 -0
- package/dist/stage/MinimapBlurPipeline.d.ts +34 -0
- package/dist/stage/MinimapBlurPipeline.d.ts.map +1 -0
- package/dist/stage/MinimapBlurPipeline.js +147 -0
- package/dist/stage/MinimapBlurPipeline.js.map +1 -0
- package/dist/stage/MinimapController.d.ts +113 -0
- package/dist/stage/MinimapController.d.ts.map +1 -0
- package/dist/stage/MinimapController.js +803 -0
- package/dist/stage/MinimapController.js.map +1 -0
- package/dist/stage/OrbitControlsInterop.d.ts +8 -0
- package/dist/stage/OrbitControlsInterop.d.ts.map +1 -0
- package/dist/stage/OrbitControlsInterop.js +19 -0
- package/dist/stage/OrbitControlsInterop.js.map +1 -0
- package/dist/stage/PageBindingController.d.ts +41 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -0
- package/dist/stage/PageBindingController.js +92 -0
- package/dist/stage/PageBindingController.js.map +1 -0
- package/dist/stage/PanelPresentationController.d.ts +92 -0
- package/dist/stage/PanelPresentationController.d.ts.map +1 -0
- package/dist/stage/PanelPresentationController.js +569 -0
- package/dist/stage/PanelPresentationController.js.map +1 -0
- package/dist/stage/PresentationReadiness.d.ts +30 -0
- package/dist/stage/PresentationReadiness.d.ts.map +1 -0
- package/dist/stage/PresentationReadiness.js +94 -0
- package/dist/stage/PresentationReadiness.js.map +1 -0
- package/dist/stage/SpaceMouseAdapter.d.ts +76 -0
- package/dist/stage/SpaceMouseAdapter.d.ts.map +1 -0
- package/dist/stage/SpaceMouseAdapter.js +197 -0
- package/dist/stage/SpaceMouseAdapter.js.map +1 -0
- package/dist/stage/SpatialElementInteractionController.d.ts +126 -0
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -0
- package/dist/stage/SpatialElementInteractionController.js +581 -0
- package/dist/stage/SpatialElementInteractionController.js.map +1 -0
- package/dist/stage/SpatialElementPresentationController.d.ts +82 -0
- package/dist/stage/SpatialElementPresentationController.d.ts.map +1 -0
- package/dist/stage/SpatialElementPresentationController.js +372 -0
- package/dist/stage/SpatialElementPresentationController.js.map +1 -0
- package/dist/stage/SpatialElementRefinement.d.ts +26 -0
- package/dist/stage/SpatialElementRefinement.d.ts.map +1 -0
- package/dist/stage/SpatialElementRefinement.js +105 -0
- package/dist/stage/SpatialElementRefinement.js.map +1 -0
- package/dist/stage/StageExperience.d.ts +536 -0
- package/dist/stage/StageExperience.d.ts.map +1 -0
- package/dist/stage/StageExperience.js +2399 -0
- package/dist/stage/StageExperience.js.map +1 -0
- package/dist/stage/StagePanelLayout.d.ts +15 -0
- package/dist/stage/StagePanelLayout.d.ts.map +1 -0
- package/dist/stage/StagePanelLayout.js +20 -0
- package/dist/stage/StagePanelLayout.js.map +1 -0
- package/dist/stage/StagePanelRuntime.d.ts +20 -0
- package/dist/stage/StagePanelRuntime.d.ts.map +1 -0
- package/dist/stage/StagePanelRuntime.js +2 -0
- package/dist/stage/StagePanelRuntime.js.map +1 -0
- package/dist/stage/StageRenderPipeline.d.ts +179 -0
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -0
- package/dist/stage/StageRenderPipeline.js +901 -0
- package/dist/stage/StageRenderPipeline.js.map +1 -0
- package/dist/stage/VirtualScrollController.d.ts +64 -0
- package/dist/stage/VirtualScrollController.d.ts.map +1 -0
- package/dist/stage/VirtualScrollController.js +329 -0
- package/dist/stage/VirtualScrollController.js.map +1 -0
- package/dist/stage/cssProjection.d.ts +18 -0
- package/dist/stage/cssProjection.d.ts.map +1 -0
- package/dist/stage/cssProjection.js +52 -0
- package/dist/stage/cssProjection.js.map +1 -0
- package/dist/stage/damping.d.ts +3 -0
- package/dist/stage/damping.d.ts.map +1 -0
- package/dist/stage/damping.js +8 -0
- package/dist/stage/damping.js.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts +31 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.js +163 -0
- package/dist/stage/minimap/MinimapGeometry.js.map +1 -0
- package/dist/stage/minimap/MinimapModel.d.ts +16 -0
- package/dist/stage/minimap/MinimapModel.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapModel.js +51 -0
- package/dist/stage/minimap/MinimapModel.js.map +1 -0
- package/dist/stage/minimap/MinimapProjection.d.ts +41 -0
- package/dist/stage/minimap/MinimapProjection.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapProjection.js +113 -0
- package/dist/stage/minimap/MinimapProjection.js.map +1 -0
- package/dist/stage/minimap/MinimapState.d.ts +102 -0
- package/dist/stage/minimap/MinimapState.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapState.js +2 -0
- package/dist/stage/minimap/MinimapState.js.map +1 -0
- package/dist/stage/minimapMeasurement.d.ts +5 -0
- package/dist/stage/minimapMeasurement.d.ts.map +1 -0
- package/dist/stage/minimapMeasurement.js +11 -0
- package/dist/stage/minimapMeasurement.js.map +1 -0
- package/dist/stage/panelContext.d.ts +71 -0
- package/dist/stage/panelContext.d.ts.map +1 -0
- package/dist/stage/panelContext.js +6 -0
- package/dist/stage/panelContext.js.map +1 -0
- package/dist/stage/panelShadow.d.ts +20 -0
- package/dist/stage/panelShadow.d.ts.map +1 -0
- package/dist/stage/panelShadow.js +22 -0
- package/dist/stage/panelShadow.js.map +1 -0
- package/dist/stage/renderMeasurement.d.ts +3 -0
- package/dist/stage/renderMeasurement.d.ts.map +1 -0
- package/dist/stage/renderMeasurement.js +19 -0
- package/dist/stage/renderMeasurement.js.map +1 -0
- package/dist/stage/renderTargetInventory.d.ts +17 -0
- package/dist/stage/renderTargetInventory.d.ts.map +1 -0
- package/dist/stage/renderTargetInventory.js +27 -0
- package/dist/stage/renderTargetInventory.js.map +1 -0
- package/dist/stage/rendererState.d.ts +14 -0
- package/dist/stage/rendererState.d.ts.map +1 -0
- package/dist/stage/rendererState.js +35 -0
- package/dist/stage/rendererState.js.map +1 -0
- package/dist/stage/resolveStageProfile.d.ts +44 -0
- package/dist/stage/resolveStageProfile.d.ts.map +1 -0
- package/dist/stage/resolveStageProfile.js +30 -0
- package/dist/stage/resolveStageProfile.js.map +1 -0
- package/dist/stage/scrollAnimation.d.ts +10 -0
- package/dist/stage/scrollAnimation.d.ts.map +1 -0
- package/dist/stage/scrollAnimation.js +11 -0
- package/dist/stage/scrollAnimation.js.map +1 -0
- package/dist/stage/scrollFrame.d.ts +43 -0
- package/dist/stage/scrollFrame.d.ts.map +1 -0
- package/dist/stage/scrollFrame.js +232 -0
- package/dist/stage/scrollFrame.js.map +1 -0
- package/dist/stage/spatialElementFrame.d.ts +6 -0
- package/dist/stage/spatialElementFrame.d.ts.map +1 -0
- package/dist/stage/spatialElementFrame.js +22 -0
- package/dist/stage/spatialElementFrame.js.map +1 -0
- package/dist/stage/stageConstants.d.ts +85 -0
- package/dist/stage/stageConstants.d.ts.map +1 -0
- package/dist/stage/stageConstants.js +85 -0
- package/dist/stage/stageConstants.js.map +1 -0
- package/dist/stage/stageDom.d.ts +10 -0
- package/dist/stage/stageDom.d.ts.map +1 -0
- package/dist/stage/stageDom.js +22 -0
- package/dist/stage/stageDom.js.map +1 -0
- package/dist/stage/stageMath.d.ts +187 -0
- package/dist/stage/stageMath.d.ts.map +1 -0
- package/dist/stage/stageMath.js +344 -0
- package/dist/stage/stageMath.js.map +1 -0
- package/dist/stage/stageSceneUtils.d.ts +42 -0
- package/dist/stage/stageSceneUtils.d.ts.map +1 -0
- package/dist/stage/stageSceneUtils.js +154 -0
- package/dist/stage/stageSceneUtils.js.map +1 -0
- package/dist/stage/stageTypes.d.ts +189 -0
- package/dist/stage/stageTypes.d.ts.map +1 -0
- package/dist/stage/stageTypes.js +2 -0
- package/dist/stage/stageTypes.js.map +1 -0
- package/dist/stage/stageVisualTest.d.ts +92 -0
- package/dist/stage/stageVisualTest.d.ts.map +1 -0
- package/dist/stage/stageVisualTest.js +5 -0
- package/dist/stage/stageVisualTest.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
/** Default environment presentation used when a route supplies no background settings. */
|
|
3
|
+
export const DEFAULT_BACKGROUND = {
|
|
4
|
+
blurriness: 0.2,
|
|
5
|
+
tint: '#b6deff',
|
|
6
|
+
tintIntensity: 0.3
|
|
7
|
+
};
|
|
8
|
+
/** Fallback panel used by the imperative API when no declarative panels are registered. */
|
|
9
|
+
export const DEFAULT_PANELS = [
|
|
10
|
+
{
|
|
11
|
+
width: 360,
|
|
12
|
+
height: 230,
|
|
13
|
+
radius: 42,
|
|
14
|
+
position: { x: 0, y: 42 },
|
|
15
|
+
backdropBlur: 3,
|
|
16
|
+
refraction: 12,
|
|
17
|
+
tint: '#ffffff',
|
|
18
|
+
tintOpacity: 0.28,
|
|
19
|
+
bezel: 18,
|
|
20
|
+
thickness: 0.35,
|
|
21
|
+
specularOpacity: 0.18,
|
|
22
|
+
shadowIntensity: 0.28,
|
|
23
|
+
opacity: 1
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
export const PANEL_CAMERA_FOV = 36;
|
|
27
|
+
export const PANEL_CONTENT_Z = 0;
|
|
28
|
+
/** Shared maximum tilt for every panel at a pointer edge. */
|
|
29
|
+
export const PANEL_POINTER_MAX_TILT = THREE.MathUtils.degToRad(10);
|
|
30
|
+
export const PANEL_POINTER_MAX_LIFT = 8;
|
|
31
|
+
export const PANEL_POINTER_DAMPING = 12;
|
|
32
|
+
/** Pointer approach distance derived from the short side with a capped aspect correction. */
|
|
33
|
+
export const PANEL_POINTER_PROXIMITY_SCALE = 0.75;
|
|
34
|
+
export const PANEL_POINTER_PROXIMITY_ASPECT_LIMIT = 1.65;
|
|
35
|
+
export const PANEL_POINTER_PROXIMITY_MIN = 72;
|
|
36
|
+
export const PANEL_POINTER_PROXIMITY_MAX = 180;
|
|
37
|
+
export const PANEL_FOCUS_MAX_OFFSET = 190;
|
|
38
|
+
export const PANEL_FOCUS_MAX_ADVANCE = 360;
|
|
39
|
+
/** Caps restored shared-perspective egress on unusually short viewports. */
|
|
40
|
+
export const PANEL_FOCUS_PERSPECTIVE_MAX_SCALE = 1.65;
|
|
41
|
+
export const PANEL_FOCUS_MIN_OPACITY = 0;
|
|
42
|
+
export const PANEL_FOCUS_MAX_BLUR = 7;
|
|
43
|
+
/** Exponential damping applied to mouse-wheel dolly input. */
|
|
44
|
+
export const WHEEL_ZOOM_DAMPING = 8.5;
|
|
45
|
+
/** Exponential damping used while scrolling a close-up back toward the overview. */
|
|
46
|
+
export const ZOOM_RESET_DAMPING = 8.5;
|
|
47
|
+
/** Duration range for an explicit return to the fitted element view. */
|
|
48
|
+
export const VIEW_RESET_MIN_DURATION = 0.3;
|
|
49
|
+
export const VIEW_RESET_MAX_DURATION = 0.8;
|
|
50
|
+
export const MINIMAP_DEFAULT_EXPANDED_HEIGHT = 230;
|
|
51
|
+
/** Viewport inset used only while the minimap is expanded by camera zoom. */
|
|
52
|
+
export const MINIMAP_FOCUSED_VIEWPORT_INSET = 10;
|
|
53
|
+
export const MINIMAP_PANEL_Z = 8;
|
|
54
|
+
export const MINIMAP_POINTER_MODEL_LIFT = 24;
|
|
55
|
+
/** Default model scale at full minimap hover, independent of its dock presentation scale. */
|
|
56
|
+
export const MINIMAP_DEFAULT_HOVER_MODEL_SCALE = 1.16;
|
|
57
|
+
export const MINIMAP_OVERLAY_Z = 0.4;
|
|
58
|
+
export const MINIMAP_VIEWPORT_BORDER_THICKNESS = 3;
|
|
59
|
+
export const MINIMAP_MIN_BLUR_GUARD = 56;
|
|
60
|
+
export const MINIMAP_DEFAULT_OVERLAY_BLUR = 10;
|
|
61
|
+
export const MINIMAP_OVERLAY_REVEAL_DAMPING = 10;
|
|
62
|
+
export const MINIMAP_DEFAULT_CONTEXT_OPACITY = 0;
|
|
63
|
+
export const MINIMAP_DEFAULT_CONTEXT_COLOR = '#000000';
|
|
64
|
+
export const MINIMAP_MODEL_RENDER_ORDER = 14;
|
|
65
|
+
export const MINIMAP_DEFAULT_MODEL_SCALE = 1;
|
|
66
|
+
/** Fraction of the minimap's short side reserved for the element bounding sphere. */
|
|
67
|
+
export const MINIMAP_MODEL_FILL = 0.96;
|
|
68
|
+
/** Suppresses only floating-point noise while keeping DOM focus on the camera timeline. */
|
|
69
|
+
export const ZOOM_FOCUS_NOTIFY_EPSILON = 0.000001;
|
|
70
|
+
/** Responsive spatial-element-fit margin that lets authored silhouettes fill the viewport. */
|
|
71
|
+
export const SPATIAL_ELEMENT_CAMERA_FIT_MARGIN = 1;
|
|
72
|
+
/** Existing default view expressed as orbit angles for backwards-compatible framing. */
|
|
73
|
+
export const DEFAULT_CAMERA_AZIMUTH = THREE.MathUtils.radToDeg(Math.atan2(0.45, 1));
|
|
74
|
+
export const DEFAULT_CAMERA_ELEVATION = THREE.MathUtils.radToDeg(Math.asin(0.28 / Math.hypot(0.45, 0.28, 1)));
|
|
75
|
+
export const DEFAULT_HDR = '';
|
|
76
|
+
export const DEFAULT_GLB = '';
|
|
77
|
+
/** Default element hover outline, tuned to remain visible on light and dark scenes. */
|
|
78
|
+
export const DEFAULT_INTERACTION_THEME = {
|
|
79
|
+
outlineColor: '#7db7ff',
|
|
80
|
+
outlineOpacity: 0.3,
|
|
81
|
+
outlineThickness: 1,
|
|
82
|
+
outlineGlow: 0.9,
|
|
83
|
+
outlineGlowThickness: 8
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=stageConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stageConstants.js","sourceRoot":"","sources":["../../src/stage/stageConstants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAIt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GAAG,QAAQ,CAAC;AAClD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC;AACnD,wFAAwF;AACxF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAC/D,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAC3C,CAAC;AACF,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAE9B,uFAAuF;AACvF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,GAAG;IACnB,gBAAgB,EAAE,CAAC;IACnB,WAAW,EAAE,GAAG;IAChB,oBAAoB,EAAE,CAAC;CACS,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport type { BackgroundSettings, StageInteractionTheme } from './stageTypes.js';\n\n/** Default environment presentation used when a route supplies no background settings. */\nexport const DEFAULT_BACKGROUND = {\n\tblurriness: 0.2,\n\ttint: '#b6deff',\n\ttintIntensity: 0.3\n} satisfies BackgroundSettings;\n\n/** Fallback panel used by the imperative API when no declarative panels are registered. */\nexport const DEFAULT_PANELS = [\n\t{\n\t\twidth: 360,\n\t\theight: 230,\n\t\tradius: 42,\n\t\tposition: { x: 0, y: 42 },\n\t\tbackdropBlur: 3,\n\t\trefraction: 12,\n\t\ttint: '#ffffff',\n\t\ttintOpacity: 0.28,\n\t\tbezel: 18,\n\t\tthickness: 0.35,\n\t\tspecularOpacity: 0.18,\n\t\tshadowIntensity: 0.28,\n\t\topacity: 1\n\t}\n] satisfies LiquidGlassPanelOptions[];\n\nexport const PANEL_CAMERA_FOV = 36;\nexport const PANEL_CONTENT_Z = 0;\n/** Shared maximum tilt for every panel at a pointer edge. */\nexport const PANEL_POINTER_MAX_TILT = THREE.MathUtils.degToRad(10);\nexport const PANEL_POINTER_MAX_LIFT = 8;\nexport const PANEL_POINTER_DAMPING = 12;\n/** Pointer approach distance derived from the short side with a capped aspect correction. */\nexport const PANEL_POINTER_PROXIMITY_SCALE = 0.75;\nexport const PANEL_POINTER_PROXIMITY_ASPECT_LIMIT = 1.65;\nexport const PANEL_POINTER_PROXIMITY_MIN = 72;\nexport const PANEL_POINTER_PROXIMITY_MAX = 180;\nexport const PANEL_FOCUS_MAX_OFFSET = 190;\nexport const PANEL_FOCUS_MAX_ADVANCE = 360;\n/** Caps restored shared-perspective egress on unusually short viewports. */\nexport const PANEL_FOCUS_PERSPECTIVE_MAX_SCALE = 1.65;\nexport const PANEL_FOCUS_MIN_OPACITY = 0;\nexport const PANEL_FOCUS_MAX_BLUR = 7;\n/** Exponential damping applied to mouse-wheel dolly input. */\nexport const WHEEL_ZOOM_DAMPING = 8.5;\n/** Exponential damping used while scrolling a close-up back toward the overview. */\nexport const ZOOM_RESET_DAMPING = 8.5;\n/** Duration range for an explicit return to the fitted element view. */\nexport const VIEW_RESET_MIN_DURATION = 0.3;\nexport const VIEW_RESET_MAX_DURATION = 0.8;\nexport const MINIMAP_DEFAULT_EXPANDED_HEIGHT = 230;\n/** Viewport inset used only while the minimap is expanded by camera zoom. */\nexport const MINIMAP_FOCUSED_VIEWPORT_INSET = 10;\nexport const MINIMAP_PANEL_Z = 8;\nexport const MINIMAP_POINTER_MODEL_LIFT = 24;\n/** Default model scale at full minimap hover, independent of its dock presentation scale. */\nexport const MINIMAP_DEFAULT_HOVER_MODEL_SCALE = 1.16;\nexport const MINIMAP_OVERLAY_Z = 0.4;\nexport const MINIMAP_VIEWPORT_BORDER_THICKNESS = 3;\nexport const MINIMAP_MIN_BLUR_GUARD = 56;\nexport const MINIMAP_DEFAULT_OVERLAY_BLUR = 10;\nexport const MINIMAP_OVERLAY_REVEAL_DAMPING = 10;\nexport const MINIMAP_DEFAULT_CONTEXT_OPACITY = 0;\nexport const MINIMAP_DEFAULT_CONTEXT_COLOR = '#000000';\nexport const MINIMAP_MODEL_RENDER_ORDER = 14;\nexport const MINIMAP_DEFAULT_MODEL_SCALE = 1;\n/** Fraction of the minimap's short side reserved for the element bounding sphere. */\nexport const MINIMAP_MODEL_FILL = 0.96;\n/** Suppresses only floating-point noise while keeping DOM focus on the camera timeline. */\nexport const ZOOM_FOCUS_NOTIFY_EPSILON = 0.000001;\n/** Responsive spatial-element-fit margin that lets authored silhouettes fill the viewport. */\nexport const SPATIAL_ELEMENT_CAMERA_FIT_MARGIN = 1;\n/** Existing default view expressed as orbit angles for backwards-compatible framing. */\nexport const DEFAULT_CAMERA_AZIMUTH = THREE.MathUtils.radToDeg(Math.atan2(0.45, 1));\nexport const DEFAULT_CAMERA_ELEVATION = THREE.MathUtils.radToDeg(\n\tMath.asin(0.28 / Math.hypot(0.45, 0.28, 1))\n);\nexport const DEFAULT_HDR = '';\nexport const DEFAULT_GLB = '';\n\n/** Default element hover outline, tuned to remain visible on light and dark scenes. */\nexport const DEFAULT_INTERACTION_THEME = {\n\toutlineColor: '#7db7ff',\n\toutlineOpacity: 0.3,\n\toutlineThickness: 1,\n\toutlineGlow: 0.9,\n\toutlineGlowThickness: 8\n} satisfies StageInteractionTheme;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Returns true when a pointer event belongs to interactive stage UI instead of the model. */
|
|
2
|
+
export declare function isStageUiTarget(target: EventTarget | null): boolean;
|
|
3
|
+
/** Converts a DOM rectangle center into the stage's centered, y-up coordinate system. */
|
|
4
|
+
export declare function getStagePositionFromRect(rect: Pick<DOMRect, 'height' | 'left' | 'top' | 'width'>): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
/** Returns whether a rectangle intersects the viewport plus an optional preload margin. */
|
|
9
|
+
export declare function isViewportRectVisible(rect: Pick<DOMRect, 'bottom' | 'left' | 'right' | 'top'>, viewportWidth: number, viewportHeight: number, margin?: number): boolean;
|
|
10
|
+
//# sourceMappingURL=stageDom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stageDom.d.ts","sourceRoot":"","sources":["../../src/stage/stageDom.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,WAOzD;AAED,yFAAyF;AACzF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;;;EAKhG;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,EACxD,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,MAAM,SAAI,WASV"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Returns true when a pointer event belongs to interactive stage UI instead of the model. */
|
|
2
|
+
export function isStageUiTarget(target) {
|
|
3
|
+
if (!(target instanceof Element))
|
|
4
|
+
return false;
|
|
5
|
+
return Boolean(target.closest('[data-stage-panel-content], [data-stage-panel-css-surface], [data-stage-panel-fallback], button, a, input, textarea, select, summary'));
|
|
6
|
+
}
|
|
7
|
+
/** Converts a DOM rectangle center into the stage's centered, y-up coordinate system. */
|
|
8
|
+
export function getStagePositionFromRect(rect) {
|
|
9
|
+
return {
|
|
10
|
+
x: rect.left + rect.width * 0.5 - window.innerWidth * 0.5,
|
|
11
|
+
y: window.innerHeight * 0.5 - (rect.top + rect.height * 0.5)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** Returns whether a rectangle intersects the viewport plus an optional preload margin. */
|
|
15
|
+
export function isViewportRectVisible(rect, viewportWidth, viewportHeight, margin = 0) {
|
|
16
|
+
const safeMargin = Math.max(Number.isFinite(margin) ? margin : 0, 0);
|
|
17
|
+
return (rect.right >= -safeMargin &&
|
|
18
|
+
rect.left <= viewportWidth + safeMargin &&
|
|
19
|
+
rect.bottom >= -safeMargin &&
|
|
20
|
+
rect.top <= viewportHeight + safeMargin);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=stageDom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stageDom.js","sourceRoot":"","sources":["../../src/stage/stageDom.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,UAAU,eAAe,CAAC,MAA0B;IACzD,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/C,OAAO,OAAO,CACb,MAAM,CAAC,OAAO,CACb,sIAAsI,CACtI,CACD,CAAC;AACH,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,wBAAwB,CAAC,IAAwD;IAChG,OAAO;QACN,CAAC,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,UAAU,GAAG,GAAG;QACzD,CAAC,EAAE,MAAM,CAAC,WAAW,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;KAC5D,CAAC;AACH,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,qBAAqB,CACpC,IAAwD,EACxD,aAAqB,EACrB,cAAsB,EACtB,MAAM,GAAG,CAAC;IAEV,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACrE,OAAO,CACN,IAAI,CAAC,KAAK,IAAI,CAAC,UAAU;QACzB,IAAI,CAAC,IAAI,IAAI,aAAa,GAAG,UAAU;QACvC,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU;QAC1B,IAAI,CAAC,GAAG,IAAI,cAAc,GAAG,UAAU,CACvC,CAAC;AACH,CAAC","sourcesContent":["/** Returns true when a pointer event belongs to interactive stage UI instead of the model. */\nexport function isStageUiTarget(target: EventTarget | null) {\n\tif (!(target instanceof Element)) return false;\n\treturn Boolean(\n\t\ttarget.closest(\n\t\t\t'[data-stage-panel-content], [data-stage-panel-css-surface], [data-stage-panel-fallback], button, a, input, textarea, select, summary'\n\t\t)\n\t);\n}\n\n/** Converts a DOM rectangle center into the stage's centered, y-up coordinate system. */\nexport function getStagePositionFromRect(rect: Pick<DOMRect, 'height' | 'left' | 'top' | 'width'>) {\n\treturn {\n\t\tx: rect.left + rect.width * 0.5 - window.innerWidth * 0.5,\n\t\ty: window.innerHeight * 0.5 - (rect.top + rect.height * 0.5)\n\t};\n}\n\n/** Returns whether a rectangle intersects the viewport plus an optional preload margin. */\nexport function isViewportRectVisible(\n\trect: Pick<DOMRect, 'bottom' | 'left' | 'right' | 'top'>,\n\tviewportWidth: number,\n\tviewportHeight: number,\n\tmargin = 0\n) {\n\tconst safeMargin = Math.max(Number.isFinite(margin) ? margin : 0, 0);\n\treturn (\n\t\trect.right >= -safeMargin &&\n\t\trect.left <= viewportWidth + safeMargin &&\n\t\trect.bottom >= -safeMargin &&\n\t\trect.top <= viewportHeight + safeMargin\n\t);\n}\n"]}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
import type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';
|
|
3
|
+
/** Resolves declarative orbit angles to a normalized direction from element to camera. */
|
|
4
|
+
export declare function getCameraOrbitDirection(azimuth?: number, elevation?: number): THREE.Vector3;
|
|
5
|
+
/** Resolves orbit angles to the world-space orientation of a camera looking at the element. */
|
|
6
|
+
export declare function getCameraOrbitQuaternion(azimuth?: number, elevation?: number): THREE.Quaternion;
|
|
7
|
+
/** Applies the cubic Hermite smoothstep curve with clamped endpoints. */
|
|
8
|
+
export declare function smoothstep(edge0: number, edge1: number, value: number): number;
|
|
9
|
+
/** Lets close-up resets travel longer while keeping small corrections responsive. */
|
|
10
|
+
export declare function getViewResetDuration(focus: number): number;
|
|
11
|
+
/** Provides a zero-velocity start and finish for the fitted-view return. */
|
|
12
|
+
export declare function getViewResetInterpolation(elapsed: number, duration: number): number;
|
|
13
|
+
/**
|
|
14
|
+
* Remaps camera focus to the earlier UI-clearance phase.
|
|
15
|
+
*
|
|
16
|
+
* Page content and ordinary panels deliberately clear before the minimap grows,
|
|
17
|
+
* preventing the expanding minimap from colliding with nearby interface elements.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getStageUiFocus(focus: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Remaps camera focus to the short, delayed minimap phase.
|
|
22
|
+
*
|
|
23
|
+
* The minimap remains thumbnail-sized while the surrounding interface begins to
|
|
24
|
+
* clear, then reaches its complete expanded size at 78% camera focus.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getMinimapFocus(focus: number): number;
|
|
27
|
+
/**
|
|
28
|
+
* Gates minimap expansion behind the UI-clearance phase.
|
|
29
|
+
*
|
|
30
|
+
* Both values originate from the same smoothed camera focus. The gate retains the
|
|
31
|
+
* intentional lead of ordinary content without adding another temporal lag.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getSequencedMinimapFocus(focus: number, uiFocus: number): number;
|
|
34
|
+
/**
|
|
35
|
+
* Moves an expanding minimap from its authored panel position to a viewport inset.
|
|
36
|
+
* A zero focus returns the exact resting position; a full focus pins its top-left
|
|
37
|
+
* corner to the requested inset independently of the expanded dimensions.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getMinimapFocusPositionOffset(basePosition: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
}, baseSize: {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}, visualSize: {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
}, viewportSize: {
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
}, focus: number, inset: number): {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
};
|
|
55
|
+
/** Normalizes browser wheel units to the pixel-based delta used by OrbitControls. */
|
|
56
|
+
export declare function normalizeWheelZoomDelta(deltaY: number, deltaMode: number, ctrlKey: boolean): number;
|
|
57
|
+
/** Accumulates an OrbitControls-compatible wheel gesture into a clamped zoom target. */
|
|
58
|
+
export declare function getWheelZoomTargetDistance(currentTargetDistance: number, deltaY: number, zoomSpeed: number, minDistance: number, maxDistance: number): number;
|
|
59
|
+
/** Resolves the authored minimap scale without imposing an upper creative limit. */
|
|
60
|
+
export declare function resolveMinimapModelScale(modelScale?: number, fallback?: number): number;
|
|
61
|
+
/** Blends the configured model multiplier through the damped minimap hover state. */
|
|
62
|
+
export declare function getMinimapHoverScale(hoverModelScale: number, pointerReveal: number): number;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the same opacity used by ordinary panels during close-up focus.
|
|
65
|
+
*
|
|
66
|
+
* Keeping DOM content and panel opacity on one curve prevents either layer from
|
|
67
|
+
* disappearing first while the phase-delayed minimap begins to grow.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getStageDomFocusOpacity(uiFocus: number): number;
|
|
70
|
+
/**
|
|
71
|
+
* Defines the camera-distance interval used by the shared close-up focus effect.
|
|
72
|
+
* Starting near the fitted view gives panels and page content enough travel to
|
|
73
|
+
* clear progressively before the element fills the viewport.
|
|
74
|
+
*/
|
|
75
|
+
export declare function getZoomFocusDistanceRange(maxDistance: number, modelRadius: number): {
|
|
76
|
+
closeDistance: number;
|
|
77
|
+
restDistance: number;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Converts camera-to-target distance into a FOV-independent visual distance.
|
|
81
|
+
* This keeps focus effects and zoom limits coherent when a SpaceMouse changes
|
|
82
|
+
* perspective FOV while ordinary OrbitControls continue to dolly the camera.
|
|
83
|
+
*/
|
|
84
|
+
export declare function getEffectiveCameraDistance(distance: number, currentFov: number, referenceFov: number): number;
|
|
85
|
+
/** Maps dolly and perspective-FOV zoom to the same normalized element focus. */
|
|
86
|
+
export declare function getCameraZoomFocus(distance: number, currentFov: number, referenceFov: number, closeDistance: number, restDistance: number): number;
|
|
87
|
+
/**
|
|
88
|
+
* Chooses the distance that best represents the element's visible magnification.
|
|
89
|
+
* OrbitControls reduces its target distance, while 3DxWare may dolly camera and
|
|
90
|
+
* target together and only reduce the distance to the element itself.
|
|
91
|
+
*/
|
|
92
|
+
export declare function getCameraZoomReferenceDistance(viewTargetDistance: number, spatialElementCenterDistance: number): number;
|
|
93
|
+
/** Returns the perspective camera distance that maps viewport pixels to world units. */
|
|
94
|
+
export declare function getPerspectiveDistance(viewportHeight: number, fov: number): number;
|
|
95
|
+
/**
|
|
96
|
+
* Places an untransformed panel around its stage-space center and aligns its
|
|
97
|
+
* top-left corner to the device pixel grid for crisp native DOM text.
|
|
98
|
+
*/
|
|
99
|
+
export declare function getNativePanelDomPosition(center: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
}, size: {
|
|
103
|
+
width: number;
|
|
104
|
+
height: number;
|
|
105
|
+
}, viewport: {
|
|
106
|
+
width: number;
|
|
107
|
+
height: number;
|
|
108
|
+
}, devicePixelRatio?: number): {
|
|
109
|
+
left: number;
|
|
110
|
+
top: number;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Compensates an x/y panel anchor when it advances toward a perspective camera.
|
|
114
|
+
*
|
|
115
|
+
* Without this correction, a panel appears to drift away from its DOM anchor as its
|
|
116
|
+
* z position changes.
|
|
117
|
+
*/
|
|
118
|
+
export declare function getPerspectiveAnchoredPanelPosition(targetX: number, targetY: number, currentZ: number, cameraDistance: number): {
|
|
119
|
+
x: number;
|
|
120
|
+
y: number;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Restores the outward screen-space drift that an off-axis panel would receive
|
|
124
|
+
* from the shared perspective while leaving its hover projection panel-local.
|
|
125
|
+
*/
|
|
126
|
+
export declare function getPanelFocusPerspectiveOffset(position: {
|
|
127
|
+
x: number;
|
|
128
|
+
y: number;
|
|
129
|
+
}, advance: number, cameraDistance: number): {
|
|
130
|
+
x: number;
|
|
131
|
+
y: number;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Builds a local projection root for a panel rendered by the shared stage camera.
|
|
135
|
+
*
|
|
136
|
+
* The translation keeps the panel anchored while it moves in depth. The z shear
|
|
137
|
+
* cancels the shared camera's off-axis perspective, so rotated children converge
|
|
138
|
+
* on the panel center instead of the viewport center.
|
|
139
|
+
*/
|
|
140
|
+
export declare function setPanelLocalPerspectiveMatrix(target: THREE.Matrix4, targetX: number, targetY: number, currentZ: number, cameraDistance: number): THREE.Matrix4;
|
|
141
|
+
/**
|
|
142
|
+
* Calculates the nearest camera distance that contains an oriented bounding box.
|
|
143
|
+
*
|
|
144
|
+
* @param bounds - World-space bounds of the object to frame.
|
|
145
|
+
* @param viewDirection - Direction from the target toward the camera.
|
|
146
|
+
* @param camera - Camera whose FOV and aspect define the frame.
|
|
147
|
+
* @param margin - Multiplicative padding around the fitted object.
|
|
148
|
+
* @param viewportScale - Fraction of the browser viewport available to the element.
|
|
149
|
+
*/
|
|
150
|
+
export declare function getCameraFitDistance(bounds: THREE.Box3, viewDirection: THREE.Vector3, camera: THREE.PerspectiveCamera, margin?: number, viewportScale?: {
|
|
151
|
+
x: number;
|
|
152
|
+
y: number;
|
|
153
|
+
}): number;
|
|
154
|
+
/** Returns the eight corners of an axis-aligned bounding box. */
|
|
155
|
+
export declare function getBoxCorners(bounds: THREE.Box3): THREE.Vector3[];
|
|
156
|
+
/** Computes the camera-facing travel used to clear panels during close-up zoom. */
|
|
157
|
+
export declare function getPanelFocusOffset(options: Required<LiquidGlassPanelOptions>, focus: number, viewportWidth: number, viewportHeight: number): {
|
|
158
|
+
x: number;
|
|
159
|
+
y: number;
|
|
160
|
+
z: number;
|
|
161
|
+
};
|
|
162
|
+
/** Chooses the least disruptive edge toward which a focused panel should travel. */
|
|
163
|
+
export declare function getPanelFocusDirection(options: Required<LiquidGlassPanelOptions>, normalizedX: number, normalizedY: number): THREE.Vector2;
|
|
164
|
+
/** Returns panel opacity at a normalized stage focus level. */
|
|
165
|
+
export declare function getPanelFocusOpacity(focus: number): number;
|
|
166
|
+
/** Returns CSS content blur at a normalized stage focus level. */
|
|
167
|
+
export declare function getPanelFocusBlur(focus: number, options: Required<LiquidGlassPanelOptions>): number;
|
|
168
|
+
/**
|
|
169
|
+
* Reduces only the rotation axis amplified by an elongated panel.
|
|
170
|
+
* Square panels keep the full response on both axes.
|
|
171
|
+
*/
|
|
172
|
+
export declare function getPanelAspectTiltScale(width: number, height: number): {
|
|
173
|
+
azimuth: number;
|
|
174
|
+
elevation: number;
|
|
175
|
+
};
|
|
176
|
+
/** Returns the independent approach band for one panel. */
|
|
177
|
+
export declare function getPanelPointerProximity(width: number, height: number): number;
|
|
178
|
+
/** Converts distance from a panel edge into a smooth zero-to-one hover influence. */
|
|
179
|
+
export declare function getPanelPointerInfluence(distance: number, width: number, height: number): number;
|
|
180
|
+
/** Resolves a pointer-relative pose with axis-specific aspect-ratio attenuation. */
|
|
181
|
+
export declare function getPanelPointerRotation(lookX: number, lookY: number, influence: number, width: number, height: number): {
|
|
182
|
+
x: number;
|
|
183
|
+
y: number;
|
|
184
|
+
};
|
|
185
|
+
/** Detects panel geometry changes that require a WebGPU mesh rebuild. */
|
|
186
|
+
export declare function hasPanelGeometryChanged(current: Required<LiquidGlassPanelOptions>, next: LiquidGlassPanelOptions): boolean;
|
|
187
|
+
//# sourceMappingURL=stageMath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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