@3driseai/3drise-viewer 0.1.25 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animationsV2/ClipPlayer.d.ts +16 -0
- package/dist/animationsV2/ClipPlayer.d.ts.map +1 -0
- package/dist/animationsV2/ClipPlayer.js +199 -0
- package/dist/animationsV2/ClipsRuntime.d.ts +150 -0
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -0
- package/dist/animationsV2/ClipsRuntime.js +707 -0
- package/dist/animationsV2/appliers.d.ts +21 -0
- package/dist/animationsV2/appliers.d.ts.map +1 -0
- package/dist/animationsV2/appliers.js +222 -0
- package/dist/animationsV2/clipUtils.d.ts +33 -0
- package/dist/animationsV2/clipUtils.d.ts.map +1 -0
- package/dist/animationsV2/clipUtils.js +164 -0
- package/dist/animationsV2/elementSettings.d.ts +15 -0
- package/dist/animationsV2/elementSettings.d.ts.map +1 -0
- package/dist/animationsV2/elementSettings.js +16 -0
- package/dist/animationsV2/index.d.ts +16 -0
- package/dist/animationsV2/index.d.ts.map +1 -0
- package/dist/animationsV2/index.js +12 -0
- package/dist/animationsV2/nodeTracks.d.ts +13 -0
- package/dist/animationsV2/nodeTracks.d.ts.map +1 -0
- package/dist/animationsV2/nodeTracks.js +165 -0
- package/dist/animationsV2/normalize.d.ts +4 -0
- package/dist/animationsV2/normalize.d.ts.map +1 -0
- package/dist/animationsV2/normalize.js +60 -0
- package/dist/animationsV2/sequenceUtils.d.ts +98 -0
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -0
- package/dist/animationsV2/sequenceUtils.js +220 -0
- package/dist/animationsV2/types.d.ts +115 -0
- package/dist/animationsV2/types.d.ts.map +1 -0
- package/dist/animationsV2/types.js +8 -0
- package/dist/api/sceneHandle.d.ts +56 -17
- package/dist/api/sceneHandle.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +154 -77
- package/dist/components/AdvancedGrid.d.ts +8 -2
- package/dist/components/AdvancedGrid.d.ts.map +1 -1
- package/dist/components/AdvancedGrid.js +31 -14
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +7 -5
- package/dist/components/Bubbles.d.ts +7 -1
- package/dist/components/Bubbles.d.ts.map +1 -1
- package/dist/components/Bubbles.js +42 -22
- package/dist/components/CameraController.d.ts.map +1 -1
- package/dist/components/CameraController.js +0 -44
- package/dist/components/ChladniGrid.d.ts +8 -4
- package/dist/components/ChladniGrid.d.ts.map +1 -1
- package/dist/components/ChladniGrid.js +31 -13
- package/dist/components/CircuitGrid.d.ts +8 -11
- package/dist/components/CircuitGrid.d.ts.map +1 -1
- package/dist/components/CircuitGrid.js +31 -13
- package/dist/components/Clouds.d.ts.map +1 -1
- package/dist/components/Clouds.js +0 -34
- package/dist/components/CloudsGenerator.d.ts +1 -1
- package/dist/components/CloudsGenerator.js +1 -1
- package/dist/components/ContourGrid.d.ts +8 -14
- package/dist/components/ContourGrid.d.ts.map +1 -1
- package/dist/components/ContourGrid.js +31 -13
- package/dist/components/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +19 -1
- package/dist/components/EffectsGenerator.d.ts +7 -1
- package/dist/components/EffectsGenerator.d.ts.map +1 -1
- package/dist/components/EffectsGenerator.js +39 -38
- package/dist/components/EnvironmentManager.d.ts +4 -4
- package/dist/components/EnvironmentManager.d.ts.map +1 -1
- package/dist/components/EnvironmentManager.js +1 -1
- package/dist/components/FlowNetGrid.d.ts +8 -4
- package/dist/components/FlowNetGrid.d.ts.map +1 -1
- package/dist/components/FlowNetGrid.js +31 -13
- package/dist/components/FractalGrid.d.ts +8 -12
- package/dist/components/FractalGrid.d.ts.map +1 -1
- package/dist/components/FractalGrid.js +31 -13
- package/dist/components/GirihGrid.d.ts +8 -1
- package/dist/components/GirihGrid.d.ts.map +1 -1
- package/dist/components/GirihGrid.js +31 -13
- package/dist/components/Glyphs.d.ts +7 -1
- package/dist/components/Glyphs.d.ts.map +1 -1
- package/dist/components/Glyphs.js +40 -34
- package/dist/components/GravWaveGrid.d.ts +8 -1
- package/dist/components/GravWaveGrid.d.ts.map +1 -1
- package/dist/components/GravWaveGrid.js +31 -13
- package/dist/components/GridsGenerator.d.ts +7 -1
- package/dist/components/GridsGenerator.d.ts.map +1 -1
- package/dist/components/GridsGenerator.js +20 -18
- package/dist/components/HexGrid.d.ts +8 -10
- package/dist/components/HexGrid.d.ts.map +1 -1
- package/dist/components/HexGrid.js +31 -13
- package/dist/components/HyperbolicGrid.d.ts +8 -4
- package/dist/components/HyperbolicGrid.d.ts.map +1 -1
- package/dist/components/HyperbolicGrid.js +31 -13
- package/dist/components/LandscapeBuilder.d.ts +1 -1
- package/dist/components/LandscapeBuilder.d.ts.map +1 -1
- package/dist/components/LandscapeBuilder.js +1 -1
- package/dist/components/LandscapeObject.d.ts +1 -1
- package/dist/components/LandscapeObject.d.ts.map +1 -1
- package/dist/components/LandscapeObject.js +1 -1
- package/dist/components/MoireGrid.d.ts +8 -12
- package/dist/components/MoireGrid.d.ts.map +1 -1
- package/dist/components/MoireGrid.js +31 -13
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +2 -2
- package/dist/components/ObjectsRenderer.d.ts +4 -1
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +57 -3
- package/dist/components/Ocean.d.ts.map +1 -1
- package/dist/components/Ocean.js +0 -63
- package/dist/components/OceanBuilder.d.ts +1 -1
- package/dist/components/OceanBuilder.js +1 -1
- package/dist/components/ParticlesGenerator.d.ts.map +1 -1
- package/dist/components/ParticlesGenerator.js +6 -0
- package/dist/components/QuasiGrid.d.ts +8 -11
- package/dist/components/QuasiGrid.d.ts.map +1 -1
- package/dist/components/QuasiGrid.js +31 -13
- package/dist/components/RadarGrid.d.ts +8 -13
- package/dist/components/RadarGrid.d.ts.map +1 -1
- package/dist/components/RadarGrid.js +31 -13
- package/dist/components/ReactionDiffusionGrid.d.ts +8 -1
- package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
- package/dist/components/ReactionDiffusionGrid.js +33 -139
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +19 -4
- package/dist/components/SkyController.d.ts.map +1 -1
- package/dist/components/SkyController.js +0 -39
- package/dist/components/SkySystem.d.ts +1 -1
- package/dist/components/SparklesBurst.d.ts +7 -1
- package/dist/components/SparklesBurst.d.ts.map +1 -1
- package/dist/components/SparklesBurst.js +31 -28
- package/dist/components/Stars.d.ts.map +1 -1
- package/dist/components/Stars.js +3 -47
- package/dist/components/TerrainBuilder.d.ts +1 -1
- package/dist/components/TerrainBuilder.d.ts.map +1 -1
- package/dist/components/TerrainBuilder.js +1 -1
- package/dist/components/VoronoiGrid.d.ts +8 -10
- package/dist/components/VoronoiGrid.d.ts.map +1 -1
- package/dist/components/VoronoiGrid.js +31 -13
- package/dist/components/WallpaperGrid.d.ts +8 -1
- package/dist/components/WallpaperGrid.d.ts.map +1 -1
- package/dist/components/WallpaperGrid.js +33 -210
- package/dist/components/effects/AuraEffect.d.ts +8 -3
- package/dist/components/effects/AuraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuraEffect.js +49 -24
- package/dist/components/effects/AuroraEffect.d.ts +8 -3
- package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuroraEffect.js +45 -25
- package/dist/components/effects/BlackHoleEffect.d.ts +8 -3
- package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
- package/dist/components/effects/BlackHoleEffect.js +42 -21
- package/dist/components/effects/ConstellationEffect.d.ts +8 -3
- package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
- package/dist/components/effects/ConstellationEffect.js +49 -23
- package/dist/components/effects/DandelionSeedsEffect.d.ts +7 -2
- package/dist/components/effects/DandelionSeedsEffect.d.ts.map +1 -1
- package/dist/components/effects/DandelionSeedsEffect.js +19 -9
- package/dist/components/effects/DataStreamEffect.d.ts +8 -3
- package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
- package/dist/components/effects/DataStreamEffect.js +54 -26
- package/dist/components/effects/DnaHelixEffect.d.ts +8 -3
- package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
- package/dist/components/effects/DnaHelixEffect.js +62 -30
- package/dist/components/effects/FallingLeavesEffect.d.ts +7 -2
- package/dist/components/effects/FallingLeavesEffect.d.ts.map +1 -1
- package/dist/components/effects/FallingLeavesEffect.js +19 -9
- package/dist/components/effects/FieldLinesEffect.d.ts +8 -3
- package/dist/components/effects/FieldLinesEffect.d.ts.map +1 -1
- package/dist/components/effects/FieldLinesEffect.js +30 -20
- package/dist/components/effects/Fire.d.ts +8 -3
- package/dist/components/effects/Fire.d.ts.map +1 -1
- package/dist/components/effects/Fire.js +47 -10
- package/dist/components/effects/FireflySwarmEffect.d.ts +7 -2
- package/dist/components/effects/FireflySwarmEffect.d.ts.map +1 -1
- package/dist/components/effects/FireflySwarmEffect.js +19 -9
- package/dist/components/effects/Flares.d.ts +10 -3
- package/dist/components/effects/Flares.d.ts.map +1 -1
- package/dist/components/effects/Flares.js +53 -56
- package/dist/components/effects/ForcefieldEffect.d.ts +8 -3
- package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
- package/dist/components/effects/ForcefieldEffect.js +52 -33
- package/dist/components/effects/GalaxyEffect.d.ts +7 -2
- package/dist/components/effects/GalaxyEffect.d.ts.map +1 -1
- package/dist/components/effects/GalaxyEffect.js +19 -9
- package/dist/components/effects/HarmonicShellEffect.d.ts +8 -3
- package/dist/components/effects/HarmonicShellEffect.d.ts.map +1 -1
- package/dist/components/effects/HarmonicShellEffect.js +30 -22
- package/dist/components/effects/HologramEffect.d.ts +8 -3
- package/dist/components/effects/HologramEffect.d.ts.map +1 -1
- package/dist/components/effects/HologramEffect.js +52 -23
- package/dist/components/effects/IceCrystalsEffect.d.ts +8 -3
- package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
- package/dist/components/effects/IceCrystalsEffect.js +36 -21
- package/dist/components/effects/IceHaloEffect.d.ts +7 -2
- package/dist/components/effects/IceHaloEffect.d.ts.map +1 -1
- package/dist/components/effects/IceHaloEffect.js +19 -9
- package/dist/components/effects/LichtenbergEffect.d.ts +7 -2
- package/dist/components/effects/LichtenbergEffect.d.ts.map +1 -1
- package/dist/components/effects/LichtenbergEffect.js +19 -9
- package/dist/components/effects/LightningEffect.d.ts +8 -3
- package/dist/components/effects/LightningEffect.d.ts.map +1 -1
- package/dist/components/effects/LightningEffect.js +54 -32
- package/dist/components/effects/MoleculesEffect.d.ts +8 -3
- package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
- package/dist/components/effects/MoleculesEffect.js +31 -21
- package/dist/components/effects/MurmurationEffect.d.ts +7 -2
- package/dist/components/effects/MurmurationEffect.d.ts.map +1 -1
- package/dist/components/effects/MurmurationEffect.js +19 -9
- package/dist/components/effects/NeuralNetworkEffect.d.ts +8 -3
- package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
- package/dist/components/effects/NeuralNetworkEffect.js +66 -33
- package/dist/components/effects/OrbEffect.d.ts +8 -3
- package/dist/components/effects/OrbEffect.d.ts.map +1 -1
- package/dist/components/effects/OrbEffect.js +89 -42
- package/dist/components/effects/PlanetaryRingsEffect.d.ts +7 -2
- package/dist/components/effects/PlanetaryRingsEffect.d.ts.map +1 -1
- package/dist/components/effects/PlanetaryRingsEffect.js +19 -9
- package/dist/components/effects/PortalEffect.d.ts +8 -3
- package/dist/components/effects/PortalEffect.d.ts.map +1 -1
- package/dist/components/effects/PortalEffect.js +41 -25
- package/dist/components/effects/ShockwaveEffect.d.ts +7 -2
- package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
- package/dist/components/effects/ShockwaveEffect.js +19 -9
- package/dist/components/effects/SmokePlumeEffect.d.ts +8 -3
- package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokePlumeEffect.js +30 -20
- package/dist/components/effects/SmokeRibbon.d.ts +8 -2
- package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
- package/dist/components/effects/SmokeRibbon.js +34 -24
- package/dist/components/effects/SmokeRingEffect.d.ts +8 -3
- package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokeRingEffect.js +33 -21
- package/dist/components/effects/StrangeAttractorEffect.d.ts +8 -3
- package/dist/components/effects/StrangeAttractorEffect.d.ts.map +1 -1
- package/dist/components/effects/StrangeAttractorEffect.js +30 -20
- package/dist/components/effects/VolumetricFogEffect.d.ts +8 -3
- package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
- package/dist/components/effects/VolumetricFogEffect.js +38 -20
- package/dist/components/effects/WaterCausticsEffect.d.ts +7 -2
- package/dist/components/effects/WaterCausticsEffect.d.ts.map +1 -1
- package/dist/components/effects/WaterCausticsEffect.js +19 -9
- package/dist/components/effects/index.d.ts +0 -1
- package/dist/components/effects/index.d.ts.map +1 -1
- package/dist/components/effects/index.js +0 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/components/landscape/LandscapeMesh.js +1 -1
- package/dist/components/landscape/types.d.ts +1 -1
- package/dist/components/landscape/types.d.ts.map +1 -1
- package/dist/components/particles/MagneticBottleParticles.d.ts +17 -0
- package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -0
- package/dist/components/particles/MagneticBottleParticles.js +618 -0
- package/dist/components/particles/ShapeBurstParticles.d.ts +17 -0
- package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -0
- package/dist/components/particles/ShapeBurstParticles.js +588 -0
- package/dist/components/particles/ShapeFlowParticles.d.ts +17 -0
- package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -0
- package/dist/components/particles/ShapeFlowParticles.js +755 -0
- package/dist/components/particles/index.d.ts +6 -0
- package/dist/components/particles/index.d.ts.map +1 -1
- package/dist/components/particles/index.js +3 -0
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +0 -5
- package/dist/components/terrain/types.d.ts +1 -1
- package/dist/components/terrain/types.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.js +0 -6
- package/dist/components/volumetricClouds/types.d.ts +1 -1
- package/dist/components/volumetricClouds/types.d.ts.map +1 -1
- package/dist/components/water/types.d.ts +1 -1
- package/dist/components/water/types.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -2
- package/dist/hooks/useConfigDriver.d.ts +22 -0
- package/dist/hooks/useConfigDriver.d.ts.map +1 -0
- package/dist/hooks/useConfigDriver.js +43 -0
- package/dist/hooks/useConfigLive.d.ts +1 -1
- package/dist/hooks/useConfigLive.d.ts.map +1 -1
- package/dist/hooks/useInteraction.d.ts +6 -7
- package/dist/hooks/useInteraction.d.ts.map +1 -1
- package/dist/hooks/useInteraction.js +87 -268
- package/dist/hooks/useLandscapeMaps.d.ts +1 -1
- package/dist/hooks/useLandscapeMaps.d.ts.map +1 -1
- package/dist/hooks/useObjectAnimation.d.ts.map +1 -1
- package/dist/hooks/useObjectAnimation.js +0 -2
- package/dist/hooks/useOceanMaterial.d.ts +1 -1
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +0 -5
- package/dist/hooks/useRuntimeSettings.d.ts +1 -1
- package/dist/hooks/useRuntimeSettings.js +1 -1
- package/dist/hooks/useThunder.d.ts +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/interactions/index.d.ts +4 -0
- package/dist/interactions/index.d.ts.map +1 -0
- package/dist/interactions/index.js +1 -0
- package/dist/interactions/runner.d.ts +24 -0
- package/dist/interactions/runner.d.ts.map +1 -0
- package/dist/interactions/runner.js +46 -0
- package/dist/operations/catalogue/curlSmoke.d.ts +3 -0
- package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -0
- package/dist/operations/catalogue/curlSmoke.js +178 -0
- package/dist/operations/catalogue/displayImage.d.ts +3 -0
- package/dist/operations/catalogue/displayImage.d.ts.map +1 -0
- package/dist/operations/catalogue/displayImage.js +40 -0
- package/dist/operations/catalogue/dissolve.d.ts +3 -0
- package/dist/operations/catalogue/dissolve.d.ts.map +1 -0
- package/dist/operations/catalogue/dissolve.js +57 -0
- package/dist/operations/catalogue/emberAsh.d.ts +3 -0
- package/dist/operations/catalogue/emberAsh.d.ts.map +1 -0
- package/dist/operations/catalogue/emberAsh.js +171 -0
- package/dist/operations/catalogue/fade.d.ts +3 -0
- package/dist/operations/catalogue/fade.d.ts.map +1 -0
- package/dist/operations/catalogue/fade.js +45 -0
- package/dist/operations/catalogue/flip.d.ts +3 -0
- package/dist/operations/catalogue/flip.d.ts.map +1 -0
- package/dist/operations/catalogue/flip.js +69 -0
- package/dist/operations/catalogue/flock.d.ts +3 -0
- package/dist/operations/catalogue/flock.d.ts.map +1 -0
- package/dist/operations/catalogue/flock.js +163 -0
- package/dist/operations/catalogue/focus.d.ts +3 -0
- package/dist/operations/catalogue/focus.d.ts.map +1 -0
- package/dist/operations/catalogue/focus.js +23 -0
- package/dist/operations/catalogue/frame.d.ts +3 -0
- package/dist/operations/catalogue/frame.d.ts.map +1 -0
- package/dist/operations/catalogue/frame.js +44 -0
- package/dist/operations/catalogue/frost.d.ts +3 -0
- package/dist/operations/catalogue/frost.d.ts.map +1 -0
- package/dist/operations/catalogue/frost.js +111 -0
- package/dist/operations/catalogue/fxInstances.d.ts +21 -0
- package/dist/operations/catalogue/fxInstances.d.ts.map +1 -0
- package/dist/operations/catalogue/fxInstances.js +47 -0
- package/dist/operations/catalogue/fxPoints.d.ts +22 -0
- package/dist/operations/catalogue/fxPoints.d.ts.map +1 -0
- package/dist/operations/catalogue/fxPoints.js +70 -0
- package/dist/operations/catalogue/glow.d.ts +3 -0
- package/dist/operations/catalogue/glow.d.ts.map +1 -0
- package/dist/operations/catalogue/glow.js +50 -0
- package/dist/operations/catalogue/heatCracks.d.ts +3 -0
- package/dist/operations/catalogue/heatCracks.d.ts.map +1 -0
- package/dist/operations/catalogue/heatCracks.js +134 -0
- package/dist/operations/catalogue/hologram.d.ts +3 -0
- package/dist/operations/catalogue/hologram.d.ts.map +1 -0
- package/dist/operations/catalogue/hologram.js +118 -0
- package/dist/operations/catalogue/inkBloom.d.ts +3 -0
- package/dist/operations/catalogue/inkBloom.d.ts.map +1 -0
- package/dist/operations/catalogue/inkBloom.js +156 -0
- package/dist/operations/catalogue/ivy.d.ts +13 -0
- package/dist/operations/catalogue/ivy.d.ts.map +1 -0
- package/dist/operations/catalogue/ivy.js +469 -0
- package/dist/operations/catalogue/jelly.d.ts +3 -0
- package/dist/operations/catalogue/jelly.d.ts.map +1 -0
- package/dist/operations/catalogue/jelly.js +50 -0
- package/dist/operations/catalogue/kintsugi.d.ts +3 -0
- package/dist/operations/catalogue/kintsugi.d.ts.map +1 -0
- package/dist/operations/catalogue/kintsugi.js +173 -0
- package/dist/operations/catalogue/lidarScan.d.ts +3 -0
- package/dist/operations/catalogue/lidarScan.d.ts.map +1 -0
- package/dist/operations/catalogue/lidarScan.js +240 -0
- package/dist/operations/catalogue/liquidMetal.d.ts +3 -0
- package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -0
- package/dist/operations/catalogue/liquidMetal.js +122 -0
- package/dist/operations/catalogue/materialFx.d.ts +6 -0
- package/dist/operations/catalogue/materialFx.d.ts.map +1 -0
- package/dist/operations/catalogue/materialFx.js +13 -0
- package/dist/operations/catalogue/metalize.d.ts +3 -0
- package/dist/operations/catalogue/metalize.d.ts.map +1 -0
- package/dist/operations/catalogue/metalize.js +135 -0
- package/dist/operations/catalogue/moveToFront.d.ts +3 -0
- package/dist/operations/catalogue/moveToFront.d.ts.map +1 -0
- package/dist/operations/catalogue/moveToFront.js +26 -0
- package/dist/operations/catalogue/orbit.d.ts +3 -0
- package/dist/operations/catalogue/orbit.d.ts.map +1 -0
- package/dist/operations/catalogue/orbit.js +29 -0
- package/dist/operations/catalogue/particleSwarm.d.ts +3 -0
- package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -0
- package/dist/operations/catalogue/particleSwarm.js +138 -0
- package/dist/operations/catalogue/petalPeel.d.ts +3 -0
- package/dist/operations/catalogue/petalPeel.d.ts.map +1 -0
- package/dist/operations/catalogue/petalPeel.js +137 -0
- package/dist/operations/catalogue/petrify.d.ts +3 -0
- package/dist/operations/catalogue/petrify.d.ts.map +1 -0
- package/dist/operations/catalogue/petrify.js +94 -0
- package/dist/operations/catalogue/portal.d.ts +3 -0
- package/dist/operations/catalogue/portal.d.ts.map +1 -0
- package/dist/operations/catalogue/portal.js +224 -0
- package/dist/operations/catalogue/print3d.d.ts +3 -0
- package/dist/operations/catalogue/print3d.d.ts.map +1 -0
- package/dist/operations/catalogue/print3d.js +275 -0
- package/dist/operations/catalogue/rainBeads.d.ts +3 -0
- package/dist/operations/catalogue/rainBeads.d.ts.map +1 -0
- package/dist/operations/catalogue/rainBeads.js +223 -0
- package/dist/operations/catalogue/restPose.d.ts +21 -0
- package/dist/operations/catalogue/restPose.d.ts.map +1 -0
- package/dist/operations/catalogue/restPose.js +55 -0
- package/dist/operations/catalogue/rimLight.d.ts +3 -0
- package/dist/operations/catalogue/rimLight.d.ts.map +1 -0
- package/dist/operations/catalogue/rimLight.js +72 -0
- package/dist/operations/catalogue/sandErosion.d.ts +3 -0
- package/dist/operations/catalogue/sandErosion.d.ts.map +1 -0
- package/dist/operations/catalogue/sandErosion.js +167 -0
- package/dist/operations/catalogue/shaderLayers.d.ts +74 -0
- package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -0
- package/dist/operations/catalogue/shaderLayers.js +322 -0
- package/dist/operations/catalogue/shatter.d.ts +3 -0
- package/dist/operations/catalogue/shatter.d.ts.map +1 -0
- package/dist/operations/catalogue/shatter.js +267 -0
- package/dist/operations/catalogue/silkDrape.d.ts +3 -0
- package/dist/operations/catalogue/silkDrape.d.ts.map +1 -0
- package/dist/operations/catalogue/silkDrape.js +340 -0
- package/dist/operations/catalogue/spin.d.ts +3 -0
- package/dist/operations/catalogue/spin.d.ts.map +1 -0
- package/dist/operations/catalogue/spin.js +42 -0
- package/dist/operations/catalogue/surfaceSample.d.ts +17 -0
- package/dist/operations/catalogue/surfaceSample.d.ts.map +1 -0
- package/dist/operations/catalogue/surfaceSample.js +187 -0
- package/dist/operations/catalogue/swirl.d.ts +3 -0
- package/dist/operations/catalogue/swirl.d.ts.map +1 -0
- package/dist/operations/catalogue/swirl.js +69 -0
- package/dist/operations/catalogue/teleport.d.ts +3 -0
- package/dist/operations/catalogue/teleport.d.ts.map +1 -0
- package/dist/operations/catalogue/teleport.js +213 -0
- package/dist/operations/catalogue/transitionField.d.ts +124 -0
- package/dist/operations/catalogue/transitionField.d.ts.map +1 -0
- package/dist/operations/catalogue/transitionField.js +278 -0
- package/dist/operations/catalogue/unweave.d.ts +3 -0
- package/dist/operations/catalogue/unweave.d.ts.map +1 -0
- package/dist/operations/catalogue/unweave.js +233 -0
- package/dist/operations/catalogue/visibility.d.ts +3 -0
- package/dist/operations/catalogue/visibility.d.ts.map +1 -0
- package/dist/operations/catalogue/visibility.js +25 -0
- package/dist/operations/catalogue/voxelize.d.ts +3 -0
- package/dist/operations/catalogue/voxelize.d.ts.map +1 -0
- package/dist/operations/catalogue/voxelize.js +148 -0
- package/dist/operations/catalogue/warmup.d.ts +22 -0
- package/dist/operations/catalogue/warmup.d.ts.map +1 -0
- package/dist/operations/catalogue/warmup.js +106 -0
- package/dist/operations/catalogue/zoom.d.ts +3 -0
- package/dist/operations/catalogue/zoom.d.ts.map +1 -0
- package/dist/operations/catalogue/zoom.js +33 -0
- package/dist/operations/index.d.ts +7 -0
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +6 -0
- package/dist/operations/objectEffects.d.ts +46 -0
- package/dist/operations/objectEffects.d.ts.map +1 -0
- package/dist/operations/objectEffects.js +136 -0
- package/dist/operations/registry.d.ts +16 -0
- package/dist/operations/registry.d.ts.map +1 -0
- package/dist/operations/registry.js +63 -0
- package/dist/operations/runtime.d.ts +60 -0
- package/dist/operations/runtime.d.ts.map +1 -0
- package/dist/operations/runtime.js +317 -0
- package/dist/operations/types.d.ts +122 -0
- package/dist/operations/types.d.ts.map +1 -0
- package/dist/operations/types.js +9 -0
- package/dist/operations/useObjectEffectLayers.d.ts +4 -0
- package/dist/operations/useObjectEffectLayers.d.ts.map +1 -0
- package/dist/operations/useObjectEffectLayers.js +42 -0
- package/dist/operations/useOperationsRuntime.d.ts +3 -0
- package/dist/operations/useOperationsRuntime.d.ts.map +1 -0
- package/dist/operations/useOperationsRuntime.js +69 -0
- package/dist/presets/landscapePresets.d.ts +1 -1
- package/dist/presets/landscapePresets.d.ts.map +1 -1
- package/dist/presets/landscapePresets.js +1 -1
- package/dist/presets/landscapeTypes.d.ts +1 -1
- package/dist/presets/landscapeTypes.d.ts.map +1 -1
- package/dist/presets/landscapeTypes.js +1 -1
- package/dist/presets/oceanSurfacePresets.d.ts +1 -1
- package/dist/presets/terrainPresets.d.ts +1 -1
- package/dist/presets/terrainPresets.d.ts.map +1 -1
- package/dist/presets/volumetricCloudPresets.d.ts +1 -1
- package/dist/types/cloudConfigs.d.ts +2 -309
- package/dist/types/cloudConfigs.d.ts.map +1 -1
- package/dist/types/cloudConfigs.js +2 -339
- package/dist/types/index.d.ts +8 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +4 -4
- package/dist/types/landscapeConfigs.d.ts +2 -217
- package/dist/types/landscapeConfigs.d.ts.map +1 -1
- package/dist/types/landscapeConfigs.js +2 -256
- package/dist/types/oceanConfigs.d.ts +2 -289
- package/dist/types/oceanConfigs.d.ts.map +1 -1
- package/dist/types/oceanConfigs.js +2 -380
- package/dist/types/terrainConfigs.d.ts +2 -250
- package/dist/types/terrainConfigs.d.ts.map +1 -1
- package/dist/types/terrainConfigs.js +2 -292
- package/dist/utils/cloudUniforms.d.ts +1 -1
- package/dist/utils/configAnimations.d.ts +6 -0
- package/dist/utils/configAnimations.d.ts.map +1 -1
- package/dist/utils/configAnimations.js +14 -0
- package/dist/utils/gridConfig.d.ts +19 -0
- package/dist/utils/gridConfig.d.ts.map +1 -0
- package/dist/utils/gridConfig.js +52 -0
- package/dist/utils/handleCloudsAnimations.d.ts +1 -1
- package/dist/utils/handleCloudsAnimations.js +1 -1
- package/dist/utils/hasHoverAnimation.d.ts.map +1 -1
- package/dist/utils/hasHoverAnimation.js +0 -2
- package/dist/utils/landscapeUniforms.d.ts +1 -1
- package/dist/utils/landscapeUniforms.d.ts.map +1 -1
- package/dist/utils/oceanUniforms.d.ts +1 -1
- package/dist/utils/particleShape.d.ts +33 -0
- package/dist/utils/particleShape.d.ts.map +1 -0
- package/dist/utils/particleShape.js +207 -0
- package/dist/utils/particleTrails.d.ts.map +1 -1
- package/dist/utils/particleTrails.js +29 -14
- package/dist/utils/terrainUniforms.d.ts +1 -1
- package/dist/utils/terrainUniforms.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// Voxelise — the surface is digitised into small cubes, then the cubes peel off
|
|
2
|
+
// and float away. Each cube is a real lit voxel (one instanced mesh, casting
|
|
3
|
+
// shadows) holding the average colour of the surface it replaced. As the front
|
|
4
|
+
// passes, the surface goes and its voxel pops in with a brief flash; a moment
|
|
5
|
+
// later the voxel lifts off along the surface normal and upward, tumbling and
|
|
6
|
+
// shrinking. Reverting flies every cube back and the surface re-forms.
|
|
7
|
+
import { BoxGeometry } from 'three';
|
|
8
|
+
import { defineOperation } from '../types.js';
|
|
9
|
+
import { GLSL_ROT, addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
|
|
10
|
+
import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, hideMeshes, runProgress, setFieldParams, surfaceLayer, } from './transitionField.js';
|
|
11
|
+
import { sampleSurfaceCached, mulberry32 } from './surfaceSample.js';
|
|
12
|
+
import { createFxInstances, disposeFxInstances } from './fxInstances.js';
|
|
13
|
+
const P = 'Vox';
|
|
14
|
+
const KEY = 'voxelize';
|
|
15
|
+
const STATE = '__opVoxelize';
|
|
16
|
+
const LIFE = 0.75;
|
|
17
|
+
/** Quantise surface samples to a grid: one voxel per occupied cell, averaged. */
|
|
18
|
+
function buildVoxels(target, resolution) {
|
|
19
|
+
const sample = sampleSurfaceCached(target, 40000, 37);
|
|
20
|
+
let min = [Infinity, Infinity, Infinity], max = [-Infinity, -Infinity, -Infinity];
|
|
21
|
+
for (let i = 0; i < sample.count; i++)
|
|
22
|
+
for (let a = 0; a < 3; a++) {
|
|
23
|
+
min[a] = Math.min(min[a], sample.position[i * 3 + a]);
|
|
24
|
+
max[a] = Math.max(max[a], sample.position[i * 3 + a]);
|
|
25
|
+
}
|
|
26
|
+
const cell = Math.max(max[0] - min[0], max[1] - min[1], max[2] - min[2], 1e-3) / Math.max(4, resolution);
|
|
27
|
+
const cells = new Map();
|
|
28
|
+
for (let i = 0; i < sample.count; i++) {
|
|
29
|
+
const ix = Math.floor((sample.position[i * 3] - min[0]) / cell);
|
|
30
|
+
const iy = Math.floor((sample.position[i * 3 + 1] - min[1]) / cell);
|
|
31
|
+
const iz = Math.floor((sample.position[i * 3 + 2] - min[2]) / cell);
|
|
32
|
+
const key = `${ix},${iy},${iz}`;
|
|
33
|
+
let v = cells.get(key);
|
|
34
|
+
if (!v) {
|
|
35
|
+
v = { p: [min[0] + (ix + 0.5) * cell, min[1] + (iy + 0.5) * cell, min[2] + (iz + 0.5) * cell], n: [0, 0, 0], c: [0, 0, 0], k: 0 };
|
|
36
|
+
cells.set(key, v);
|
|
37
|
+
}
|
|
38
|
+
for (let a = 0; a < 3; a++) {
|
|
39
|
+
v.n[a] += sample.normal[i * 3 + a];
|
|
40
|
+
v.c[a] += sample.color[i * 3 + a];
|
|
41
|
+
}
|
|
42
|
+
v.k++;
|
|
43
|
+
}
|
|
44
|
+
const n = cells.size;
|
|
45
|
+
const positions = new Float32Array(n * 3), normals = new Float32Array(n * 3), colors = new Float32Array(n * 3), rand = new Float32Array(n * 4);
|
|
46
|
+
const rnd = mulberry32(41);
|
|
47
|
+
let i = 0;
|
|
48
|
+
for (const v of cells.values()) {
|
|
49
|
+
const len = Math.hypot(v.n[0], v.n[1], v.n[2]) || 1;
|
|
50
|
+
for (let a = 0; a < 3; a++) {
|
|
51
|
+
positions[i * 3 + a] = v.p[a];
|
|
52
|
+
normals[i * 3 + a] = v.n[a] / len;
|
|
53
|
+
colors[i * 3 + a] = v.c[a] / v.k;
|
|
54
|
+
}
|
|
55
|
+
for (let a = 0; a < 4; a++)
|
|
56
|
+
rand[i * 4 + a] = rnd();
|
|
57
|
+
i++;
|
|
58
|
+
}
|
|
59
|
+
return { n, cell, positions, normals, colors, rand };
|
|
60
|
+
}
|
|
61
|
+
export default defineOperation({
|
|
62
|
+
value: 'voxelize',
|
|
63
|
+
label: 'Voxelise',
|
|
64
|
+
description: 'Digitise the targets into cubes that peel off and float away — reverting clicks them back',
|
|
65
|
+
channel: 'visual',
|
|
66
|
+
multi: true,
|
|
67
|
+
toggles: true,
|
|
68
|
+
usableIn: ['interaction', 'action'],
|
|
69
|
+
params: {
|
|
70
|
+
direction: { type: 'select', label: 'Direction', default: 'up', options: DIRECTION_OPTIONS },
|
|
71
|
+
resolution: { type: 'number', label: 'Resolution', default: 26, min: 6, max: 70, step: 1, hint: 'Cubes across the object’s largest side' },
|
|
72
|
+
lift: { type: 'number', label: 'Float', default: 1, min: 0, max: 4, step: 0.05, unit: '×' },
|
|
73
|
+
edgeColor: { type: 'color', label: 'Scan colour', default: '#7fe3ff' },
|
|
74
|
+
scale: { type: 'number', label: 'Pattern', default: 2, min: 0.5, max: 12, step: 0.1 },
|
|
75
|
+
duration: { type: 'number', label: 'Duration', default: 3, min: 0.3, max: 12, step: 0.1, unit: 's' },
|
|
76
|
+
},
|
|
77
|
+
apply(target, p, ctx) {
|
|
78
|
+
let st = target.userData[STATE];
|
|
79
|
+
if (!st) {
|
|
80
|
+
const field = createFieldState(target);
|
|
81
|
+
field.edgeWidth.value = 0.04;
|
|
82
|
+
const life = { value: LIFE }, lift = { value: 1 };
|
|
83
|
+
const vox = buildVoxels(target, Math.round(Number(p.resolution)));
|
|
84
|
+
const s = vox.cell * 0.94;
|
|
85
|
+
const mesh = createFxInstances(target, {
|
|
86
|
+
geometry: new BoxGeometry(s, s, s),
|
|
87
|
+
count: vox.n, positions: vox.positions, colors: vox.colors,
|
|
88
|
+
attributes: { aVoxP: [vox.positions, 3], aVoxN: [vox.normals, 3], aVoxR: [vox.rand, 4] },
|
|
89
|
+
layerKey: 'voxelInstances', roughness: 0.55, metalness: 0.05,
|
|
90
|
+
layer: {
|
|
91
|
+
uniforms: { ...fieldUniforms(P, field), uVoxLife: life, uVoxLift: lift },
|
|
92
|
+
common: `varying float vVoxFlash;\n${fieldGlsl(P)}\n${GLSL_ROT}`,
|
|
93
|
+
vertexPars: /* glsl */ `
|
|
94
|
+
attribute vec3 aVoxP; attribute vec3 aVoxN; attribute vec4 aVoxR;
|
|
95
|
+
float voxAge() { return (uVoxProgress - VoxBirthOf(VoxField(VoxNorm(aVoxP)))) / uVoxLife; }
|
|
96
|
+
mat3 voxSpin(float a) { float fly = smoothstep(0.3, 1.0, a); return fxRot(normalize(aVoxR.xyz - 0.5 + vec3(1e-3)), fly * fly * (2.0 + 3.0 * aVoxR.w)); }`,
|
|
97
|
+
normal: `{ objectNormal = voxSpin(voxAge()) * objectNormal; }`,
|
|
98
|
+
vertex: /* glsl */ `
|
|
99
|
+
{
|
|
100
|
+
float a = voxAge();
|
|
101
|
+
float pop = smoothstep(0.0, 0.14, a);
|
|
102
|
+
float fly = smoothstep(0.3, 1.0, a);
|
|
103
|
+
float sc = pop * (1.0 - smoothstep(0.72, 1.0, a));
|
|
104
|
+
float E = uVoxExtent;
|
|
105
|
+
vec3 off = (aVoxN * 0.3 + vec3(0.0, 1.0, 0.0) * (0.6 + 0.8 * aVoxR.y)) * E * 0.55 * uVoxLift * fly * fly
|
|
106
|
+
+ (aVoxR.xyz - 0.5) * E * 0.25 * fly;
|
|
107
|
+
transformed = voxSpin(a) * (transformed * sc) + off;
|
|
108
|
+
vVoxFlash = pop * (1.0 - smoothstep(0.1, 0.24, a));
|
|
109
|
+
}`,
|
|
110
|
+
emissive: `totalEmissiveRadiance += uVoxEdgeColor * vVoxFlash * 0.7;`,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
st = { field, life, lift, mesh, mats: new Set() };
|
|
114
|
+
const own = st;
|
|
115
|
+
const layer = surfaceLayer(P, field, 'tint');
|
|
116
|
+
forEachMeshMaterial(target, (mat, m) => {
|
|
117
|
+
if (m.userData?.__opFxHelper)
|
|
118
|
+
return;
|
|
119
|
+
if (addLayer(mat, KEY, layer))
|
|
120
|
+
own.mats.add(mat);
|
|
121
|
+
});
|
|
122
|
+
target.userData[STATE] = st;
|
|
123
|
+
}
|
|
124
|
+
const s = st;
|
|
125
|
+
setFieldParams(s.field, p, target, ctx);
|
|
126
|
+
s.lift.value = Number(p.lift);
|
|
127
|
+
s.mesh.visible = true;
|
|
128
|
+
return runProgress(target, s.field, 1 + LIFE, {
|
|
129
|
+
duration: Number(p.duration), ease: 'none',
|
|
130
|
+
onComplete: () => { hideMeshes(target, KEY, true); s.mesh.visible = false; },
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
revert(target, p) {
|
|
134
|
+
const s = target.userData[STATE];
|
|
135
|
+
if (!s)
|
|
136
|
+
return;
|
|
137
|
+
hideMeshes(target, KEY, false);
|
|
138
|
+
s.mesh.visible = true;
|
|
139
|
+
return runProgress(target, s.field, 0, {
|
|
140
|
+
duration: Number(p.duration), ease: 'none',
|
|
141
|
+
onComplete: () => {
|
|
142
|
+
s.mats.forEach(m => removeLayer(m, KEY));
|
|
143
|
+
disposeFxInstances(s.mesh);
|
|
144
|
+
delete target.userData[STATE];
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Object3D } from 'three';
|
|
2
|
+
export interface WarmContext {
|
|
3
|
+
gl: any;
|
|
4
|
+
scene: any;
|
|
5
|
+
cam: any;
|
|
6
|
+
}
|
|
7
|
+
export declare function warmContext(): WarmContext | null;
|
|
8
|
+
/** compileAsync with a safety timeout (a driver that never reports ready must not hang an effect). */
|
|
9
|
+
export declare function compileInBackground(root: Object3D, timeoutMs?: number): Promise<void>;
|
|
10
|
+
/** Keep a freshly created helper off screen until its shaders are compiled (see warmHelpers). */
|
|
11
|
+
export declare function hideUntilWarm(obj: Object3D): void;
|
|
12
|
+
/** Compile every helper under `root` that is waiting, in the background, then show it. */
|
|
13
|
+
export declare function warmHelpers(root: Object3D): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Warm-only runs (pre-warming): while this is on, an effect's runProgress compiles
|
|
16
|
+
* everything it needs and then stops — nothing animates. See runtime.prewarmEffect.
|
|
17
|
+
*/
|
|
18
|
+
export declare const warmMode: {
|
|
19
|
+
on: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare function retainPrograms(root: Object3D): void;
|
|
22
|
+
//# sourceMappingURL=warmup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warmup.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/warmup.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAY,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGhD,MAAM,WAAW,WAAW;IAAG,EAAE,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE;AAE9D,wBAAgB,WAAW,IAAI,WAAW,GAAG,IAAI,CAGhD;AAED,sGAAsG;AACtG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAQnF;AAUD,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,GAAG,EAAE,QAAQ,QAI1C;AAED,0FAA0F;AAC1F,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAQzD;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ;;CAAgB,CAAC;AAStC,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,QAmB5C"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Shader warm-up — effects never freeze the scene.
|
|
3
|
+
// =============================================================================
|
|
4
|
+
//
|
|
5
|
+
// WebGL compiles a shader program the first time a material is drawn with new
|
|
6
|
+
// code, and three.js does that synchronously inside the frame: the whole scene
|
|
7
|
+
// stops until it is done (worst on Windows, where ANGLE translates to Direct3D).
|
|
8
|
+
// three's compileAsync avoids that — with KHR_parallel_shader_compile it issues
|
|
9
|
+
// the compile and polls for completion without blocking — but only for objects
|
|
10
|
+
// that are NOT being drawn yet: a visible material with new code still compiles
|
|
11
|
+
// synchronously on the next frame.
|
|
12
|
+
//
|
|
13
|
+
// So effects compile before anything changes on screen:
|
|
14
|
+
// • layered materials: the layer is staged, a hidden clone with the same code
|
|
15
|
+
// is compiled in the background, then the layer is committed to the live
|
|
16
|
+
// material — three finds the finished program in its cache (same cache key)
|
|
17
|
+
// and reuses it, no compile (see shaderLayers.commitPendingLayers);
|
|
18
|
+
// • effect helpers (particles, threads, rings, beams, instances): their
|
|
19
|
+
// materials start hidden (material.visible = false; three still compiles
|
|
20
|
+
// hidden materials) and are shown once their program is ready.
|
|
21
|
+
// Without a renderer / camera (SSR, tests) everything happens immediately.
|
|
22
|
+
//
|
|
23
|
+
import { SceneStore } from '@3driseai/3drise-core';
|
|
24
|
+
import { InstancedMesh, LineSegments, Mesh, Points } from 'three';
|
|
25
|
+
import cameraManager from '../../utils/CameraSingleton.js';
|
|
26
|
+
export function warmContext() {
|
|
27
|
+
const gl = SceneStore.gl, scene = SceneStore.scene, cam = cameraManager.getCamera?.();
|
|
28
|
+
return gl && scene && cam && typeof gl.compileAsync === 'function' ? { gl, scene, cam } : null;
|
|
29
|
+
}
|
|
30
|
+
/** compileAsync with a safety timeout (a driver that never reports ready must not hang an effect). */
|
|
31
|
+
export function compileInBackground(root, timeoutMs = 8000) {
|
|
32
|
+
const ctx = warmContext();
|
|
33
|
+
if (!ctx)
|
|
34
|
+
return Promise.resolve();
|
|
35
|
+
let timer;
|
|
36
|
+
return Promise.race([
|
|
37
|
+
Promise.resolve(ctx.gl.compileAsync(root, ctx.cam, ctx.scene)).then(() => undefined, () => undefined),
|
|
38
|
+
new Promise(r => { timer = setTimeout(r, timeoutMs); }),
|
|
39
|
+
]).finally(() => clearTimeout(timer));
|
|
40
|
+
}
|
|
41
|
+
const FLAG = '__opFxWarm';
|
|
42
|
+
const materialsOf = (obj) => {
|
|
43
|
+
const out = [];
|
|
44
|
+
obj.traverse((c) => { if (c.material)
|
|
45
|
+
out.push(...(Array.isArray(c.material) ? c.material : [c.material])); });
|
|
46
|
+
return out;
|
|
47
|
+
};
|
|
48
|
+
/** Keep a freshly created helper off screen until its shaders are compiled (see warmHelpers). */
|
|
49
|
+
export function hideUntilWarm(obj) {
|
|
50
|
+
if (!warmContext())
|
|
51
|
+
return;
|
|
52
|
+
for (const m of materialsOf(obj))
|
|
53
|
+
m.visible = false;
|
|
54
|
+
obj.userData[FLAG] = true;
|
|
55
|
+
}
|
|
56
|
+
/** Compile every helper under `root` that is waiting, in the background, then show it. */
|
|
57
|
+
export function warmHelpers(root) {
|
|
58
|
+
const waiting = [];
|
|
59
|
+
root.traverse((c) => { if (c.userData?.[FLAG])
|
|
60
|
+
waiting.push(c); });
|
|
61
|
+
return Promise.all(waiting.map(h => compileInBackground(h).then(() => {
|
|
62
|
+
for (const m of materialsOf(h))
|
|
63
|
+
m.visible = true;
|
|
64
|
+
delete h.userData[FLAG];
|
|
65
|
+
retainPrograms(h);
|
|
66
|
+
}))).then(() => undefined);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Warm-only runs (pre-warming): while this is on, an effect's runProgress compiles
|
|
70
|
+
* everything it needs and then stops — nothing animates. See runtime.prewarmEffect.
|
|
71
|
+
*/
|
|
72
|
+
export const warmMode = { on: false };
|
|
73
|
+
/**
|
|
74
|
+
* Effect helpers are disposed when an effect ends, and three destroys a program
|
|
75
|
+
* when its last material goes — so the next play would compile again. Keep one
|
|
76
|
+
* tiny, never-drawn clone per helper material so its program stays cached.
|
|
77
|
+
*/
|
|
78
|
+
const retained = [];
|
|
79
|
+
const retainedKeys = new Set();
|
|
80
|
+
export function retainPrograms(root) {
|
|
81
|
+
const ctx = warmContext();
|
|
82
|
+
if (!ctx)
|
|
83
|
+
return;
|
|
84
|
+
root.traverse((c) => {
|
|
85
|
+
const mats = c.material ? (Array.isArray(c.material) ? c.material : [c.material]) : [];
|
|
86
|
+
for (const m of mats) {
|
|
87
|
+
const key = `${c.type}|${m.type}|${m.vertexShader?.length ?? ''}|${m.fragmentShader?.length ?? ''}|${m.customProgramCacheKey?.() ?? ''}`;
|
|
88
|
+
if (retainedKeys.has(key))
|
|
89
|
+
continue;
|
|
90
|
+
retainedKeys.add(key);
|
|
91
|
+
const keep = m.clone();
|
|
92
|
+
keep.onBeforeCompile = m.onBeforeCompile;
|
|
93
|
+
keep.customProgramCacheKey = m.customProgramCacheKey;
|
|
94
|
+
keep.visible = true;
|
|
95
|
+
const stand = c.isInstancedMesh ? new InstancedMesh(c.geometry, keep, 1) : c.isPoints ? new Points(c.geometry, keep)
|
|
96
|
+
: c.isLineSegments ? new LineSegments(c.geometry, keep) : c.isMesh ? new Mesh(c.geometry, keep) : null;
|
|
97
|
+
if (!stand)
|
|
98
|
+
continue;
|
|
99
|
+
try {
|
|
100
|
+
ctx.gl.compile(stand, ctx.cam, ctx.scene);
|
|
101
|
+
retained.push(keep);
|
|
102
|
+
}
|
|
103
|
+
catch { /* ignore */ }
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/zoom.ts"],"names":[],"mappings":";AAGA,wBA4BG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Quaternion, Vector3 } from 'three';
|
|
2
|
+
import { DEFAULT_EASE, defineOperation } from '../types.js';
|
|
3
|
+
export default defineOperation({
|
|
4
|
+
value: 'zoom',
|
|
5
|
+
label: 'Zoom to',
|
|
6
|
+
description: 'Fly the camera close to the target, facing it',
|
|
7
|
+
channel: 'camera',
|
|
8
|
+
multi: false,
|
|
9
|
+
toggles: true,
|
|
10
|
+
usableIn: ['interaction', 'action'],
|
|
11
|
+
exclusive: { group: 'camera', release: 'handover' },
|
|
12
|
+
params: {
|
|
13
|
+
distance: { type: 'number', label: 'Distance', default: 2, min: 0.1, max: 100, step: 0.1 },
|
|
14
|
+
duration: { type: 'number', label: 'Duration', default: 1, min: 0, max: 10, step: 0.05, unit: 's' },
|
|
15
|
+
},
|
|
16
|
+
apply(target, p, ctx) {
|
|
17
|
+
const pose = ctx.tools.cameraPose();
|
|
18
|
+
if (!pose)
|
|
19
|
+
return;
|
|
20
|
+
ctx.saveCameraHome();
|
|
21
|
+
const camPos = new Vector3(...pose.position);
|
|
22
|
+
const at = target.getWorldPosition(new Vector3());
|
|
23
|
+
// Stand in front of the target, on the side the camera is already on.
|
|
24
|
+
const forward = new Vector3(0, 0, 1).applyQuaternion(target.getWorldQuaternion(new Quaternion()));
|
|
25
|
+
if (forward.dot(camPos.clone().sub(at).normalize()) < 0)
|
|
26
|
+
forward.negate();
|
|
27
|
+
const to = at.clone().add(forward.multiplyScalar(Number(p.distance)));
|
|
28
|
+
void ctx.tools.animateCamera({ position: [to.x, to.y, to.z] }, Number(p.duration), DEFAULT_EASE, [at.x, at.y, at.z]);
|
|
29
|
+
},
|
|
30
|
+
revert(_target, p, ctx) {
|
|
31
|
+
ctx.restoreCameraHome(Number(p.duration), DEFAULT_EASE);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export { OPERATIONS, getOperation, operationsFor, resolveParams, channelOf } from './registry';
|
|
3
|
+
export { runEffect, applyOperation, revertOperation, runOf, isOperationOn, resolveEffectTargets, runActionEffects, previewEffect, previewEffects, isPreviewing, prewarmEffect, areActionEffectsOn, subscribeActionEffects, registerOperationTools, } from './runtime';
|
|
4
|
+
export { useOperationsRuntime } from './useOperationsRuntime';
|
|
5
|
+
export { ObjectEffectsController, runningObjectEffects, objectEffectParams, isObjectOperation, surfaceSignature } from './objectEffects';
|
|
6
|
+
export { useObjectEffectLayers } from './useObjectEffectLayers';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACH,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,oBAAoB,EACtF,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,GACnJ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzI,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export { OPERATIONS, getOperation, operationsFor, resolveParams, channelOf } from './registry.js';
|
|
3
|
+
export { runEffect, applyOperation, revertOperation, runOf, isOperationOn, resolveEffectTargets, runActionEffects, previewEffect, previewEffects, isPreviewing, prewarmEffect, areActionEffectsOn, subscribeActionEffects, registerOperationTools, } from './runtime.js';
|
|
4
|
+
export { useOperationsRuntime } from './useOperationsRuntime.js';
|
|
5
|
+
export { ObjectEffectsController, runningObjectEffects, objectEffectParams, isObjectOperation, surfaceSignature } from './objectEffects.js';
|
|
6
|
+
export { useObjectEffectLayers } from './useObjectEffectLayers.js';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Object3D } from 'three';
|
|
2
|
+
import type { ObjectEffect } from '@3driseai/3drise-core';
|
|
3
|
+
import type { OperationDefinition, OperationParams } from './types';
|
|
4
|
+
/** An operation can be an object effect. */
|
|
5
|
+
export declare const isObjectOperation: (def: OperationDefinition | undefined) => def is OperationDefinition;
|
|
6
|
+
/**
|
|
7
|
+
* The effects that actually run: on, known, usable on objects, one per operation,
|
|
8
|
+
* and one of each stack (the first wins).
|
|
9
|
+
*/
|
|
10
|
+
export declare function runningObjectEffects(effects: ObjectEffect[] | undefined): ObjectEffect[];
|
|
11
|
+
/** An object effect's parameters: defaults, its overrides, then what object effects force. */
|
|
12
|
+
export declare const objectEffectParams: (def: OperationDefinition, effect: Pick<ObjectEffect, "params">) => OperationParams;
|
|
13
|
+
export declare class ObjectEffectsController {
|
|
14
|
+
private root;
|
|
15
|
+
private running;
|
|
16
|
+
private effects;
|
|
17
|
+
private refreshing;
|
|
18
|
+
private disposed;
|
|
19
|
+
constructor(root: Object3D);
|
|
20
|
+
/** The object's targets for an effect: the object, or its named nodes. */
|
|
21
|
+
private targetsOf;
|
|
22
|
+
private on;
|
|
23
|
+
private off;
|
|
24
|
+
/**
|
|
25
|
+
* Bring what runs in line with `effects`.
|
|
26
|
+
* animate switching an effect on / off plays its transition (studio, actions)
|
|
27
|
+
* instant everything lands in its end state at once (scene load)
|
|
28
|
+
* A changed parameter always lands at once.
|
|
29
|
+
*/
|
|
30
|
+
sync(effects: ObjectEffect[] | undefined, mode: 'animate' | 'instant'): void;
|
|
31
|
+
/**
|
|
32
|
+
* The object's meshes or materials were replaced: take every effect off the
|
|
33
|
+
* old ones and put it straight back on the new ones (no transition).
|
|
34
|
+
*/
|
|
35
|
+
refresh(): Promise<void>;
|
|
36
|
+
/** Take everything off at once (the object is going away). */
|
|
37
|
+
dispose(): void;
|
|
38
|
+
/** Ids of the effects running now (tests / studio). */
|
|
39
|
+
get runningIds(): string[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* What identifies the object's own drawable surface: its meshes and their
|
|
43
|
+
* materials (effect helpers left out). A change means effects must move over.
|
|
44
|
+
*/
|
|
45
|
+
export declare function surfaceSignature(root: Object3D): string;
|
|
46
|
+
//# sourceMappingURL=objectEffects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectEffects.d.ts","sourceRoot":"","sources":["../../src/operations/objectEffects.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,uBAAuB,CAAC;AAGzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE,4CAA4C;AAC5C,eAAO,MAAM,iBAAiB,GAAI,KAAK,mBAAmB,GAAG,SAAS,KAAG,GAAG,IAAI,mBACpB,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,SAAS,GAAG,YAAY,EAAE,CAgBxF;AAED,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,GAAI,KAAK,mBAAmB,EAAE,QAAQ,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,KAAG,eACzB,CAAC;AAY5E,qBAAa,uBAAuB;IAMpB,OAAO,CAAC,IAAI;IALxB,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,QAAQ,CAAS;gBAEL,IAAI,EAAE,QAAQ;IAElC,0EAA0E;IAC1E,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,EAAE;IAIV,OAAO,CAAC,GAAG;IAQX;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS;IAwBrE;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAaxB,8DAA8D;IAC9D,OAAO;IAMP,uDAAuD;IACvD,IAAI,UAAU,IAAI,MAAM,EAAE,CAAqC;CAClE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAQvD"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { findNodesByName } from '@3driseai/3drise-core';
|
|
2
|
+
import { getOperation, resolveParams } from './registry.js';
|
|
3
|
+
import { applyOperation, forceRevert, runOf } from './runtime.js';
|
|
4
|
+
/** An operation can be an object effect. */
|
|
5
|
+
export const isObjectOperation = (def) => !!def && def.usableIn.includes('object') && !!def.revert;
|
|
6
|
+
/**
|
|
7
|
+
* The effects that actually run: on, known, usable on objects, one per operation,
|
|
8
|
+
* and one of each stack (the first wins).
|
|
9
|
+
*/
|
|
10
|
+
export function runningObjectEffects(effects) {
|
|
11
|
+
const out = [];
|
|
12
|
+
const ops = new Set();
|
|
13
|
+
const stacks = new Set();
|
|
14
|
+
for (const e of effects ?? []) {
|
|
15
|
+
if (!e?.enabled)
|
|
16
|
+
continue;
|
|
17
|
+
const def = getOperation(e.operation);
|
|
18
|
+
if (!isObjectOperation(def) || ops.has(def.value))
|
|
19
|
+
continue;
|
|
20
|
+
if (def.stack) {
|
|
21
|
+
if (stacks.has(def.stack))
|
|
22
|
+
continue;
|
|
23
|
+
stacks.add(def.stack);
|
|
24
|
+
}
|
|
25
|
+
ops.add(def.value);
|
|
26
|
+
out.push(e);
|
|
27
|
+
}
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
/** An object effect's parameters: defaults, its overrides, then what object effects force. */
|
|
31
|
+
export const objectEffectParams = (def, effect) => ({ ...resolveParams(def, effect.params), ...(def.objectParams ?? {}) });
|
|
32
|
+
const namesKey = (e) => (e.meshNames ?? []).join('|');
|
|
33
|
+
export class ObjectEffectsController {
|
|
34
|
+
root;
|
|
35
|
+
running = new Map(); // effect id →
|
|
36
|
+
effects = [];
|
|
37
|
+
refreshing = null;
|
|
38
|
+
disposed = false;
|
|
39
|
+
constructor(root) {
|
|
40
|
+
this.root = root;
|
|
41
|
+
}
|
|
42
|
+
/** The object's targets for an effect: the object, or its named nodes. */
|
|
43
|
+
targetsOf(e) {
|
|
44
|
+
if (!e.meshNames?.length)
|
|
45
|
+
return [this.root];
|
|
46
|
+
const out = [];
|
|
47
|
+
for (const name of e.meshNames)
|
|
48
|
+
out.push(...findNodesByName(this.root, name).filter(n => n !== this.root));
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
on(def, targets, params) {
|
|
52
|
+
for (const t of targets)
|
|
53
|
+
applyOperation(def, t, params, this.root, { bare: true });
|
|
54
|
+
}
|
|
55
|
+
off(r, instant) {
|
|
56
|
+
const def = getOperation(r.op);
|
|
57
|
+
if (!def)
|
|
58
|
+
return;
|
|
59
|
+
// with its own parameters — it may have gone on at once (load / edit), but goes off with its transition
|
|
60
|
+
const params = instant ? { ...r.params, duration: 0 } : r.params;
|
|
61
|
+
for (const t of r.targets)
|
|
62
|
+
forceRevert(def, t, params);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Bring what runs in line with `effects`.
|
|
66
|
+
* animate switching an effect on / off plays its transition (studio, actions)
|
|
67
|
+
* instant everything lands in its end state at once (scene load)
|
|
68
|
+
* A changed parameter always lands at once.
|
|
69
|
+
*/
|
|
70
|
+
sync(effects, mode) {
|
|
71
|
+
if (this.disposed)
|
|
72
|
+
return;
|
|
73
|
+
this.effects = effects ?? [];
|
|
74
|
+
if (this.refreshing)
|
|
75
|
+
return; // the refresh puts the latest list back when it is done
|
|
76
|
+
const next = runningObjectEffects(effects);
|
|
77
|
+
const byId = new Map(next.map(e => [e.id, e]));
|
|
78
|
+
for (const [id, r] of this.running) {
|
|
79
|
+
const e = byId.get(id);
|
|
80
|
+
if (e && e.operation === r.op && namesKey(e) === r.targetsKey)
|
|
81
|
+
continue;
|
|
82
|
+
this.off(r, mode === 'instant');
|
|
83
|
+
this.running.delete(id);
|
|
84
|
+
}
|
|
85
|
+
for (const e of next) {
|
|
86
|
+
const def = getOperation(e.operation);
|
|
87
|
+
const params = objectEffectParams(def, e);
|
|
88
|
+
const paramsKey = JSON.stringify(params);
|
|
89
|
+
const r = this.running.get(e.id);
|
|
90
|
+
if (r && r.paramsKey === paramsKey)
|
|
91
|
+
continue;
|
|
92
|
+
const targets = r?.targets ?? this.targetsOf(e);
|
|
93
|
+
this.on(def, targets, r || mode === 'instant' ? { ...params, duration: 0 } : params);
|
|
94
|
+
this.running.set(e.id, { op: def.value, targets, targetsKey: namesKey(e), params, paramsKey });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The object's meshes or materials were replaced: take every effect off the
|
|
99
|
+
* old ones and put it straight back on the new ones (no transition).
|
|
100
|
+
*/
|
|
101
|
+
refresh() {
|
|
102
|
+
if (this.refreshing || !this.running.size)
|
|
103
|
+
return this.refreshing ?? Promise.resolve();
|
|
104
|
+
const list = [...this.running.values()];
|
|
105
|
+
this.running.clear();
|
|
106
|
+
list.forEach(r => this.off(r, true));
|
|
107
|
+
const done = Promise.all(list.flatMap(r => r.targets.map(t => runOf(r.op, t))));
|
|
108
|
+
this.refreshing = done.then(() => {
|
|
109
|
+
this.refreshing = null;
|
|
110
|
+
this.sync(this.effects, 'instant');
|
|
111
|
+
});
|
|
112
|
+
return this.refreshing;
|
|
113
|
+
}
|
|
114
|
+
/** Take everything off at once (the object is going away). */
|
|
115
|
+
dispose() {
|
|
116
|
+
this.running.forEach(r => this.off(r, true));
|
|
117
|
+
this.running.clear();
|
|
118
|
+
this.disposed = true;
|
|
119
|
+
}
|
|
120
|
+
/** Ids of the effects running now (tests / studio). */
|
|
121
|
+
get runningIds() { return [...this.running.keys()]; }
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* What identifies the object's own drawable surface: its meshes and their
|
|
125
|
+
* materials (effect helpers left out). A change means effects must move over.
|
|
126
|
+
*/
|
|
127
|
+
export function surfaceSignature(root) {
|
|
128
|
+
const parts = [];
|
|
129
|
+
root.traverse((c) => {
|
|
130
|
+
if (!c.isMesh || c.userData?.__opFxHelper)
|
|
131
|
+
return;
|
|
132
|
+
const mats = Array.isArray(c.material) ? c.material : [c.material];
|
|
133
|
+
parts.push(c.uuid + ':' + mats.map((m) => m?.uuid ?? '').join(','));
|
|
134
|
+
});
|
|
135
|
+
return parts.join(';');
|
|
136
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OperationChannel, OperationEffect, OperationName } from '@3driseai/3drise-core';
|
|
2
|
+
import type { OperationDefinition, OperationParams, OperationSource } from './types';
|
|
3
|
+
export declare const OPERATIONS: OperationDefinition[];
|
|
4
|
+
export declare const getOperation: (name: OperationName) => OperationDefinition | undefined;
|
|
5
|
+
/** Operations offered in a context (gallery-only ones only on gallery objects), optionally one channel. */
|
|
6
|
+
export declare const operationsFor: (source: OperationSource, opts?: {
|
|
7
|
+
gallery?: boolean;
|
|
8
|
+
channel?: OperationChannel;
|
|
9
|
+
}) => OperationDefinition[];
|
|
10
|
+
/** An effect's channel — the stored one, else its operation's (effects saved before channels). */
|
|
11
|
+
export declare const channelOf: (effect: Pick<OperationEffect, "operation"> & {
|
|
12
|
+
channel?: OperationChannel;
|
|
13
|
+
}) => OperationChannel;
|
|
14
|
+
/** Defaults overlaid with the effect's own values (unknown keys dropped). */
|
|
15
|
+
export declare function resolveParams(def: OperationDefinition, overrides?: OperationParams): OperationParams;
|
|
16
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/operations/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA0CrF,eAAO,MAAM,UAAU,EAAE,mBAAmB,EAO3C,CAAC;AAIF,eAAO,MAAM,YAAY,GAAI,MAAM,aAAa,KAAG,mBAAmB,GAAG,SAA6B,CAAC;AAEvG,2GAA2G;AAC3G,eAAO,MAAM,aAAa,GAAI,QAAQ,eAAe,EAAE,OAAM;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,gBAAgB,CAAA;CAAO,KAAG,mBAAmB,EACG,CAAC;AAE7I,kGAAkG;AAClG,eAAO,MAAM,SAAS,GAAI,QAAQ,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;CAAE,KAAG,gBAC/B,CAAC;AAE1E,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,GAAG,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,eAAe,GAAG,eAAe,CAOpG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import glow from './catalogue/glow.js';
|
|
2
|
+
import fade from './catalogue/fade.js';
|
|
3
|
+
import visibility from './catalogue/visibility.js';
|
|
4
|
+
import zoom from './catalogue/zoom.js';
|
|
5
|
+
import focus from './catalogue/focus.js';
|
|
6
|
+
import moveToFront from './catalogue/moveToFront.js';
|
|
7
|
+
import displayImage from './catalogue/displayImage.js';
|
|
8
|
+
import rimLight from './catalogue/rimLight.js';
|
|
9
|
+
import dissolve from './catalogue/dissolve.js';
|
|
10
|
+
import spin from './catalogue/spin.js';
|
|
11
|
+
import jelly from './catalogue/jelly.js';
|
|
12
|
+
import flip from './catalogue/flip.js';
|
|
13
|
+
import swirl from './catalogue/swirl.js';
|
|
14
|
+
import emberAsh from './catalogue/emberAsh.js';
|
|
15
|
+
import particleSwarm from './catalogue/particleSwarm.js';
|
|
16
|
+
import hologram from './catalogue/hologram.js';
|
|
17
|
+
import shatter from './catalogue/shatter.js';
|
|
18
|
+
import sandErosion from './catalogue/sandErosion.js';
|
|
19
|
+
import teleport from './catalogue/teleport.js';
|
|
20
|
+
import inkBloom from './catalogue/inkBloom.js';
|
|
21
|
+
import flock from './catalogue/flock.js';
|
|
22
|
+
import metalize from './catalogue/metalize.js';
|
|
23
|
+
import liquidMetal from './catalogue/liquidMetal.js';
|
|
24
|
+
import frost from './catalogue/frost.js';
|
|
25
|
+
import heatCracks from './catalogue/heatCracks.js';
|
|
26
|
+
import petrify from './catalogue/petrify.js';
|
|
27
|
+
import portal from './catalogue/portal.js';
|
|
28
|
+
import voxelize from './catalogue/voxelize.js';
|
|
29
|
+
import unweave from './catalogue/unweave.js';
|
|
30
|
+
import petalPeel from './catalogue/petalPeel.js';
|
|
31
|
+
import frame from './catalogue/frame.js';
|
|
32
|
+
import orbit from './catalogue/orbit.js';
|
|
33
|
+
import kintsugi from './catalogue/kintsugi.js';
|
|
34
|
+
import rainBeads from './catalogue/rainBeads.js';
|
|
35
|
+
import ivy from './catalogue/ivy.js';
|
|
36
|
+
import curlSmoke from './catalogue/curlSmoke.js';
|
|
37
|
+
import lidarScan from './catalogue/lidarScan.js';
|
|
38
|
+
import print3d from './catalogue/print3d.js';
|
|
39
|
+
import silkDrape from './catalogue/silkDrape.js';
|
|
40
|
+
// Grouped by channel (picker order): transform · visual · camera.
|
|
41
|
+
export const OPERATIONS = [
|
|
42
|
+
jelly, flip, spin, swirl, moveToFront,
|
|
43
|
+
glow, rimLight, dissolve, emberAsh, particleSwarm, hologram, shatter,
|
|
44
|
+
sandErosion, teleport, inkBloom, flock, liquidMetal, metalize, frost, heatCracks, petrify, kintsugi, rainBeads, ivy,
|
|
45
|
+
portal, voxelize, unweave, petalPeel, curlSmoke, lidarScan, print3d, silkDrape,
|
|
46
|
+
fade, visibility, displayImage,
|
|
47
|
+
zoom, frame, focus, orbit,
|
|
48
|
+
];
|
|
49
|
+
const byName = new Map(OPERATIONS.map(o => [o.value, o]));
|
|
50
|
+
export const getOperation = (name) => byName.get(name);
|
|
51
|
+
/** Operations offered in a context (gallery-only ones only on gallery objects), optionally one channel. */
|
|
52
|
+
export const operationsFor = (source, opts = {}) => OPERATIONS.filter(o => o.usableIn.includes(source) && (!o.galleryOnly || opts.gallery) && (!opts.channel || o.channel === opts.channel));
|
|
53
|
+
/** An effect's channel — the stored one, else its operation's (effects saved before channels). */
|
|
54
|
+
export const channelOf = (effect) => effect.channel ?? getOperation(effect.operation)?.channel ?? 'visual';
|
|
55
|
+
/** Defaults overlaid with the effect's own values (unknown keys dropped). */
|
|
56
|
+
export function resolveParams(def, overrides) {
|
|
57
|
+
const out = {};
|
|
58
|
+
for (const [key, spec] of Object.entries(def.params ?? {})) {
|
|
59
|
+
const v = overrides?.[key];
|
|
60
|
+
out[key] = v === undefined || v === null ? spec.default : v;
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|