@spatial-elements/core 0.1.0-beta.2 → 1.0.0-beta.10
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/README.md +16 -13
- package/dist/catalog/CarouselDeviceCamera.d.ts +20 -0
- package/dist/catalog/CarouselDeviceCamera.d.ts.map +1 -0
- package/dist/catalog/CarouselDeviceCamera.js +58 -0
- package/dist/catalog/CarouselDeviceCamera.js.map +1 -0
- package/dist/catalog/CarouselGlassCompositor.d.ts +14 -3
- package/dist/catalog/CarouselGlassCompositor.d.ts.map +1 -1
- package/dist/catalog/CarouselGlassCompositor.js +164 -28
- package/dist/catalog/CarouselGlassCompositor.js.map +1 -1
- package/dist/catalog/CarouselGround.d.ts +43 -0
- package/dist/catalog/CarouselGround.d.ts.map +1 -0
- package/dist/catalog/CarouselGround.js +270 -0
- package/dist/catalog/CarouselGround.js.map +1 -0
- package/dist/catalog/CarouselSectionSurfaces.d.ts +10 -0
- package/dist/catalog/CarouselSectionSurfaces.d.ts.map +1 -0
- package/dist/catalog/CarouselSectionSurfaces.js +55 -0
- package/dist/catalog/CarouselSectionSurfaces.js.map +1 -0
- package/dist/catalog/CatalogDepthBlur.d.ts +45 -0
- package/dist/catalog/CatalogDepthBlur.d.ts.map +1 -0
- package/dist/catalog/CatalogDepthBlur.js +190 -0
- package/dist/catalog/CatalogDepthBlur.js.map +1 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts +2 -0
- package/dist/catalog/CatalogEndpointRegistry.d.ts.map +1 -1
- package/dist/catalog/CatalogEndpointRegistry.js +2 -0
- package/dist/catalog/CatalogEndpointRegistry.js.map +1 -1
- package/dist/catalog/CatalogGeometryFade.d.ts +5 -1
- package/dist/catalog/CatalogGeometryFade.d.ts.map +1 -1
- package/dist/catalog/CatalogGeometryFade.js +45 -9
- package/dist/catalog/CatalogGeometryFade.js.map +1 -1
- package/dist/catalog/CatalogModelOutline.d.ts +33 -0
- package/dist/catalog/CatalogModelOutline.d.ts.map +1 -0
- package/dist/catalog/CatalogModelOutline.js +143 -0
- package/dist/catalog/CatalogModelOutline.js.map +1 -0
- package/dist/catalog/CatalogNavigationRegistry.d.ts +44 -0
- package/dist/catalog/CatalogNavigationRegistry.d.ts.map +1 -0
- package/dist/catalog/CatalogNavigationRegistry.js +66 -0
- package/dist/catalog/CatalogNavigationRegistry.js.map +1 -0
- package/dist/catalog/CatalogPreparation.d.ts +3 -3
- package/dist/catalog/CatalogPreparation.d.ts.map +1 -1
- package/dist/catalog/CatalogPreparation.js +10 -7
- package/dist/catalog/CatalogPreparation.js.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +175 -5
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +739 -121
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/CatalogTransition.d.ts +4 -2
- package/dist/catalog/CatalogTransition.d.ts.map +1 -1
- package/dist/catalog/CatalogTransition.js +206 -90
- package/dist/catalog/CatalogTransition.js.map +1 -1
- package/dist/catalog/CatalogWarmOutputContext.d.ts +39 -0
- package/dist/catalog/CatalogWarmOutputContext.d.ts.map +1 -0
- package/dist/catalog/CatalogWarmOutputContext.js +159 -0
- package/dist/catalog/CatalogWarmOutputContext.js.map +1 -0
- package/dist/catalog/EarlyNavigationCoordinator.d.ts +35 -0
- package/dist/catalog/EarlyNavigationCoordinator.d.ts.map +1 -0
- package/dist/catalog/EarlyNavigationCoordinator.js +103 -0
- package/dist/catalog/EarlyNavigationCoordinator.js.map +1 -0
- package/dist/catalog/NavigationFeedback.d.ts +12 -0
- package/dist/catalog/NavigationFeedback.d.ts.map +1 -0
- package/dist/catalog/NavigationFeedback.js +40 -0
- package/dist/catalog/NavigationFeedback.js.map +1 -0
- package/dist/catalog/PreparationGate.d.ts +4 -0
- package/dist/catalog/PreparationGate.d.ts.map +1 -1
- package/dist/catalog/PreparationGate.js +1 -0
- package/dist/catalog/PreparationGate.js.map +1 -1
- package/dist/catalog/SourceDomClipping.d.ts +8 -0
- package/dist/catalog/SourceDomClipping.d.ts.map +1 -0
- package/dist/catalog/SourceDomClipping.js +74 -0
- package/dist/catalog/SourceDomClipping.js.map +1 -0
- package/dist/catalog/SourceDomMotion.d.ts +28 -0
- package/dist/catalog/SourceDomMotion.d.ts.map +1 -0
- package/dist/catalog/SourceDomMotion.js +111 -0
- package/dist/catalog/SourceDomMotion.js.map +1 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts +9 -0
- package/dist/catalog/SpatialGeometryCapture.d.ts.map +1 -1
- package/dist/catalog/SpatialGeometryCapture.js +11 -1
- package/dist/catalog/SpatialGeometryCapture.js.map +1 -1
- package/dist/catalog/SpatialPageRegistry.d.ts +18 -0
- package/dist/catalog/SpatialPageRegistry.d.ts.map +1 -0
- package/dist/catalog/SpatialPageRegistry.js +21 -0
- package/dist/catalog/SpatialPageRegistry.js.map +1 -0
- package/dist/catalog/StagedCatalogTransition.d.ts +74 -0
- package/dist/catalog/StagedCatalogTransition.d.ts.map +1 -0
- package/dist/catalog/StagedCatalogTransition.js +270 -0
- package/dist/catalog/StagedCatalogTransition.js.map +1 -0
- package/dist/catalog/cardModelFit.d.ts +7 -0
- package/dist/catalog/cardModelFit.d.ts.map +1 -0
- package/dist/catalog/cardModelFit.js +16 -0
- package/dist/catalog/cardModelFit.js.map +1 -0
- package/dist/catalog/cardProjection.d.ts +39 -0
- package/dist/catalog/cardProjection.d.ts.map +1 -0
- package/dist/catalog/cardProjection.js +110 -0
- package/dist/catalog/cardProjection.js.map +1 -0
- package/dist/catalog/carouselMotion.d.ts +74 -0
- package/dist/catalog/carouselMotion.d.ts.map +1 -0
- package/dist/catalog/carouselMotion.js +185 -0
- package/dist/catalog/carouselMotion.js.map +1 -0
- package/dist/catalog/carouselPanelProjection.d.ts.map +1 -1
- package/dist/catalog/carouselPanelProjection.js +48 -11
- package/dist/catalog/carouselPanelProjection.js.map +1 -1
- package/dist/catalog/carouselProximity.d.ts +11 -0
- package/dist/catalog/carouselProximity.d.ts.map +1 -0
- package/dist/catalog/carouselProximity.js +13 -0
- package/dist/catalog/carouselProximity.js.map +1 -0
- package/dist/catalog/carouselSupport.d.ts +4 -0
- package/dist/catalog/carouselSupport.d.ts.map +1 -0
- package/dist/catalog/carouselSupport.js +30 -0
- package/dist/catalog/carouselSupport.js.map +1 -0
- package/dist/catalog/catalogActivationFocus.d.ts +5 -0
- package/dist/catalog/catalogActivationFocus.d.ts.map +1 -0
- package/dist/catalog/catalogActivationFocus.js +39 -0
- package/dist/catalog/catalogActivationFocus.js.map +1 -0
- package/dist/catalog/catalogDomSnapshot.d.ts +18 -0
- package/dist/catalog/catalogDomSnapshot.d.ts.map +1 -0
- package/dist/catalog/catalogDomSnapshot.js +51 -0
- package/dist/catalog/catalogDomSnapshot.js.map +1 -0
- package/dist/catalog/catalogJourney.d.ts +4 -1
- package/dist/catalog/catalogJourney.d.ts.map +1 -1
- package/dist/catalog/catalogJourney.js +7 -15
- package/dist/catalog/catalogJourney.js.map +1 -1
- package/dist/catalog/catalogPage.d.ts +7 -3
- package/dist/catalog/catalogPage.d.ts.map +1 -1
- package/dist/catalog/catalogPage.js.map +1 -1
- package/dist/catalog/catalogPose.d.ts +54 -6
- package/dist/catalog/catalogPose.d.ts.map +1 -1
- package/dist/catalog/catalogPose.js +100 -23
- package/dist/catalog/catalogPose.js.map +1 -1
- package/dist/catalog/catalogRecipes.d.ts +3 -2
- package/dist/catalog/catalogRecipes.d.ts.map +1 -1
- package/dist/catalog/catalogRecipes.js +10 -25
- package/dist/catalog/catalogRecipes.js.map +1 -1
- package/dist/catalog/catalogTransitionViewport.d.ts +9 -0
- package/dist/catalog/catalogTransitionViewport.d.ts.map +1 -0
- package/dist/catalog/catalogTransitionViewport.js +13 -0
- package/dist/catalog/catalogTransitionViewport.js.map +1 -0
- package/dist/catalog/catalogViewLink.d.ts +2 -0
- package/dist/catalog/catalogViewLink.d.ts.map +1 -1
- package/dist/catalog/catalogViewLink.js +10 -2
- package/dist/catalog/catalogViewLink.js.map +1 -1
- package/dist/catalog/deviceYaw.d.ts +21 -0
- package/dist/catalog/deviceYaw.d.ts.map +1 -0
- package/dist/catalog/deviceYaw.js +87 -0
- package/dist/catalog/deviceYaw.js.map +1 -0
- package/dist/catalog/listDeviceOrientation.d.ts +17 -0
- package/dist/catalog/listDeviceOrientation.d.ts.map +1 -0
- package/dist/catalog/listDeviceOrientation.js +262 -0
- package/dist/catalog/listDeviceOrientation.js.map +1 -0
- package/dist/catalog/spatialElementAssets.d.ts +5 -5
- package/dist/catalog/spatialElementAssets.d.ts.map +1 -1
- package/dist/catalog/spatialElementAssets.js.map +1 -1
- package/dist/catalog/spatialElementLodPair.d.ts +2 -1
- package/dist/catalog/spatialElementLodPair.d.ts.map +1 -1
- package/dist/catalog/spatialElementLodPair.js.map +1 -1
- package/dist/catalog/stagedDetailGeometry.d.ts +37 -0
- package/dist/catalog/stagedDetailGeometry.d.ts.map +1 -0
- package/dist/catalog/stagedDetailGeometry.js +55 -0
- package/dist/catalog/stagedDetailGeometry.js.map +1 -0
- package/dist/catalog/stagedDockGeometry.d.ts +66 -0
- package/dist/catalog/stagedDockGeometry.d.ts.map +1 -0
- package/dist/catalog/stagedDockGeometry.js +66 -0
- package/dist/catalog/stagedDockGeometry.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/spatial-element/ResponsiveViewportMetrics.d.ts +18 -0
- package/dist/spatial-element/ResponsiveViewportMetrics.d.ts.map +1 -0
- package/dist/spatial-element/ResponsiveViewportMetrics.js +68 -0
- package/dist/spatial-element/ResponsiveViewportMetrics.js.map +1 -0
- package/dist/spatial-element/SectionSurfaceRegistry.d.ts +2 -0
- package/dist/spatial-element/SectionSurfaceRegistry.d.ts.map +1 -0
- package/dist/spatial-element/SectionSurfaceRegistry.js +2 -0
- package/dist/spatial-element/SectionSurfaceRegistry.js.map +1 -0
- package/dist/spatial-element/SpatialElementDockController.d.ts +22 -10
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +228 -96
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
- package/dist/spatial-element/SpatialElementPaneController.d.ts +67 -0
- package/dist/spatial-element/SpatialElementPaneController.d.ts.map +1 -0
- package/dist/spatial-element/SpatialElementPaneController.js +246 -0
- package/dist/spatial-element/SpatialElementPaneController.js.map +1 -0
- package/dist/spatial-element/activeDetailSection.d.ts +8 -0
- package/dist/spatial-element/activeDetailSection.d.ts.map +1 -0
- package/dist/spatial-element/activeDetailSection.js +19 -0
- package/dist/spatial-element/activeDetailSection.js.map +1 -0
- package/dist/spatial-element/layoutTokens.json +228 -0
- package/dist/spatial-element/messages.d.ts +34 -0
- package/dist/spatial-element/messages.d.ts.map +1 -0
- package/dist/spatial-element/messages.js +34 -0
- package/dist/spatial-element/messages.js.map +1 -0
- package/dist/spatial-element/responsiveLayout.d.ts +1353 -0
- package/dist/spatial-element/responsiveLayout.d.ts.map +1 -0
- package/dist/spatial-element/responsiveLayout.js +210 -0
- package/dist/spatial-element/responsiveLayout.js.map +1 -0
- package/dist/spatial-element/sectionBackground.d.ts +3 -0
- package/dist/spatial-element/sectionBackground.d.ts.map +1 -0
- package/dist/spatial-element/sectionBackground.js +2 -0
- package/dist/spatial-element/sectionBackground.js.map +1 -0
- package/dist/spatial-element/spatialElement.d.ts +17 -12
- package/dist/spatial-element/spatialElement.d.ts.map +1 -1
- package/dist/spatial-element/spatialElement.js +33 -6
- package/dist/spatial-element/spatialElement.js.map +1 -1
- package/dist/spatial-element/spatialElementDock.d.ts +15 -0
- package/dist/spatial-element/spatialElementDock.d.ts.map +1 -1
- package/dist/spatial-element/spatialElementDock.js +22 -0
- package/dist/spatial-element/spatialElementDock.js.map +1 -1
- package/dist/spatial-element/spatialElementGeometry.d.ts +22 -0
- package/dist/spatial-element/spatialElementGeometry.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementGeometry.js +40 -0
- package/dist/spatial-element/spatialElementGeometry.js.map +1 -0
- package/dist/spatial-element/spatialElementMedia.d.ts +16 -0
- package/dist/spatial-element/spatialElementMedia.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementMedia.js +29 -0
- package/dist/spatial-element/spatialElementMedia.js.map +1 -0
- package/dist/spatial-element/spatialElementScene.d.ts +16 -0
- package/dist/spatial-element/spatialElementScene.d.ts.map +1 -0
- package/dist/spatial-element/spatialElementScene.js +22 -0
- package/dist/spatial-element/spatialElementScene.js.map +1 -0
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts +6 -25
- package/dist/spatial-element/spatialElementSectionRegistry.d.ts.map +1 -1
- package/dist/spatial-element/spatialElementSectionRegistry.js +6 -63
- package/dist/spatial-element/spatialElementSectionRegistry.js.map +1 -1
- package/dist/spatial-element/spatialTheme.d.ts +27 -0
- package/dist/spatial-element/spatialTheme.d.ts.map +1 -0
- package/dist/spatial-element/spatialTheme.js +83 -0
- package/dist/spatial-element/spatialTheme.js.map +1 -0
- package/dist/spatial-element/types.d.ts +117 -36
- package/dist/spatial-element/types.d.ts.map +1 -1
- package/dist/spatial-element/types.js.map +1 -1
- package/dist/stage/BackgroundLayerOutput.d.ts +76 -0
- package/dist/stage/BackgroundLayerOutput.d.ts.map +1 -0
- package/dist/stage/BackgroundLayerOutput.js +333 -0
- package/dist/stage/BackgroundLayerOutput.js.map +1 -0
- package/dist/stage/DeviceGeometryMotion.d.ts +13 -0
- package/dist/stage/DeviceGeometryMotion.d.ts.map +1 -0
- package/dist/stage/DeviceGeometryMotion.js +37 -0
- package/dist/stage/DeviceGeometryMotion.js.map +1 -0
- package/dist/stage/LiquidGlassPanel.d.ts +7 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +46 -5
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts +4 -1
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +57 -66
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/ModelPointerPreview.d.ts +22 -0
- package/dist/stage/ModelPointerPreview.d.ts.map +1 -0
- package/dist/stage/ModelPointerPreview.js +71 -0
- package/dist/stage/ModelPointerPreview.js.map +1 -0
- package/dist/stage/PageBindingController.d.ts +10 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -1
- package/dist/stage/PageBindingController.js +45 -5
- package/dist/stage/PageBindingController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts +21 -1
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +190 -31
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +19 -1
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +134 -13
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/SpatialElementPresentationController.d.ts +14 -2
- package/dist/stage/SpatialElementPresentationController.d.ts.map +1 -1
- package/dist/stage/SpatialElementPresentationController.js +47 -2
- package/dist/stage/SpatialElementPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementRefinement.d.ts +34 -1
- package/dist/stage/SpatialElementRefinement.d.ts.map +1 -1
- package/dist/stage/SpatialElementRefinement.js +175 -37
- package/dist/stage/SpatialElementRefinement.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +263 -10
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +655 -124
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageFullscreenController.d.ts +17 -0
- package/dist/stage/StageFullscreenController.d.ts.map +1 -0
- package/dist/stage/StageFullscreenController.js +90 -0
- package/dist/stage/StageFullscreenController.js.map +1 -0
- package/dist/stage/StagePanelRuntime.d.ts +2 -1
- package/dist/stage/StagePanelRuntime.d.ts.map +1 -1
- package/dist/stage/StagePanelRuntime.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts +90 -2
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +494 -119
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/VirtualScrollController.d.ts +7 -0
- package/dist/stage/VirtualScrollController.d.ts.map +1 -1
- package/dist/stage/VirtualScrollController.js +63 -6
- package/dist/stage/VirtualScrollController.js.map +1 -1
- package/dist/stage/inertLease.d.ts +2 -0
- package/dist/stage/inertLease.d.ts.map +1 -0
- package/dist/stage/inertLease.js +18 -0
- package/dist/stage/inertLease.js.map +1 -0
- package/dist/stage/interactionGuidance.d.ts +22 -0
- package/dist/stage/interactionGuidance.d.ts.map +1 -0
- package/dist/stage/interactionGuidance.js +53 -0
- package/dist/stage/interactionGuidance.js.map +1 -0
- package/dist/stage/interactionOutline.d.ts +14 -0
- package/dist/stage/interactionOutline.d.ts.map +1 -0
- package/dist/stage/interactionOutline.js +59 -0
- package/dist/stage/interactionOutline.js.map +1 -0
- package/dist/stage/minimap/MinimapGeometry.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapGeometry.js +29 -0
- package/dist/stage/minimap/MinimapGeometry.js.map +1 -1
- package/dist/stage/minimap/MinimapModel.d.ts +2 -1
- package/dist/stage/minimap/MinimapModel.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapModel.js +34 -4
- package/dist/stage/minimap/MinimapModel.js.map +1 -1
- package/dist/stage/minimap/MinimapModelGeometry.d.ts +21 -0
- package/dist/stage/minimap/MinimapModelGeometry.d.ts.map +1 -0
- package/dist/stage/minimap/MinimapModelGeometry.js +68 -0
- package/dist/stage/minimap/MinimapModelGeometry.js.map +1 -0
- package/dist/stage/minimap/MinimapProjection.d.ts +7 -0
- package/dist/stage/minimap/MinimapProjection.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapProjection.js +14 -13
- package/dist/stage/minimap/MinimapProjection.js.map +1 -1
- package/dist/stage/minimap/MinimapState.d.ts +3 -8
- package/dist/stage/minimap/MinimapState.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapState.js.map +1 -1
- package/dist/stage/mouseHover.d.ts +9 -0
- package/dist/stage/mouseHover.d.ts.map +1 -0
- package/dist/stage/mouseHover.js +55 -0
- package/dist/stage/mouseHover.js.map +1 -0
- package/dist/stage/panelContext.d.ts +27 -2
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/renderSettings.d.ts +10 -0
- package/dist/stage/renderSettings.d.ts.map +1 -0
- package/dist/stage/renderSettings.js +27 -0
- package/dist/stage/renderSettings.js.map +1 -0
- package/dist/stage/renderTargetInventory.d.ts +1 -1
- package/dist/stage/renderTargetInventory.js +1 -1
- package/dist/stage/renderTargetInventory.js.map +1 -1
- package/dist/stage/rendererState.d.ts +2 -0
- package/dist/stage/rendererState.d.ts.map +1 -1
- package/dist/stage/rendererState.js +13 -0
- package/dist/stage/rendererState.js.map +1 -1
- package/dist/stage/sceneEndpointEligibility.d.ts +20 -0
- package/dist/stage/sceneEndpointEligibility.d.ts.map +1 -0
- package/dist/stage/sceneEndpointEligibility.js +363 -0
- package/dist/stage/sceneEndpointEligibility.js.map +1 -0
- package/dist/stage/scrollFrame.d.ts +2 -0
- package/dist/stage/scrollFrame.d.ts.map +1 -1
- package/dist/stage/scrollFrame.js +18 -5
- package/dist/stage/scrollFrame.js.map +1 -1
- package/dist/stage/spatialElementFrame.d.ts.map +1 -1
- package/dist/stage/spatialElementFrame.js +5 -1
- package/dist/stage/spatialElementFrame.js.map +1 -1
- package/dist/stage/stageConstants.d.ts +3 -3
- package/dist/stage/stageConstants.d.ts.map +1 -1
- package/dist/stage/stageConstants.js +6 -6
- package/dist/stage/stageConstants.js.map +1 -1
- package/dist/stage/stageDom.d.ts +2 -0
- package/dist/stage/stageDom.d.ts.map +1 -1
- package/dist/stage/stageDom.js +10 -1
- package/dist/stage/stageDom.js.map +1 -1
- package/dist/stage/stageMath.d.ts +9 -10
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +23 -21
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +30 -3
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +24 -1
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/logo.svg +188 -0
- package/package.json +7 -5
|
@@ -45,7 +45,16 @@ export interface StagePanelRegistration {
|
|
|
45
45
|
getElement(): HTMLElement | undefined;
|
|
46
46
|
getFrameElement(): HTMLElement | undefined;
|
|
47
47
|
getSurfaceElement(): HTMLElement | undefined;
|
|
48
|
-
getPointerReactive(): boolean;
|
|
48
|
+
getPointerReactive(): boolean | 'lift';
|
|
49
|
+
getFocusReactive?(): boolean | 'top-right';
|
|
50
|
+
/** Neighbouring panel frame that shares a corner control's exit path. */
|
|
51
|
+
getFocusAnchor?(): HTMLElement | undefined;
|
|
52
|
+
getNativeContent?(): boolean;
|
|
53
|
+
/** Runs synchronously before the native panel surface is measured and drawn. */
|
|
54
|
+
updateNativeLayout?(): void;
|
|
55
|
+
getVisible?(): boolean;
|
|
56
|
+
/** Selection is read without rebuilding the minimap model. */
|
|
57
|
+
getMinimapSelected?(): boolean;
|
|
49
58
|
getMinimapOptions(): StagePanelMinimapOptions | undefined;
|
|
50
59
|
getOptions(): LiquidGlassPanelOptions;
|
|
51
60
|
getSurface(): StagePanelSurface;
|
|
@@ -57,15 +66,31 @@ export interface StagePanelRegistration {
|
|
|
57
66
|
getMinimapDockProgress(): number;
|
|
58
67
|
/** Returns the viewport-space top edge used to anchor the rendered model. */
|
|
59
68
|
getMinimapModelTop(): number | undefined;
|
|
69
|
+
getMinimapModelLeft?(): number | undefined;
|
|
60
70
|
}
|
|
61
71
|
export interface StageViewportRegistration {
|
|
62
72
|
getElement(): HTMLElement | undefined;
|
|
63
73
|
}
|
|
64
74
|
export interface StageContext {
|
|
65
|
-
|
|
75
|
+
/** Detail-page ownership; stale route cleanup cannot reset a newer media selection. */
|
|
76
|
+
registerDetailMedia?(read: () => import('../spatial-element/types.js').SpatialElementMediaItem['kind']): () => void;
|
|
77
|
+
/** Cached browser layout metrics; unavailable during SSR. */
|
|
78
|
+
getLayoutMetrics?(mode?: 'stable' | 'visible'): import('../spatial-element/responsiveLayout.js').ResponsiveLayoutInput | undefined;
|
|
79
|
+
/** Reactive in framework adapters; false during SSR and until the GPU has painted. */
|
|
80
|
+
isEnhanced?(): boolean;
|
|
81
|
+
prefetchSpatialElement?(stage: import('../spatial-element/spatialElementScene.js').SpatialElementScene): void;
|
|
66
82
|
registerPanel(panel: StagePanelRegistration): () => void;
|
|
83
|
+
/** Refresh appearance from registered getters without rebinding the page or its camera. */
|
|
84
|
+
updatePanelAppearance?(): void;
|
|
67
85
|
registerViewport(viewport: StageViewportRegistration): () => void;
|
|
68
86
|
/** Restores the element camera to its initial fitted pose. */
|
|
69
87
|
resetView(): void;
|
|
88
|
+
/** True for both native fullscreen and its viewport fallback. */
|
|
89
|
+
isFullscreen?(): boolean;
|
|
90
|
+
/** Current camera zoom focus, from the fitted detail view (0) to close-up (1). */
|
|
91
|
+
getZoomFocus?(): number;
|
|
92
|
+
/** Damped UI focus shared by panels and the document-scrolled detail pane. */
|
|
93
|
+
getZoomUiFocus?(): number;
|
|
94
|
+
setFullscreen?(fullscreen: boolean): void;
|
|
70
95
|
}
|
|
71
96
|
//# sourceMappingURL=panelContext.d.ts.map
|
|
@@ -1 +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,iBA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AC;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/
|
|
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 | 'lift';\n\tgetFocusReactive?(): boolean | 'top-right';\n\t/** Neighbouring panel frame that shares a corner control's exit path. */\n\tgetFocusAnchor?(): HTMLElement | undefined;\n\tgetNativeContent?(): boolean;\n\t/** Runs synchronously before the native panel surface is measured and drawn. */\n\tupdateNativeLayout?(): void;\n\tgetVisible?(): boolean;\n\t/** Selection is read without rebuilding the minimap model. */\n\tgetMinimapSelected?(): 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\tgetMinimapModelLeft?(): number | undefined;\n}\n\nexport interface StageViewportRegistration {\n\tgetElement(): HTMLElement | undefined;\n}\n\nexport interface StageContext {\n\t/** Detail-page ownership; stale route cleanup cannot reset a newer media selection. */\n\tregisterDetailMedia?(read: () => import('../spatial-element/types.js').SpatialElementMediaItem['kind']): () => void;\n\t/** Cached browser layout metrics; unavailable during SSR. */\n\tgetLayoutMetrics?(mode?: 'stable' | 'visible'): import('../spatial-element/responsiveLayout.js').ResponsiveLayoutInput | undefined;\n\t/** Reactive in framework adapters; false during SSR and until the GPU has painted. */\n\tisEnhanced?(): boolean;\n\tprefetchSpatialElement?(stage: import('../spatial-element/spatialElementScene.js').SpatialElementScene): void;\n\tregisterPanel(panel: StagePanelRegistration): () => void;\n\t/** Refresh appearance from registered getters without rebinding the page or its camera. */\n\tupdatePanelAppearance?(): void;\n\tregisterViewport(viewport: StageViewportRegistration): () => void;\n\t/** Restores the element camera to its initial fitted pose. */\n\tresetView(): void;\n\t/** True for both native fullscreen and its viewport fallback. */\n\tisFullscreen?(): boolean;\n\t/** Current camera zoom focus, from the fitted detail view (0) to close-up (1). */\n\tgetZoomFocus?(): number;\n\t/** Damped UI focus shared by panels and the document-scrolled detail pane. */\n\tgetZoomUiFocus?(): number;\n\tsetFullscreen?(fullscreen: boolean): void;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StageRenderSettings } from './stageTypes.js';
|
|
2
|
+
export interface ResolvedStageRenderSettings {
|
|
3
|
+
maxPixelRatio: number;
|
|
4
|
+
maxPixels: number | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const DEFAULT_STAGE_RENDER_SETTINGS: Readonly<ResolvedStageRenderSettings>;
|
|
7
|
+
export declare function resolveStageRenderSettings(settings?: StageRenderSettings): ResolvedStageRenderSettings;
|
|
8
|
+
/** Keep the viewport aspect ratio and allow subsampling on very large displays. */
|
|
9
|
+
export declare function getStageRenderPixelRatio(width: number, height: number, devicePixelRatio: number, settings?: Readonly<ResolvedStageRenderSettings>): number;
|
|
10
|
+
//# sourceMappingURL=renderSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSettings.d.ts","sourceRoot":"","sources":["../../src/stage/renderSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,WAAW,2BAA2B;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,2BAA2B,CAG/E,CAAC;AAEF,wBAAgB,0BAA0B,CACzC,QAAQ,GAAE,mBAAwB,GAChC,2BAA2B,CAa7B;AAED,mFAAmF;AACnF,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EACxB,QAAQ,GAAE,QAAQ,CAAC,2BAA2B,CAAiC,UAW/E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const DEFAULT_STAGE_RENDER_SETTINGS = {
|
|
2
|
+
maxPixelRatio: 1,
|
|
3
|
+
maxPixels: 1920 * 1080
|
|
4
|
+
};
|
|
5
|
+
export function resolveStageRenderSettings(settings = {}) {
|
|
6
|
+
return {
|
|
7
|
+
maxPixelRatio: Number.isFinite(settings.maxPixelRatio) && settings.maxPixelRatio > 0
|
|
8
|
+
? settings.maxPixelRatio
|
|
9
|
+
: DEFAULT_STAGE_RENDER_SETTINGS.maxPixelRatio,
|
|
10
|
+
maxPixels: settings.maxPixels === null
|
|
11
|
+
? null
|
|
12
|
+
: Number.isFinite(settings.maxPixels) && settings.maxPixels > 0
|
|
13
|
+
? Math.max(1, Math.floor(settings.maxPixels))
|
|
14
|
+
: DEFAULT_STAGE_RENDER_SETTINGS.maxPixels
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Keep the viewport aspect ratio and allow subsampling on very large displays. */
|
|
18
|
+
export function getStageRenderPixelRatio(width, height, devicePixelRatio, settings = DEFAULT_STAGE_RENDER_SETTINGS) {
|
|
19
|
+
const viewportWidth = Number.isFinite(width) && width > 0 ? width : 1;
|
|
20
|
+
const viewportHeight = Number.isFinite(height) && height > 0 ? height : 1;
|
|
21
|
+
const nativeRatio = Number.isFinite(devicePixelRatio) && devicePixelRatio > 0 ? devicePixelRatio : 1;
|
|
22
|
+
const pixelBudgetRatio = settings.maxPixels === null
|
|
23
|
+
? Infinity
|
|
24
|
+
: Math.sqrt(settings.maxPixels / (viewportWidth * viewportHeight));
|
|
25
|
+
return Math.min(nativeRatio, settings.maxPixelRatio, pixelBudgetRatio);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=renderSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSettings.js","sourceRoot":"","sources":["../../src/stage/renderSettings.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,6BAA6B,GAA0C;IACnF,aAAa,EAAE,CAAC;IAChB,SAAS,EAAE,IAAI,GAAG,IAAI;CACtB,CAAC;AAEF,MAAM,UAAU,0BAA0B,CACzC,WAAgC,EAAE;IAElC,OAAO;QACN,aAAa,EACZ,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,aAAc,GAAG,CAAC;YACrE,CAAC,CAAC,QAAQ,CAAC,aAAc;YACzB,CAAC,CAAC,6BAA6B,CAAC,aAAa;QAC/C,SAAS,EACR,QAAQ,CAAC,SAAS,KAAK,IAAI;YAC1B,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,SAAU,GAAG,CAAC;gBAC/D,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAU,CAAC,CAAC;gBAC9C,CAAC,CAAC,6BAA6B,CAAC,SAAS;KAC5C,CAAC;AACH,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,wBAAwB,CACvC,KAAa,EACb,MAAc,EACd,gBAAwB,EACxB,WAAkD,6BAA6B;IAE/E,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,MAAM,WAAW,GAChB,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,MAAM,gBAAgB,GACrB,QAAQ,CAAC,SAAS,KAAK,IAAI;QAC1B,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,GAAG,CAAC,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import type { StageRenderSettings } from './stageTypes.js';\n\nexport interface ResolvedStageRenderSettings {\n\tmaxPixelRatio: number;\n\tmaxPixels: number | null;\n}\n\nexport const DEFAULT_STAGE_RENDER_SETTINGS: Readonly<ResolvedStageRenderSettings> = {\n\tmaxPixelRatio: 1,\n\tmaxPixels: 1920 * 1080\n};\n\nexport function resolveStageRenderSettings(\n\tsettings: StageRenderSettings = {}\n): ResolvedStageRenderSettings {\n\treturn {\n\t\tmaxPixelRatio:\n\t\t\tNumber.isFinite(settings.maxPixelRatio) && settings.maxPixelRatio! > 0\n\t\t\t\t? settings.maxPixelRatio!\n\t\t\t\t: DEFAULT_STAGE_RENDER_SETTINGS.maxPixelRatio,\n\t\tmaxPixels:\n\t\t\tsettings.maxPixels === null\n\t\t\t\t? null\n\t\t\t\t: Number.isFinite(settings.maxPixels) && settings.maxPixels! > 0\n\t\t\t\t\t? Math.max(1, Math.floor(settings.maxPixels!))\n\t\t\t\t\t: DEFAULT_STAGE_RENDER_SETTINGS.maxPixels\n\t};\n}\n\n/** Keep the viewport aspect ratio and allow subsampling on very large displays. */\nexport function getStageRenderPixelRatio(\n\twidth: number,\n\theight: number,\n\tdevicePixelRatio: number,\n\tsettings: Readonly<ResolvedStageRenderSettings> = DEFAULT_STAGE_RENDER_SETTINGS\n) {\n\tconst viewportWidth = Number.isFinite(width) && width > 0 ? width : 1;\n\tconst viewportHeight = Number.isFinite(height) && height > 0 ? height : 1;\n\tconst nativeRatio =\n\t\tNumber.isFinite(devicePixelRatio) && devicePixelRatio > 0 ? devicePixelRatio : 1;\n\tconst pixelBudgetRatio =\n\t\tsettings.maxPixels === null\n\t\t\t? Infinity\n\t\t\t: Math.sqrt(settings.maxPixels / (viewportWidth * viewportHeight));\n\treturn Math.min(nativeRatio, settings.maxPixelRatio, pixelBudgetRatio);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RenderTarget } from 'three/webgpu';
|
|
2
|
-
/** Three
|
|
2
|
+
/** Three r186 diagnostic adapter only; never used for rendering or ownership. */
|
|
3
3
|
export declare function gaussianTargets(effect: unknown): RenderTarget[];
|
|
4
4
|
export declare function describeRenderTargets(groups: Readonly<Record<string, readonly RenderTarget[]>>): {
|
|
5
5
|
liveTargets: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Three
|
|
1
|
+
/** Three r186 diagnostic adapter only; never used for rendering or ownership. */
|
|
2
2
|
export function gaussianTargets(effect) {
|
|
3
3
|
const node = effect;
|
|
4
4
|
return [node?._horizontalRT, node?._verticalRT].filter((target) => Boolean(target));
|
|
@@ -1 +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
|
|
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 r186 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"]}
|
|
@@ -4,6 +4,8 @@ type RendererStatePort = Pick<WebGPURenderer, 'getCanvasTarget' | 'setCanvasTarg
|
|
|
4
4
|
setViewport(value: Vector4): void;
|
|
5
5
|
setScissor(value: Vector4): void;
|
|
6
6
|
};
|
|
7
|
+
/** A cached uniform attachment must be complete on WebGPU and its WebGL fallback. */
|
|
8
|
+
export declare function clearFullTarget(renderer: Pick<WebGPURenderer, 'getScissorTest' | 'setScissorTest' | 'clear'>): void;
|
|
7
9
|
/** A pass borrows renderer state; failures must not poison the next output band. */
|
|
8
10
|
export declare function withRendererState<T>(renderer: RendererStatePort, draw: () => T): T;
|
|
9
11
|
/** Restore borrowed scene visibility even if a WebGPU pass throws. */
|
|
@@ -1 +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"}
|
|
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,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,OAAO,CAAC,QAK5G;AAED,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"}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { Color, Vector4 } from 'three/webgpu';
|
|
2
|
+
/** A cached uniform attachment must be complete on WebGPU and its WebGL fallback. */
|
|
3
|
+
export function clearFullTarget(renderer) {
|
|
4
|
+
const scissorTest = renderer.getScissorTest();
|
|
5
|
+
if (scissorTest)
|
|
6
|
+
renderer.setScissorTest(false);
|
|
7
|
+
try {
|
|
8
|
+
renderer.clear();
|
|
9
|
+
}
|
|
10
|
+
finally {
|
|
11
|
+
if (scissorTest)
|
|
12
|
+
renderer.setScissorTest(true);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
2
15
|
/** A pass borrows renderer state; failures must not poison the next output band. */
|
|
3
16
|
export function withRendererState(renderer, draw) {
|
|
4
17
|
const canvas = renderer.getCanvasTarget();
|
|
@@ -1 +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,MAA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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"]}
|
|
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,qFAAqF;AACrF,MAAM,UAAU,eAAe,CAAC,QAA6E;IAC5G,MAAM,WAAW,GAAG,QAAQ,CAAC,cAA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,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 cached uniform attachment must be complete on WebGPU and its WebGL fallback. */\nexport function clearFullTarget(renderer: Pick<WebGPURenderer, 'getScissorTest' | 'setScissorTest' | 'clear'>) {\n\tconst scissorTest = renderer.getScissorTest();\n\tif (scissorTest) renderer.setScissorTest(false);\n\ttry { renderer.clear(); }\n\tfinally { if (scissorTest) renderer.setScissorTest(true); }\n}\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"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
export interface SceneEndpointGuard {
|
|
3
|
+
/** Checks recorded values only: no scene traversal, matrix update or allocation. */
|
|
4
|
+
isValid(): boolean;
|
|
5
|
+
dispose(): void;
|
|
6
|
+
}
|
|
7
|
+
/** A narrow, static standard-material scene. Stage owns binding/size/input eligibility;
|
|
8
|
+
* Refinement owns target-write epochs and must recheck them after its GPU fence.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createSceneEndpointGuard(options: {
|
|
11
|
+
scene: THREE.Scene;
|
|
12
|
+
camera: THREE.Camera;
|
|
13
|
+
model: THREE.Object3D;
|
|
14
|
+
low: THREE.Object3D;
|
|
15
|
+
high: THREE.Object3D;
|
|
16
|
+
highEnvironment?: THREE.Texture;
|
|
17
|
+
additionalScenes?: readonly THREE.Scene[];
|
|
18
|
+
additionalCameras?: readonly THREE.Camera[];
|
|
19
|
+
}): SceneEndpointGuard | undefined;
|
|
20
|
+
//# sourceMappingURL=sceneEndpointEligibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sceneEndpointEligibility.d.ts","sourceRoot":"","sources":["../../src/stage/sceneEndpointEligibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,MAAM,WAAW,kBAAkB;IAClC,oFAAoF;IACpF,OAAO,IAAI,OAAO,CAAC;IACnB,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IACjD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC;IACtB,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,eAAe,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAChC,gBAAgB,CAAC,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,CAAC;IAC1C,iBAAiB,CAAC,EAAE,SAAS,KAAK,CAAC,MAAM,EAAE,CAAC;CAC5C,GAAG,kBAAkB,GAAG,SAAS,CA0OjC"}
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
/** A narrow, static standard-material scene. Stage owns binding/size/input eligibility;
|
|
3
|
+
* Refinement owns target-write epochs and must recheck them after its GPU fence.
|
|
4
|
+
*/
|
|
5
|
+
export function createSceneEndpointGuard(options) {
|
|
6
|
+
const checks = [], cleanup = [];
|
|
7
|
+
const nodes = new Set(), resources = new Set();
|
|
8
|
+
let lowRoot = options.low;
|
|
9
|
+
while (lowRoot.parent && lowRoot.parent !== options.model)
|
|
10
|
+
lowRoot = lowRoot.parent;
|
|
11
|
+
let eligible = true, invalid = false, disposed = false;
|
|
12
|
+
const reject = () => { eligible = false; };
|
|
13
|
+
const physicalRange = (value, maximum = Infinity) => {
|
|
14
|
+
if (value !== undefined && (typeof value !== 'number' || !Number.isFinite(value) || value < 0 || value > maximum))
|
|
15
|
+
reject();
|
|
16
|
+
};
|
|
17
|
+
const invalidate = () => { invalid = true; };
|
|
18
|
+
const dispose = () => {
|
|
19
|
+
if (disposed)
|
|
20
|
+
return;
|
|
21
|
+
disposed = true;
|
|
22
|
+
for (const release of cleanup)
|
|
23
|
+
release();
|
|
24
|
+
cleanup.length = 0;
|
|
25
|
+
};
|
|
26
|
+
function watch(resource) {
|
|
27
|
+
resource.addEventListener('dispose', invalidate);
|
|
28
|
+
cleanup.push(() => resource.removeEventListener('dispose', invalidate));
|
|
29
|
+
}
|
|
30
|
+
function scalar(read) {
|
|
31
|
+
const value = read();
|
|
32
|
+
if (typeof value === 'number' && !Number.isFinite(value) && value !== Infinity)
|
|
33
|
+
reject();
|
|
34
|
+
checks.push(() => read() === value);
|
|
35
|
+
}
|
|
36
|
+
function sequence(read) {
|
|
37
|
+
const values = [...read()];
|
|
38
|
+
checks.push(() => {
|
|
39
|
+
const current = read();
|
|
40
|
+
if (current.length !== values.length)
|
|
41
|
+
return false;
|
|
42
|
+
for (let i = 0; i < values.length; i++)
|
|
43
|
+
if (current[i] !== values[i])
|
|
44
|
+
return false;
|
|
45
|
+
return true;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function keys(object, ignored = new Set()) {
|
|
49
|
+
const names = Object.keys(object).filter(name => !ignored.has(name));
|
|
50
|
+
const expected = new Set(names);
|
|
51
|
+
checks.push(() => {
|
|
52
|
+
let count = 0;
|
|
53
|
+
for (const name in object)
|
|
54
|
+
if (Object.hasOwn(object, name) && !ignored.has(name)) {
|
|
55
|
+
if (!expected.has(name))
|
|
56
|
+
return false;
|
|
57
|
+
count++;
|
|
58
|
+
}
|
|
59
|
+
return count === names.length;
|
|
60
|
+
});
|
|
61
|
+
return names;
|
|
62
|
+
}
|
|
63
|
+
function value(read, environmentTexture = false) {
|
|
64
|
+
const original = read();
|
|
65
|
+
if (original === null || typeof original !== 'object') {
|
|
66
|
+
if (typeof original === 'function')
|
|
67
|
+
reject();
|
|
68
|
+
else
|
|
69
|
+
scalar(read);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
checks.push(() => read() === original);
|
|
73
|
+
if (original instanceof THREE.Texture) {
|
|
74
|
+
texture(original, environmentTexture);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (original instanceof THREE.Color) {
|
|
78
|
+
// Negative radiance can cross NodeMaterial's outgoing-light clamp as
|
|
79
|
+
// the background changes; static values alone do not prove affinity.
|
|
80
|
+
physicalRange(original.r);
|
|
81
|
+
physicalRange(original.g);
|
|
82
|
+
physicalRange(original.b);
|
|
83
|
+
const copy = original.clone();
|
|
84
|
+
checks.push(() => original.equals(copy));
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (original instanceof THREE.Vector2 || original instanceof THREE.Vector3 || original instanceof THREE.Vector4 ||
|
|
88
|
+
original instanceof THREE.Quaternion || original instanceof THREE.Euler || original instanceof THREE.Matrix3 ||
|
|
89
|
+
original instanceof THREE.Matrix4 || original instanceof THREE.Plane || original instanceof THREE.Box3 || original instanceof THREE.Sphere) {
|
|
90
|
+
const copy = original.clone();
|
|
91
|
+
checks.push(() => original.equals(copy));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (Array.isArray(original)) {
|
|
95
|
+
sequence(() => original);
|
|
96
|
+
for (let i = 0; i < original.length; i++)
|
|
97
|
+
value(() => original[i]);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (Object.getPrototypeOf(original) !== Object.prototype && Object.getPrototypeOf(original) !== null) {
|
|
101
|
+
reject();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const record = original;
|
|
105
|
+
for (const name of keys(record))
|
|
106
|
+
value(() => record[name]);
|
|
107
|
+
}
|
|
108
|
+
function texture(resource, environment = false) {
|
|
109
|
+
const dynamic = resource;
|
|
110
|
+
const image = resource.source?.data;
|
|
111
|
+
// Arbitrary floating/signed material maps have no nonnegative-radiance
|
|
112
|
+
// contract. Do not scan their pixel arrays on the Hold path. Prepared
|
|
113
|
+
// runtime environment/background resources are a separate owner contract.
|
|
114
|
+
if (!environment && [THREE.FloatType, THREE.HalfFloatType, THREE.ByteType, THREE.ShortType, THREE.IntType].some(type => type === resource.type))
|
|
115
|
+
reject();
|
|
116
|
+
const changingImage = (data) => Boolean(data && typeof data === 'object' &&
|
|
117
|
+
('getContext' in data || 'requestVideoFrameCallback' in data ||
|
|
118
|
+
('tagName' in data && /^(VIDEO|CANVAS)$/i.test(String(data.tagName)))));
|
|
119
|
+
if (dynamic.isVideoTexture || dynamic.isVideoFrameTexture || dynamic.isCanvasTexture || dynamic.isFramebufferTexture ||
|
|
120
|
+
dynamic.isDepthTexture || (dynamic.isRenderTargetTexture && !environment) || resource.onUpdate ||
|
|
121
|
+
changingImage(image) || (Array.isArray(image) && image.some(changingImage))) {
|
|
122
|
+
reject();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (resources.has(resource))
|
|
126
|
+
return;
|
|
127
|
+
resources.add(resource);
|
|
128
|
+
watch(resource);
|
|
129
|
+
for (const name of ['version', 'mapping', 'channel', 'wrapS', 'wrapT', 'wrapR', 'magFilter', 'minFilter',
|
|
130
|
+
'anisotropy', 'format', 'internalFormat', 'type', 'colorSpace', 'generateMipmaps', 'premultiplyAlpha',
|
|
131
|
+
'flipY', 'unpackAlignment', 'compareFunction', 'rotation', 'matrixAutoUpdate', 'onUpdate']) {
|
|
132
|
+
const record = resource;
|
|
133
|
+
scalar(() => record[name]);
|
|
134
|
+
}
|
|
135
|
+
value(() => resource.offset);
|
|
136
|
+
value(() => resource.repeat);
|
|
137
|
+
value(() => resource.center);
|
|
138
|
+
value(() => resource.matrix);
|
|
139
|
+
scalar(() => resource.source);
|
|
140
|
+
scalar(() => resource.source.version);
|
|
141
|
+
scalar(() => resource.source.data);
|
|
142
|
+
if (Array.isArray(image))
|
|
143
|
+
sequence(() => resource.source.data);
|
|
144
|
+
for (const data of Array.isArray(image) ? image : [image])
|
|
145
|
+
if (data && typeof data === 'object') {
|
|
146
|
+
for (const name of ['width', 'height', 'depth', 'data'])
|
|
147
|
+
scalar(() => data[name]);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function material(resource) {
|
|
151
|
+
if (![THREE.MeshBasicMaterial, THREE.MeshStandardMaterial, THREE.MeshPhysicalMaterial].some(Type => resource.constructor === Type) ||
|
|
152
|
+
(resource.blending !== THREE.NormalBlending && resource.blending !== THREE.NoBlending) ||
|
|
153
|
+
resource.onBeforeRender !== THREE.Material.prototype.onBeforeRender ||
|
|
154
|
+
resource.onBeforeCompile !== THREE.Material.prototype.onBeforeCompile ||
|
|
155
|
+
resource.customProgramCacheKey !== THREE.Material.prototype.customProgramCacheKey) {
|
|
156
|
+
reject();
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (resources.has(resource))
|
|
160
|
+
return;
|
|
161
|
+
resources.add(resource);
|
|
162
|
+
watch(resource);
|
|
163
|
+
scalar(() => resource.constructor);
|
|
164
|
+
const record = resource;
|
|
165
|
+
for (const name of ['emissiveIntensity', 'envMapIntensity', 'lightMapIntensity'])
|
|
166
|
+
physicalRange(record[name]);
|
|
167
|
+
for (const name of ['opacity', 'aoMapIntensity', 'transmission', 'metalness', 'roughness', 'clearcoat',
|
|
168
|
+
'clearcoatRoughness', 'sheen', 'sheenRoughness', 'iridescence', 'specularIntensity', 'reflectivity'])
|
|
169
|
+
physicalRange(record[name], 1);
|
|
170
|
+
// Authored vertex colors can contain negative floats. Keep those uncommon
|
|
171
|
+
// scenes live instead of introducing a large vertex-array validation pass.
|
|
172
|
+
if (resource.vertexColors)
|
|
173
|
+
reject();
|
|
174
|
+
for (const name of keys(record, new Set(['_listeners', 'userData'])))
|
|
175
|
+
value(() => record[name]);
|
|
176
|
+
checks.push(() => resource.onBeforeRender === THREE.Material.prototype.onBeforeRender &&
|
|
177
|
+
resource.onBeforeCompile === THREE.Material.prototype.onBeforeCompile &&
|
|
178
|
+
resource.customProgramCacheKey === THREE.Material.prototype.customProgramCacheKey);
|
|
179
|
+
}
|
|
180
|
+
function attribute(resource) {
|
|
181
|
+
if (!resource)
|
|
182
|
+
return;
|
|
183
|
+
if (!(resource instanceof THREE.BufferAttribute) && !(resource instanceof THREE.InterleavedBufferAttribute)) {
|
|
184
|
+
reject();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const data = resource instanceof THREE.InterleavedBufferAttribute ? resource.data : resource;
|
|
188
|
+
if (data.usage !== THREE.StaticDrawUsage) {
|
|
189
|
+
reject();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
for (const name of ['version', 'array', 'count', 'usage', 'stride']) {
|
|
193
|
+
const record = data;
|
|
194
|
+
scalar(() => record[name]);
|
|
195
|
+
}
|
|
196
|
+
for (const name of ['itemSize', 'normalized', 'offset', 'gpuType', 'data']) {
|
|
197
|
+
const record = resource;
|
|
198
|
+
scalar(() => record[name]);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function geometry(resource) {
|
|
202
|
+
if (resources.has(resource))
|
|
203
|
+
return;
|
|
204
|
+
resources.add(resource);
|
|
205
|
+
watch(resource);
|
|
206
|
+
if (resource.isInstancedBufferGeometry || Object.keys(resource.morphAttributes).length)
|
|
207
|
+
reject();
|
|
208
|
+
scalar(() => resource.index);
|
|
209
|
+
attribute(resource.index);
|
|
210
|
+
scalar(() => resource.attributes);
|
|
211
|
+
for (const name of keys(resource.attributes)) {
|
|
212
|
+
scalar(() => resource.attributes[name]);
|
|
213
|
+
attribute(resource.attributes[name]);
|
|
214
|
+
}
|
|
215
|
+
checks.push(() => { for (const _name in resource.morphAttributes)
|
|
216
|
+
return false; return true; });
|
|
217
|
+
value(() => resource.drawRange);
|
|
218
|
+
value(() => resource.groups);
|
|
219
|
+
value(() => resource.boundingBox);
|
|
220
|
+
value(() => resource.boundingSphere);
|
|
221
|
+
}
|
|
222
|
+
function node(object) {
|
|
223
|
+
if (nodes.has(object))
|
|
224
|
+
return;
|
|
225
|
+
nodes.add(object);
|
|
226
|
+
const supported = [THREE.Scene, THREE.Group, THREE.Object3D, THREE.Mesh, THREE.PerspectiveCamera, THREE.OrthographicCamera,
|
|
227
|
+
THREE.AmbientLight, THREE.HemisphereLight, THREE.DirectionalLight, THREE.PointLight, THREE.SpotLight, THREE.RectAreaLight];
|
|
228
|
+
if (!supported.some(Type => object.constructor === Type) || object.animations.length || object.castShadow ||
|
|
229
|
+
object.onBeforeRender !== THREE.Object3D.prototype.onBeforeRender || object.onAfterRender !== THREE.Object3D.prototype.onAfterRender ||
|
|
230
|
+
object.onBeforeShadow !== THREE.Object3D.prototype.onBeforeShadow || object.onAfterShadow !== THREE.Object3D.prototype.onAfterShadow) {
|
|
231
|
+
reject();
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
checks.push(() => object.animations.length === 0 && object.onBeforeRender === THREE.Object3D.prototype.onBeforeRender &&
|
|
235
|
+
object.onAfterRender === THREE.Object3D.prototype.onAfterRender && object.onBeforeShadow === THREE.Object3D.prototype.onBeforeShadow &&
|
|
236
|
+
object.onAfterShadow === THREE.Object3D.prototype.onAfterShadow);
|
|
237
|
+
scalar(() => object.constructor);
|
|
238
|
+
if (object !== lowRoot && object !== options.high)
|
|
239
|
+
scalar(() => object.visible);
|
|
240
|
+
for (const name of ['parent', 'matrixAutoUpdate', 'matrixWorldAutoUpdate', 'frustumCulled', 'renderOrder', 'castShadow', 'receiveShadow'])
|
|
241
|
+
scalar(() => object[name]);
|
|
242
|
+
scalar(() => object.layers.mask);
|
|
243
|
+
value(() => object.position);
|
|
244
|
+
value(() => object.quaternion);
|
|
245
|
+
value(() => object.rotation);
|
|
246
|
+
value(() => object.scale);
|
|
247
|
+
value(() => object.matrix);
|
|
248
|
+
value(() => object.matrixWorld);
|
|
249
|
+
sequence(() => object.children);
|
|
250
|
+
if (object instanceof THREE.Mesh) {
|
|
251
|
+
if (object.morphTargetInfluences?.length)
|
|
252
|
+
reject();
|
|
253
|
+
scalar(() => object.morphTargetInfluences);
|
|
254
|
+
scalar(() => object.geometry);
|
|
255
|
+
geometry(object.geometry);
|
|
256
|
+
scalar(() => object.material);
|
|
257
|
+
if (Array.isArray(object.material)) {
|
|
258
|
+
sequence(() => object.material);
|
|
259
|
+
object.material.forEach(material);
|
|
260
|
+
}
|
|
261
|
+
else
|
|
262
|
+
material(object.material);
|
|
263
|
+
}
|
|
264
|
+
if (object instanceof THREE.Light) {
|
|
265
|
+
const light = object;
|
|
266
|
+
physicalRange(object.intensity);
|
|
267
|
+
for (const name of ['color', 'groundColor', 'intensity', 'distance', 'decay', 'angle', 'penumbra', 'width', 'height'])
|
|
268
|
+
value(() => light[name]);
|
|
269
|
+
if ('target' in object) {
|
|
270
|
+
scalar(() => object.target);
|
|
271
|
+
node(object.target);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
for (const child of object.children)
|
|
275
|
+
node(child);
|
|
276
|
+
}
|
|
277
|
+
function cameraSnapshot(camera) {
|
|
278
|
+
node(camera);
|
|
279
|
+
if (camera.constructor !== THREE.PerspectiveCamera && camera.constructor !== THREE.OrthographicCamera)
|
|
280
|
+
reject();
|
|
281
|
+
value(() => camera.projectionMatrix);
|
|
282
|
+
value(() => camera.projectionMatrixInverse);
|
|
283
|
+
value(() => camera.matrixWorldInverse);
|
|
284
|
+
const record = camera;
|
|
285
|
+
for (const name of ['near', 'far', 'fov', 'aspect', 'zoom', 'focus', 'filmGauge', 'filmOffset', 'coordinateSystem', 'view',
|
|
286
|
+
'left', 'right', 'top', 'bottom'])
|
|
287
|
+
value(() => record[name]);
|
|
288
|
+
}
|
|
289
|
+
function sceneSnapshot(scene, allowHigh = false) {
|
|
290
|
+
node(scene);
|
|
291
|
+
if (scene.overrideMaterial !== null)
|
|
292
|
+
reject();
|
|
293
|
+
physicalRange(scene.backgroundIntensity);
|
|
294
|
+
physicalRange(scene.environmentIntensity);
|
|
295
|
+
const lowEnvironment = scene.environment, highEnvironment = allowHigh ? options.highEnvironment : undefined;
|
|
296
|
+
checks.push(() => scene.environment === lowEnvironment || Boolean(highEnvironment && scene.environment === highEnvironment));
|
|
297
|
+
if (lowEnvironment)
|
|
298
|
+
texture(lowEnvironment, true);
|
|
299
|
+
if (highEnvironment)
|
|
300
|
+
texture(highEnvironment, true);
|
|
301
|
+
// Prepared environment targets are stable renderer-owned resources; arbitrary
|
|
302
|
+
// render-target material maps remain ineligible above.
|
|
303
|
+
value(() => scene.background, true);
|
|
304
|
+
for (const name of ['backgroundBlurriness', 'backgroundIntensity', 'backgroundRotation',
|
|
305
|
+
'environmentIntensity', 'environmentRotation', 'overrideMaterial'])
|
|
306
|
+
value(() => scene[name]);
|
|
307
|
+
const fog = scene.fog;
|
|
308
|
+
scalar(() => scene.fog);
|
|
309
|
+
if (fog) {
|
|
310
|
+
if (fog.constructor !== THREE.Fog && fog.constructor !== THREE.FogExp2)
|
|
311
|
+
reject();
|
|
312
|
+
value(() => fog.color);
|
|
313
|
+
for (const name of ['near', 'far', 'density'])
|
|
314
|
+
scalar(() => fog[name]);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
try {
|
|
318
|
+
if (lowRoot === options.high || lowRoot.parent !== options.model || options.high.parent !== options.model || options.model.children.length !== 2 ||
|
|
319
|
+
options.scene.overrideMaterial !== null)
|
|
320
|
+
reject();
|
|
321
|
+
sceneSnapshot(options.scene, true);
|
|
322
|
+
cameraSnapshot(options.camera);
|
|
323
|
+
node(options.model);
|
|
324
|
+
if (!nodes.has(options.low) || !nodes.has(options.high))
|
|
325
|
+
reject();
|
|
326
|
+
if (options.camera.constructor !== THREE.PerspectiveCamera)
|
|
327
|
+
reject();
|
|
328
|
+
if (options.additionalScenes) {
|
|
329
|
+
sequence(() => options.additionalScenes);
|
|
330
|
+
for (const scene of options.additionalScenes)
|
|
331
|
+
sceneSnapshot(scene);
|
|
332
|
+
}
|
|
333
|
+
if (options.additionalCameras) {
|
|
334
|
+
sequence(() => options.additionalCameras);
|
|
335
|
+
for (const camera of options.additionalCameras)
|
|
336
|
+
cameraSnapshot(camera);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
catch {
|
|
340
|
+
eligible = false;
|
|
341
|
+
}
|
|
342
|
+
if (!eligible) {
|
|
343
|
+
dispose();
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
return { isValid() {
|
|
347
|
+
if (disposed || invalid)
|
|
348
|
+
return false;
|
|
349
|
+
try {
|
|
350
|
+
for (const check of checks)
|
|
351
|
+
if (!check()) {
|
|
352
|
+
invalid = true;
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
catch {
|
|
358
|
+
invalid = true;
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
}, dispose };
|
|
362
|
+
}
|
|
363
|
+
//# sourceMappingURL=sceneEndpointEligibility.js.map
|