@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,113 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
export { getProjectiveCssMatrix3d } from '../cssProjection.js';
|
|
3
|
+
/**
|
|
4
|
+
* Fits a compact clipping range around the panel and live minimap model.
|
|
5
|
+
*
|
|
6
|
+
* The regular panel camera spans thousands of world units. Reusing that range
|
|
7
|
+
* for thumbnail geometry collapses closely layered element surfaces into the
|
|
8
|
+
* same depth values, so a small pointer tilt can make their fragments alternate.
|
|
9
|
+
*/
|
|
10
|
+
export function getMinimapDepthRange(bounds, guard = 16, minimumNear = 0.01) {
|
|
11
|
+
const safeGuard = Math.max(Number.isFinite(guard) ? guard : 0, 0);
|
|
12
|
+
const safeMinimumNear = Math.max(Number.isFinite(minimumNear) ? minimumNear : 0.01, 0.000001);
|
|
13
|
+
let near = Number.POSITIVE_INFINITY;
|
|
14
|
+
let far = Number.NEGATIVE_INFINITY;
|
|
15
|
+
bounds.forEach(({ distance, radius }) => {
|
|
16
|
+
if (!Number.isFinite(distance) || distance <= 0)
|
|
17
|
+
return;
|
|
18
|
+
const safeRadius = Math.max(Number.isFinite(radius) ? radius : 0, 0);
|
|
19
|
+
near = Math.min(near, distance - safeRadius);
|
|
20
|
+
far = Math.max(far, distance + safeRadius);
|
|
21
|
+
});
|
|
22
|
+
if (!Number.isFinite(near) || !Number.isFinite(far)) {
|
|
23
|
+
return { near: safeMinimumNear, far: safeMinimumNear + 1 };
|
|
24
|
+
}
|
|
25
|
+
near = Math.max(near - safeGuard, safeMinimumNear);
|
|
26
|
+
far = Math.max(far + safeGuard, near + 0.01);
|
|
27
|
+
return { near, far };
|
|
28
|
+
}
|
|
29
|
+
/** Returns the FOV that makes panel-local world units match CSS pixels at a distance. */
|
|
30
|
+
export function getPanelLocalCameraFov(panelHeight, distance) {
|
|
31
|
+
return THREE.MathUtils.radToDeg(2 * Math.atan(Math.max(panelHeight, 1) / (Math.max(distance, 1) * 2)));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Projects the main camera frustum onto the minimap model's target plane.
|
|
35
|
+
*
|
|
36
|
+
* The conversion intentionally passes through model-local coordinates. This keeps
|
|
37
|
+
* panning and orbiting stable even though the minimap layer itself follows a tilted
|
|
38
|
+
* panel in screen space.
|
|
39
|
+
*/
|
|
40
|
+
export function getMinimapViewportRect(stageCamera, minimapCamera, target, stageModel, minimapSourceRoot, minimapSourceLayer, width, height) {
|
|
41
|
+
const stageForward = new THREE.Vector3();
|
|
42
|
+
stageCamera.getWorldDirection(stageForward);
|
|
43
|
+
if (stageForward.lengthSq() < 0.0001)
|
|
44
|
+
return null;
|
|
45
|
+
const targetPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(stageForward, target);
|
|
46
|
+
const stageOrigin = stageCamera.getWorldPosition(new THREE.Vector3());
|
|
47
|
+
const stageRay = new THREE.Ray();
|
|
48
|
+
const hit = new THREE.Vector3();
|
|
49
|
+
const projected = [];
|
|
50
|
+
const corners = [
|
|
51
|
+
new THREE.Vector3(-1, -1, 0.5),
|
|
52
|
+
new THREE.Vector3(1, -1, 0.5),
|
|
53
|
+
new THREE.Vector3(1, 1, 0.5),
|
|
54
|
+
new THREE.Vector3(-1, 1, 0.5)
|
|
55
|
+
];
|
|
56
|
+
stageCamera.updateMatrixWorld(true);
|
|
57
|
+
stageModel.updateWorldMatrix(true, true);
|
|
58
|
+
minimapSourceRoot.updateWorldMatrix(true, true);
|
|
59
|
+
minimapSourceLayer.updateWorldMatrix(true, true);
|
|
60
|
+
minimapCamera.updateMatrixWorld(true);
|
|
61
|
+
corners.forEach((corner) => {
|
|
62
|
+
const worldPoint = corner.clone().unproject(stageCamera);
|
|
63
|
+
const direction = worldPoint.sub(stageOrigin).normalize();
|
|
64
|
+
stageRay.set(stageOrigin, direction);
|
|
65
|
+
const intersection = stageRay.intersectPlane(targetPlane, hit);
|
|
66
|
+
if (!intersection)
|
|
67
|
+
return;
|
|
68
|
+
const modelPoint = stageModel.worldToLocal(intersection.clone());
|
|
69
|
+
const minimapPoint = minimapSourceRoot.localToWorld(modelPoint);
|
|
70
|
+
// The camera is panel-local, so remove the layer's shared screen transform.
|
|
71
|
+
minimapSourceLayer.worldToLocal(minimapPoint);
|
|
72
|
+
const ndc = minimapPoint.project(minimapCamera);
|
|
73
|
+
if (!Number.isFinite(ndc.x) || !Number.isFinite(ndc.y))
|
|
74
|
+
return;
|
|
75
|
+
projected.push(new THREE.Vector2(ndc.x * width * 0.5, ndc.y * height * 0.5));
|
|
76
|
+
});
|
|
77
|
+
if (projected.length < 4)
|
|
78
|
+
return null;
|
|
79
|
+
const minX = Math.min(...projected.map((point) => point.x));
|
|
80
|
+
const maxX = Math.max(...projected.map((point) => point.x));
|
|
81
|
+
const minY = Math.min(...projected.map((point) => point.y));
|
|
82
|
+
const maxY = Math.max(...projected.map((point) => point.y));
|
|
83
|
+
const centerX = (minX + maxX) * 0.5;
|
|
84
|
+
const centerY = (minY + maxY) * 0.5;
|
|
85
|
+
let rectWidth = maxX - minX;
|
|
86
|
+
let rectHeight = maxY - minY;
|
|
87
|
+
if (!Number.isFinite(rectWidth) ||
|
|
88
|
+
!Number.isFinite(rectHeight) ||
|
|
89
|
+
rectWidth <= 0 ||
|
|
90
|
+
rectHeight <= 0) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const minSize = 8;
|
|
94
|
+
const minScale = Math.max(minSize / rectWidth, minSize / rectHeight, 1);
|
|
95
|
+
rectWidth *= minScale;
|
|
96
|
+
rectHeight *= minScale;
|
|
97
|
+
const fitScale = Math.min(width / rectWidth, height / rectHeight, 1);
|
|
98
|
+
rectWidth *= fitScale;
|
|
99
|
+
rectHeight *= fitScale;
|
|
100
|
+
const maxCenterX = Math.max((width - rectWidth) * 0.5, 0);
|
|
101
|
+
const maxCenterY = Math.max((height - rectHeight) * 0.5, 0);
|
|
102
|
+
return {
|
|
103
|
+
x: THREE.MathUtils.clamp(centerX, -maxCenterX, maxCenterX),
|
|
104
|
+
y: THREE.MathUtils.clamp(centerY, -maxCenterY, maxCenterY),
|
|
105
|
+
width: rectWidth,
|
|
106
|
+
height: rectHeight
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/** Normalizes a CSS blur radius before it is passed to the WebGPU blur pipeline. */
|
|
110
|
+
export function getMinimapCssBlurRadius(blur) {
|
|
111
|
+
return Math.max(blur, 0);
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=MinimapProjection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinimapProjection.js","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapProjection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAU/D;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAAoC,EACpC,KAAK,GAAG,EAAE,EACV,WAAW,GAAG,IAAI;IAElB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAClE,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9F,IAAI,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACpC,IAAI,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAEnC,MAAM,CAAC,OAAO,CAAC,CAAC,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vB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC;IACrE,SAAS,IAAI,QAAQ,CAAC;IACtB,UAAU,IAAI,QAAQ,CAAC;IACvB,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;IAE5D,OAAO;QACN,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;QAC1D,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;QAC1D,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,UAAU;KAClB,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,uBAAuB,CAAC,IAAY;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport type { Object3D } from 'three';\n\nexport { getProjectiveCssMatrix3d } from '../cssProjection.js';\nexport type { CssProjectionPoint, CssProjectionQuad } from '../cssProjection.js';\n\nexport interface MinimapDepthBound {\n\t/** Positive camera-space distance to the bound's center. */\n\tdistance: number;\n\t/** Camera-space radius that must remain inside the clipping range. */\n\tradius: number;\n}\n\n/**\n * Fits a compact clipping range around the panel and live minimap model.\n *\n * The regular panel camera spans thousands of world units. Reusing that range\n * for thumbnail geometry collapses closely layered element surfaces into the\n * same depth values, so a small pointer tilt can make their fragments alternate.\n */\nexport function getMinimapDepthRange(\n\tbounds: readonly MinimapDepthBound[],\n\tguard = 16,\n\tminimumNear = 0.01\n) {\n\tconst safeGuard = Math.max(Number.isFinite(guard) ? guard : 0, 0);\n\tconst safeMinimumNear = Math.max(Number.isFinite(minimumNear) ? minimumNear : 0.01, 0.000001);\n\tlet near = Number.POSITIVE_INFINITY;\n\tlet far = Number.NEGATIVE_INFINITY;\n\n\tbounds.forEach(({ distance, radius }) => {\n\t\tif (!Number.isFinite(distance) || distance <= 0) return;\n\t\tconst safeRadius = Math.max(Number.isFinite(radius) ? radius : 0, 0);\n\t\tnear = Math.min(near, distance - safeRadius);\n\t\tfar = Math.max(far, distance + safeRadius);\n\t});\n\n\tif (!Number.isFinite(near) || !Number.isFinite(far)) {\n\t\treturn { near: safeMinimumNear, far: safeMinimumNear + 1 };\n\t}\n\n\tnear = Math.max(near - safeGuard, safeMinimumNear);\n\tfar = Math.max(far + safeGuard, near + 0.01);\n\treturn { near, far };\n}\n\n/** Returns the FOV that makes panel-local world units match CSS pixels at a distance. */\nexport function getPanelLocalCameraFov(panelHeight: number, distance: number) {\n\treturn THREE.MathUtils.radToDeg(\n\t\t2 * Math.atan(Math.max(panelHeight, 1) / (Math.max(distance, 1) * 2))\n\t);\n}\n\n/** Rectangle, in panel-local pixels, occupied by the main camera's current view. */\nexport interface MinimapViewportRect {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * Projects the main camera frustum onto the minimap model's target plane.\n *\n * The conversion intentionally passes through model-local coordinates. This keeps\n * panning and orbiting stable even though the minimap layer itself follows a tilted\n * panel in screen space.\n */\nexport function getMinimapViewportRect(\n\tstageCamera: THREE.PerspectiveCamera,\n\tminimapCamera: THREE.PerspectiveCamera,\n\ttarget: THREE.Vector3,\n\tstageModel: Object3D,\n\tminimapSourceRoot: Object3D,\n\tminimapSourceLayer: Object3D,\n\twidth: number,\n\theight: number\n): MinimapViewportRect | null {\n\tconst stageForward = new THREE.Vector3();\n\tstageCamera.getWorldDirection(stageForward);\n\tif (stageForward.lengthSq() < 0.0001) return null;\n\n\tconst targetPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(stageForward, target);\n\tconst stageOrigin = stageCamera.getWorldPosition(new THREE.Vector3());\n\tconst stageRay = new THREE.Ray();\n\tconst hit = new THREE.Vector3();\n\tconst projected: THREE.Vector2[] = [];\n\tconst corners = [\n\t\tnew THREE.Vector3(-1, -1, 0.5),\n\t\tnew THREE.Vector3(1, -1, 0.5),\n\t\tnew THREE.Vector3(1, 1, 0.5),\n\t\tnew THREE.Vector3(-1, 1, 0.5)\n\t];\n\n\tstageCamera.updateMatrixWorld(true);\n\tstageModel.updateWorldMatrix(true, true);\n\tminimapSourceRoot.updateWorldMatrix(true, true);\n\tminimapSourceLayer.updateWorldMatrix(true, true);\n\tminimapCamera.updateMatrixWorld(true);\n\n\tcorners.forEach((corner) => {\n\t\tconst worldPoint = corner.clone().unproject(stageCamera);\n\t\tconst direction = worldPoint.sub(stageOrigin).normalize();\n\t\tstageRay.set(stageOrigin, direction);\n\t\tconst intersection = stageRay.intersectPlane(targetPlane, hit);\n\t\tif (!intersection) return;\n\n\t\tconst modelPoint = stageModel.worldToLocal(intersection.clone());\n\t\tconst minimapPoint = minimapSourceRoot.localToWorld(modelPoint);\n\t\t// The camera is panel-local, so remove the layer's shared screen transform.\n\t\tminimapSourceLayer.worldToLocal(minimapPoint);\n\t\tconst ndc = minimapPoint.project(minimapCamera);\n\t\tif (!Number.isFinite(ndc.x) || !Number.isFinite(ndc.y)) return;\n\t\tprojected.push(new THREE.Vector2(ndc.x * width * 0.5, ndc.y * height * 0.5));\n\t});\n\n\tif (projected.length < 4) return null;\n\tconst minX = Math.min(...projected.map((point) => point.x));\n\tconst maxX = Math.max(...projected.map((point) => point.x));\n\tconst minY = Math.min(...projected.map((point) => point.y));\n\tconst maxY = Math.max(...projected.map((point) => point.y));\n\tconst centerX = (minX + maxX) * 0.5;\n\tconst centerY = (minY + maxY) * 0.5;\n\tlet rectWidth = maxX - minX;\n\tlet rectHeight = maxY - minY;\n\tif (\n\t\t!Number.isFinite(rectWidth) ||\n\t\t!Number.isFinite(rectHeight) ||\n\t\trectWidth <= 0 ||\n\t\trectHeight <= 0\n\t) {\n\t\treturn null;\n\t}\n\n\tconst minSize = 8;\n\tconst minScale = Math.max(minSize / rectWidth, minSize / rectHeight, 1);\n\trectWidth *= minScale;\n\trectHeight *= minScale;\n\tconst fitScale = Math.min(width / rectWidth, height / rectHeight, 1);\n\trectWidth *= fitScale;\n\trectHeight *= fitScale;\n\tconst maxCenterX = Math.max((width - rectWidth) * 0.5, 0);\n\tconst maxCenterY = Math.max((height - rectHeight) * 0.5, 0);\n\n\treturn {\n\t\tx: THREE.MathUtils.clamp(centerX, -maxCenterX, maxCenterX),\n\t\ty: THREE.MathUtils.clamp(centerY, -maxCenterY, maxCenterY),\n\t\twidth: rectWidth,\n\t\theight: rectHeight\n\t};\n}\n\n/** Normalizes a CSS blur radius before it is passed to the WebGPU blur pipeline. */\nexport function getMinimapCssBlurRadius(blur: number) {\n\treturn Math.max(blur, 0);\n}\n"]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
import type { Material, Object3D } from 'three';
|
|
3
|
+
import type { MinimapBlurPipeline } from '../MinimapBlurPipeline.js';
|
|
4
|
+
import type { StageMinimapOptions } from '../stageTypes.js';
|
|
5
|
+
export type ResolvedStageMinimapOptions = Required<Omit<StageMinimapOptions, 'dockedView'>>;
|
|
6
|
+
/** Original material state retained while the live minimap model fades in and out. */
|
|
7
|
+
export interface MinimapMaterialOpacityState {
|
|
8
|
+
material: Material;
|
|
9
|
+
opacity: number;
|
|
10
|
+
transparent: boolean;
|
|
11
|
+
depthWrite: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Owns all resources and animated values for one panel-backed element minimap.
|
|
15
|
+
*
|
|
16
|
+
* The live display model stays separate from the isolated blur capture so pointer
|
|
17
|
+
* interaction cannot change the pixels used by the overlay.
|
|
18
|
+
*/
|
|
19
|
+
export interface StageMinimapState {
|
|
20
|
+
panelIndex: number;
|
|
21
|
+
screenCamera: THREE.PerspectiveCamera;
|
|
22
|
+
camera: THREE.PerspectiveCamera;
|
|
23
|
+
captureCamera: THREE.PerspectiveCamera;
|
|
24
|
+
model: Object3D;
|
|
25
|
+
sourceRoot: Object3D;
|
|
26
|
+
displayModel: Object3D;
|
|
27
|
+
/** Canonical element root within the minimap's centering/orientation hierarchy. */
|
|
28
|
+
spatialElementRoot: Object3D;
|
|
29
|
+
/** Per-mesh bound points expressed in the centered display model's local coordinates. */
|
|
30
|
+
modelBoundsPoints: THREE.Vector3[];
|
|
31
|
+
/** Camera-relative element pose captured from the fitted initial stage view. */
|
|
32
|
+
restQuaternion: THREE.Quaternion;
|
|
33
|
+
/** Optional camera-relative element pose authored for the docked presentation. */
|
|
34
|
+
dockedQuaternion?: THREE.Quaternion;
|
|
35
|
+
displayMaterials: MinimapMaterialOpacityState[];
|
|
36
|
+
displayOpacity: number;
|
|
37
|
+
layer: THREE.Group;
|
|
38
|
+
modelRadius: number;
|
|
39
|
+
baseWidth: number;
|
|
40
|
+
baseHeight: number;
|
|
41
|
+
baseRadius: number;
|
|
42
|
+
currentWidth: number;
|
|
43
|
+
currentHeight: number;
|
|
44
|
+
sourceScene: THREE.Scene;
|
|
45
|
+
captureLayer: THREE.Group;
|
|
46
|
+
contextTarget: THREE.RenderTarget;
|
|
47
|
+
displayTarget: THREE.RenderTarget;
|
|
48
|
+
panelTarget: THREE.RenderTarget;
|
|
49
|
+
blurPipeline: MinimapBlurPipeline;
|
|
50
|
+
displayMaterial: THREE.NodeMaterial;
|
|
51
|
+
displayQuad: THREE.QuadMesh;
|
|
52
|
+
overlayComposite: THREE.Mesh<THREE.BufferGeometry, THREE.NodeMaterial>;
|
|
53
|
+
/** Live source used to composite the glass result over the active stage capture. */
|
|
54
|
+
stageCaptureTexture: {
|
|
55
|
+
value: THREE.Texture;
|
|
56
|
+
};
|
|
57
|
+
/** Matching preallocated blur capture used by frosted minimap surfaces. */
|
|
58
|
+
stageBlurTexture: {
|
|
59
|
+
value: THREE.Texture;
|
|
60
|
+
};
|
|
61
|
+
overlayVisibility: {
|
|
62
|
+
value: number;
|
|
63
|
+
};
|
|
64
|
+
overlayPanelSize: {
|
|
65
|
+
value: THREE.Vector2;
|
|
66
|
+
};
|
|
67
|
+
overlayViewportCenter: {
|
|
68
|
+
value: THREE.Vector2;
|
|
69
|
+
};
|
|
70
|
+
overlayViewportHalfSize: {
|
|
71
|
+
value: THREE.Vector2;
|
|
72
|
+
};
|
|
73
|
+
overlayViewportRadii: {
|
|
74
|
+
value: THREE.Vector4;
|
|
75
|
+
};
|
|
76
|
+
captureUvScale: {
|
|
77
|
+
value: THREE.Vector2;
|
|
78
|
+
};
|
|
79
|
+
blurGuard: number;
|
|
80
|
+
captureExtentWidth: number;
|
|
81
|
+
captureExtentHeight: number;
|
|
82
|
+
overlayRing: THREE.Mesh<THREE.BufferGeometry, THREE.MeshBasicMaterial>;
|
|
83
|
+
/** Stable depth variants avoid material recompilation on each zoom boundary. */
|
|
84
|
+
ringRestMaterial: THREE.MeshBasicMaterial;
|
|
85
|
+
ringForegroundMaterial: THREE.MeshBasicMaterial;
|
|
86
|
+
overlayProgress: number;
|
|
87
|
+
overlayGeometryWidth: number;
|
|
88
|
+
overlayGeometryHeight: number;
|
|
89
|
+
overlayGeometryDirty: boolean;
|
|
90
|
+
/** Reusable numeric snapshot used to invalidate the expensive overlay captures. */
|
|
91
|
+
overlayCaptureState: number[];
|
|
92
|
+
overlayCaptureDirty: boolean;
|
|
93
|
+
overlayCaptureValid: boolean;
|
|
94
|
+
panelCaptureState: number[];
|
|
95
|
+
panelCaptureDirty: boolean;
|
|
96
|
+
panelCaptureValid: boolean;
|
|
97
|
+
pointerReveal: number;
|
|
98
|
+
/** Whether the panel-backed minimap intersects the viewport preload area. */
|
|
99
|
+
viewportVisible: boolean;
|
|
100
|
+
options: ResolvedStageMinimapOptions;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=MinimapState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinimapState.d.ts","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC,CAAC;AAE5F,sFAAsF;AACtF,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACtC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAChC,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACvC,KAAK,EAAE,QAAQ,CAAC;IAChB,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,QAAQ,CAAC;IACvB,mFAAmF;IACnF,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,yFAAyF;IACzF,iBAAiB,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IACnC,gFAAgF;IAChF,cAAc,EAAE,KAAK,CAAC,UAAU,CAAC;IACjC,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;IACpC,gBAAgB,EAAE,2BAA2B,EAAE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;IAC/C,cAAc,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAA;KAAE,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvE,gFAAgF;IAChF,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC1C,sBAAsB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mFAAmF;IACnF,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,2BAA2B,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinimapState.js","sourceRoot":"","sources":["../../../src/stage/minimap/MinimapState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC","sourcesContent":["import * as THREE from 'three/webgpu';\nimport type { Material, Object3D } from 'three';\nimport type { MinimapBlurPipeline } from '../MinimapBlurPipeline.js';\nimport type { StageMinimapOptions } from '../stageTypes.js';\n\nexport type ResolvedStageMinimapOptions = Required<Omit<StageMinimapOptions, 'dockedView'>>;\n\n/** Original material state retained while the live minimap model fades in and out. */\nexport interface MinimapMaterialOpacityState {\n\tmaterial: Material;\n\topacity: number;\n\ttransparent: boolean;\n\tdepthWrite: boolean;\n}\n\n/**\n * Owns all resources and animated values for one panel-backed element minimap.\n *\n * The live display model stays separate from the isolated blur capture so pointer\n * interaction cannot change the pixels used by the overlay.\n */\nexport interface StageMinimapState {\n\tpanelIndex: number;\n\tscreenCamera: THREE.PerspectiveCamera;\n\tcamera: THREE.PerspectiveCamera;\n\tcaptureCamera: THREE.PerspectiveCamera;\n\tmodel: Object3D;\n\tsourceRoot: Object3D;\n\tdisplayModel: Object3D;\n\t/** Canonical element root within the minimap's centering/orientation hierarchy. */\n\tspatialElementRoot: Object3D;\n\t/** Per-mesh bound points expressed in the centered display model's local coordinates. */\n\tmodelBoundsPoints: THREE.Vector3[];\n\t/** Camera-relative element pose captured from the fitted initial stage view. */\n\trestQuaternion: THREE.Quaternion;\n\t/** Optional camera-relative element pose authored for the docked presentation. */\n\tdockedQuaternion?: THREE.Quaternion;\n\tdisplayMaterials: MinimapMaterialOpacityState[];\n\tdisplayOpacity: number;\n\tlayer: THREE.Group;\n\tmodelRadius: number;\n\tbaseWidth: number;\n\tbaseHeight: number;\n\tbaseRadius: number;\n\tcurrentWidth: number;\n\tcurrentHeight: number;\n\tsourceScene: THREE.Scene;\n\tcaptureLayer: THREE.Group;\n\tcontextTarget: THREE.RenderTarget;\n\tdisplayTarget: THREE.RenderTarget;\n\tpanelTarget: THREE.RenderTarget;\n\tblurPipeline: MinimapBlurPipeline;\n\tdisplayMaterial: THREE.NodeMaterial;\n\tdisplayQuad: THREE.QuadMesh;\n\toverlayComposite: THREE.Mesh<THREE.BufferGeometry, THREE.NodeMaterial>;\n\t/** Live source used to composite the glass result over the active stage capture. */\n\tstageCaptureTexture: { value: THREE.Texture };\n\t/** Matching preallocated blur capture used by frosted minimap surfaces. */\n\tstageBlurTexture: { value: THREE.Texture };\n\toverlayVisibility: { value: number };\n\toverlayPanelSize: { value: THREE.Vector2 };\n\toverlayViewportCenter: { value: THREE.Vector2 };\n\toverlayViewportHalfSize: { value: THREE.Vector2 };\n\toverlayViewportRadii: { value: THREE.Vector4 };\n\tcaptureUvScale: { value: THREE.Vector2 };\n\tblurGuard: number;\n\tcaptureExtentWidth: number;\n\tcaptureExtentHeight: number;\n\toverlayRing: THREE.Mesh<THREE.BufferGeometry, THREE.MeshBasicMaterial>;\n\t/** Stable depth variants avoid material recompilation on each zoom boundary. */\n\tringRestMaterial: THREE.MeshBasicMaterial;\n\tringForegroundMaterial: THREE.MeshBasicMaterial;\n\toverlayProgress: number;\n\toverlayGeometryWidth: number;\n\toverlayGeometryHeight: number;\n\toverlayGeometryDirty: boolean;\n\t/** Reusable numeric snapshot used to invalidate the expensive overlay captures. */\n\toverlayCaptureState: number[];\n\toverlayCaptureDirty: boolean;\n\toverlayCaptureValid: boolean;\n\tpanelCaptureState: number[];\n\tpanelCaptureDirty: boolean;\n\tpanelCaptureValid: boolean;\n\tpointerReveal: number;\n\t/** Whether the panel-backed minimap intersects the viewport preload area. */\n\tviewportVisible: boolean;\n\toptions: ResolvedStageMinimapOptions;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Diagnostic ablations only; normal pages always retain the complete minimap. */
|
|
2
|
+
export type MinimapMeasurementMode = 'full' | 'no-overlay' | 'no-blur' | 'reuse-capture';
|
|
3
|
+
export declare function parseMinimapMeasurementMode(search: string): MinimapMeasurementMode;
|
|
4
|
+
export declare function getMinimapMeasurementMode(): MinimapMeasurementMode;
|
|
5
|
+
//# sourceMappingURL=minimapMeasurement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimapMeasurement.d.ts","sourceRoot":"","sources":["../../src/stage/minimapMeasurement.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,eAAe,CAAC;AAEzF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,CAKlF;AAED,wBAAgB,yBAAyB,IAAI,sBAAsB,CAIlE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function parseMinimapMeasurementMode(search) {
|
|
2
|
+
const params = new URLSearchParams(search);
|
|
3
|
+
if (params.get('stage-test') !== '1')
|
|
4
|
+
return 'full';
|
|
5
|
+
const mode = params.get('minimap-measurement');
|
|
6
|
+
return mode === 'no-overlay' || mode === 'no-blur' || mode === 'reuse-capture' ? mode : 'full';
|
|
7
|
+
}
|
|
8
|
+
export function getMinimapMeasurementMode() {
|
|
9
|
+
return parseMinimapMeasurementMode(typeof window === 'undefined' ? '' : (window.location?.search ?? ''));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=minimapMeasurement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimapMeasurement.js","sourceRoot":"","sources":["../../src/stage/minimapMeasurement.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,2BAA2B,CAAC,MAAc;IACzD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,GAAG;QAAE,OAAO,MAAM,CAAC;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAC/C,OAAO,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AAChG,CAAC;AAED,MAAM,UAAU,yBAAyB;IACxC,OAAO,2BAA2B,CACjC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,CAAC,CACpE,CAAC;AACH,CAAC","sourcesContent":["/** Diagnostic ablations only; normal pages always retain the complete minimap. */\nexport type MinimapMeasurementMode = 'full' | 'no-overlay' | 'no-blur' | 'reuse-capture';\n\nexport function parseMinimapMeasurementMode(search: string): MinimapMeasurementMode {\n\tconst params = new URLSearchParams(search);\n\tif (params.get('stage-test') !== '1') return 'full';\n\tconst mode = params.get('minimap-measurement');\n\treturn mode === 'no-overlay' || mode === 'no-blur' || mode === 'reuse-capture' ? mode : 'full';\n}\n\nexport function getMinimapMeasurementMode(): MinimapMeasurementMode {\n\treturn parseMinimapMeasurementMode(\n\t\ttypeof window === 'undefined' ? '' : (window.location?.search ?? '')\n\t);\n}\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';
|
|
2
|
+
import type { StageMinimapDockedView, StagePanelSurface } from './stageTypes.js';
|
|
3
|
+
export declare const STAGE_CONTEXT_KEY: unique symbol;
|
|
4
|
+
/** Notifies an active stage that externally positioned panel frames changed layout. */
|
|
5
|
+
export declare const STAGE_PANEL_LAYOUT_EVENT = "stage:panel-layout";
|
|
6
|
+
/** Notifies an active stage that an external panel visual changed without affecting layout. */
|
|
7
|
+
export declare const STAGE_PANEL_VISUAL_EVENT = "stage:panel-visual";
|
|
8
|
+
export interface StagePanelPose {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
position: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface StagePanelShape {
|
|
17
|
+
radius: number;
|
|
18
|
+
contentInset?: number;
|
|
19
|
+
}
|
|
20
|
+
export type StagePanelTheme = Omit<LiquidGlassPanelOptions, 'width' | 'height' | 'position' | 'radius'> & {
|
|
21
|
+
/** Semantic surface style. Defaults to the WebGPU-backed `glass` mode. */
|
|
22
|
+
surface?: StagePanelSurface;
|
|
23
|
+
};
|
|
24
|
+
export interface StagePanelMinimapOptions {
|
|
25
|
+
expandedHeight?: number;
|
|
26
|
+
inset?: number;
|
|
27
|
+
/** Additional unbounded scale applied to the fitted model. Values below 0.2 are clamped. */
|
|
28
|
+
modelScale?: number;
|
|
29
|
+
/** Model multiplier at full pointer hover. Use 1 to disable hover enlargement. */
|
|
30
|
+
hoverModelScale?: number;
|
|
31
|
+
/** Hover multiplier used once the minimap is expanded by camera zoom. */
|
|
32
|
+
expandedHoverModelScale?: number;
|
|
33
|
+
/** Optional spatial-element-specific presentation used while the minimap is docked. */
|
|
34
|
+
dockedView?: StageMinimapDockedView;
|
|
35
|
+
overlayColor?: string | number;
|
|
36
|
+
overlayOpacity?: number;
|
|
37
|
+
/** Gaussian blur radius in CSS pixels. */
|
|
38
|
+
overlayBlur?: number;
|
|
39
|
+
contextColor?: string | number;
|
|
40
|
+
contextOpacity?: number;
|
|
41
|
+
viewportColor?: string | number;
|
|
42
|
+
}
|
|
43
|
+
export interface StagePanelRegistration {
|
|
44
|
+
getContentInset(): number;
|
|
45
|
+
getElement(): HTMLElement | undefined;
|
|
46
|
+
getFrameElement(): HTMLElement | undefined;
|
|
47
|
+
getSurfaceElement(): HTMLElement | undefined;
|
|
48
|
+
getPointerReactive(): boolean;
|
|
49
|
+
getMinimapOptions(): StagePanelMinimapOptions | undefined;
|
|
50
|
+
getOptions(): LiquidGlassPanelOptions;
|
|
51
|
+
getSurface(): StagePanelSurface;
|
|
52
|
+
/** Returns the opacity of the panel surface without affecting panel content. */
|
|
53
|
+
getSurfaceOpacity(): number;
|
|
54
|
+
/** Returns a transient presentation scale applied to a rendered minimap model. */
|
|
55
|
+
getMinimapModelScale(): number;
|
|
56
|
+
/** Returns the animated transition from the regular to the docked minimap view. */
|
|
57
|
+
getMinimapDockProgress(): number;
|
|
58
|
+
/** Returns the viewport-space top edge used to anchor the rendered model. */
|
|
59
|
+
getMinimapModelTop(): number | undefined;
|
|
60
|
+
}
|
|
61
|
+
export interface StageViewportRegistration {
|
|
62
|
+
getElement(): HTMLElement | undefined;
|
|
63
|
+
}
|
|
64
|
+
export interface StageContext {
|
|
65
|
+
prefetchSpatialElement?(stage: import('../spatial-element/types.js').SpatialStageConfig): void;
|
|
66
|
+
registerPanel(panel: StagePanelRegistration): () => void;
|
|
67
|
+
registerViewport(viewport: StageViewportRegistration): () => void;
|
|
68
|
+
/** Restores the element camera to its initial fitted pose. */
|
|
69
|
+
resetView(): void;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=panelContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panelContext.d.ts","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,eAAO,MAAM,iBAAiB,eAAkB,CAAC;AAEjD,uFAAuF;AACvF,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,+FAA+F;AAC/F,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CACjC,uBAAuB,EACvB,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAC1C,GAAG;IACH,0EAA0E;IAC1E,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAIF,MAAM,WAAW,wBAAwB;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,UAAU,CAAC,E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I,CAAC;IACzD,gBAAgB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,IAAI,CAAC;IAClE,8DAA8D;IAC9D,SAAS,IAAI,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const STAGE_CONTEXT_KEY = Symbol('stage');
|
|
2
|
+
/** Notifies an active stage that externally positioned panel frames changed layout. */
|
|
3
|
+
export const STAGE_PANEL_LAYOUT_EVENT = 'stage:panel-layout';
|
|
4
|
+
/** Notifies an active stage that an external panel visual changed without affecting layout. */
|
|
5
|
+
export const STAGE_PANEL_VISUAL_EVENT = 'stage:panel-visual';
|
|
6
|
+
//# sourceMappingURL=panelContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panelContext.js","sourceRoot":"","sources":["../../src/stage/panelContext.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAEjD,uFAAuF;AACvF,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE7D,+FAA+F;AAC/F,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC","sourcesContent":["\nimport type { LiquidGlassPanelOptions } from './LiquidGlassPanel.js';\nimport type { StageMinimapDockedView, StagePanelSurface } from './stageTypes.js';\n\nexport const STAGE_CONTEXT_KEY = Symbol('stage');\n\n/** Notifies an active stage that externally positioned panel frames changed layout. */\nexport const STAGE_PANEL_LAYOUT_EVENT = 'stage:panel-layout';\n\n/** Notifies an active stage that an external panel visual changed without affecting layout. */\nexport const STAGE_PANEL_VISUAL_EVENT = 'stage:panel-visual';\n\nexport interface StagePanelPose {\n\twidth: number;\n\theight: number;\n\tposition: { x: number; y: number };\n}\n\nexport interface StagePanelShape {\n\tradius: number;\n\tcontentInset?: number;\n}\n\nexport type StagePanelTheme = Omit<\n\tLiquidGlassPanelOptions,\n\t'width' | 'height' | 'position' | 'radius'\n> & {\n\t/** Semantic surface style. Defaults to the WebGPU-backed `glass` mode. */\n\tsurface?: StagePanelSurface;\n};\n\n\n\nexport interface StagePanelMinimapOptions {\n\texpandedHeight?: number;\n\tinset?: number;\n\t/** Additional unbounded scale applied to the fitted 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\toverlayColor?: string | number;\n\toverlayOpacity?: number;\n\t/** Gaussian blur radius in CSS pixels. */\n\toverlayBlur?: number;\n\tcontextColor?: string | number;\n\tcontextOpacity?: number;\n\tviewportColor?: string | number;\n}\n\nexport interface StagePanelRegistration {\n\tgetContentInset(): number;\n\tgetElement(): HTMLElement | undefined;\n\tgetFrameElement(): HTMLElement | undefined;\n\tgetSurfaceElement(): HTMLElement | undefined;\n\tgetPointerReactive(): boolean;\n\tgetMinimapOptions(): StagePanelMinimapOptions | undefined;\n\tgetOptions(): LiquidGlassPanelOptions;\n\tgetSurface(): StagePanelSurface;\n\t/** Returns the opacity of the panel surface without affecting panel content. */\n\tgetSurfaceOpacity(): number;\n\t/** Returns a transient presentation scale applied to a rendered minimap model. */\n\tgetMinimapModelScale(): number;\n\t/** Returns the animated transition from the regular to the docked minimap view. */\n\tgetMinimapDockProgress(): number;\n\t/** Returns the viewport-space top edge used to anchor the rendered model. */\n\tgetMinimapModelTop(): number | undefined;\n}\n\nexport interface StageViewportRegistration {\n\tgetElement(): HTMLElement | undefined;\n}\n\nexport interface StageContext {\n\tprefetchSpatialElement?(stage: import('../spatial-element/types.js').SpatialStageConfig): void;\n\tregisterPanel(panel: StagePanelRegistration): () => void;\n\tregisterViewport(viewport: StageViewportRegistration): () => void;\n\t/** Restores the element camera to its initial fitted pose. */\n\tresetView(): void;\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface PanelShadowLayer {
|
|
2
|
+
offsetY: number;
|
|
3
|
+
blur: number;
|
|
4
|
+
alphaScale: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const PANEL_SHADOW_INTENSITY_EXPONENT = 1.35;
|
|
7
|
+
/** Shared shadow geometry and strength for CSS and WebGPU panel surfaces. */
|
|
8
|
+
export declare const PANEL_SHADOW_RECIPE: readonly [{
|
|
9
|
+
readonly offsetY: 0;
|
|
10
|
+
readonly blur: 8;
|
|
11
|
+
readonly alphaScale: 0.36;
|
|
12
|
+
}, {
|
|
13
|
+
readonly offsetY: 0;
|
|
14
|
+
readonly blur: 28;
|
|
15
|
+
readonly alphaScale: 0.6;
|
|
16
|
+
}];
|
|
17
|
+
export declare function getCssPanelBoxShadow(shadowIntensity: number): string;
|
|
18
|
+
/** Preserves subtle low values while giving the upper half of the scale more visual range. */
|
|
19
|
+
export declare function resolvePanelShadowStrength(shadowIntensity: number): number;
|
|
20
|
+
//# sourceMappingURL=panelShadow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panelShadow.d.ts","sourceRoot":"","sources":["../../src/stage/panelShadow.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,+BAA+B,OAAO,CAAC;AAEpD,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB;;;;;;;;EAGgB,CAAC;AAEjD,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,UAM3D;AAED,8FAA8F;AAC9F,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,UAEjE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const PANEL_SHADOW_INTENSITY_EXPONENT = 1.35;
|
|
2
|
+
/** Shared shadow geometry and strength for CSS and WebGPU panel surfaces. */
|
|
3
|
+
export const PANEL_SHADOW_RECIPE = [
|
|
4
|
+
{ offsetY: 0, blur: 8, alphaScale: 0.36 },
|
|
5
|
+
{ offsetY: 0, blur: 28, alphaScale: 0.6 }
|
|
6
|
+
];
|
|
7
|
+
export function getCssPanelBoxShadow(shadowIntensity) {
|
|
8
|
+
const strength = resolvePanelShadowStrength(shadowIntensity);
|
|
9
|
+
return PANEL_SHADOW_RECIPE.map(({ offsetY, blur, alphaScale }) => `0 ${offsetY}px ${blur}px rgb(0 0 0 / ${formatAlpha(strength * alphaScale)})`).join(', ');
|
|
10
|
+
}
|
|
11
|
+
/** Preserves subtle low values while giving the upper half of the scale more visual range. */
|
|
12
|
+
export function resolvePanelShadowStrength(shadowIntensity) {
|
|
13
|
+
return Math.pow(clamp(shadowIntensity, 0, 1), PANEL_SHADOW_INTENSITY_EXPONENT);
|
|
14
|
+
}
|
|
15
|
+
function formatAlpha(value) {
|
|
16
|
+
return Number(value.toFixed(4));
|
|
17
|
+
}
|
|
18
|
+
function clamp(value, min, max) {
|
|
19
|
+
const finiteValue = Number.isFinite(value) ? value : min;
|
|
20
|
+
return Math.min(Math.max(finiteValue, min), max);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=panelShadow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panelShadow.js","sourceRoot":"","sources":["../../src/stage/panelShadow.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,+BAA+B,GAAG,IAAI,CAAC;AAEpD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE;IACzC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE;CACM,CAAC;AAEjD,MAAM,UAAU,oBAAoB,CAAC,eAAuB;IAC3D,MAAM,QAAQ,GAAG,0BAA0B,CAAC,eAAe,CAAC,CAAC;IAC7D,OAAO,mBAAmB,CAAC,GAAG,CAC7B,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CACjC,KAAK,OAAO,MAAM,IAAI,kBAAkB,WAAW,CAAC,QAAQ,GAAG,UAAU,CAAC,GAAG,CAC9E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,0BAA0B,CAAC,eAAuB;IACjE,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,+BAA+B,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IACjC,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IACrD,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;IACzD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC","sourcesContent":["export interface PanelShadowLayer {\n\toffsetY: number;\n\tblur: number;\n\talphaScale: number;\n}\n\nexport const PANEL_SHADOW_INTENSITY_EXPONENT = 1.35;\n\n/** Shared shadow geometry and strength for CSS and WebGPU panel surfaces. */\nexport const PANEL_SHADOW_RECIPE = [\n\t{ offsetY: 0, blur: 8, alphaScale: 0.36 },\n\t{ offsetY: 0, blur: 28, alphaScale: 0.6 }\n] as const satisfies readonly PanelShadowLayer[];\n\nexport function getCssPanelBoxShadow(shadowIntensity: number) {\n\tconst strength = resolvePanelShadowStrength(shadowIntensity);\n\treturn PANEL_SHADOW_RECIPE.map(\n\t\t({ offsetY, blur, alphaScale }) =>\n\t\t\t`0 ${offsetY}px ${blur}px rgb(0 0 0 / ${formatAlpha(strength * alphaScale)})`\n\t).join(', ');\n}\n\n/** Preserves subtle low values while giving the upper half of the scale more visual range. */\nexport function resolvePanelShadowStrength(shadowIntensity: number) {\n\treturn Math.pow(clamp(shadowIntensity, 0, 1), PANEL_SHADOW_INTENSITY_EXPONENT);\n}\n\nfunction formatAlpha(value: number) {\n\treturn Number(value.toFixed(4));\n}\n\nfunction clamp(value: number, min: number, max: number) {\n\tconst finiteValue = Number.isFinite(value) ? value : min;\n\treturn Math.min(Math.max(finiteValue, min), max);\n}\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Test-only comparisons, including incomplete views; normal pages retain complete rendering. */
|
|
2
|
+
export declare function parseRenderMeasurement(search: string): 'fixed-minimap-size' | 'full' | 'no-halo' | 'frozen-backdrop' | 'halo-unconditional' | 'halo-mask-only' | 'halo-frozen-mask' | 'halo-half-mask' | 'halo-fused' | 'halo-separate';
|
|
3
|
+
//# sourceMappingURL=renderMeasurement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderMeasurement.d.ts","sourceRoot":"","sources":["../../src/stage/renderMeasurement.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,MAAM,GAEZ,oBAAoB,GACpB,MAAM,GACN,SAAS,GACT,iBAAiB,GACjB,oBAAoB,GACpB,gBAAgB,GAChB,kBAAkB,GAClB,gBAAgB,GAChB,YAAY,GACZ,eAAe,CAejB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Test-only comparisons, including incomplete views; normal pages retain complete rendering. */
|
|
2
|
+
export function parseRenderMeasurement(search) {
|
|
3
|
+
const query = new URLSearchParams(search);
|
|
4
|
+
if (query.get('stage-test') !== '1')
|
|
5
|
+
return 'full';
|
|
6
|
+
const mode = query.get('render-measurement');
|
|
7
|
+
return mode === 'fixed-minimap-size' ||
|
|
8
|
+
mode === 'no-halo' ||
|
|
9
|
+
mode === 'frozen-backdrop' ||
|
|
10
|
+
mode === 'halo-unconditional' ||
|
|
11
|
+
mode === 'halo-mask-only' ||
|
|
12
|
+
mode === 'halo-frozen-mask' ||
|
|
13
|
+
mode === 'halo-half-mask' ||
|
|
14
|
+
mode === 'halo-fused' ||
|
|
15
|
+
mode === 'halo-separate'
|
|
16
|
+
? mode
|
|
17
|
+
: 'full';
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=renderMeasurement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderMeasurement.js","sourceRoot":"","sources":["../../src/stage/renderMeasurement.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,UAAU,sBAAsB,CACrC,MAAc;IAYd,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,GAAG;QAAE,OAAO,MAAM,CAAC;IACnD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC7C,OAAO,IAAI,KAAK,oBAAoB;QACnC,IAAI,KAAK,SAAS;QAClB,IAAI,KAAK,iBAAiB;QAC1B,IAAI,KAAK,oBAAoB;QAC7B,IAAI,KAAK,gBAAgB;QACzB,IAAI,KAAK,kBAAkB;QAC3B,IAAI,KAAK,gBAAgB;QACzB,IAAI,KAAK,YAAY;QACrB,IAAI,KAAK,eAAe;QACxB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,MAAM,CAAC;AACX,CAAC","sourcesContent":["/** Test-only comparisons, including incomplete views; normal pages retain complete rendering. */\nexport function parseRenderMeasurement(\n\tsearch: string\n):\n\t| 'fixed-minimap-size'\n\t| 'full'\n\t| 'no-halo'\n\t| 'frozen-backdrop'\n\t| 'halo-unconditional'\n\t| 'halo-mask-only'\n\t| 'halo-frozen-mask'\n\t| 'halo-half-mask'\n\t| 'halo-fused'\n\t| 'halo-separate' {\n\tconst query = new URLSearchParams(search);\n\tif (query.get('stage-test') !== '1') return 'full';\n\tconst mode = query.get('render-measurement');\n\treturn mode === 'fixed-minimap-size' ||\n\t\tmode === 'no-halo' ||\n\t\tmode === 'frozen-backdrop' ||\n\t\tmode === 'halo-unconditional' ||\n\t\tmode === 'halo-mask-only' ||\n\t\tmode === 'halo-frozen-mask' ||\n\t\tmode === 'halo-half-mask' ||\n\t\tmode === 'halo-fused' ||\n\t\tmode === 'halo-separate'\n\t\t? mode\n\t\t: 'full';\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { RenderTarget } from 'three/webgpu';
|
|
2
|
+
/** Three r185 diagnostic adapter only; never used for rendering or ownership. */
|
|
3
|
+
export declare function gaussianTargets(effect: unknown): RenderTarget[];
|
|
4
|
+
export declare function describeRenderTargets(groups: Readonly<Record<string, readonly RenderTarget[]>>): {
|
|
5
|
+
liveTargets: number;
|
|
6
|
+
targets: {
|
|
7
|
+
owner: string;
|
|
8
|
+
id: string;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
samples: number;
|
|
12
|
+
depth: boolean;
|
|
13
|
+
colorAttachments: number;
|
|
14
|
+
colorType: import("three/webgpu").TextureDataType;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=renderTargetInventory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderTargetInventory.d.ts","sourceRoot":"","sources":["../../src/stage/renderTargetInventory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,EAAE,CAK/D;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC,CAAC;;;;;;;;;;;;EAqB9F"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Three r185 diagnostic adapter only; never used for rendering or ownership. */
|
|
2
|
+
export function gaussianTargets(effect) {
|
|
3
|
+
const node = effect;
|
|
4
|
+
return [node?._horizontalRT, node?._verticalRT].filter((target) => Boolean(target));
|
|
5
|
+
}
|
|
6
|
+
export function describeRenderTargets(groups) {
|
|
7
|
+
const seen = new Set();
|
|
8
|
+
const targets = Object.entries(groups).flatMap(([owner, values]) => values.flatMap((target) => {
|
|
9
|
+
if (seen.has(target))
|
|
10
|
+
return [];
|
|
11
|
+
seen.add(target);
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
owner,
|
|
15
|
+
id: target.texture.uuid,
|
|
16
|
+
width: target.width,
|
|
17
|
+
height: target.height,
|
|
18
|
+
samples: target.samples,
|
|
19
|
+
depth: target.depthBuffer,
|
|
20
|
+
colorAttachments: target.textures.length,
|
|
21
|
+
colorType: target.texture.type
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
}));
|
|
25
|
+
return { liveTargets: targets.length, targets };
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=renderTargetInventory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderTargetInventory.js","sourceRoot":"","sources":["../../src/stage/renderTargetInventory.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,UAAU,eAAe,CAAC,MAAe;IAC9C,MAAM,IAAI,GAAG,MAAkF,CAAC;IAChG,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAA0B,EAAE,CACzF,OAAO,CAAC,MAAM,CAAC,CACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAyD;IAC9F,MAAM,IAAI,GAAG,IAAI,GAAG,EAAgB,CAAC;IACrC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,CAClE,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjB,OAAO;YACN;gBACC,KAAK;gBACL,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;gBACvB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,KAAK,EAAE,MAAM,CAAC,WAAW;gBACzB,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;gBACxC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;aAC9B;SACD,CAAC;IACH,CAAC,CAAC,CACF,CAAC;IACF,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC","sourcesContent":["import type { RenderTarget } from 'three/webgpu';\n\n/** Three r185 diagnostic adapter only; never used for rendering or ownership. */\nexport function gaussianTargets(effect: unknown): RenderTarget[] {\n\tconst node = effect as { _horizontalRT?: RenderTarget; _verticalRT?: RenderTarget } | undefined;\n\treturn [node?._horizontalRT, node?._verticalRT].filter((target): target is RenderTarget =>\n\t\tBoolean(target)\n\t);\n}\n\nexport function describeRenderTargets(groups: Readonly<Record<string, readonly RenderTarget[]>>) {\n\tconst seen = new Set<RenderTarget>();\n\tconst targets = Object.entries(groups).flatMap(([owner, values]) =>\n\t\tvalues.flatMap((target) => {\n\t\t\tif (seen.has(target)) return [];\n\t\t\tseen.add(target);\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\towner,\n\t\t\t\t\tid: target.texture.uuid,\n\t\t\t\t\twidth: target.width,\n\t\t\t\t\theight: target.height,\n\t\t\t\t\tsamples: target.samples,\n\t\t\t\t\tdepth: target.depthBuffer,\n\t\t\t\t\tcolorAttachments: target.textures.length,\n\t\t\t\t\tcolorType: target.texture.type\n\t\t\t\t}\n\t\t\t];\n\t\t})\n\t);\n\treturn { liveTargets: targets.length, targets };\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Vector4 } from 'three/webgpu';
|
|
2
|
+
import type { WebGPURenderer } from 'three/webgpu';
|
|
3
|
+
type RendererStatePort = Pick<WebGPURenderer, 'getCanvasTarget' | 'setCanvasTarget' | 'getRenderTarget' | 'setRenderTarget' | 'getClearColor' | 'getClearAlpha' | 'setClearColor' | 'getViewport' | 'getScissor' | 'getScissorTest' | 'setScissorTest'> & {
|
|
4
|
+
setViewport(value: Vector4): void;
|
|
5
|
+
setScissor(value: Vector4): void;
|
|
6
|
+
};
|
|
7
|
+
/** A pass borrows renderer state; failures must not poison the next output band. */
|
|
8
|
+
export declare function withRendererState<T>(renderer: RendererStatePort, draw: () => T): T;
|
|
9
|
+
/** Restore borrowed scene visibility even if a WebGPU pass throws. */
|
|
10
|
+
export declare function withVisibility<T>(nodes: readonly {
|
|
11
|
+
visible: boolean;
|
|
12
|
+
}[], draw: () => T): T;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=rendererState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendererState.d.ts","sourceRoot":"","sources":["../../src/stage/rendererState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,KAAK,iBAAiB,GAAG,IAAI,CAC5B,cAAc,EACZ,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,CAClB,GAAG;IAAE,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,CAAC;AAE5E,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAkBlF;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAS1F"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Color, Vector4 } from 'three/webgpu';
|
|
2
|
+
/** A pass borrows renderer state; failures must not poison the next output band. */
|
|
3
|
+
export function withRendererState(renderer, draw) {
|
|
4
|
+
const canvas = renderer.getCanvasTarget();
|
|
5
|
+
const target = renderer.getRenderTarget();
|
|
6
|
+
const color = renderer.getClearColor(new Color());
|
|
7
|
+
const alpha = renderer.getClearAlpha();
|
|
8
|
+
const viewport = renderer.getViewport(new Vector4());
|
|
9
|
+
const scissor = renderer.getScissor(new Vector4());
|
|
10
|
+
const scissorTest = renderer.getScissorTest();
|
|
11
|
+
try {
|
|
12
|
+
return draw();
|
|
13
|
+
}
|
|
14
|
+
finally {
|
|
15
|
+
renderer.setCanvasTarget(canvas);
|
|
16
|
+
renderer.setRenderTarget(target);
|
|
17
|
+
renderer.setClearColor(color, alpha);
|
|
18
|
+
renderer.setViewport(viewport);
|
|
19
|
+
renderer.setScissor(scissor);
|
|
20
|
+
renderer.setScissorTest(scissorTest);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Restore borrowed scene visibility even if a WebGPU pass throws. */
|
|
24
|
+
export function withVisibility(nodes, draw) {
|
|
25
|
+
const visible = nodes.map((node) => node.visible);
|
|
26
|
+
try {
|
|
27
|
+
return draw();
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
nodes.forEach((node, index) => {
|
|
31
|
+
node.visible = visible[index];
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=rendererState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendererState.js","sourceRoot":"","sources":["../../src/stage/rendererState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAkB9C,oFAAoF;AACpF,MAAM,UAAU,iBAAiB,CAAI,QAA2B,EAAE,IAAa;IAC9E,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC9C,IAAI,CAAC;QACJ,OAAO,IAAI,EAAE,CAAC;IACf,CAAC;YAAS,CAAC;QACV,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACjC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACjC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACrC,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC/B,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC7B,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,cAAc,CAAI,KAAsC,EAAE,IAAa;IACtF,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC;QACJ,OAAO,IAAI,EAAE,CAAC;IACf,CAAC;YAAS,CAAC;QACV,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC","sourcesContent":["import { Color, Vector4 } from 'three/webgpu';\nimport type { WebGPURenderer } from 'three/webgpu';\n\ntype RendererStatePort = Pick<\n\tWebGPURenderer,\n\t| 'getCanvasTarget'\n\t| 'setCanvasTarget'\n\t| 'getRenderTarget'\n\t| 'setRenderTarget'\n\t| 'getClearColor'\n\t| 'getClearAlpha'\n\t| 'setClearColor'\n\t| 'getViewport'\n\t| 'getScissor'\n\t| 'getScissorTest'\n\t| 'setScissorTest'\n> & { setViewport(value: Vector4): void; setScissor(value: Vector4): void };\n\n/** A pass borrows renderer state; failures must not poison the next output band. */\nexport function withRendererState<T>(renderer: RendererStatePort, draw: () => T): T {\n\tconst canvas = renderer.getCanvasTarget();\n\tconst target = renderer.getRenderTarget();\n\tconst color = renderer.getClearColor(new Color());\n\tconst alpha = renderer.getClearAlpha();\n\tconst viewport = renderer.getViewport(new Vector4());\n\tconst scissor = renderer.getScissor(new Vector4());\n\tconst scissorTest = renderer.getScissorTest();\n\ttry {\n\t\treturn draw();\n\t} finally {\n\t\trenderer.setCanvasTarget(canvas);\n\t\trenderer.setRenderTarget(target);\n\t\trenderer.setClearColor(color, alpha);\n\t\trenderer.setViewport(viewport);\n\t\trenderer.setScissor(scissor);\n\t\trenderer.setScissorTest(scissorTest);\n\t}\n}\n\n/** Restore borrowed scene visibility even if a WebGPU pass throws. */\nexport function withVisibility<T>(nodes: readonly { visible: boolean }[], draw: () => T): T {\n\tconst visible = nodes.map((node) => node.visible);\n\ttry {\n\t\treturn draw();\n\t} finally {\n\t\tnodes.forEach((node, index) => {\n\t\t\tnode.visible = visible[index];\n\t\t});\n\t}\n}\n"]}
|