@3driseai/3drise-viewer 0.1.26 → 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 +3 -0
- package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
- package/dist/animationsV2/ClipPlayer.js +67 -8
- package/dist/animationsV2/ClipsRuntime.d.ts +39 -0
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +245 -14
- package/dist/animationsV2/appliers.d.ts +5 -0
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +25 -7
- package/dist/animationsV2/index.d.ts +1 -1
- package/dist/animationsV2/index.d.ts.map +1 -1
- package/dist/animationsV2/normalize.d.ts.map +1 -1
- package/dist/animationsV2/normalize.js +18 -7
- package/dist/animationsV2/sequenceUtils.d.ts +42 -1
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
- package/dist/animationsV2/sequenceUtils.js +103 -3
- package/dist/animationsV2/types.d.ts +20 -0
- package/dist/animationsV2/types.d.ts.map +1 -1
- 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/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/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/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/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.map +1 -1
- package/dist/components/ObjectsRenderer.js +37 -3
- 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.js +1 -1
- 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/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/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/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 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- 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/useLandscapeMaps.d.ts +1 -1
- package/dist/hooks/useLandscapeMaps.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.d.ts +1 -1
- package/dist/hooks/useThunder.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/interactions/index.d.ts +2 -1
- package/dist/interactions/index.d.ts.map +1 -1
- package/dist/interactions/index.js +1 -1
- package/dist/interactions/runner.d.ts +18 -3
- package/dist/interactions/runner.d.ts.map +1 -1
- package/dist/interactions/runner.js +25 -2
- 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.map +1 -1
- package/dist/operations/catalogue/displayImage.js +1 -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.map +1 -1
- package/dist/operations/catalogue/fade.js +1 -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.map +1 -1
- package/dist/operations/catalogue/focus.js +1 -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.map +1 -1
- package/dist/operations/catalogue/glow.js +2 -1
- 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/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.map +1 -1
- package/dist/operations/catalogue/moveToFront.js +1 -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.map +1 -1
- package/dist/operations/catalogue/visibility.js +1 -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.map +1 -1
- package/dist/operations/catalogue/zoom.js +1 -0
- package/dist/operations/index.d.ts +4 -2
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +4 -2
- 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 +7 -2
- package/dist/operations/registry.d.ts.map +1 -1
- package/dist/operations/registry.js +45 -3
- package/dist/operations/runtime.d.ts +40 -2
- package/dist/operations/runtime.d.ts.map +1 -1
- package/dist/operations/runtime.js +164 -8
- package/dist/operations/types.d.ts +29 -3
- package/dist/operations/types.d.ts.map +1 -1
- package/dist/operations/types.js +6 -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.map +1 -1
- package/dist/operations/useOperationsRuntime.js +42 -4
- 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
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import {
|
|
5
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
|
+
import { DEFAULT_GENERATIVE_EFFECTS, EFFECTS_ANIMATABLE } from "@3driseai/3drise-core";
|
|
6
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
7
9
|
// ── Pulsing junction-dot shader ───────────────────────────────────────────────
|
|
8
10
|
const dotVert = /* glsl */ `
|
|
9
11
|
attribute float aPhase;
|
|
@@ -75,18 +77,40 @@ function helixAt(t, si, numStrands, r, h) {
|
|
|
75
77
|
return new THREE.Vector3(Math.cos(angle) * r, t * h - h / 2, Math.sin(angle) * r);
|
|
76
78
|
}
|
|
77
79
|
// ── Component ─────────────────────────────────────────────────────────────────
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
/** Knobs that rebuild the helix (sample count, strands, radius, height, the bolt layer mount): commit only. */
|
|
81
|
+
const STRUCTURAL = ['particleCount', 'strandCount', 'helixRadius', 'helixHeight', 'runningLightEnabled'];
|
|
82
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
|
|
83
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.dnaHelix.map((p) => p.value));
|
|
84
|
+
const _color = new THREE.Color();
|
|
85
|
+
/** The single push point: every config knob that lives on a material reaches it here. */
|
|
86
|
+
function applyConfig(scene, boltPtsMat, c) {
|
|
87
|
+
_color.set(c.basePairColor || '#00ffee');
|
|
88
|
+
const col = scene.rungGeo.attributes.color;
|
|
89
|
+
for (let v = 0; v < col.count; v++) {
|
|
90
|
+
const br = scene.rungBright[v >> 1];
|
|
91
|
+
col.setXYZ(v, _color.r * br, _color.g * br, _color.b * br);
|
|
92
|
+
}
|
|
93
|
+
col.needsUpdate = true;
|
|
94
|
+
scene.rungMat.opacity = c.opacity * 0.7;
|
|
95
|
+
scene.dotMat.uniforms.uSize.value = 14 * c.intensity;
|
|
96
|
+
scene.dotMat.uniforms.uOpacity.value = c.opacity;
|
|
97
|
+
boltPtsMat.uniforms.uSize.value = 18 * c.intensity;
|
|
98
|
+
boltPtsMat.uniforms.uOpacity.value = c.opacity;
|
|
99
|
+
}
|
|
100
|
+
const DnaHelixEffect = ({ boundingRadius, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
|
|
101
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULT_GENERATIVE_EFFECTS.dnaHelix, config), [config]);
|
|
102
|
+
const { particleCount, strandCount, helixRadius, helixHeight, runningLightEnabled } = cfg;
|
|
81
103
|
const groupRef = useRef(null);
|
|
82
104
|
useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
|
|
105
|
+
// the knobs read per frame (speed, intensity), from the last merged config
|
|
106
|
+
const cur = useRef(cfg);
|
|
83
107
|
const washProgress = useRef(0);
|
|
84
108
|
const r = boundingRadius * helixRadius;
|
|
85
109
|
const h = boundingRadius * helixHeight;
|
|
86
110
|
const numStrands = Math.min(strandCount, 3);
|
|
87
|
-
// Bolt travel state
|
|
111
|
+
// Bolt travel state - just headT + seed per bolt, no THREE objects
|
|
88
112
|
const boltStates = useRef([]);
|
|
89
|
-
//
|
|
113
|
+
// Static geometry: backbone, rungs, dots. Colours, sizes and opacity are pushed.
|
|
90
114
|
const scene = useMemo(() => {
|
|
91
115
|
const N = Math.max(particleCount, 150);
|
|
92
116
|
const RUNG_STEP = Math.max(3, Math.floor(N / 22));
|
|
@@ -96,7 +120,7 @@ const DnaHelixEffect = ({ boundingRadius, config, animations, onObjectReady, onO
|
|
|
96
120
|
strandPts[si].push(helixAt(i / (N - 1), si, numStrands, r, h));
|
|
97
121
|
}
|
|
98
122
|
}
|
|
99
|
-
// Backbone lines
|
|
123
|
+
// Backbone lines - colors updated each frame
|
|
100
124
|
const makeStrandLine = (pts) => {
|
|
101
125
|
const pos = new Float32Array(pts.length * 3);
|
|
102
126
|
const col = new Float32Array(pts.length * 3);
|
|
@@ -117,27 +141,27 @@ const DnaHelixEffect = ({ boundingRadius, config, animations, onObjectReady, onO
|
|
|
117
141
|
});
|
|
118
142
|
return {
|
|
119
143
|
line: new THREE.Line(geo, mat),
|
|
144
|
+
geo,
|
|
145
|
+
mat,
|
|
120
146
|
colorBuf: col,
|
|
121
147
|
colorAttr: geo.attributes.color,
|
|
122
148
|
N: pts.length,
|
|
123
149
|
};
|
|
124
150
|
};
|
|
125
151
|
const strands = strandPts.map(makeStrandLine);
|
|
126
|
-
// Rungs
|
|
127
|
-
const rV = [],
|
|
128
|
-
const rc = new THREE.Color(basePairColor || '#00ffee');
|
|
152
|
+
// Rungs (coloured by applyConfig from basePairColor x a per-rung brightness)
|
|
153
|
+
const rV = [], rB = [];
|
|
129
154
|
for (let i = 0; i < N; i += RUNG_STEP) {
|
|
130
155
|
const a = strandPts[0][i];
|
|
131
156
|
const b = strandPts[1 % numStrands][i];
|
|
132
157
|
rV.push(a.x, a.y, a.z, b.x, b.y, b.z);
|
|
133
|
-
|
|
134
|
-
rC.push(rc.r * br, rc.g * br, rc.b * br, rc.r * br, rc.g * br, rc.b * br);
|
|
158
|
+
rB.push(0.55 + 0.3 * Math.sin((i / (N - 1)) * Math.PI));
|
|
135
159
|
}
|
|
136
160
|
const rungGeo = new THREE.BufferGeometry();
|
|
137
161
|
rungGeo.setAttribute('position', new THREE.BufferAttribute(new Float32Array(rV), 3));
|
|
138
|
-
rungGeo.setAttribute('color', new THREE.BufferAttribute(new Float32Array(
|
|
162
|
+
rungGeo.setAttribute('color', new THREE.BufferAttribute(new Float32Array(rV.length), 3));
|
|
139
163
|
const rungMat = new THREE.LineBasicMaterial({
|
|
140
|
-
vertexColors: true, transparent: true,
|
|
164
|
+
vertexColors: true, transparent: true,
|
|
141
165
|
depthWrite: false, blending: THREE.AdditiveBlending,
|
|
142
166
|
});
|
|
143
167
|
// Junction dots
|
|
@@ -157,17 +181,23 @@ const DnaHelixEffect = ({ boundingRadius, config, animations, onObjectReady, onO
|
|
|
157
181
|
const dotMat = new THREE.ShaderMaterial({
|
|
158
182
|
vertexShader: dotVert, fragmentShader: dotFrag,
|
|
159
183
|
uniforms: {
|
|
160
|
-
uSize: { value: 14
|
|
184
|
+
uSize: { value: 14 },
|
|
161
185
|
uColor: { value: new THREE.Vector3(0.15, 1.0, 0.93) },
|
|
162
|
-
uOpacity: { value:
|
|
186
|
+
uOpacity: { value: 1 },
|
|
163
187
|
u_time: { value: 0 },
|
|
164
188
|
},
|
|
165
189
|
transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
|
|
166
190
|
});
|
|
167
|
-
return { strands, N, rungGeo, rungMat, dotGeo, dotMat };
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
191
|
+
return { strands, N, rungGeo, rungMat, rungBright: new Float32Array(rB), dotGeo, dotMat };
|
|
192
|
+
}, [particleCount, numStrands, r, h]);
|
|
193
|
+
useEffect(() => () => {
|
|
194
|
+
scene.strands.forEach(({ geo, mat }) => { geo.dispose(); mat.dispose(); });
|
|
195
|
+
scene.rungGeo.dispose();
|
|
196
|
+
scene.rungMat.dispose();
|
|
197
|
+
scene.dotGeo.dispose();
|
|
198
|
+
scene.dotMat.dispose();
|
|
199
|
+
}, [scene]);
|
|
200
|
+
// Single combined geometry for ALL energy bolts.
|
|
171
201
|
// Uses LineSegments (GL_LINES: disconnected pairs), one draw call for all bolts.
|
|
172
202
|
const { boltGeo, boltMat, boltPtsGeo, boltPtsMat } = useMemo(() => {
|
|
173
203
|
const totalBolts = numStrands * BOLTS_PER_STRAND;
|
|
@@ -192,7 +222,7 @@ const DnaHelixEffect = ({ boundingRadius, config, animations, onObjectReady, onO
|
|
|
192
222
|
});
|
|
193
223
|
}
|
|
194
224
|
}
|
|
195
|
-
// Points layer
|
|
225
|
+
// Points layer - one sprite per BOLT_N sample, drives the glow thickness
|
|
196
226
|
const totalPts = numStrands * BOLTS_PER_STRAND * BOLT_N;
|
|
197
227
|
const ptPos = new Float32Array(totalPts * 3);
|
|
198
228
|
const ptBright = new Float32Array(totalPts);
|
|
@@ -210,12 +240,19 @@ const DnaHelixEffect = ({ boundingRadius, config, animations, onObjectReady, onO
|
|
|
210
240
|
transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
|
|
211
241
|
});
|
|
212
242
|
return { boltGeo: geo, boltMat: mat, boltPtsGeo: ptsGeo, boltPtsMat: ptsMat };
|
|
213
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
214
243
|
}, [numStrands]);
|
|
215
|
-
|
|
244
|
+
useEffect(() => () => { boltGeo.dispose(); boltMat.dispose(); boltPtsGeo.dispose(); boltPtsMat.dispose(); }, [boltGeo, boltMat, boltPtsGeo, boltPtsMat]);
|
|
245
|
+
const push = useCallback((merged) => {
|
|
246
|
+
cur.current = merged;
|
|
247
|
+
applyConfig(scene, boltPtsMat, merged);
|
|
248
|
+
}, [scene, boltPtsMat]);
|
|
249
|
+
useLayoutEffect(() => { push(cfg); }, [push, cfg]);
|
|
250
|
+
useConfigDriver({ rootRef: groupRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
251
|
+
// Frame loop
|
|
216
252
|
useFrame((state, delta) => {
|
|
217
253
|
if (!groupRef.current)
|
|
218
254
|
return;
|
|
255
|
+
const { speed, intensity } = cur.current;
|
|
219
256
|
groupRef.current.rotation.y += delta * speed * 0.18;
|
|
220
257
|
scene.dotMat.uniforms.u_time.value = state.clock.getElapsedTime();
|
|
221
258
|
// Backbone color wash
|
|
@@ -242,10 +279,8 @@ const DnaHelixEffect = ({ boundingRadius, config, animations, onObjectReady, onO
|
|
|
242
279
|
const ptPosAttr = boltPtsGeo.attributes.position;
|
|
243
280
|
const ptBrtAttr = boltPtsGeo.attributes.aBright;
|
|
244
281
|
const JITTER = r * 0.20;
|
|
245
|
-
boltPtsMat.uniforms.uSize.value = 18 * intensity;
|
|
246
|
-
boltPtsMat.uniforms.uOpacity.value = opacity;
|
|
247
282
|
boltStates.current.forEach((state, boltIdx) => {
|
|
248
|
-
state.headT += delta * speed * 0.18; // slow
|
|
283
|
+
state.headT += delta * speed * 0.18; // slow - so each bolt is clearly visible
|
|
249
284
|
if (state.headT >= 1) {
|
|
250
285
|
state.headT -= 1;
|
|
251
286
|
state.seed++;
|
|
@@ -304,9 +339,6 @@ const DnaHelixEffect = ({ boundingRadius, config, animations, onObjectReady, onO
|
|
|
304
339
|
ptPosAttr.needsUpdate = true;
|
|
305
340
|
ptBrtAttr.needsUpdate = true;
|
|
306
341
|
}
|
|
307
|
-
if (animations?.length) {
|
|
308
|
-
applyGenerativeAnimations([scene.dotMat, boltPtsMat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
309
|
-
}
|
|
310
342
|
});
|
|
311
343
|
return (_jsxs("group", { ref: groupRef, children: [scene.strands.map(({ line }, i) => _jsx("primitive", { object: line }, i)), _jsx("lineSegments", { geometry: scene.rungGeo, material: scene.rungMat }), _jsx("points", { geometry: scene.dotGeo, material: scene.dotMat }), runningLightEnabled && (_jsxs(_Fragment, { children: [_jsx("lineSegments", { geometry: boltGeo, material: boltMat }), _jsx("points", { geometry: boltPtsGeo, material: boltPtsMat })] }))] }));
|
|
312
344
|
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AnimationOptions, FallingLeavesConfig } from '@3driseai/3drise-core';
|
|
2
|
+
import type { AnimationOptions, FallingLeavesConfig, MouseMoveDomain } from '@3driseai/3drise-core';
|
|
3
3
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
4
|
export interface FallingLeavesEffectProps extends ObjectReadyProps {
|
|
5
5
|
boundingRadius: number;
|
|
6
6
|
config: FallingLeavesConfig;
|
|
7
|
-
|
|
7
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
10
|
+
keyframes?: AnimationOptions[];
|
|
11
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
12
|
+
mouseMove?: MouseMoveDomain;
|
|
8
13
|
/** True when the effect is attached to an object, so it can react to the host. */
|
|
9
14
|
hasHost?: boolean;
|
|
10
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FallingLeavesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/FallingLeavesEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FallingLeavesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/FallingLeavesEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAC9D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AA8ZD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAqC3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
-
import {
|
|
5
|
+
import { EFFECTS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
6
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
7
9
|
/**
|
|
8
10
|
* Leaves drifting past the object, each one integrating the Andersen-Pesavento-Wang falling-plate equations, so they flutter, glide and tumble like real leaves.
|
|
9
11
|
*
|
|
@@ -405,7 +407,7 @@ function build(u, c, bound, env) {
|
|
|
405
407
|
dispose() { geo.dispose(); mat.dispose(); },
|
|
406
408
|
};
|
|
407
409
|
}
|
|
408
|
-
/**
|
|
410
|
+
/** A value for every knob: the base the renderer draws and keyframes interpolate from. */
|
|
409
411
|
const DEFAULTS = {
|
|
410
412
|
intensity: 1,
|
|
411
413
|
speed: 1,
|
|
@@ -419,27 +421,35 @@ const DEFAULTS = {
|
|
|
419
421
|
wind: 0.5,
|
|
420
422
|
autumnColor: '#c4631f',
|
|
421
423
|
};
|
|
422
|
-
|
|
424
|
+
/** Knobs that rebuild the object: they change on commit, never through the live path. */
|
|
425
|
+
const STRUCTURAL = ['leafCount'];
|
|
426
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
|
|
427
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.fallingLeaves.map((p) => p.value));
|
|
428
|
+
const FallingLeavesEffect = ({ boundingRadius, config, id, keyframes, mouseMove, hasHost = false, onObjectReady, onObjectDispose }) => {
|
|
423
429
|
const rootRef = useRef(null);
|
|
424
|
-
const animCache = useRef({});
|
|
425
430
|
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
426
431
|
// a standalone effect gets boundingRadius 1
|
|
427
432
|
const b = boundingRadius > 0 ? boundingRadius : 1;
|
|
428
|
-
const cfg = useMemo(() => (
|
|
433
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULTS, config), [config]);
|
|
429
434
|
const env = useMemo(() => ({ hasHost: hasHost }), [hasHost]);
|
|
430
435
|
// uniforms outlive the objects, so keyframe animations survive a rebuild
|
|
431
436
|
const uniforms = useMemo(() => createUniforms(), []);
|
|
432
437
|
// rebuilt only when the host size or a structural knob changes
|
|
433
|
-
const instance = useMemo(() => build(uniforms,
|
|
438
|
+
const instance = useMemo(() => build(uniforms, cfg, b, env), [uniforms, b, env, cfg.leafCount]);
|
|
434
439
|
useEffect(() => () => instance.dispose(), [instance]);
|
|
435
440
|
useLayoutEffect(() => {
|
|
436
441
|
applyConfig(uniforms, cfg, b, env);
|
|
437
442
|
instance.apply(cfg);
|
|
438
443
|
}, [instance, uniforms, cfg, b, env]);
|
|
444
|
+
// Committed config + live drag + keyframes + pointer, merged into the one push point
|
|
445
|
+
// (the uniforms, then the instance's own cheap per-config step).
|
|
446
|
+
const push = useCallback((merged) => {
|
|
447
|
+
applyConfig(uniforms, merged, b, env);
|
|
448
|
+
instance.apply(merged);
|
|
449
|
+
}, [instance, uniforms, b, env]);
|
|
450
|
+
useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
439
451
|
useFrame((state, delta) => {
|
|
440
452
|
instance.update(Math.min(delta, 0.1), state.camera);
|
|
441
|
-
if (animations?.length)
|
|
442
|
-
applyGenerativeAnimations(instance.materials, animations, animCache.current, Date.now(), false);
|
|
443
453
|
});
|
|
444
454
|
return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
|
|
445
455
|
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import type { AnimationOptions,
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FieldLinesConfig, AnimationOptions, MouseMoveDomain } from "@3driseai/3drise-core";
|
|
3
3
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
4
|
export interface FieldLinesEffectProps extends ObjectReadyProps {
|
|
5
5
|
boundingRadius: number;
|
|
6
6
|
config: FieldLinesConfig;
|
|
7
|
-
|
|
7
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
10
|
+
keyframes?: AnimationOptions[];
|
|
11
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
12
|
+
mouseMove?: MouseMoveDomain;
|
|
8
13
|
}
|
|
9
14
|
declare const FieldLinesEffect: React.FC<FieldLinesEffectProps>;
|
|
10
15
|
export default FieldLinesEffect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldLinesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/FieldLinesEffect.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FieldLinesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/FieldLinesEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGjG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC3D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAyOD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA+CrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
-
import * as THREE from 'three';
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
4
3
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
-
import
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
|
+
import { DEFAULT_GENERATIVE_EFFECTS, EFFECTS_ANIMATABLE } from "@3driseai/3drise-core";
|
|
6
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
7
9
|
/**
|
|
8
10
|
* Magnetic dipole field lines around the host, from the analytic line equation
|
|
9
11
|
* r = L sin^2(theta), with trapped particles that bounce between magnetic
|
|
@@ -210,10 +212,27 @@ const particleFrag = /* glsl */ `
|
|
|
210
212
|
gl_FragColor = vec4(col, core * core * (0.5 + 0.5 * vGlow) * uOpacity);
|
|
211
213
|
}
|
|
212
214
|
`;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
+
/** Knobs that rebuild the line and particle geometry: commit only, never live. */
|
|
216
|
+
const STRUCTURAL = ['shells', 'linesPerShell', 'particleCount'];
|
|
217
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what applyConfig pushes. */
|
|
218
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.fieldLines.map((p) => p.value));
|
|
219
|
+
/** The single push point: every config knob reaches its uniform here. */
|
|
220
|
+
function applyConfig(u, c, bound) {
|
|
221
|
+
u.uSpeed.value = c.speed;
|
|
222
|
+
u.uIntensity.value = c.intensity;
|
|
223
|
+
u.uOpacity.value = c.opacity;
|
|
224
|
+
u.uColor.value.set(c.color);
|
|
225
|
+
u.uApexColor.value.set(c.apexColor);
|
|
226
|
+
u.uBound.value = bound;
|
|
227
|
+
u.uExtent.value = c.extent;
|
|
228
|
+
u.uTwist.value = c.twist;
|
|
229
|
+
u.uTilt.value = c.tilt;
|
|
230
|
+
u.uParticleSize.value = c.particleSize;
|
|
231
|
+
}
|
|
232
|
+
const FieldLinesEffect = ({ boundingRadius, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
|
|
233
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULT_GENERATIVE_EFFECTS.fieldLines, config), [config]);
|
|
234
|
+
const { shells, linesPerShell, particleCount } = cfg;
|
|
215
235
|
const rootRef = useRef(null);
|
|
216
|
-
const animCache = useRef({});
|
|
217
236
|
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
218
237
|
// one uniform set, shared by the lines and the particles
|
|
219
238
|
const uniforms = useMemo(() => ({
|
|
@@ -238,22 +257,13 @@ const FieldLinesEffect = ({ boundingRadius, config, animations, onObjectReady, o
|
|
|
238
257
|
const particleGeometry = useMemo(() => buildFieldParticles(shells, linesPerShell, particleCount), [shells, linesPerShell, particleCount]);
|
|
239
258
|
useEffect(() => () => lineGeometry.dispose(), [lineGeometry]);
|
|
240
259
|
useEffect(() => () => particleGeometry.dispose(), [particleGeometry]);
|
|
241
|
-
|
|
242
|
-
uniforms
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
uniforms.uApexColor.value.set(apexColor);
|
|
247
|
-
uniforms.uBound.value = boundingRadius;
|
|
248
|
-
uniforms.uExtent.value = extent;
|
|
249
|
-
uniforms.uTwist.value = twist;
|
|
250
|
-
uniforms.uTilt.value = tilt;
|
|
251
|
-
uniforms.uParticleSize.value = particleSize;
|
|
252
|
-
}, [uniforms, speed, intensity, opacity, color, apexColor, boundingRadius, extent, twist, tilt, particleSize]);
|
|
260
|
+
const push = useCallback((merged) => {
|
|
261
|
+
applyConfig(uniforms, merged, boundingRadius);
|
|
262
|
+
}, [uniforms, boundingRadius]);
|
|
263
|
+
useLayoutEffect(() => { push(cfg); }, [push, cfg]);
|
|
264
|
+
useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
253
265
|
useFrame((_, delta) => {
|
|
254
266
|
uniforms.uTime.value += delta * uniforms.uSpeed.value;
|
|
255
|
-
if (animations?.length)
|
|
256
|
-
applyGenerativeAnimations(materials, animations, animCache.current, Date.now(), false);
|
|
257
267
|
});
|
|
258
268
|
return (_jsxs("group", { ref: rootRef, children: [_jsx("lineSegments", { geometry: lineGeometry, material: materials[0], frustumCulled: false }), _jsx("points", { geometry: particleGeometry, material: materials[1], frustumCulled: false })] }));
|
|
259
269
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Object3D } from 'three';
|
|
2
|
-
import { AnimationOptions, FireConfig } from "@3driseai/3drise-core";
|
|
2
|
+
import type { AnimationOptions, FireConfig, MouseMoveDomain } from "@3driseai/3drise-core";
|
|
3
3
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
4
|
export interface FireProps extends ObjectReadyProps {
|
|
5
5
|
/**
|
|
@@ -14,8 +14,13 @@ export interface FireProps extends ObjectReadyProps {
|
|
|
14
14
|
*/
|
|
15
15
|
hostRef?: Object3D | null;
|
|
16
16
|
config: FireConfig;
|
|
17
|
-
|
|
17
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
18
|
+
id?: string;
|
|
19
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
20
|
+
keyframes?: AnimationOptions[];
|
|
21
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
22
|
+
mouseMove?: MouseMoveDomain;
|
|
18
23
|
}
|
|
19
|
-
declare const Fire: ({ hostRef, config,
|
|
24
|
+
declare const Fire: ({ hostRef, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }: FireProps) => import("react").JSX.Element;
|
|
20
25
|
export default Fire;
|
|
21
26
|
//# sourceMappingURL=Fire.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fire.d.ts","sourceRoot":"","sources":["../../../src/components/effects/Fire.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Fire.d.ts","sourceRoot":"","sources":["../../../src/components/effects/Fire.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IAC/C;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAsGD,QAAA,MAAM,IAAI,GAAI,+EAA+E,SAAS,gCA4IrG,CAAC;AACF,eAAe,IAAI,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box3, Sphere,
|
|
3
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { Box3, Sphere, Vector3, Matrix4, PlaneGeometry, InstancedBufferGeometry, InstancedBufferAttribute, } from 'three';
|
|
3
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
4
4
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import { DEFAULT_GENERATIVE_EFFECTS, EFFECTS_ANIMATABLE } from "@3driseai/3drise-core";
|
|
5
6
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
7
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
8
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
9
|
// Add to FireConfig in 3drize-core:
|
|
7
10
|
// mode?: 'crown' | 'wrap' // wrap scatters tongues over the host surface
|
|
8
11
|
// coverage?: number // 0..1 — how far down the host burns (wrap)
|
|
@@ -85,14 +88,30 @@ function sampleSurface(host, count) {
|
|
|
85
88
|
}
|
|
86
89
|
return points;
|
|
87
90
|
}
|
|
88
|
-
|
|
91
|
+
/** Knobs that re-fit or re-scatter the flames, or mount the light: commit only, never live. */
|
|
92
|
+
const STRUCTURAL = ['mode', 'coverage', 'tongues', 'radius', 'height', 'radiusScale', 'heightScale', 'light'];
|
|
93
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
|
|
94
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.fire.map((p) => p.value));
|
|
95
|
+
/** The single push point: every config knob that lives on the material reaches it here. */
|
|
96
|
+
function applyConfig(m, c) {
|
|
97
|
+
m.u_intensity = c.intensity;
|
|
98
|
+
// speed is integrated into u_time on the CPU (see useFrame), so the shader's
|
|
99
|
+
// u_time * u_speed never jumps when the speed changes
|
|
100
|
+
m.u_speed = 1;
|
|
101
|
+
m.u_turbulence = c.turbulence;
|
|
102
|
+
m.u_sway = c.sway;
|
|
103
|
+
m.u_tint.set(c.tint);
|
|
104
|
+
}
|
|
105
|
+
const Fire = ({ hostRef, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
|
|
106
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULT_GENERATIVE_EFFECTS.fire, config), [config]);
|
|
89
107
|
const group = useRef(null);
|
|
90
108
|
useObjectReady(group, config, onObjectReady, onObjectDispose);
|
|
91
109
|
const material = useRef(null);
|
|
92
110
|
const lightRef = useRef(null);
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
111
|
+
// the knobs read per frame (speed, intensity), from the last merged config
|
|
112
|
+
const cur = useRef(cfg);
|
|
113
|
+
const { radius, height, radiusScale, heightScale, light, mode, coverage, tongues } = cfg;
|
|
114
|
+
// Shared instanced quad - per-tongue attributes are (re)filled on fit.
|
|
96
115
|
const geometry = useMemo(() => {
|
|
97
116
|
const base = new PlaneGeometry(1, 1);
|
|
98
117
|
const geo = new InstancedBufferGeometry();
|
|
@@ -192,11 +211,29 @@ const Fire = ({ hostRef, config, animations, onObjectReady, onObjectDispose }) =
|
|
|
192
211
|
heightScale,
|
|
193
212
|
geometry,
|
|
194
213
|
]);
|
|
195
|
-
|
|
214
|
+
// One push point for the material: the committed config when the material mounts or
|
|
215
|
+
// the config commits, the merged one while anything overrides it.
|
|
216
|
+
const cfgRef = useRef(cfg);
|
|
217
|
+
cfgRef.current = cfg;
|
|
218
|
+
const setMaterial = useCallback((m) => {
|
|
219
|
+
material.current = m;
|
|
220
|
+
if (m)
|
|
221
|
+
applyConfig(m, cfgRef.current);
|
|
222
|
+
}, []);
|
|
223
|
+
const push = useCallback((merged) => {
|
|
224
|
+
cur.current = merged;
|
|
225
|
+
if (material.current)
|
|
226
|
+
applyConfig(material.current, merged);
|
|
227
|
+
}, []);
|
|
228
|
+
useLayoutEffect(() => { push(cfg); }, [push, cfg]);
|
|
229
|
+
useConfigDriver({ rootRef: group, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
230
|
+
useFrame(({ clock }, delta) => {
|
|
196
231
|
const t = clock.getElapsedTime();
|
|
197
|
-
|
|
232
|
+
const { speed, intensity } = cur.current;
|
|
233
|
+
if (material.current)
|
|
234
|
+
material.current.u_time += Math.min(delta, 0.1) * speed;
|
|
198
235
|
if (light && lightRef.current) {
|
|
199
|
-
// Low-frequency flicker
|
|
236
|
+
// Low-frequency flicker - calm, ember-like, no strobing.
|
|
200
237
|
const flicker = 0.82 +
|
|
201
238
|
0.12 * Math.sin(t * 7.3) * Math.sin(t * 3.1) +
|
|
202
239
|
0.06 * Math.sin(t * 13.7 + 1.4);
|
|
@@ -205,6 +242,6 @@ const Fire = ({ hostRef, config, animations, onObjectReady, onObjectDispose }) =
|
|
|
205
242
|
material.current.u_height * (0.35 + 0.03 * Math.sin(t * 5.1));
|
|
206
243
|
}
|
|
207
244
|
});
|
|
208
|
-
return (_jsxs("group", { ref: group, children: [_jsx("mesh", { geometry: geometry, frustumCulled: false, children: _jsx("fireMaterial", { ref:
|
|
245
|
+
return (_jsxs("group", { ref: group, children: [_jsx("mesh", { geometry: geometry, frustumCulled: false, children: _jsx("fireMaterial", { ref: setMaterial }) }), light && (_jsx("pointLight", { ref: lightRef, color: "#ff7a26", distance: 0, decay: 2 }))] }));
|
|
209
246
|
};
|
|
210
247
|
export default Fire;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AnimationOptions, FireflySwarmConfig } from '@3driseai/3drise-core';
|
|
2
|
+
import type { AnimationOptions, FireflySwarmConfig, MouseMoveDomain } from '@3driseai/3drise-core';
|
|
3
3
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
4
|
export interface FireflySwarmEffectProps extends ObjectReadyProps {
|
|
5
5
|
boundingRadius: number;
|
|
6
6
|
config: FireflySwarmConfig;
|
|
7
|
-
|
|
7
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
10
|
+
keyframes?: AnimationOptions[];
|
|
11
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
12
|
+
mouseMove?: MouseMoveDomain;
|
|
8
13
|
/** True when the effect is attached to an object, so it can react to the host. */
|
|
9
14
|
hasHost?: boolean;
|
|
10
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FireflySwarmEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/FireflySwarmEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FireflySwarmEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/FireflySwarmEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAInG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC7D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AA8XD,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAqCzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
-
import {
|
|
5
|
+
import { EFFECTS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
6
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
7
9
|
/**
|
|
8
10
|
* Kuramoto-coupled fireflies drifting on a divergence-free flow: random blinking slowly locks into sync, with ripples of light rolling through the swarm. Use for night, garden, forest, magical scenes.
|
|
9
11
|
*
|
|
@@ -367,7 +369,7 @@ function build(u, c, bound, env) {
|
|
|
367
369
|
dispose() { geo.dispose(); mat.dispose(); },
|
|
368
370
|
};
|
|
369
371
|
}
|
|
370
|
-
/**
|
|
372
|
+
/** A value for every knob: the base the renderer draws and keyframes interpolate from. */
|
|
371
373
|
const DEFAULTS = {
|
|
372
374
|
intensity: 1,
|
|
373
375
|
speed: 1,
|
|
@@ -381,27 +383,35 @@ const DEFAULTS = {
|
|
|
381
383
|
glowSize: 1,
|
|
382
384
|
flashColor: '#d4ff5c',
|
|
383
385
|
};
|
|
384
|
-
|
|
386
|
+
/** Knobs that rebuild the object: they change on commit, never through the live path. */
|
|
387
|
+
const STRUCTURAL = ['count'];
|
|
388
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
|
|
389
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.fireflySwarm.map((p) => p.value));
|
|
390
|
+
const FireflySwarmEffect = ({ boundingRadius, config, id, keyframes, mouseMove, hasHost = false, onObjectReady, onObjectDispose }) => {
|
|
385
391
|
const rootRef = useRef(null);
|
|
386
|
-
const animCache = useRef({});
|
|
387
392
|
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
388
393
|
// a standalone effect gets boundingRadius 1
|
|
389
394
|
const b = boundingRadius > 0 ? boundingRadius : 1;
|
|
390
|
-
const cfg = useMemo(() => (
|
|
395
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULTS, config), [config]);
|
|
391
396
|
const env = useMemo(() => ({ hasHost: hasHost }), [hasHost]);
|
|
392
397
|
// uniforms outlive the objects, so keyframe animations survive a rebuild
|
|
393
398
|
const uniforms = useMemo(() => createUniforms(), []);
|
|
394
399
|
// rebuilt only when the host size or a structural knob changes
|
|
395
|
-
const instance = useMemo(() => build(uniforms,
|
|
400
|
+
const instance = useMemo(() => build(uniforms, cfg, b, env), [uniforms, b, env, cfg.count]);
|
|
396
401
|
useEffect(() => () => instance.dispose(), [instance]);
|
|
397
402
|
useLayoutEffect(() => {
|
|
398
403
|
applyConfig(uniforms, cfg, b, env);
|
|
399
404
|
instance.apply(cfg);
|
|
400
405
|
}, [instance, uniforms, cfg, b, env]);
|
|
406
|
+
// Committed config + live drag + keyframes + pointer, merged into the one push point
|
|
407
|
+
// (the uniforms, then the instance's own cheap per-config step).
|
|
408
|
+
const push = useCallback((merged) => {
|
|
409
|
+
applyConfig(uniforms, merged, b, env);
|
|
410
|
+
instance.apply(merged);
|
|
411
|
+
}, [instance, uniforms, b, env]);
|
|
412
|
+
useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
401
413
|
useFrame((state, delta) => {
|
|
402
414
|
instance.update(Math.min(delta, 0.1), state.camera);
|
|
403
|
-
if (animations?.length)
|
|
404
|
-
applyGenerativeAnimations(instance.materials, animations, animCache.current, Date.now(), false);
|
|
405
415
|
});
|
|
406
416
|
return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
|
|
407
417
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector3, Object3D } from "three";
|
|
2
|
-
import { AnimationOptions, FlaresConfig } from "@3driseai/3drise-core";
|
|
2
|
+
import type { AnimationOptions, FlaresConfig, MouseMoveDomain } from "@3driseai/3drise-core";
|
|
3
3
|
declare global {
|
|
4
4
|
namespace JSX {
|
|
5
5
|
interface IntrinsicElements {
|
|
@@ -15,11 +15,18 @@ export type FlaresProps = ObjectReadyProps & {
|
|
|
15
15
|
* false -> plane mode: circular limb billboard (default).
|
|
16
16
|
*/
|
|
17
17
|
hostRef?: Object3D | null;
|
|
18
|
+
/** Host bounding radius (1 for a standalone effect): the billboard is sized from it. */
|
|
19
|
+
boundingRadius?: number;
|
|
18
20
|
/** Root the bursts at the center (shooting from source) instead of the limb. */
|
|
19
21
|
config: FlaresConfig;
|
|
20
22
|
/** Uniform overrides for FlareMaterial (u_frequency, u_reach, ...). */
|
|
21
23
|
uniforms?: Record<string, number | Vector3 | number[]>;
|
|
22
|
-
|
|
24
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
25
|
+
id?: string;
|
|
26
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
27
|
+
keyframes?: AnimationOptions[];
|
|
28
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
29
|
+
mouseMove?: MouseMoveDomain;
|
|
23
30
|
};
|
|
24
|
-
export default function Flares({ hostRef, config, uniforms,
|
|
31
|
+
export default function Flares({ hostRef, boundingRadius, config, uniforms, id, keyframes, mouseMove, onObjectReady, onObjectDispose }: FlaresProps): import("react").JSX.Element;
|
|
25
32
|
//# sourceMappingURL=Flares.d.ts.map
|