@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,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ActionSequence } from '@3driseai/3drise-core';
|
|
3
|
+
import type { AnimationClip, AnimationSequence } from './types';
|
|
4
|
+
export interface ClipPlayerProps {
|
|
5
|
+
getSettings: (state: string) => any;
|
|
6
|
+
/** The project's actions, for sequence cues (by id). */
|
|
7
|
+
getAction?: (id: string) => ActionSequence | undefined;
|
|
8
|
+
/** Start the sequences flagged `autoplay` (published viewer). The studio leaves this off. */
|
|
9
|
+
autoplay?: {
|
|
10
|
+
sequences: AnimationSequence[];
|
|
11
|
+
clips: AnimationClip[];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare const ClipPlayer: React.FC<ClipPlayerProps>;
|
|
15
|
+
export default ClipPlayer;
|
|
16
|
+
//# sourceMappingURL=ClipPlayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClipPlayer.d.ts","sourceRoot":"","sources":["../../src/animationsV2/ClipPlayer.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC5B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC;IACpC,wDAAwD;IACxD,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC;IACvD,6FAA6F;IAC7F,QAAQ,CAAC,EAAE;QAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;QAAC,KAAK,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;CACzE;AAcD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoJzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// ClipPlayer — drives ClipsRuntime from the R3F frame loop, and feeds it input.
|
|
3
|
+
// =============================================================================
|
|
4
|
+
//
|
|
5
|
+
// Mount inside the Canvas AFTER the objects and the environment: R3F runs
|
|
6
|
+
// same-priority frame callbacks in subscription order, so clips write after the
|
|
7
|
+
// objects' own per-frame animation. Priority stays 0 — a positive priority would
|
|
8
|
+
// take rendering over from R3F (see CLAUDE.md on the cloud pass).
|
|
9
|
+
//
|
|
10
|
+
// `getSettings(state)` returns an element's authored settings (action patches
|
|
11
|
+
// included) — the value a stopped track restores. The studio reads it from Redux,
|
|
12
|
+
// the published viewer from the loaded project (resolveElementSettings).
|
|
13
|
+
//
|
|
14
|
+
// Input drivers (sequence.driver):
|
|
15
|
+
// mouseX / mouseY the pointer's position over the canvas is the progress (0–1).
|
|
16
|
+
// mouseWheel the wheel moves the progress (sensitivity); touch: vertical drag.
|
|
17
|
+
// While one runs, OrbitControls zoom is off. At either end the wheel
|
|
18
|
+
// is let through, so the host page can scroll on.
|
|
19
|
+
// Listeners sit on window and check the canvas rect: studio overlays above the
|
|
20
|
+
// canvas would otherwise swallow the events.
|
|
21
|
+
//
|
|
22
|
+
// `autoplay` (published viewer): sequences flagged autoplay start on mount; time-driven
|
|
23
|
+
// ones hold at their start until the objects they animate are loaded.
|
|
24
|
+
//
|
|
25
|
+
import { useEffect, useRef } from 'react';
|
|
26
|
+
import { useFrame, useThree } from '@react-three/fiber';
|
|
27
|
+
import ClipsRuntime from './ClipsRuntime.js';
|
|
28
|
+
import { clipMap } from './sequenceUtils.js';
|
|
29
|
+
/** Wheel delta in pixels, whatever the device reports. */
|
|
30
|
+
const wheelPixels = (e) => e.deltaMode === 1 ? e.deltaY * 16 : e.deltaMode === 2 ? e.deltaY * window.innerHeight : e.deltaY;
|
|
31
|
+
/** Diagnostics switch: `?animdebug=1` or localStorage '3drise.animdebug' = '1'. */
|
|
32
|
+
function animDebugOn() {
|
|
33
|
+
try {
|
|
34
|
+
if (typeof window === 'undefined')
|
|
35
|
+
return false;
|
|
36
|
+
return new URLSearchParams(window.location.search).has('animdebug') || window.localStorage.getItem('3drise.animdebug') === '1';
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const ClipPlayer = ({ getSettings, getAction, autoplay }) => {
|
|
43
|
+
// Before any other effect, so the first calls are logged too.
|
|
44
|
+
if (!ClipsRuntime.debug && animDebugOn()) {
|
|
45
|
+
ClipsRuntime.debug = true;
|
|
46
|
+
window.__clipsRuntime = ClipsRuntime;
|
|
47
|
+
}
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
ClipsRuntime.dlog('ClipPlayer mounted', { published: !!autoplay });
|
|
50
|
+
return () => ClipsRuntime.dlog('ClipPlayer unmounted', { published: !!autoplay });
|
|
51
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
52
|
+
}, []);
|
|
53
|
+
const camera = useThree((s) => s.camera);
|
|
54
|
+
const controls = useThree((s) => s.controls);
|
|
55
|
+
const gl = useThree((s) => s.gl);
|
|
56
|
+
// Read at restore time through a ref, so the context object stays stable.
|
|
57
|
+
const settingsRef = useRef(getSettings);
|
|
58
|
+
settingsRef.current = getSettings;
|
|
59
|
+
const actionRef = useRef(getAction);
|
|
60
|
+
actionRef.current = getAction;
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
ClipsRuntime.setContext({
|
|
63
|
+
camera, controls,
|
|
64
|
+
getSettings: (state) => settingsRef.current(state),
|
|
65
|
+
getAction: (id) => actionRef.current?.(id),
|
|
66
|
+
});
|
|
67
|
+
return () => ClipsRuntime.setContext(null);
|
|
68
|
+
}, [camera, controls]);
|
|
69
|
+
// --- autoplay (published viewer) --------------------------------------------------
|
|
70
|
+
// Each sequence flagged autoplay starts when the scene mounts — driven ones too (a
|
|
71
|
+
// wheel-driven sequence is "playing" = listening to the wheel from the start). A
|
|
72
|
+
// time-driven one holds at its start until its objects are loaded (waitForTargets).
|
|
73
|
+
// Already-running sequences are left alone, so a re-render or remount never restarts
|
|
74
|
+
// one. Leaving the scene clears the runtime: nothing carries over to another route.
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!autoplay)
|
|
77
|
+
return;
|
|
78
|
+
const lookup = clipMap(autoplay.clips);
|
|
79
|
+
ClipsRuntime.dlog('autoplay effect', {
|
|
80
|
+
clips: autoplay.clips.length,
|
|
81
|
+
sequences: autoplay.sequences.map(s => ({ name: s.name, autoplay: s.autoplay, driver: s.driver, active: ClipsRuntime.isSequenceActive(s.id) })),
|
|
82
|
+
});
|
|
83
|
+
for (const seq of autoplay.sequences) {
|
|
84
|
+
if (!seq.autoplay || ClipsRuntime.isSequenceActive(seq.id))
|
|
85
|
+
continue;
|
|
86
|
+
ClipsRuntime.playSequence(seq, lookup, { waitForTargets: true });
|
|
87
|
+
}
|
|
88
|
+
}, [autoplay?.sequences, autoplay?.clips]);
|
|
89
|
+
const isPublished = !!autoplay;
|
|
90
|
+
useEffect(() => () => { if (isPublished)
|
|
91
|
+
ClipsRuntime.reset(); }, [isPublished]);
|
|
92
|
+
// --- input drivers ----------------------------------------------------------------
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
const canvas = gl.domElement;
|
|
95
|
+
const inside = (x, y) => {
|
|
96
|
+
const r = canvas.getBoundingClientRect();
|
|
97
|
+
return x >= r.left && x <= r.right && y >= r.top && y <= r.bottom ? r : null;
|
|
98
|
+
};
|
|
99
|
+
/** Progress along the wheel-driven sequences; true when any of them moved. */
|
|
100
|
+
const nudgeWheel = (pixels) => {
|
|
101
|
+
let moved = false;
|
|
102
|
+
for (const d of ClipsRuntime.getDrivenSequences()) {
|
|
103
|
+
if (d.driver !== 'mouseWheel')
|
|
104
|
+
continue;
|
|
105
|
+
const dir = d.settings?.invert ? -1 : 1;
|
|
106
|
+
const delta = pixels * dir * Math.max(0.01, d.settings?.sensitivity ?? 1) / 1000;
|
|
107
|
+
if (ClipsRuntime.nudgeSequenceProgress(d.id, delta))
|
|
108
|
+
moved = true;
|
|
109
|
+
}
|
|
110
|
+
return moved;
|
|
111
|
+
};
|
|
112
|
+
let touchY = null;
|
|
113
|
+
const onPointerMove = (e) => {
|
|
114
|
+
const r = inside(e.clientX, e.clientY);
|
|
115
|
+
if (!r)
|
|
116
|
+
return;
|
|
117
|
+
for (const d of ClipsRuntime.getDrivenSequences()) {
|
|
118
|
+
if (d.driver !== 'mouseX' && d.driver !== 'mouseY')
|
|
119
|
+
continue;
|
|
120
|
+
const raw = d.driver === 'mouseX' ? (e.clientX - r.left) / r.width : (e.clientY - r.top) / r.height;
|
|
121
|
+
ClipsRuntime.setSequenceProgress(d.id, d.settings?.invert ? 1 - raw : raw);
|
|
122
|
+
}
|
|
123
|
+
// Touch has no wheel: a vertical drag stands in for it (drag up = forward).
|
|
124
|
+
if (e.pointerType === 'touch' && touchY !== null) {
|
|
125
|
+
nudgeWheel(touchY - e.clientY);
|
|
126
|
+
touchY = e.clientY;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const onPointerDown = (e) => {
|
|
130
|
+
if (e.pointerType === 'touch' && inside(e.clientX, e.clientY))
|
|
131
|
+
touchY = e.clientY;
|
|
132
|
+
};
|
|
133
|
+
const onPointerUp = () => { touchY = null; };
|
|
134
|
+
const onWheel = (e) => {
|
|
135
|
+
if (!inside(e.clientX, e.clientY))
|
|
136
|
+
return;
|
|
137
|
+
// Only swallow the wheel while it moved something; at either end the page scrolls.
|
|
138
|
+
if (nudgeWheel(wheelPixels(e)))
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
};
|
|
141
|
+
window.addEventListener('pointermove', onPointerMove);
|
|
142
|
+
window.addEventListener('pointerdown', onPointerDown);
|
|
143
|
+
window.addEventListener('pointerup', onPointerUp);
|
|
144
|
+
window.addEventListener('pointercancel', onPointerUp);
|
|
145
|
+
window.addEventListener('wheel', onWheel, { passive: false });
|
|
146
|
+
return () => {
|
|
147
|
+
window.removeEventListener('pointermove', onPointerMove);
|
|
148
|
+
window.removeEventListener('pointerdown', onPointerDown);
|
|
149
|
+
window.removeEventListener('pointerup', onPointerUp);
|
|
150
|
+
window.removeEventListener('pointercancel', onPointerUp);
|
|
151
|
+
window.removeEventListener('wheel', onWheel);
|
|
152
|
+
};
|
|
153
|
+
}, [gl]);
|
|
154
|
+
// --- zoom: OrbitControls must not zoom while the wheel drives a sequence -----------
|
|
155
|
+
const zoomRestore = useRef(null);
|
|
156
|
+
useEffect(() => () => {
|
|
157
|
+
const z = zoomRestore.current;
|
|
158
|
+
if (z?.controls)
|
|
159
|
+
z.controls.enableZoom = z.enableZoom;
|
|
160
|
+
zoomRestore.current = null;
|
|
161
|
+
}, []);
|
|
162
|
+
// --- camera: OrbitControls sit out while an animation drives the camera ------------
|
|
163
|
+
// Their update (damping residue, min / max distance and angle limits, auto-rotate)
|
|
164
|
+
// would otherwise pull the camera back every frame. Handed back afterwards with
|
|
165
|
+
// the authored setting (so the Controls "enabled" switch always wins).
|
|
166
|
+
const cameraHeld = useRef(null);
|
|
167
|
+
useEffect(() => () => {
|
|
168
|
+
const c = cameraHeld.current;
|
|
169
|
+
if (c)
|
|
170
|
+
c.enabled = settingsRef.current('camera')?.controls?.enabled ?? true;
|
|
171
|
+
cameraHeld.current = null;
|
|
172
|
+
}, []);
|
|
173
|
+
useFrame((_state, delta) => {
|
|
174
|
+
ClipsRuntime.tick(delta);
|
|
175
|
+
const driving = ClipsRuntime.isDrivingCamera();
|
|
176
|
+
if (driving && controls) {
|
|
177
|
+
if (cameraHeld.current !== controls)
|
|
178
|
+
cameraHeld.current = controls;
|
|
179
|
+
controls.enabled = false;
|
|
180
|
+
}
|
|
181
|
+
else if (cameraHeld.current) {
|
|
182
|
+
cameraHeld.current.enabled = settingsRef.current('camera')?.controls?.enabled ?? true;
|
|
183
|
+
cameraHeld.current = null;
|
|
184
|
+
}
|
|
185
|
+
const wheelActive = ClipsRuntime.getDrivenSequences().some(d => d.driver === 'mouseWheel');
|
|
186
|
+
const z = zoomRestore.current;
|
|
187
|
+
if (wheelActive && controls && !z) {
|
|
188
|
+
zoomRestore.current = { controls, enableZoom: controls.enableZoom !== false };
|
|
189
|
+
controls.enableZoom = false;
|
|
190
|
+
}
|
|
191
|
+
else if ((!wheelActive || z?.controls !== controls) && z) {
|
|
192
|
+
if (z.controls)
|
|
193
|
+
z.controls.enableZoom = z.enableZoom;
|
|
194
|
+
zoomRestore.current = null;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
return null;
|
|
198
|
+
};
|
|
199
|
+
export default ClipPlayer;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { AnimationClip, AnimationSequence, KeyValue, Track } from './types';
|
|
2
|
+
import { type ApplyContext } from './appliers';
|
|
3
|
+
import { type ClipLookup, type ScheduledClip } from './sequenceUtils';
|
|
4
|
+
/** A driven sequence as the input layer sees it. */
|
|
5
|
+
export interface DrivenSequence {
|
|
6
|
+
id: string;
|
|
7
|
+
driver: AnimationSequence['driver'];
|
|
8
|
+
settings: AnimationSequence['driverSettings'];
|
|
9
|
+
/** 0–1 along the sequence's own direction (reverse flips it). */
|
|
10
|
+
progress: number;
|
|
11
|
+
}
|
|
12
|
+
export type RuntimeEventType = 'start' | 'end' | 'loop';
|
|
13
|
+
export interface RuntimeEvent {
|
|
14
|
+
type: RuntimeEventType;
|
|
15
|
+
kind: 'clip' | 'sequence';
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
/** @deprecated name kept for existing imports */
|
|
19
|
+
export type ClipEvent = RuntimeEvent;
|
|
20
|
+
declare class ClipsRuntime {
|
|
21
|
+
private clips;
|
|
22
|
+
private sequences;
|
|
23
|
+
private ctx;
|
|
24
|
+
private order;
|
|
25
|
+
private version;
|
|
26
|
+
private listeners;
|
|
27
|
+
/** Coarse: play / pause / stop / start / end / reset / data edits — never per frame. */
|
|
28
|
+
private stateVersion;
|
|
29
|
+
private stateListeners;
|
|
30
|
+
private eventListeners;
|
|
31
|
+
/** tracks whose authored value must be written back on the next tick */
|
|
32
|
+
private pendingRestore;
|
|
33
|
+
/** last written value per property (targetKey -> JSON) */
|
|
34
|
+
private written;
|
|
35
|
+
debug: boolean;
|
|
36
|
+
private logAt;
|
|
37
|
+
dlog(...args: unknown[]): void;
|
|
38
|
+
/** At most once per `ms` per key. */
|
|
39
|
+
private dlogEvery;
|
|
40
|
+
private caller;
|
|
41
|
+
setContext(ctx: ApplyContext | null): void;
|
|
42
|
+
/**
|
|
43
|
+
* Every change, including each frame's time while anything plays. For UI that
|
|
44
|
+
* follows the playhead, write through refs in the listener — never re-render React
|
|
45
|
+
* per frame (the timeline panels would re-render ~60×/s on the render thread).
|
|
46
|
+
*/
|
|
47
|
+
subscribe(listener: () => void): () => void;
|
|
48
|
+
getVersion(): number;
|
|
49
|
+
/** State changes only (play / pause / stop / start / end / reset / edits) — safe for React. */
|
|
50
|
+
subscribeState(listener: () => void): () => void;
|
|
51
|
+
getStateVersion(): number;
|
|
52
|
+
on(listener: (e: RuntimeEvent) => void): () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Forget every instance without writing anything back — a new scene is loading
|
|
55
|
+
* (the singleton outlives a route change: whatever the studio was playing must not
|
|
56
|
+
* carry into the published view).
|
|
57
|
+
*/
|
|
58
|
+
reset(): void;
|
|
59
|
+
play(clip: AnimationClip, opts?: {
|
|
60
|
+
from?: number;
|
|
61
|
+
speed?: number;
|
|
62
|
+
reverse?: boolean;
|
|
63
|
+
}): void;
|
|
64
|
+
pause(clipId: string): void;
|
|
65
|
+
resume(clipId: string): void;
|
|
66
|
+
/** Stop and put the clip's properties back to their authored values. */
|
|
67
|
+
stop(clipId: string): void;
|
|
68
|
+
/** Hold the clip at t (seconds) — the editor playhead, or seek() from outside. */
|
|
69
|
+
pose(clip: AnimationClip, t: number): void;
|
|
70
|
+
/** The clip data changed (editor edit): keep time and play state, use the new tracks. */
|
|
71
|
+
updateClip(clip: AnimationClip): void;
|
|
72
|
+
getTime(clipId: string): number;
|
|
73
|
+
isPlaying(clipId: string): boolean;
|
|
74
|
+
isActive(clipId: string): boolean;
|
|
75
|
+
/** Value of a track at the clip's current time (the panel's value column). */
|
|
76
|
+
sampleAt(clip: AnimationClip, track: Track): KeyValue | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Play a sequence. `reverse` defaults to the sequence's own; `from` is sequence
|
|
79
|
+
* seconds (defaults to the current time, or the start edge of the run).
|
|
80
|
+
*/
|
|
81
|
+
playSequence(seq: AnimationSequence, clips: ClipLookup, opts?: {
|
|
82
|
+
from?: number;
|
|
83
|
+
speed?: number;
|
|
84
|
+
reverse?: boolean;
|
|
85
|
+
waitForTargets?: boolean;
|
|
86
|
+
}): void;
|
|
87
|
+
/** Driven sequences that are running — what the input layer (ClipPlayer) feeds. */
|
|
88
|
+
getDrivenSequences(): DrivenSequence[];
|
|
89
|
+
/**
|
|
90
|
+
* Set a sequence's position, 0–1 along its own direction (reverse flips it). A
|
|
91
|
+
* driven sequence eases there (its smoothing); any other is posed there at once.
|
|
92
|
+
*/
|
|
93
|
+
setSequenceProgress(seqId: string, progress: number): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Move a driven sequence's target by `delta` of its length (the wheel). Returns
|
|
96
|
+
* false when it is already at that end — the caller then lets the event through
|
|
97
|
+
* (page scroll), so a visitor is never trapped inside the canvas.
|
|
98
|
+
*/
|
|
99
|
+
nudgeSequenceProgress(seqId: string, delta: number): boolean;
|
|
100
|
+
getSequenceProgress(seqId: string): number;
|
|
101
|
+
private progressOf;
|
|
102
|
+
private timeOf;
|
|
103
|
+
pauseSequence(seqId: string): void;
|
|
104
|
+
resumeSequence(seqId: string): void;
|
|
105
|
+
/** Stop and put every property the sequence drove back to its authored value. */
|
|
106
|
+
stopSequence(seqId: string): void;
|
|
107
|
+
/** Hold the sequence at T (sequence seconds) — the panel's scrub, or seek(). */
|
|
108
|
+
poseSequence(seq: AnimationSequence, clips: ClipLookup, T: number): void;
|
|
109
|
+
/** The sequence or one of its clips changed: re-resolve, keep time and play state. */
|
|
110
|
+
updateSequence(seq: AnimationSequence, clips: ClipLookup): void;
|
|
111
|
+
/**
|
|
112
|
+
* Whether a PLAYING clip or sequence writes the camera right now. The player then
|
|
113
|
+
* holds OrbitControls off so its own update (damping, distance / angle limits,
|
|
114
|
+
* auto-rotate) doesn't fight the animation. A posed (paused) one doesn't count —
|
|
115
|
+
* in the editor you can still orbit around a held pose.
|
|
116
|
+
*/
|
|
117
|
+
isDrivingCamera(): boolean;
|
|
118
|
+
getSequenceTime(seqId: string): number;
|
|
119
|
+
getSequenceDuration(seqId: string): number;
|
|
120
|
+
isSequencePlaying(seqId: string): boolean;
|
|
121
|
+
isSequenceActive(seqId: string): boolean;
|
|
122
|
+
tick(delta: number): void;
|
|
123
|
+
/** Objects / nodes the sequence animates — or its cued actions touch — that aren't in the scene yet. */
|
|
124
|
+
private missingTargets;
|
|
125
|
+
/** Apply / revert the actions whose cue state changed since the last tick. */
|
|
126
|
+
private syncCues;
|
|
127
|
+
/** Revert every action the sequence applied (stop / close). */
|
|
128
|
+
private releaseActions;
|
|
129
|
+
/** Every driver's values for this frame, lowest priority first. */
|
|
130
|
+
private proposals;
|
|
131
|
+
private runRestores;
|
|
132
|
+
/** Whether any active driver still has a track on (state, node, path). */
|
|
133
|
+
private isDriven;
|
|
134
|
+
private advanceClip;
|
|
135
|
+
private finishClip;
|
|
136
|
+
/**
|
|
137
|
+
* Same edge rules as a clip, on the sequence clock. "Forward" is the run's base
|
|
138
|
+
* direction: a reversed run starts at the end and finishes at 0.
|
|
139
|
+
*/
|
|
140
|
+
private advanceSequence;
|
|
141
|
+
private finishSequence;
|
|
142
|
+
private emit;
|
|
143
|
+
private bump;
|
|
144
|
+
/** A state change: notifies both kinds of subscribers. */
|
|
145
|
+
private bumpState;
|
|
146
|
+
}
|
|
147
|
+
export type { ScheduledClip };
|
|
148
|
+
declare const clipsRuntime: ClipsRuntime;
|
|
149
|
+
export default clipsRuntime;
|
|
150
|
+
//# sourceMappingURL=ClipsRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClipsRuntime.d.ts","sourceRoot":"","sources":["../../src/animationsV2/ClipsRuntime.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,EAAmD,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEhG,OAAO,EAEL,KAAK,UAAU,EAAE,KAAK,aAAa,EACpC,MAAM,iBA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