@3driseai/3drise-viewer 0.1.26 → 0.1.28
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/ApollonianGrid.d.ts +25 -0
- package/dist/components/ApollonianGrid.d.ts.map +1 -0
- package/dist/components/ApollonianGrid.js +80 -0
- 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/ConformalGrid.d.ts +25 -0
- package/dist/components/ConformalGrid.d.ts.map +1 -0
- package/dist/components/ConformalGrid.js +97 -0
- 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 +9 -3
- package/dist/components/GridsGenerator.d.ts.map +1 -1
- package/dist/components/GridsGenerator.js +41 -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/HilbertGrid.d.ts +25 -0
- package/dist/components/HilbertGrid.d.ts.map +1 -0
- package/dist/components/HilbertGrid.js +93 -0
- 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/LensingGrid.d.ts +25 -0
- package/dist/components/LensingGrid.d.ts.map +1 -0
- package/dist/components/LensingGrid.js +81 -0
- 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/ParastichyGrid.d.ts +25 -0
- package/dist/components/ParastichyGrid.d.ts.map +1 -0
- package/dist/components/ParastichyGrid.js +82 -0
- package/dist/components/ParticlesGenerator.d.ts.map +1 -1
- package/dist/components/ParticlesGenerator.js +6 -0
- package/dist/components/PhyllotaxisGrid.d.ts +25 -0
- package/dist/components/PhyllotaxisGrid.d.ts.map +1 -0
- package/dist/components/PhyllotaxisGrid.js +95 -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/TruchetGrid.d.ts +25 -0
- package/dist/components/TruchetGrid.d.ts.map +1 -0
- package/dist/components/TruchetGrid.js +82 -0
- 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 +14 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +7 -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/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/gridConfigs.d.ts +103 -0
- package/dist/types/gridConfigs.d.ts.map +1 -1
- package/dist/types/index.d.ts +9 -9
- 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,618 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import { GENERATIVE_PARTICLES_ANIMATABLE } from '@3driseai/3drise-core';
|
|
6
|
+
import { applyConfigKeyframeAnimations, applyConfigMouseMove } from '../../utils/configAnimations.js';
|
|
7
|
+
import { createPointerUniforms, stepPointerField, usePointerField } from '../../utils/pointerField.js';
|
|
8
|
+
import { createTrailUniforms, applyTrailConfig, createCpuTrail } from '../../utils/particleTrails.js';
|
|
9
|
+
import { SHAPE_SCALE, shapeGeometry, radialMap } from '../../utils/particleShape.js';
|
|
10
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
11
|
+
import { useConfigLiveHandle } from '../../hooks/useConfigLive.js';
|
|
12
|
+
/**
|
|
13
|
+
* Magnetic Bottle — Charged particles woven over any mesh shape: counter-rotating constant-bearing spirals that tighten into glowing tips, in two exact family colours; the cursor pinches, drifts or heats the orbits. Use for sci-fi and tech scenes.
|
|
14
|
+
*/
|
|
15
|
+
// Magnetic Bottle — charged particles woven into a shape by a magnetic field.
|
|
16
|
+
// Movement: the chosen mesh is read as a flux surface: a ray from the axis at every angle and height
|
|
17
|
+
// gives its radius R(theta, h). Each particle orbits the axis on that surface. Magnetic flux
|
|
18
|
+
// through its orbit is conserved, so B ~ 1 / Rm(h)^2 (Rm = mean radius at that height), and
|
|
19
|
+
// the magnetic moment mu = v_perp^2 / B is an adiabatic invariant: where the surface narrows the
|
|
20
|
+
// field grows, v_perp grows as 1 / Rm, the orbit spins faster (omega ~ 1 / Rm^2) and v_par =
|
|
21
|
+
// sqrt(v^2 - v_perp^2) falls to zero at the mirror point, where the particle turns back.
|
|
22
|
+
// Positive and negative charges gyrate in opposite senses, so the two families cross into a
|
|
23
|
+
// woven lattice; each pitch angle mirrors at its own height, so the weave fills the shape.
|
|
24
|
+
// A cone gives the inward vortex (tight, fast, bright near the tip); polyhedra give pyramids.
|
|
25
|
+
// Colour: exact per family: positive = color, negative = counterColor. The pitch sets the light:
|
|
26
|
+
// sin(alpha) = v_perp / v -> brightness and whitening, so mirror points glow as bright rings.
|
|
27
|
+
// Every particle leaves a fading ink line (the woven shape) and a white-hot head.
|
|
28
|
+
// Mouse (pointerMode, cursor on the camera-facing plane through the object):
|
|
29
|
+
// pinch — a magnet: the field grows under the cursor, the surface dents in and particles that reach
|
|
30
|
+
// the dent mirror off it.
|
|
31
|
+
// drift — an electric field: E x B drift carries every particle the same way round the cursor
|
|
32
|
+
// (charge independent), so the weave shears into a local swirl.
|
|
33
|
+
// heat — an RF antenna at the cyclotron resonance: passing particles gain v_perp, flare in the
|
|
34
|
+
// heat colour and mirror earlier; collisions relax them back over seconds.
|
|
35
|
+
// Trails (trailMode): streak = motion blur, comet = gyro tails, echo = afterglow, in family colour.
|
|
36
|
+
//
|
|
37
|
+
// Generated from the approved lab module (particle lab, shapes batch). Sim units = object-local / size.
|
|
38
|
+
// config.shape is a mesh-builder geometry config ({ type, ...params }); utils/particleShape builds it with
|
|
39
|
+
// the core mesh builders (createMeshByType) and reads it as a surface.
|
|
40
|
+
// ---------------------------------------------------------------------------------------------
|
|
41
|
+
// Engine features
|
|
42
|
+
// ---------------------------------------------------------------------------------------------
|
|
43
|
+
const QUALITY_SCALE = { low: 0.5, medium: 1, high: 1.6 };
|
|
44
|
+
/** mulberry32 — seeded PRNG, returns a function giving floats in [0,1). */
|
|
45
|
+
function mulberry32(seed) {
|
|
46
|
+
let a = seed >>> 0;
|
|
47
|
+
return function () {
|
|
48
|
+
a = (a + 0x6d2b79f5) >>> 0;
|
|
49
|
+
let t = a;
|
|
50
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
51
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
52
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** Viewport-height hook so point sizes are pixel-correct at any canvas size. */
|
|
56
|
+
function attachViewH(obj, u) {
|
|
57
|
+
const scratch = new THREE.Vector2();
|
|
58
|
+
obj.onBeforeRender = (renderer) => {
|
|
59
|
+
renderer.getDrawingBufferSize(scratch);
|
|
60
|
+
u.uViewH.value = scratch.y;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function colorUniform(hex) {
|
|
64
|
+
return { value: new THREE.Color(hex) };
|
|
65
|
+
}
|
|
66
|
+
function qualityScale(q) { return QUALITY_SCALE[q] || 1; }
|
|
67
|
+
function seedMix(base, seed) {
|
|
68
|
+
let h = (base ^ Math.imul((Math.round(seed) | 0) + 0x9e37, 0x85ebca6b)) >>> 0;
|
|
69
|
+
h = Math.imul(h ^ (h >>> 13), 0xc2b2ae35) >>> 0;
|
|
70
|
+
return (h ^ (h >>> 16)) >>> 0;
|
|
71
|
+
}
|
|
72
|
+
function createFixedStep(H, maxSteps) {
|
|
73
|
+
let acc = 0;
|
|
74
|
+
return {
|
|
75
|
+
H,
|
|
76
|
+
run(d, step) {
|
|
77
|
+
acc += Math.max(d, 0);
|
|
78
|
+
let k = 0;
|
|
79
|
+
while (acc >= H && k < maxSteps) {
|
|
80
|
+
step(H);
|
|
81
|
+
acc -= H;
|
|
82
|
+
k++;
|
|
83
|
+
}
|
|
84
|
+
if (k === maxSteps)
|
|
85
|
+
acc = Math.min(acc, H);
|
|
86
|
+
return acc / H;
|
|
87
|
+
},
|
|
88
|
+
reset() { acc = 0; },
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function createPickProxy(center, radius) {
|
|
92
|
+
const geo = new THREE.SphereGeometry(1, 16, 10);
|
|
93
|
+
const mat = new THREE.MeshBasicMaterial({ visible: false });
|
|
94
|
+
const mesh = new THREE.Mesh(geo, mat);
|
|
95
|
+
mesh.name = 'pickProxy';
|
|
96
|
+
mesh.position.set(center[0], center[1], center[2]);
|
|
97
|
+
mesh.scale.setScalar(radius);
|
|
98
|
+
return { mesh, dispose() { geo.dispose(); mat.dispose(); } };
|
|
99
|
+
}
|
|
100
|
+
const _frustum = new THREE.Frustum();
|
|
101
|
+
const _pm = new THREE.Matrix4();
|
|
102
|
+
const _sphere = new THREE.Sphere();
|
|
103
|
+
function inView(object, camera, center, radius, size) {
|
|
104
|
+
if (!camera || !camera.projectionMatrix)
|
|
105
|
+
return true;
|
|
106
|
+
object.updateWorldMatrix(true, false);
|
|
107
|
+
_sphere.center.set(center[0], center[1], center[2]).multiplyScalar(size).applyMatrix4(object.matrixWorld);
|
|
108
|
+
_sphere.radius = radius * size * object.matrixWorld.getMaxScaleOnAxis();
|
|
109
|
+
_pm.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
|
|
110
|
+
_frustum.setFromProjectionMatrix(_pm);
|
|
111
|
+
return _frustum.intersectsSphere(_sphere);
|
|
112
|
+
}
|
|
113
|
+
const POINTER_MODES = ['pinch', 'drift', 'heat'];
|
|
114
|
+
const NTH = 96, NHT = 96; // radial map resolution (angle x height)
|
|
115
|
+
const H_STEP = 1 / 120;
|
|
116
|
+
const V0 = 0.9; // speed along the orbit (units / s) at speed 1
|
|
117
|
+
const TRAIL_LOOK = { streak: 0.25, comet: 1, echo: 1 };
|
|
118
|
+
const TRAIL_ALPHA = { streak: 1.6, comet: 2, echo: 3 };
|
|
119
|
+
const BOUNDS = { center: [0, 0, 0], radius: 1.25 };
|
|
120
|
+
function createUniforms() {
|
|
121
|
+
return {
|
|
122
|
+
uTime: { value: 0 },
|
|
123
|
+
uSize: { value: 1 },
|
|
124
|
+
uViewH: { value: 800 },
|
|
125
|
+
uIntensity: { value: 1 },
|
|
126
|
+
uSpeed: { value: 1 },
|
|
127
|
+
uOpacity: { value: 0.9 },
|
|
128
|
+
uColor: colorUniform('#ffffff'),
|
|
129
|
+
uParticleCount: { value: 0 },
|
|
130
|
+
uWindings: { value: 1.6 },
|
|
131
|
+
uPitchSpread: { value: 0.6 },
|
|
132
|
+
uLineLife: { value: 6 },
|
|
133
|
+
uLineDensity: { value: 1 },
|
|
134
|
+
uCounterColor: colorUniform('#ffffff'),
|
|
135
|
+
uGlow: { value: 1 },
|
|
136
|
+
uPointerMode: { value: 0 },
|
|
137
|
+
uPointerStrength: { value: 1 },
|
|
138
|
+
uPointerRadius: { value: 1 },
|
|
139
|
+
uPointerColor: colorUniform('#ffffff'),
|
|
140
|
+
uTrailGain: { value: 1 },
|
|
141
|
+
uCamLocal: { value: new THREE.Vector3(0, 0, 3) },
|
|
142
|
+
...createPointerUniforms(),
|
|
143
|
+
...createTrailUniforms(),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function applyConfig(u, c, size) {
|
|
147
|
+
u.uSize.value = size;
|
|
148
|
+
u.uIntensity.value = c.intensity;
|
|
149
|
+
u.uSpeed.value = c.speed;
|
|
150
|
+
u.uOpacity.value = c.opacity;
|
|
151
|
+
u.uColor.value.set(c.color);
|
|
152
|
+
u.uParticleCount.value = c.particleCount;
|
|
153
|
+
u.uWindings.value = c.windings;
|
|
154
|
+
u.uPitchSpread.value = c.pitchSpread;
|
|
155
|
+
u.uLineLife.value = c.lineLife;
|
|
156
|
+
u.uLineDensity.value = c.lineDensity;
|
|
157
|
+
u.uCounterColor.value.set(c.counterColor);
|
|
158
|
+
u.uGlow.value = c.glow;
|
|
159
|
+
u.uPointerMode.value = POINTER_MODES.indexOf(c.pointerMode); // -1 = 'none' (off)
|
|
160
|
+
u.uPointerStrength.value = c.pointerStrength;
|
|
161
|
+
u.uPointerRadius.value = c.pointerRadius;
|
|
162
|
+
u.uPointerColor.value.set(c.pointerColor);
|
|
163
|
+
applyTrailConfig(u, c);
|
|
164
|
+
}
|
|
165
|
+
// Light code shared by lines, heads and trails: c = family (0 / 1) + 2 x pitch (0..1) + 4 x heat (0..1)
|
|
166
|
+
// packed as code = family + 2 * round(pitch * 63) + 128 * round(heat * 31)
|
|
167
|
+
const LIGHT_GLSL = /* glsl */ `
|
|
168
|
+
uniform vec3 uColor, uCounterColor, uPointerColor;
|
|
169
|
+
uniform float uGlow;
|
|
170
|
+
vec3 familyLight(float code, out float pitch) {
|
|
171
|
+
float heat = floor(code / 128.0);
|
|
172
|
+
float rest = code - heat * 128.0;
|
|
173
|
+
float pq = floor(rest / 2.0);
|
|
174
|
+
float fam = rest - pq * 2.0;
|
|
175
|
+
pitch = pq / 63.0;
|
|
176
|
+
heat /= 31.0;
|
|
177
|
+
vec3 c = fam < 0.5 ? uColor : uCounterColor;
|
|
178
|
+
float s4 = pitch * pitch * pitch * pitch;
|
|
179
|
+
// tight orbits (sin(alpha) -> 1, near the mirror point) whiten and brighten into rings
|
|
180
|
+
vec3 col = mix(c, vec3(1.0), 0.3 * s4 * s4) * (0.55 + 0.6 * pitch + 0.9 * uGlow * s4 * s4);
|
|
181
|
+
return mix(col, uPointerColor * 1.6, heat);
|
|
182
|
+
}
|
|
183
|
+
`;
|
|
184
|
+
const lineVertex = /* glsl */ `
|
|
185
|
+
uniform float uSize, uViewH, uIntensity, uOpacity;
|
|
186
|
+
uniform vec3 uCamLocal;
|
|
187
|
+
${LIGHT_GLSL}
|
|
188
|
+
attribute vec2 aL; // light code, age fraction (-1 = empty)
|
|
189
|
+
varying vec3 vCol;
|
|
190
|
+
varying float vA;
|
|
191
|
+
void main() {
|
|
192
|
+
vec4 mv = modelViewMatrix * vec4(position * uSize, 1.0);
|
|
193
|
+
float pitch;
|
|
194
|
+
vCol = familyLight(aL.x, pitch) * uIntensity;
|
|
195
|
+
float f = aL.y;
|
|
196
|
+
float fade = f < 0.0 ? 0.0 : smoothstep(0.0, 0.02, f) * (1.0 - smoothstep(0.45, 1.0, f));
|
|
197
|
+
// the far side of the surface is dimmer, so the front weave reads cleanly over the back one
|
|
198
|
+
vec3 radial = normalize(vec3(position.x, 0.0, position.z) + 1e-5);
|
|
199
|
+
float facing = dot(radial, normalize(uCamLocal - position));
|
|
200
|
+
vA = uOpacity * fade * 0.8 * mix(0.3, 1.0, smoothstep(-0.35, 0.35, facing));
|
|
201
|
+
gl_PointSize = clamp(uSize * uViewH * 0.005 * (0.8 + 0.5 * pitch) / -mv.z, 1.0, 12.0) * step(0.004, vA);
|
|
202
|
+
gl_Position = projectionMatrix * mv;
|
|
203
|
+
}
|
|
204
|
+
`;
|
|
205
|
+
const lineFragment = /* glsl */ `
|
|
206
|
+
varying vec3 vCol;
|
|
207
|
+
varying float vA;
|
|
208
|
+
void main() {
|
|
209
|
+
vec2 d = gl_PointCoord * 2.0 - 1.0;
|
|
210
|
+
float r2 = dot(d, d);
|
|
211
|
+
if (r2 > 1.0) discard;
|
|
212
|
+
float a = (exp(-r2 * 5.0) + 0.15 * exp(-r2 * 1.8)) * (1.0 - r2) * vA;
|
|
213
|
+
if (a < 0.002) discard;
|
|
214
|
+
gl_FragColor = vec4(vCol, a);
|
|
215
|
+
}
|
|
216
|
+
`;
|
|
217
|
+
const headVertex = /* glsl */ `
|
|
218
|
+
uniform float uSize, uViewH, uIntensity, uOpacity;
|
|
219
|
+
${LIGHT_GLSL}
|
|
220
|
+
attribute float aCode;
|
|
221
|
+
varying vec3 vCol;
|
|
222
|
+
varying float vA;
|
|
223
|
+
void main() {
|
|
224
|
+
vec4 mv = modelViewMatrix * vec4(position * uSize, 1.0);
|
|
225
|
+
float pitch;
|
|
226
|
+
vCol = familyLight(aCode, pitch) * uIntensity;
|
|
227
|
+
vA = uOpacity * (0.6 + 0.4 * uGlow);
|
|
228
|
+
gl_PointSize = clamp(uSize * uViewH * 0.03 / -mv.z, 2.0, 36.0);
|
|
229
|
+
gl_Position = projectionMatrix * mv;
|
|
230
|
+
}
|
|
231
|
+
`;
|
|
232
|
+
const headFragment = /* glsl */ `
|
|
233
|
+
varying vec3 vCol;
|
|
234
|
+
varying float vA;
|
|
235
|
+
void main() {
|
|
236
|
+
vec2 d = gl_PointCoord * 2.0 - 1.0;
|
|
237
|
+
float r2 = dot(d, d);
|
|
238
|
+
if (r2 > 1.0) discard;
|
|
239
|
+
float core = exp(-r2 * 45.0);
|
|
240
|
+
float glow = exp(-r2 * 8.0) * 0.5 + exp(-r2 * 2.5) * 0.1;
|
|
241
|
+
float a = clamp((core + glow) * (1.0 - r2) * vA, 0.0, 1.0);
|
|
242
|
+
if (a < 0.003) discard;
|
|
243
|
+
gl_FragColor = vec4(mix(normalize(vCol + 1e-4) * 1.2, vec3(1.0), core), a);
|
|
244
|
+
}
|
|
245
|
+
`;
|
|
246
|
+
function build(u, c, size) {
|
|
247
|
+
const q = qualityScale(c.quality);
|
|
248
|
+
const n = Math.max(2, Math.round(c.particleCount));
|
|
249
|
+
const rng = mulberry32(seedMix(0xb077, c.seed));
|
|
250
|
+
// ---- the shape as a flux surface, normalised into the unit box round the origin ----
|
|
251
|
+
const geom = shapeGeometry(c.shape);
|
|
252
|
+
const map = radialMap(geom, NTH, NHT);
|
|
253
|
+
geom.dispose();
|
|
254
|
+
const R = map.R;
|
|
255
|
+
let rMax = 0;
|
|
256
|
+
for (let k = 0; k < R.length; k++)
|
|
257
|
+
rMax = Math.max(rMax, R[k]);
|
|
258
|
+
const hSpan = map.ymax - map.ymin;
|
|
259
|
+
const sc = SHAPE_SCALE; // real size: the shape's parameters set the object's size
|
|
260
|
+
for (let k = 0; k < R.length; k++)
|
|
261
|
+
R[k] *= sc;
|
|
262
|
+
const Y0 = -hSpan * sc / 2, Y1 = hSpan * sc / 2;
|
|
263
|
+
const bR = Math.max(BOUNDS.radius, Math.hypot(rMax, hSpan * sc / 2) * 1.08); // selection bounds grow with the shape
|
|
264
|
+
// mean radius per height (sets the field B ~ 1 / Rm^2), and where the surface is widest
|
|
265
|
+
const Rm = new Float32Array(NHT);
|
|
266
|
+
let jWide = 0;
|
|
267
|
+
for (let j = 0; j < NHT; j++) {
|
|
268
|
+
let s = 0;
|
|
269
|
+
for (let i = 0; i < NTH; i++)
|
|
270
|
+
s += R[j * NTH + i];
|
|
271
|
+
Rm[j] = s / NTH;
|
|
272
|
+
if (Rm[j] > Rm[jWide])
|
|
273
|
+
jWide = j;
|
|
274
|
+
}
|
|
275
|
+
const RW = Rm[jWide];
|
|
276
|
+
const hOf = (j) => Y0 + ((j + 0.5) / NHT) * (Y1 - Y0);
|
|
277
|
+
function rmAt(h) {
|
|
278
|
+
let f = (h - Y0) / (Y1 - Y0) * NHT - 0.5;
|
|
279
|
+
if (f < 0)
|
|
280
|
+
f = 0;
|
|
281
|
+
else if (f > NHT - 1.001)
|
|
282
|
+
f = NHT - 1.001;
|
|
283
|
+
const j = f | 0, t = f - j;
|
|
284
|
+
return Rm[j] + (Rm[j + 1] - Rm[j]) * t;
|
|
285
|
+
}
|
|
286
|
+
function rAt(th, h) {
|
|
287
|
+
let f = (h - Y0) / (Y1 - Y0) * NHT - 0.5;
|
|
288
|
+
if (f < 0)
|
|
289
|
+
f = 0;
|
|
290
|
+
else if (f > NHT - 1.001)
|
|
291
|
+
f = NHT - 1.001;
|
|
292
|
+
let g = (th / (Math.PI * 2)) * NTH;
|
|
293
|
+
g -= Math.floor(g / NTH) * NTH;
|
|
294
|
+
const j = f | 0, t = f - j, i = g | 0, s = g - i, i1 = (i + 1) % NTH;
|
|
295
|
+
const a = R[j * NTH + i] + (R[j * NTH + i1] - R[j * NTH + i]) * s;
|
|
296
|
+
const b = R[(j + 1) * NTH + i] + (R[(j + 1) * NTH + i1] - R[(j + 1) * NTH + i]) * s;
|
|
297
|
+
return a + (b - a) * t;
|
|
298
|
+
}
|
|
299
|
+
// ---- particles: bearing angle, charge family (handedness), phase, direction ----
|
|
300
|
+
const h = new Float32Array(n), th = new Float32Array(n), dir = new Int8Array(n), fam = new Uint8Array(n);
|
|
301
|
+
const psi = new Float32Array(n), heat = new Float32Array(n);
|
|
302
|
+
const hx = new Float32Array(n * 3), hv = new Float32Array(n * 3), code = new Float32Array(n), hK = new Float32Array(n);
|
|
303
|
+
const acc = new Float32Array(n);
|
|
304
|
+
const half = Math.ceil(n / 2);
|
|
305
|
+
for (let i = 0; i < n; i++) {
|
|
306
|
+
fam[i] = i % 2;
|
|
307
|
+
const k = i >> 1;
|
|
308
|
+
psi[i] = (k / half - 0.5) * 2; // -1..1, scaled by pitchSpread each step
|
|
309
|
+
h[i] = Y0 + (Y1 - Y0) * ((k * 0.618034) % 1); // golden-ratio spread along the height
|
|
310
|
+
th[i] = (k / half) * Math.PI * 2 + fam[i] * Math.PI / half;
|
|
311
|
+
dir[i] = k % 2 === 0 ? 1 : -1;
|
|
312
|
+
}
|
|
313
|
+
// meridian slope dRm/dh for arc length along the surface
|
|
314
|
+
const dRm = new Float32Array(NHT);
|
|
315
|
+
for (let j = 0; j < NHT; j++) {
|
|
316
|
+
const a = Rm[Math.max(j - 1, 0)], b = Rm[Math.min(j + 1, NHT - 1)];
|
|
317
|
+
dRm[j] = (b - a) / (((Math.min(j + 1, NHT - 1) - Math.max(j - 1, 0)) / NHT) * (Y1 - Y0));
|
|
318
|
+
}
|
|
319
|
+
function slopeAt(hh) {
|
|
320
|
+
let f = (hh - Y0) / (Y1 - Y0) * NHT - 0.5;
|
|
321
|
+
if (f < 0)
|
|
322
|
+
f = 0;
|
|
323
|
+
else if (f > NHT - 1.001)
|
|
324
|
+
f = NHT - 1.001;
|
|
325
|
+
const j = f | 0, t = f - j;
|
|
326
|
+
return dRm[j] + (dRm[j + 1] - dRm[j]) * t;
|
|
327
|
+
}
|
|
328
|
+
// ---- line ink: a ring of points the particles lay down ----
|
|
329
|
+
const NL = Math.max(8000, Math.round(60000 * q));
|
|
330
|
+
const lp = new Float32Array(NL * 3), la = new Float32Array(NL * 2), lb = new Float32Array(NL); // lb = birth time
|
|
331
|
+
for (let k = 0; k < NL; k++)
|
|
332
|
+
la[k * 2 + 1] = -1;
|
|
333
|
+
let lHead = 0;
|
|
334
|
+
let time = 0;
|
|
335
|
+
const P = new THREE.Vector3();
|
|
336
|
+
let trail = null;
|
|
337
|
+
function pack(f, pitch, ht) {
|
|
338
|
+
return f + 2 * Math.round(Math.min(Math.max(pitch, 0), 1) * 63) + 128 * Math.round(Math.min(Math.max(ht, 0), 1) * 31);
|
|
339
|
+
}
|
|
340
|
+
function step(dt) {
|
|
341
|
+
time += dt;
|
|
342
|
+
// bearing of the loxodromes: tan(psi) = R dtheta / dm; windings sets it, pitchSpread fans it per particle
|
|
343
|
+
const base = Math.atan(u.uWindings.value * 2.2);
|
|
344
|
+
const spread = 0.35 * u.uPitchSpread.value;
|
|
345
|
+
const mode = u.uPointerMode.value;
|
|
346
|
+
const S = u.uPointerStrength.value * u.uPointerActive.value;
|
|
347
|
+
const Rp = 0.28 * u.uPointerRadius.value;
|
|
348
|
+
P.copy(u.uPointer.value);
|
|
349
|
+
const spacing = 0.0055 / Math.max(u.uLineDensity.value, 0.05);
|
|
350
|
+
const life = Math.max(u.uLineLife.value, 0.1);
|
|
351
|
+
const cool = Math.exp(-dt / 1.6);
|
|
352
|
+
for (let i = 0; i < n; i++) {
|
|
353
|
+
const j = i * 3;
|
|
354
|
+
const px = hx[j], py = hx[j + 1], pz = hx[j + 2];
|
|
355
|
+
// cursor proximity (from the last position)
|
|
356
|
+
let g = 0;
|
|
357
|
+
if (S > 0.001) {
|
|
358
|
+
const ex = px - P.x, ey = py - P.y, ez = pz - P.z;
|
|
359
|
+
const d2 = ex * ex + ey * ey + ez * ez;
|
|
360
|
+
if (d2 < 9 * Rp * Rp)
|
|
361
|
+
g = Math.exp(-d2 / (Rp * Rp));
|
|
362
|
+
}
|
|
363
|
+
if (mode === 2 && g > 0.02)
|
|
364
|
+
heat[i] = Math.min(heat[i] + 3 * S * g * dt, 1); // cyclotron heating
|
|
365
|
+
heat[i] *= cool;
|
|
366
|
+
const pinch = mode === 0 ? 1 - 0.5 * S * g : 1; // a magnet dents the surface
|
|
367
|
+
const rm = Math.max(rmAt(h[i]) * pinch, 0.012);
|
|
368
|
+
// heated or pinched orbits wind tighter (a stronger local field)
|
|
369
|
+
const b = Math.min(base + spread * psi[i] + 0.5 * heat[i] + (1 - pinch) * 0.9, 1.52);
|
|
370
|
+
const V = V0 * (1 + 0.6 * heat[i]);
|
|
371
|
+
const sl = slopeAt(h[i]);
|
|
372
|
+
let nh = h[i] + dir[i] * V * Math.cos(b) / Math.sqrt(1 + sl * sl) * dt;
|
|
373
|
+
if (nh < Y0 + 0.004) {
|
|
374
|
+
nh = Y0 + 0.004;
|
|
375
|
+
dir[i] = 1;
|
|
376
|
+
} // the ends turn the orbit back
|
|
377
|
+
if (nh > Y1 - 0.004) {
|
|
378
|
+
nh = Y1 - 0.004;
|
|
379
|
+
dir[i] = -1;
|
|
380
|
+
}
|
|
381
|
+
h[i] = nh;
|
|
382
|
+
let dth = (fam[i] ? -1 : 1) * V * Math.sin(b) / rm * dt;
|
|
383
|
+
const cap = 0.35; // at a closing tip the turn rate saturates
|
|
384
|
+
if (dth > cap)
|
|
385
|
+
dth = cap;
|
|
386
|
+
else if (dth < -cap)
|
|
387
|
+
dth = -cap;
|
|
388
|
+
if (mode === 1)
|
|
389
|
+
dth += 5 * S * g * dt; // E x B drift: the same sense for both charges
|
|
390
|
+
th[i] += dth;
|
|
391
|
+
const r = rAt(th[i], h[i]) * pinch;
|
|
392
|
+
const x = r * Math.cos(th[i]), y = h[i], z = r * Math.sin(th[i]);
|
|
393
|
+
hx[j] = x;
|
|
394
|
+
hx[j + 1] = y;
|
|
395
|
+
hx[j + 2] = z;
|
|
396
|
+
hv[j] = (x - px) / dt;
|
|
397
|
+
hv[j + 1] = (y - py) / dt;
|
|
398
|
+
hv[j + 2] = (z - pz) / dt;
|
|
399
|
+
const tight = Math.min(Math.max(1 - rm / RW, 0), 1); // 0 at the widest girth, 1 at a closing tip
|
|
400
|
+
code[i] = pack(fam[i], tight, heat[i]);
|
|
401
|
+
hK[i] = code[i] + 0.25; // trails read the same code
|
|
402
|
+
// lay ink along the path
|
|
403
|
+
const seg = Math.hypot(x - px, y - py, z - pz);
|
|
404
|
+
if (seg > 0.5) {
|
|
405
|
+
acc[i] = 0;
|
|
406
|
+
if (trail)
|
|
407
|
+
trail.reset(i);
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
acc[i] += seg;
|
|
411
|
+
while (acc[i] >= spacing) {
|
|
412
|
+
acc[i] -= spacing;
|
|
413
|
+
const t = seg > 1e-6 ? 1 - acc[i] / seg : 1;
|
|
414
|
+
const k = lHead;
|
|
415
|
+
lHead = (lHead + 1) % NL;
|
|
416
|
+
lp[k * 3] = px + (x - px) * t;
|
|
417
|
+
lp[k * 3 + 1] = py + (y - py) * t;
|
|
418
|
+
lp[k * 3 + 2] = pz + (z - pz) * t;
|
|
419
|
+
la[k * 2] = code[i];
|
|
420
|
+
lb[k] = time;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
// age of every ink point as a fraction of its life
|
|
424
|
+
for (let k = 0; k < NL; k++) {
|
|
425
|
+
if (la[k * 2 + 1] < -0.5 && lb[k] === 0)
|
|
426
|
+
continue;
|
|
427
|
+
const f = (time - lb[k]) / life;
|
|
428
|
+
la[k * 2 + 1] = f > 1 ? -1 : f;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
// settle: particles spread round the surface and the lines are drawn
|
|
432
|
+
for (let i = 0; i < n; i++) {
|
|
433
|
+
const r = rAt(th[i], h[i]);
|
|
434
|
+
hx[i * 3] = r * Math.cos(th[i]);
|
|
435
|
+
hx[i * 3 + 1] = h[i];
|
|
436
|
+
hx[i * 3 + 2] = r * Math.sin(th[i]);
|
|
437
|
+
}
|
|
438
|
+
const warm = Math.min(u.uLineLife.value, 8);
|
|
439
|
+
for (let s = 0; s < warm / H_STEP; s++)
|
|
440
|
+
step(H_STEP);
|
|
441
|
+
// ---- geometry ----
|
|
442
|
+
const lgeo = new THREE.BufferGeometry();
|
|
443
|
+
const lpAttr = new THREE.BufferAttribute(lp, 3).setUsage(THREE.DynamicDrawUsage);
|
|
444
|
+
const laAttr = new THREE.BufferAttribute(la, 2).setUsage(THREE.DynamicDrawUsage);
|
|
445
|
+
lgeo.setAttribute('position', lpAttr);
|
|
446
|
+
lgeo.setAttribute('aL', laAttr);
|
|
447
|
+
const mk = (vs, fs) => new THREE.ShaderMaterial({
|
|
448
|
+
uniforms: u, vertexShader: vs, fragmentShader: fs, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
|
|
449
|
+
});
|
|
450
|
+
const lmat = mk(lineVertex, lineFragment);
|
|
451
|
+
const lines = new THREE.Points(lgeo, lmat);
|
|
452
|
+
lines.frustumCulled = false;
|
|
453
|
+
attachViewH(lines, u);
|
|
454
|
+
const hgeo = new THREE.BufferGeometry();
|
|
455
|
+
const hxAttr = new THREE.BufferAttribute(hx, 3).setUsage(THREE.DynamicDrawUsage);
|
|
456
|
+
const hcAttr = new THREE.BufferAttribute(code, 1).setUsage(THREE.DynamicDrawUsage);
|
|
457
|
+
hgeo.setAttribute('position', hxAttr);
|
|
458
|
+
hgeo.setAttribute('aCode', hcAttr);
|
|
459
|
+
const hmat = mk(headVertex, headFragment);
|
|
460
|
+
const heads = new THREE.Points(hgeo, hmat);
|
|
461
|
+
heads.frustumCulled = false;
|
|
462
|
+
heads.renderOrder = 3;
|
|
463
|
+
const object = new THREE.Group();
|
|
464
|
+
const proxy = createPickProxy(BOUNDS.center, bR);
|
|
465
|
+
object.add(lines, heads, proxy.mesh);
|
|
466
|
+
const trailGLSL = /* glsl */ `
|
|
467
|
+
uniform float uTrailGain;
|
|
468
|
+
${LIGHT_GLSL}
|
|
469
|
+
vec3 trailShade(vec3 p, float f) {
|
|
470
|
+
float pitch;
|
|
471
|
+
vec3 c = familyLight(floor(TRAIL_K), pitch);
|
|
472
|
+
c /= max(max(c.r, max(c.g, c.b)), 1.0); // keep <= 1: a saturated colour cannot be tinted
|
|
473
|
+
return mix(c, uTrailColor, smoothstep(0.0, 0.55, f)) * uTrailGain;
|
|
474
|
+
}
|
|
475
|
+
vec3 trailView(vec3 mv, out float mag) { mag = 1.0; return mv; }
|
|
476
|
+
`;
|
|
477
|
+
const materials = [lmat, hmat];
|
|
478
|
+
let trailKey = '', look = 1;
|
|
479
|
+
function buildTrails(mode, share) {
|
|
480
|
+
look = TRAIL_LOOK[mode] || 1;
|
|
481
|
+
const key = mode + ':' + share;
|
|
482
|
+
if (key === trailKey)
|
|
483
|
+
return;
|
|
484
|
+
trailKey = key;
|
|
485
|
+
if (trail) {
|
|
486
|
+
object.remove(trail.object);
|
|
487
|
+
trail.dispose();
|
|
488
|
+
trail = null;
|
|
489
|
+
}
|
|
490
|
+
materials.length = 2;
|
|
491
|
+
trail = createCpuTrail(mode, { u, n, pos: hx, vel: hv, k: hK, glsl: trailGLSL, sizePx: 0.016, spacing: 0.002, sub: 12, alpha: TRAIL_ALPHA[mode] });
|
|
492
|
+
if (!trail)
|
|
493
|
+
return;
|
|
494
|
+
trail.object.renderOrder = 2;
|
|
495
|
+
object.add(trail.object);
|
|
496
|
+
materials.push(...trail.materials);
|
|
497
|
+
}
|
|
498
|
+
buildTrails(c.trailMode, c.trailShare);
|
|
499
|
+
const stepper = createFixedStep(H_STEP, 8);
|
|
500
|
+
return {
|
|
501
|
+
object,
|
|
502
|
+
materials,
|
|
503
|
+
apply(cfg) { if (cfg)
|
|
504
|
+
buildTrails(cfg.trailMode, cfg.trailShare); },
|
|
505
|
+
update(dt, camera, pointer) {
|
|
506
|
+
const rdt = Math.min(Math.max(dt, 0), 1 / 20);
|
|
507
|
+
if (camera && !inView(object, camera, BOUNDS.center, bR, u.uSize.value))
|
|
508
|
+
return;
|
|
509
|
+
const d = rdt * u.uSpeed.value;
|
|
510
|
+
u.uTime.value += d;
|
|
511
|
+
if (camera) {
|
|
512
|
+
object.worldToLocal(u.uCamLocal.value.copy(camera.position)).divideScalar(u.uSize.value);
|
|
513
|
+
if (pointer)
|
|
514
|
+
stepPointerField(u, pointer, camera, object, u.uSize.value, rdt);
|
|
515
|
+
}
|
|
516
|
+
u.uVelScale.value = look;
|
|
517
|
+
let simD = 0;
|
|
518
|
+
stepper.run(d, (hh) => { step(hh); simD += hh; });
|
|
519
|
+
if (simD > 0) {
|
|
520
|
+
lpAttr.needsUpdate = true;
|
|
521
|
+
laAttr.needsUpdate = true;
|
|
522
|
+
hxAttr.needsUpdate = true;
|
|
523
|
+
hcAttr.needsUpdate = true;
|
|
524
|
+
if (trail)
|
|
525
|
+
trail.update(simD / look);
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
seek(t) { for (let s = 0; s < Math.round(t / H_STEP); s++)
|
|
529
|
+
step(H_STEP); lpAttr.needsUpdate = true; laAttr.needsUpdate = true; },
|
|
530
|
+
dispose() {
|
|
531
|
+
lgeo.dispose();
|
|
532
|
+
lmat.dispose();
|
|
533
|
+
hgeo.dispose();
|
|
534
|
+
hmat.dispose();
|
|
535
|
+
proxy.dispose();
|
|
536
|
+
if (trail)
|
|
537
|
+
trail.dispose();
|
|
538
|
+
},
|
|
539
|
+
_state: { hx, h, psi, heat },
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
/** Defaults for every knob, so an older saved config still renders (identical to the catalog entry). */
|
|
543
|
+
const DEFAULTS = {
|
|
544
|
+
intensity: 1,
|
|
545
|
+
speed: 1,
|
|
546
|
+
opacity: 0.9,
|
|
547
|
+
size: 1,
|
|
548
|
+
color: '#5fd6ff',
|
|
549
|
+
particleCount: 48,
|
|
550
|
+
shape: { type: 'cone', radius: 0.5, height: 1, radialSegments: 32 },
|
|
551
|
+
windings: 0.6,
|
|
552
|
+
pitchSpread: 0.3,
|
|
553
|
+
lineLife: 6,
|
|
554
|
+
lineDensity: 1,
|
|
555
|
+
counterColor: '#ff6fb3',
|
|
556
|
+
glow: 1,
|
|
557
|
+
seed: 1,
|
|
558
|
+
quality: 'medium',
|
|
559
|
+
pointerMode: 'drift',
|
|
560
|
+
pointerStrength: 1,
|
|
561
|
+
pointerRadius: 1,
|
|
562
|
+
pointerColor: '#fff0c8',
|
|
563
|
+
trailMode: 'comet',
|
|
564
|
+
trailLength: 0.8,
|
|
565
|
+
trailOpacity: 0.8,
|
|
566
|
+
trailColor: '#8f7bff',
|
|
567
|
+
trailShare: 1,
|
|
568
|
+
};
|
|
569
|
+
/** Knobs that rebuild the simulation: they change on commit, never through the live path. */
|
|
570
|
+
const STRUCTURAL = ['particleCount', 'shape', 'seed', 'quality'];
|
|
571
|
+
/** Knobs an animation (or mouse move) may drive per frame — generated from applyConfig. */
|
|
572
|
+
const ANIMATABLE = new Set(GENERATIVE_PARTICLES_ANIMATABLE.magneticBottle.map((p) => p.value));
|
|
573
|
+
const MagneticBottleParticles = ({ id, size, config, animations, mouseMove, onObjectReady, onObjectDispose }) => {
|
|
574
|
+
const rootRef = useRef(null);
|
|
575
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
576
|
+
const s = size > 0 ? size : 1;
|
|
577
|
+
const cfg = useMemo(() => ({ ...DEFAULTS, ...config }), [config]);
|
|
578
|
+
// the shape is an object: rebuild on a change of its content, not of its identity
|
|
579
|
+
const shapeKey = JSON.stringify(cfg.shape);
|
|
580
|
+
// uniforms outlive the objects, so keyframe animations survive a rebuild
|
|
581
|
+
const uniforms = useMemo(() => createUniforms(), []);
|
|
582
|
+
// rebuilt only when a structural knob changes (trails rebuild inside apply())
|
|
583
|
+
const instance = useMemo(() => build(uniforms, cfg, s), [uniforms, cfg.particleCount, cfg.seed, cfg.quality, shapeKey]);
|
|
584
|
+
useEffect(() => () => instance.dispose(), [instance]);
|
|
585
|
+
useLayoutEffect(() => {
|
|
586
|
+
applyConfig(uniforms, cfg, s);
|
|
587
|
+
instance.apply(cfg);
|
|
588
|
+
}, [instance, uniforms, cfg, s]);
|
|
589
|
+
// Slider drags and keyframe animations are both overrides on the committed config.
|
|
590
|
+
// This is the one place they are merged and pushed, so they compose instead of
|
|
591
|
+
// overwriting each other; the animation wins, because it is the active driver.
|
|
592
|
+
const keyframes = animations?.particles?.animations;
|
|
593
|
+
const animOverride = useRef({});
|
|
594
|
+
const animFrom = useRef({});
|
|
595
|
+
const animStart = useRef(0);
|
|
596
|
+
// Editing a keyframe restarts its cycle rather than dropping the user mid-way.
|
|
597
|
+
useEffect(() => { animStart.current = performance.now(); animFrom.current = {}; }, [keyframes]);
|
|
598
|
+
const push = useCallback((overrides) => {
|
|
599
|
+
const merged = { ...cfg, ...overrides, ...animOverride.current };
|
|
600
|
+
const z = merged.size;
|
|
601
|
+
applyConfig(uniforms, merged, z && z > 0 ? z : s);
|
|
602
|
+
}, [cfg, uniforms, s]);
|
|
603
|
+
const live = useConfigLiveHandle(rootRef, id, 'particles', cfg, STRUCTURAL, push);
|
|
604
|
+
const pointer = usePointerField();
|
|
605
|
+
useFrame((state, delta) => {
|
|
606
|
+
instance.update(Math.min(delta, 0.1), state.camera, pointer);
|
|
607
|
+
// Keyframes first, pointer on top: a knob bound to both follows the cursor.
|
|
608
|
+
const pointerBound = !!mouseMove?.enabled && !!mouseMove.properties?.length;
|
|
609
|
+
if (keyframes?.length || pointerBound) {
|
|
610
|
+
applyConfigKeyframeAnimations(keyframes, animFrom.current, cfg, animOverride.current, performance.now() - animStart.current, ANIMATABLE);
|
|
611
|
+
if (pointerBound)
|
|
612
|
+
applyConfigMouseMove(mouseMove.properties, cfg, animOverride.current, state.pointer, ANIMATABLE);
|
|
613
|
+
push(live.current);
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
|
|
617
|
+
};
|
|
618
|
+
export default MagneticBottleParticles;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ObjectAnimations, ShapeBurstParticlesConfig, MouseMoveDomain } from '@3driseai/3drise-core';
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
export interface ShapeBurstParticlesProps extends ObjectReadyProps {
|
|
5
|
+
/** Pointer bindings for this object's config knobs (mouseMove.particles). */
|
|
6
|
+
mouseMove?: MouseMoveDomain;
|
|
7
|
+
/** Scene object id: the controller finds the live-edit handle by it. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** World size of the object (units); the object's transform scales it further. */
|
|
10
|
+
size: number;
|
|
11
|
+
config: ShapeBurstParticlesConfig;
|
|
12
|
+
/** Per-domain keyframes; the `particles` domain drives this object's config knobs. */
|
|
13
|
+
animations?: ObjectAnimations;
|
|
14
|
+
}
|
|
15
|
+
declare const ShapeBurstParticles: React.FC<ShapeBurstParticlesProps>;
|
|
16
|
+
export default ShapeBurstParticles;
|
|
17
|
+
//# sourceMappingURL=ShapeBurstParticles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShapeBurstParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/ShapeBurstParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO1G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAC9D,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,yBAAyB,CAAC;IAClC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;AA4eD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAuD3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|