@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.
Files changed (476) hide show
  1. package/dist/animationsV2/ClipPlayer.d.ts +3 -0
  2. package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
  3. package/dist/animationsV2/ClipPlayer.js +67 -8
  4. package/dist/animationsV2/ClipsRuntime.d.ts +39 -0
  5. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  6. package/dist/animationsV2/ClipsRuntime.js +245 -14
  7. package/dist/animationsV2/appliers.d.ts +5 -0
  8. package/dist/animationsV2/appliers.d.ts.map +1 -1
  9. package/dist/animationsV2/appliers.js +25 -7
  10. package/dist/animationsV2/index.d.ts +1 -1
  11. package/dist/animationsV2/index.d.ts.map +1 -1
  12. package/dist/animationsV2/normalize.d.ts.map +1 -1
  13. package/dist/animationsV2/normalize.js +18 -7
  14. package/dist/animationsV2/sequenceUtils.d.ts +42 -1
  15. package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
  16. package/dist/animationsV2/sequenceUtils.js +103 -3
  17. package/dist/animationsV2/types.d.ts +20 -0
  18. package/dist/animationsV2/types.d.ts.map +1 -1
  19. package/dist/components/AdvancedGrid.d.ts +8 -2
  20. package/dist/components/AdvancedGrid.d.ts.map +1 -1
  21. package/dist/components/AdvancedGrid.js +31 -14
  22. package/dist/components/AnimatedObject.d.ts.map +1 -1
  23. package/dist/components/AnimatedObject.js +7 -5
  24. package/dist/components/ApollonianGrid.d.ts +25 -0
  25. package/dist/components/ApollonianGrid.d.ts.map +1 -0
  26. package/dist/components/ApollonianGrid.js +80 -0
  27. package/dist/components/Bubbles.d.ts +7 -1
  28. package/dist/components/Bubbles.d.ts.map +1 -1
  29. package/dist/components/Bubbles.js +42 -22
  30. package/dist/components/ChladniGrid.d.ts +8 -4
  31. package/dist/components/ChladniGrid.d.ts.map +1 -1
  32. package/dist/components/ChladniGrid.js +31 -13
  33. package/dist/components/CircuitGrid.d.ts +8 -11
  34. package/dist/components/CircuitGrid.d.ts.map +1 -1
  35. package/dist/components/CircuitGrid.js +31 -13
  36. package/dist/components/CloudsGenerator.d.ts +1 -1
  37. package/dist/components/CloudsGenerator.js +1 -1
  38. package/dist/components/ConformalGrid.d.ts +25 -0
  39. package/dist/components/ConformalGrid.d.ts.map +1 -0
  40. package/dist/components/ConformalGrid.js +97 -0
  41. package/dist/components/ContourGrid.d.ts +8 -14
  42. package/dist/components/ContourGrid.d.ts.map +1 -1
  43. package/dist/components/ContourGrid.js +31 -13
  44. package/dist/components/EffectsGenerator.d.ts +7 -1
  45. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  46. package/dist/components/EffectsGenerator.js +39 -38
  47. package/dist/components/EnvironmentManager.d.ts +4 -4
  48. package/dist/components/EnvironmentManager.d.ts.map +1 -1
  49. package/dist/components/FlowNetGrid.d.ts +8 -4
  50. package/dist/components/FlowNetGrid.d.ts.map +1 -1
  51. package/dist/components/FlowNetGrid.js +31 -13
  52. package/dist/components/FractalGrid.d.ts +8 -12
  53. package/dist/components/FractalGrid.d.ts.map +1 -1
  54. package/dist/components/FractalGrid.js +31 -13
  55. package/dist/components/GirihGrid.d.ts +8 -1
  56. package/dist/components/GirihGrid.d.ts.map +1 -1
  57. package/dist/components/GirihGrid.js +31 -13
  58. package/dist/components/Glyphs.d.ts +7 -1
  59. package/dist/components/Glyphs.d.ts.map +1 -1
  60. package/dist/components/Glyphs.js +40 -34
  61. package/dist/components/GravWaveGrid.d.ts +8 -1
  62. package/dist/components/GravWaveGrid.d.ts.map +1 -1
  63. package/dist/components/GravWaveGrid.js +31 -13
  64. package/dist/components/GridsGenerator.d.ts +9 -3
  65. package/dist/components/GridsGenerator.d.ts.map +1 -1
  66. package/dist/components/GridsGenerator.js +41 -18
  67. package/dist/components/HexGrid.d.ts +8 -10
  68. package/dist/components/HexGrid.d.ts.map +1 -1
  69. package/dist/components/HexGrid.js +31 -13
  70. package/dist/components/HilbertGrid.d.ts +25 -0
  71. package/dist/components/HilbertGrid.d.ts.map +1 -0
  72. package/dist/components/HilbertGrid.js +93 -0
  73. package/dist/components/HyperbolicGrid.d.ts +8 -4
  74. package/dist/components/HyperbolicGrid.d.ts.map +1 -1
  75. package/dist/components/HyperbolicGrid.js +31 -13
  76. package/dist/components/LandscapeBuilder.d.ts +1 -1
  77. package/dist/components/LandscapeBuilder.d.ts.map +1 -1
  78. package/dist/components/LandscapeBuilder.js +1 -1
  79. package/dist/components/LandscapeObject.d.ts +1 -1
  80. package/dist/components/LandscapeObject.d.ts.map +1 -1
  81. package/dist/components/LandscapeObject.js +1 -1
  82. package/dist/components/LensingGrid.d.ts +25 -0
  83. package/dist/components/LensingGrid.d.ts.map +1 -0
  84. package/dist/components/LensingGrid.js +81 -0
  85. package/dist/components/MoireGrid.d.ts +8 -12
  86. package/dist/components/MoireGrid.d.ts.map +1 -1
  87. package/dist/components/MoireGrid.js +31 -13
  88. package/dist/components/ObjectNode.d.ts.map +1 -1
  89. package/dist/components/ObjectNode.js +2 -2
  90. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  91. package/dist/components/ObjectsRenderer.js +37 -3
  92. package/dist/components/OceanBuilder.d.ts +1 -1
  93. package/dist/components/OceanBuilder.js +1 -1
  94. package/dist/components/ParastichyGrid.d.ts +25 -0
  95. package/dist/components/ParastichyGrid.d.ts.map +1 -0
  96. package/dist/components/ParastichyGrid.js +82 -0
  97. package/dist/components/ParticlesGenerator.d.ts.map +1 -1
  98. package/dist/components/ParticlesGenerator.js +6 -0
  99. package/dist/components/PhyllotaxisGrid.d.ts +25 -0
  100. package/dist/components/PhyllotaxisGrid.d.ts.map +1 -0
  101. package/dist/components/PhyllotaxisGrid.js +95 -0
  102. package/dist/components/QuasiGrid.d.ts +8 -11
  103. package/dist/components/QuasiGrid.d.ts.map +1 -1
  104. package/dist/components/QuasiGrid.js +31 -13
  105. package/dist/components/RadarGrid.d.ts +8 -13
  106. package/dist/components/RadarGrid.d.ts.map +1 -1
  107. package/dist/components/RadarGrid.js +31 -13
  108. package/dist/components/ReactionDiffusionGrid.d.ts +8 -1
  109. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
  110. package/dist/components/ReactionDiffusionGrid.js +33 -139
  111. package/dist/components/SceneBuilder.js +1 -1
  112. package/dist/components/SkySystem.d.ts +1 -1
  113. package/dist/components/SparklesBurst.d.ts +7 -1
  114. package/dist/components/SparklesBurst.d.ts.map +1 -1
  115. package/dist/components/SparklesBurst.js +31 -28
  116. package/dist/components/TerrainBuilder.d.ts +1 -1
  117. package/dist/components/TerrainBuilder.d.ts.map +1 -1
  118. package/dist/components/TerrainBuilder.js +1 -1
  119. package/dist/components/TruchetGrid.d.ts +25 -0
  120. package/dist/components/TruchetGrid.d.ts.map +1 -0
  121. package/dist/components/TruchetGrid.js +82 -0
  122. package/dist/components/VoronoiGrid.d.ts +8 -10
  123. package/dist/components/VoronoiGrid.d.ts.map +1 -1
  124. package/dist/components/VoronoiGrid.js +31 -13
  125. package/dist/components/WallpaperGrid.d.ts +8 -1
  126. package/dist/components/WallpaperGrid.d.ts.map +1 -1
  127. package/dist/components/WallpaperGrid.js +33 -210
  128. package/dist/components/effects/AuraEffect.d.ts +8 -3
  129. package/dist/components/effects/AuraEffect.d.ts.map +1 -1
  130. package/dist/components/effects/AuraEffect.js +49 -24
  131. package/dist/components/effects/AuroraEffect.d.ts +8 -3
  132. package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
  133. package/dist/components/effects/AuroraEffect.js +45 -25
  134. package/dist/components/effects/BlackHoleEffect.d.ts +8 -3
  135. package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
  136. package/dist/components/effects/BlackHoleEffect.js +42 -21
  137. package/dist/components/effects/ConstellationEffect.d.ts +8 -3
  138. package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
  139. package/dist/components/effects/ConstellationEffect.js +49 -23
  140. package/dist/components/effects/DandelionSeedsEffect.d.ts +7 -2
  141. package/dist/components/effects/DandelionSeedsEffect.d.ts.map +1 -1
  142. package/dist/components/effects/DandelionSeedsEffect.js +19 -9
  143. package/dist/components/effects/DataStreamEffect.d.ts +8 -3
  144. package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
  145. package/dist/components/effects/DataStreamEffect.js +54 -26
  146. package/dist/components/effects/DnaHelixEffect.d.ts +8 -3
  147. package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
  148. package/dist/components/effects/DnaHelixEffect.js +62 -30
  149. package/dist/components/effects/FallingLeavesEffect.d.ts +7 -2
  150. package/dist/components/effects/FallingLeavesEffect.d.ts.map +1 -1
  151. package/dist/components/effects/FallingLeavesEffect.js +19 -9
  152. package/dist/components/effects/FieldLinesEffect.d.ts +8 -3
  153. package/dist/components/effects/FieldLinesEffect.d.ts.map +1 -1
  154. package/dist/components/effects/FieldLinesEffect.js +30 -20
  155. package/dist/components/effects/Fire.d.ts +8 -3
  156. package/dist/components/effects/Fire.d.ts.map +1 -1
  157. package/dist/components/effects/Fire.js +47 -10
  158. package/dist/components/effects/FireflySwarmEffect.d.ts +7 -2
  159. package/dist/components/effects/FireflySwarmEffect.d.ts.map +1 -1
  160. package/dist/components/effects/FireflySwarmEffect.js +19 -9
  161. package/dist/components/effects/Flares.d.ts +10 -3
  162. package/dist/components/effects/Flares.d.ts.map +1 -1
  163. package/dist/components/effects/Flares.js +53 -56
  164. package/dist/components/effects/ForcefieldEffect.d.ts +8 -3
  165. package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
  166. package/dist/components/effects/ForcefieldEffect.js +52 -33
  167. package/dist/components/effects/GalaxyEffect.d.ts +7 -2
  168. package/dist/components/effects/GalaxyEffect.d.ts.map +1 -1
  169. package/dist/components/effects/GalaxyEffect.js +19 -9
  170. package/dist/components/effects/HarmonicShellEffect.d.ts +8 -3
  171. package/dist/components/effects/HarmonicShellEffect.d.ts.map +1 -1
  172. package/dist/components/effects/HarmonicShellEffect.js +30 -22
  173. package/dist/components/effects/HologramEffect.d.ts +8 -3
  174. package/dist/components/effects/HologramEffect.d.ts.map +1 -1
  175. package/dist/components/effects/HologramEffect.js +52 -23
  176. package/dist/components/effects/IceCrystalsEffect.d.ts +8 -3
  177. package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
  178. package/dist/components/effects/IceCrystalsEffect.js +36 -21
  179. package/dist/components/effects/IceHaloEffect.d.ts +7 -2
  180. package/dist/components/effects/IceHaloEffect.d.ts.map +1 -1
  181. package/dist/components/effects/IceHaloEffect.js +19 -9
  182. package/dist/components/effects/LichtenbergEffect.d.ts +7 -2
  183. package/dist/components/effects/LichtenbergEffect.d.ts.map +1 -1
  184. package/dist/components/effects/LichtenbergEffect.js +19 -9
  185. package/dist/components/effects/LightningEffect.d.ts +8 -3
  186. package/dist/components/effects/LightningEffect.d.ts.map +1 -1
  187. package/dist/components/effects/LightningEffect.js +54 -32
  188. package/dist/components/effects/MoleculesEffect.d.ts +8 -3
  189. package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
  190. package/dist/components/effects/MoleculesEffect.js +31 -21
  191. package/dist/components/effects/MurmurationEffect.d.ts +7 -2
  192. package/dist/components/effects/MurmurationEffect.d.ts.map +1 -1
  193. package/dist/components/effects/MurmurationEffect.js +19 -9
  194. package/dist/components/effects/NeuralNetworkEffect.d.ts +8 -3
  195. package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
  196. package/dist/components/effects/NeuralNetworkEffect.js +66 -33
  197. package/dist/components/effects/OrbEffect.d.ts +8 -3
  198. package/dist/components/effects/OrbEffect.d.ts.map +1 -1
  199. package/dist/components/effects/OrbEffect.js +89 -42
  200. package/dist/components/effects/PlanetaryRingsEffect.d.ts +7 -2
  201. package/dist/components/effects/PlanetaryRingsEffect.d.ts.map +1 -1
  202. package/dist/components/effects/PlanetaryRingsEffect.js +19 -9
  203. package/dist/components/effects/PortalEffect.d.ts +8 -3
  204. package/dist/components/effects/PortalEffect.d.ts.map +1 -1
  205. package/dist/components/effects/PortalEffect.js +41 -25
  206. package/dist/components/effects/ShockwaveEffect.d.ts +7 -2
  207. package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
  208. package/dist/components/effects/ShockwaveEffect.js +19 -9
  209. package/dist/components/effects/SmokePlumeEffect.d.ts +8 -3
  210. package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
  211. package/dist/components/effects/SmokePlumeEffect.js +30 -20
  212. package/dist/components/effects/SmokeRibbon.d.ts +8 -2
  213. package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
  214. package/dist/components/effects/SmokeRibbon.js +34 -24
  215. package/dist/components/effects/SmokeRingEffect.d.ts +8 -3
  216. package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
  217. package/dist/components/effects/SmokeRingEffect.js +33 -21
  218. package/dist/components/effects/StrangeAttractorEffect.d.ts +8 -3
  219. package/dist/components/effects/StrangeAttractorEffect.d.ts.map +1 -1
  220. package/dist/components/effects/StrangeAttractorEffect.js +30 -20
  221. package/dist/components/effects/VolumetricFogEffect.d.ts +8 -3
  222. package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
  223. package/dist/components/effects/VolumetricFogEffect.js +38 -20
  224. package/dist/components/effects/WaterCausticsEffect.d.ts +7 -2
  225. package/dist/components/effects/WaterCausticsEffect.d.ts.map +1 -1
  226. package/dist/components/effects/WaterCausticsEffect.js +19 -9
  227. package/dist/components/effects/index.d.ts +0 -1
  228. package/dist/components/effects/index.d.ts.map +1 -1
  229. package/dist/components/effects/index.js +0 -1
  230. package/dist/components/index.d.ts +14 -1
  231. package/dist/components/index.d.ts.map +1 -1
  232. package/dist/components/index.js +7 -1
  233. package/dist/components/landscape/LandscapeMesh.js +1 -1
  234. package/dist/components/landscape/types.d.ts +1 -1
  235. package/dist/components/landscape/types.d.ts.map +1 -1
  236. package/dist/components/particles/MagneticBottleParticles.d.ts +17 -0
  237. package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -0
  238. package/dist/components/particles/MagneticBottleParticles.js +618 -0
  239. package/dist/components/particles/ShapeBurstParticles.d.ts +17 -0
  240. package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -0
  241. package/dist/components/particles/ShapeBurstParticles.js +588 -0
  242. package/dist/components/particles/ShapeFlowParticles.d.ts +17 -0
  243. package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -0
  244. package/dist/components/particles/ShapeFlowParticles.js +755 -0
  245. package/dist/components/particles/index.d.ts +6 -0
  246. package/dist/components/particles/index.d.ts.map +1 -1
  247. package/dist/components/particles/index.js +3 -0
  248. package/dist/components/terrain/types.d.ts +1 -1
  249. package/dist/components/terrain/types.d.ts.map +1 -1
  250. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +1 -1
  251. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
  252. package/dist/components/volumetricClouds/types.d.ts +1 -1
  253. package/dist/components/volumetricClouds/types.d.ts.map +1 -1
  254. package/dist/components/water/types.d.ts +1 -1
  255. package/dist/components/water/types.d.ts.map +1 -1
  256. package/dist/hooks/index.d.ts +2 -0
  257. package/dist/hooks/index.d.ts.map +1 -1
  258. package/dist/hooks/index.js +1 -0
  259. package/dist/hooks/useConfigDriver.d.ts +22 -0
  260. package/dist/hooks/useConfigDriver.d.ts.map +1 -0
  261. package/dist/hooks/useConfigDriver.js +43 -0
  262. package/dist/hooks/useConfigLive.d.ts +1 -1
  263. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  264. package/dist/hooks/useLandscapeMaps.d.ts +1 -1
  265. package/dist/hooks/useLandscapeMaps.d.ts.map +1 -1
  266. package/dist/hooks/useOceanMaterial.d.ts +1 -1
  267. package/dist/hooks/useThunder.d.ts +1 -1
  268. package/dist/index.d.ts +1 -2
  269. package/dist/index.d.ts.map +1 -1
  270. package/dist/index.js +1 -2
  271. package/dist/interactions/index.d.ts +2 -1
  272. package/dist/interactions/index.d.ts.map +1 -1
  273. package/dist/interactions/index.js +1 -1
  274. package/dist/interactions/runner.d.ts +18 -3
  275. package/dist/interactions/runner.d.ts.map +1 -1
  276. package/dist/interactions/runner.js +25 -2
  277. package/dist/operations/catalogue/curlSmoke.d.ts +3 -0
  278. package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -0
  279. package/dist/operations/catalogue/curlSmoke.js +178 -0
  280. package/dist/operations/catalogue/displayImage.d.ts.map +1 -1
  281. package/dist/operations/catalogue/displayImage.js +1 -0
  282. package/dist/operations/catalogue/dissolve.d.ts +3 -0
  283. package/dist/operations/catalogue/dissolve.d.ts.map +1 -0
  284. package/dist/operations/catalogue/dissolve.js +57 -0
  285. package/dist/operations/catalogue/emberAsh.d.ts +3 -0
  286. package/dist/operations/catalogue/emberAsh.d.ts.map +1 -0
  287. package/dist/operations/catalogue/emberAsh.js +171 -0
  288. package/dist/operations/catalogue/fade.d.ts.map +1 -1
  289. package/dist/operations/catalogue/fade.js +1 -0
  290. package/dist/operations/catalogue/flip.d.ts +3 -0
  291. package/dist/operations/catalogue/flip.d.ts.map +1 -0
  292. package/dist/operations/catalogue/flip.js +69 -0
  293. package/dist/operations/catalogue/flock.d.ts +3 -0
  294. package/dist/operations/catalogue/flock.d.ts.map +1 -0
  295. package/dist/operations/catalogue/flock.js +163 -0
  296. package/dist/operations/catalogue/focus.d.ts.map +1 -1
  297. package/dist/operations/catalogue/focus.js +1 -0
  298. package/dist/operations/catalogue/frame.d.ts +3 -0
  299. package/dist/operations/catalogue/frame.d.ts.map +1 -0
  300. package/dist/operations/catalogue/frame.js +44 -0
  301. package/dist/operations/catalogue/frost.d.ts +3 -0
  302. package/dist/operations/catalogue/frost.d.ts.map +1 -0
  303. package/dist/operations/catalogue/frost.js +111 -0
  304. package/dist/operations/catalogue/fxInstances.d.ts +21 -0
  305. package/dist/operations/catalogue/fxInstances.d.ts.map +1 -0
  306. package/dist/operations/catalogue/fxInstances.js +47 -0
  307. package/dist/operations/catalogue/fxPoints.d.ts +22 -0
  308. package/dist/operations/catalogue/fxPoints.d.ts.map +1 -0
  309. package/dist/operations/catalogue/fxPoints.js +70 -0
  310. package/dist/operations/catalogue/glow.d.ts.map +1 -1
  311. package/dist/operations/catalogue/glow.js +2 -1
  312. package/dist/operations/catalogue/heatCracks.d.ts +3 -0
  313. package/dist/operations/catalogue/heatCracks.d.ts.map +1 -0
  314. package/dist/operations/catalogue/heatCracks.js +134 -0
  315. package/dist/operations/catalogue/hologram.d.ts +3 -0
  316. package/dist/operations/catalogue/hologram.d.ts.map +1 -0
  317. package/dist/operations/catalogue/hologram.js +118 -0
  318. package/dist/operations/catalogue/inkBloom.d.ts +3 -0
  319. package/dist/operations/catalogue/inkBloom.d.ts.map +1 -0
  320. package/dist/operations/catalogue/inkBloom.js +156 -0
  321. package/dist/operations/catalogue/ivy.d.ts +13 -0
  322. package/dist/operations/catalogue/ivy.d.ts.map +1 -0
  323. package/dist/operations/catalogue/ivy.js +469 -0
  324. package/dist/operations/catalogue/jelly.d.ts +3 -0
  325. package/dist/operations/catalogue/jelly.d.ts.map +1 -0
  326. package/dist/operations/catalogue/jelly.js +50 -0
  327. package/dist/operations/catalogue/kintsugi.d.ts +3 -0
  328. package/dist/operations/catalogue/kintsugi.d.ts.map +1 -0
  329. package/dist/operations/catalogue/kintsugi.js +173 -0
  330. package/dist/operations/catalogue/lidarScan.d.ts +3 -0
  331. package/dist/operations/catalogue/lidarScan.d.ts.map +1 -0
  332. package/dist/operations/catalogue/lidarScan.js +240 -0
  333. package/dist/operations/catalogue/liquidMetal.d.ts +3 -0
  334. package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -0
  335. package/dist/operations/catalogue/liquidMetal.js +122 -0
  336. package/dist/operations/catalogue/metalize.d.ts +3 -0
  337. package/dist/operations/catalogue/metalize.d.ts.map +1 -0
  338. package/dist/operations/catalogue/metalize.js +135 -0
  339. package/dist/operations/catalogue/moveToFront.d.ts.map +1 -1
  340. package/dist/operations/catalogue/moveToFront.js +1 -0
  341. package/dist/operations/catalogue/orbit.d.ts +3 -0
  342. package/dist/operations/catalogue/orbit.d.ts.map +1 -0
  343. package/dist/operations/catalogue/orbit.js +29 -0
  344. package/dist/operations/catalogue/particleSwarm.d.ts +3 -0
  345. package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -0
  346. package/dist/operations/catalogue/particleSwarm.js +138 -0
  347. package/dist/operations/catalogue/petalPeel.d.ts +3 -0
  348. package/dist/operations/catalogue/petalPeel.d.ts.map +1 -0
  349. package/dist/operations/catalogue/petalPeel.js +137 -0
  350. package/dist/operations/catalogue/petrify.d.ts +3 -0
  351. package/dist/operations/catalogue/petrify.d.ts.map +1 -0
  352. package/dist/operations/catalogue/petrify.js +94 -0
  353. package/dist/operations/catalogue/portal.d.ts +3 -0
  354. package/dist/operations/catalogue/portal.d.ts.map +1 -0
  355. package/dist/operations/catalogue/portal.js +224 -0
  356. package/dist/operations/catalogue/print3d.d.ts +3 -0
  357. package/dist/operations/catalogue/print3d.d.ts.map +1 -0
  358. package/dist/operations/catalogue/print3d.js +275 -0
  359. package/dist/operations/catalogue/rainBeads.d.ts +3 -0
  360. package/dist/operations/catalogue/rainBeads.d.ts.map +1 -0
  361. package/dist/operations/catalogue/rainBeads.js +223 -0
  362. package/dist/operations/catalogue/restPose.d.ts +21 -0
  363. package/dist/operations/catalogue/restPose.d.ts.map +1 -0
  364. package/dist/operations/catalogue/restPose.js +55 -0
  365. package/dist/operations/catalogue/rimLight.d.ts +3 -0
  366. package/dist/operations/catalogue/rimLight.d.ts.map +1 -0
  367. package/dist/operations/catalogue/rimLight.js +72 -0
  368. package/dist/operations/catalogue/sandErosion.d.ts +3 -0
  369. package/dist/operations/catalogue/sandErosion.d.ts.map +1 -0
  370. package/dist/operations/catalogue/sandErosion.js +167 -0
  371. package/dist/operations/catalogue/shaderLayers.d.ts +74 -0
  372. package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -0
  373. package/dist/operations/catalogue/shaderLayers.js +322 -0
  374. package/dist/operations/catalogue/shatter.d.ts +3 -0
  375. package/dist/operations/catalogue/shatter.d.ts.map +1 -0
  376. package/dist/operations/catalogue/shatter.js +267 -0
  377. package/dist/operations/catalogue/silkDrape.d.ts +3 -0
  378. package/dist/operations/catalogue/silkDrape.d.ts.map +1 -0
  379. package/dist/operations/catalogue/silkDrape.js +340 -0
  380. package/dist/operations/catalogue/spin.d.ts +3 -0
  381. package/dist/operations/catalogue/spin.d.ts.map +1 -0
  382. package/dist/operations/catalogue/spin.js +42 -0
  383. package/dist/operations/catalogue/surfaceSample.d.ts +17 -0
  384. package/dist/operations/catalogue/surfaceSample.d.ts.map +1 -0
  385. package/dist/operations/catalogue/surfaceSample.js +187 -0
  386. package/dist/operations/catalogue/swirl.d.ts +3 -0
  387. package/dist/operations/catalogue/swirl.d.ts.map +1 -0
  388. package/dist/operations/catalogue/swirl.js +69 -0
  389. package/dist/operations/catalogue/teleport.d.ts +3 -0
  390. package/dist/operations/catalogue/teleport.d.ts.map +1 -0
  391. package/dist/operations/catalogue/teleport.js +213 -0
  392. package/dist/operations/catalogue/transitionField.d.ts +124 -0
  393. package/dist/operations/catalogue/transitionField.d.ts.map +1 -0
  394. package/dist/operations/catalogue/transitionField.js +278 -0
  395. package/dist/operations/catalogue/unweave.d.ts +3 -0
  396. package/dist/operations/catalogue/unweave.d.ts.map +1 -0
  397. package/dist/operations/catalogue/unweave.js +233 -0
  398. package/dist/operations/catalogue/visibility.d.ts.map +1 -1
  399. package/dist/operations/catalogue/visibility.js +1 -0
  400. package/dist/operations/catalogue/voxelize.d.ts +3 -0
  401. package/dist/operations/catalogue/voxelize.d.ts.map +1 -0
  402. package/dist/operations/catalogue/voxelize.js +148 -0
  403. package/dist/operations/catalogue/warmup.d.ts +22 -0
  404. package/dist/operations/catalogue/warmup.d.ts.map +1 -0
  405. package/dist/operations/catalogue/warmup.js +106 -0
  406. package/dist/operations/catalogue/zoom.d.ts.map +1 -1
  407. package/dist/operations/catalogue/zoom.js +1 -0
  408. package/dist/operations/index.d.ts +4 -2
  409. package/dist/operations/index.d.ts.map +1 -1
  410. package/dist/operations/index.js +4 -2
  411. package/dist/operations/objectEffects.d.ts +46 -0
  412. package/dist/operations/objectEffects.d.ts.map +1 -0
  413. package/dist/operations/objectEffects.js +136 -0
  414. package/dist/operations/registry.d.ts +7 -2
  415. package/dist/operations/registry.d.ts.map +1 -1
  416. package/dist/operations/registry.js +45 -3
  417. package/dist/operations/runtime.d.ts +40 -2
  418. package/dist/operations/runtime.d.ts.map +1 -1
  419. package/dist/operations/runtime.js +164 -8
  420. package/dist/operations/types.d.ts +29 -3
  421. package/dist/operations/types.d.ts.map +1 -1
  422. package/dist/operations/types.js +6 -0
  423. package/dist/operations/useObjectEffectLayers.d.ts +4 -0
  424. package/dist/operations/useObjectEffectLayers.d.ts.map +1 -0
  425. package/dist/operations/useObjectEffectLayers.js +42 -0
  426. package/dist/operations/useOperationsRuntime.d.ts.map +1 -1
  427. package/dist/operations/useOperationsRuntime.js +42 -4
  428. package/dist/presets/landscapePresets.d.ts +1 -1
  429. package/dist/presets/landscapePresets.d.ts.map +1 -1
  430. package/dist/presets/landscapePresets.js +1 -1
  431. package/dist/presets/landscapeTypes.d.ts +1 -1
  432. package/dist/presets/landscapeTypes.d.ts.map +1 -1
  433. package/dist/presets/landscapeTypes.js +1 -1
  434. package/dist/presets/oceanSurfacePresets.d.ts +1 -1
  435. package/dist/presets/terrainPresets.d.ts +1 -1
  436. package/dist/presets/terrainPresets.d.ts.map +1 -1
  437. package/dist/presets/volumetricCloudPresets.d.ts +1 -1
  438. package/dist/types/cloudConfigs.d.ts +2 -309
  439. package/dist/types/cloudConfigs.d.ts.map +1 -1
  440. package/dist/types/cloudConfigs.js +2 -339
  441. package/dist/types/gridConfigs.d.ts +103 -0
  442. package/dist/types/gridConfigs.d.ts.map +1 -1
  443. package/dist/types/index.d.ts +9 -9
  444. package/dist/types/index.d.ts.map +1 -1
  445. package/dist/types/index.js +4 -4
  446. package/dist/types/landscapeConfigs.d.ts +2 -217
  447. package/dist/types/landscapeConfigs.d.ts.map +1 -1
  448. package/dist/types/landscapeConfigs.js +2 -256
  449. package/dist/types/oceanConfigs.d.ts +2 -289
  450. package/dist/types/oceanConfigs.d.ts.map +1 -1
  451. package/dist/types/oceanConfigs.js +2 -380
  452. package/dist/types/terrainConfigs.d.ts +2 -250
  453. package/dist/types/terrainConfigs.d.ts.map +1 -1
  454. package/dist/types/terrainConfigs.js +2 -292
  455. package/dist/utils/cloudUniforms.d.ts +1 -1
  456. package/dist/utils/configAnimations.d.ts +6 -0
  457. package/dist/utils/configAnimations.d.ts.map +1 -1
  458. package/dist/utils/configAnimations.js +14 -0
  459. package/dist/utils/gridConfig.d.ts +19 -0
  460. package/dist/utils/gridConfig.d.ts.map +1 -0
  461. package/dist/utils/gridConfig.js +52 -0
  462. package/dist/utils/handleCloudsAnimations.d.ts +1 -1
  463. package/dist/utils/handleCloudsAnimations.js +1 -1
  464. package/dist/utils/hasHoverAnimation.d.ts.map +1 -1
  465. package/dist/utils/hasHoverAnimation.js +0 -2
  466. package/dist/utils/landscapeUniforms.d.ts +1 -1
  467. package/dist/utils/landscapeUniforms.d.ts.map +1 -1
  468. package/dist/utils/oceanUniforms.d.ts +1 -1
  469. package/dist/utils/particleShape.d.ts +33 -0
  470. package/dist/utils/particleShape.d.ts.map +1 -0
  471. package/dist/utils/particleShape.js +207 -0
  472. package/dist/utils/particleTrails.d.ts.map +1 -1
  473. package/dist/utils/particleTrails.js +29 -14
  474. package/dist/utils/terrainUniforms.d.ts +1 -1
  475. package/dist/utils/terrainUniforms.d.ts.map +1 -1
  476. package/package.json +2 -2
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRef, useMemo } from 'react';
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 { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
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
  // ── Seeded LCG RNG — deterministic, no Math.random ───────────────────────────
8
10
  function makeRng(seed) {
9
11
  let s = (seed * 1664525 + 1013904223) >>> 0;
@@ -55,22 +57,37 @@ const glowFrag = /* glsl */ `
55
57
  }
56
58
  `;
57
59
  const FADE_DUR = 0.22;
58
- const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
59
- const { boltCount, branchDepth, color, glowColor, opacity, speed, intensity, strikeRadius } = config;
60
- const startValuesCacheRef = useRef({});
60
+ /** Knobs that rebuild the bolts (count, fractal depth): commit only, never live. */
61
+ const STRUCTURAL = ['boltCount', 'branchDepth'];
62
+ /** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
63
+ const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.lightning.map((p) => p.value));
64
+ /** The single push point: every config knob that lives on a material reaches it here. */
65
+ function applyConfig(cols, glowMats, c) {
66
+ cols.core.set(c.color);
67
+ cols.glow.set(c.glowColor);
68
+ cols.glowVec.set(cols.glow.r, cols.glow.g, cols.glow.b);
69
+ for (const m of glowMats) {
70
+ m.uniforms.uPointSize.value = 6 * c.intensity;
71
+ m.uniforms.uOpacity.value = c.opacity * 0.12;
72
+ }
73
+ }
74
+ const LightningEffect = ({ boundingRadius, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
75
+ const cfg = useMemo(() => withConfigDefaults(DEFAULT_GENERATIVE_EFFECTS.lightning, config), [config]);
76
+ const { boltCount, branchDepth } = cfg;
61
77
  const rootRef = useRef(null);
62
78
  useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
79
+ // the knobs read per frame (speed, intensity, opacity, strikeRadius), from the last merged config
80
+ const cur = useRef(cfg);
63
81
  const requestedDepth = Number(branchDepth);
64
82
  const depth = Number.isFinite(requestedDepth)
65
83
  ? Math.min(Math.max(Math.floor(requestedDepth), 2), 6)
66
84
  : 2;
67
85
  const N = Math.pow(2, depth) + 1; // vertex count: 5, 9, 17, 33, 65
68
- const coreCol = useMemo(() => new THREE.Color(color), [color]);
69
- const glowCol = useMemo(() => new THREE.Color(glowColor), [glowColor]);
70
- const glowVec = useMemo(() => new THREE.Vector3(glowCol.r, glowCol.g, glowCol.b), [glowCol]);
71
- const sr = boundingRadius * strikeRadius;
72
- // ── Compute origin/target for a bolt from a seed ───────────────────────────
86
+ // written by applyConfig, read when the bolts are recoloured
87
+ const cols = useMemo(() => ({ core: new THREE.Color(), glow: new THREE.Color(), glowVec: new THREE.Vector3() }), []);
88
+ // Compute origin/target for a bolt from a seed (the strike radius is read live)
73
89
  function boltEndpoints(rng) {
90
+ const sr = boundingRadius * cur.current.strikeRadius;
74
91
  const theta = rng() * Math.PI * 2;
75
92
  const elev = 0.3 + rng() * 0.4; // horizontal spread of origin
76
93
  return [
@@ -78,7 +95,7 @@ const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, on
78
95
  new THREE.Vector3((rng() - 0.5) * boundingRadius * 0.4, (rng() - 0.5) * boundingRadius * 0.3, (rng() - 0.5) * boundingRadius * 0.4),
79
96
  ];
80
97
  }
81
- // ── Build line+point geometry from a point list ────────────────────────────
98
+ // Build line+point geometry from a point list
82
99
  function makeGeos(pts, colBuf, brightBuf) {
83
100
  const posArr = new Float32Array(N * 3);
84
101
  for (let i = 0; i < pts.length && i < N; i++) {
@@ -94,7 +111,7 @@ const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, on
94
111
  pointGeo.setAttribute('aBrightness', new THREE.BufferAttribute(brightBuf, 1));
95
112
  return { lineGeo, pointGeo };
96
113
  }
97
- // ── Initialise bolts ───────────────────────────────────────────────────────
114
+ // Initialise bolts
98
115
  const bolts = useMemo(() => {
99
116
  return Array.from({ length: boltCount }, (_, bi) => {
100
117
  const seed = bi * 997 + 1;
@@ -112,35 +129,44 @@ const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, on
112
129
  });
113
130
  // eslint-disable-next-line react-hooks/exhaustive-deps
114
131
  }, [boltCount, depth, N]);
115
- // ── Shared materials ───────────────────────────────────────────────────────
132
+ useEffect(() => () => bolts.forEach((b) => { b.lineGeo.dispose(); b.pointGeo.dispose(); }), [bolts]);
133
+ // Shared materials
116
134
  const lineMat = useMemo(() => new THREE.LineBasicMaterial({
117
135
  vertexColors: true,
118
136
  transparent: true,
119
137
  depthWrite: false,
120
138
  blending: THREE.AdditiveBlending,
121
139
  }), []);
140
+ useEffect(() => () => lineMat.dispose(), [lineMat]);
122
141
  const glowMats = useMemo(() => bolts.map(() => new THREE.ShaderMaterial({
123
142
  vertexShader: glowVert,
124
143
  fragmentShader: glowFrag,
125
144
  uniforms: {
126
- uPointSize: { value: 6 * intensity },
127
- uColor: { value: glowVec },
128
- uOpacity: { value: opacity * 0.12 },
145
+ uPointSize: { value: 6 },
146
+ uColor: { value: cols.glowVec },
147
+ uOpacity: { value: 0.12 },
129
148
  },
130
149
  transparent: true,
131
150
  depthWrite: false,
132
151
  blending: THREE.AdditiveBlending,
133
- })),
134
- // eslint-disable-next-line react-hooks/exhaustive-deps
135
- [bolts, intensity, glowVec, opacity]);
136
- // ── Recompute vertex colors from current progress ──────────────────────────
152
+ })), [bolts, cols]);
153
+ useEffect(() => () => glowMats.forEach((m) => m.dispose()), [glowMats]);
154
+ const push = useCallback((merged) => {
155
+ cur.current = merged;
156
+ applyConfig(cols, glowMats, merged);
157
+ }, [cols, glowMats]);
158
+ useLayoutEffect(() => { push(cfg); }, [push, cfg]);
159
+ useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
160
+ // Recompute vertex colors from current progress
137
161
  function refreshColors(bolt, overallScale) {
138
162
  const { progress, points, colBuf, brightBuf, lineGeo, pointGeo } = bolt;
163
+ const intensity = cur.current.intensity;
164
+ const { core: coreCol, glow: glowCol } = cols;
139
165
  const n = points.length;
140
166
  for (let i = 0; i < n; i++) {
141
167
  const t = i / (n - 1);
142
168
  if (t > progress + 0.001) {
143
- // Not yet reached — keep black (invisible with additive blend)
169
+ // Not yet reached - keep black (invisible with additive blend)
144
170
  colBuf[i * 3] = colBuf[i * 3 + 1] = colBuf[i * 3 + 2] = 0;
145
171
  brightBuf[i] = 0;
146
172
  continue;
@@ -148,12 +174,12 @@ const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, on
148
174
  const behind = progress - t; // 0 = at head
149
175
  // Exponential trail: bright near head, fades behind
150
176
  const trail = Math.exp(-behind * 7.0);
151
- // Build-up: whole bolt intensifies as progress moves from 0→1
177
+ // Build-up: whole bolt intensifies as progress moves from 0->1
152
178
  const buildUp = 0.3 + 0.7 * progress;
153
179
  // Extra corona right at the head
154
180
  const corona = Math.exp(-behind * behind * 220) * 3.0;
155
181
  const totalBri = (trail * buildUp + corona) * intensity * overallScale;
156
- // Color: glow color in body → core (white-ish) at head corona
182
+ // Color: glow color in body -> core (white-ish) at head corona
157
183
  const headMix = Math.min(1, corona * 0.5);
158
184
  colBuf[i * 3] = (glowCol.r + (coreCol.r - glowCol.r) * headMix) * totalBri;
159
185
  colBuf[i * 3 + 1] = (glowCol.g + (coreCol.g - glowCol.g) * headMix) * totalBri;
@@ -163,7 +189,7 @@ const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, on
163
189
  lineGeo.attributes.color.needsUpdate = true;
164
190
  pointGeo.attributes.aBrightness.needsUpdate = true;
165
191
  }
166
- // ── Rebuild bolt shape with fresh fractal ─────────────────────────────────
192
+ // Rebuild bolt shape with fresh fractal
167
193
  function rebuildShape(bolt) {
168
194
  bolt.seed++;
169
195
  const rng = makeRng(bolt.seed);
@@ -182,6 +208,7 @@ const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, on
182
208
  posP.needsUpdate = true;
183
209
  }
184
210
  useFrame((_, delta) => {
211
+ const { speed, opacity } = cur.current;
185
212
  const dt = delta * speed;
186
213
  bolts.forEach((bolt, bi) => {
187
214
  switch (bolt.phase) {
@@ -208,7 +235,7 @@ const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, on
208
235
  break;
209
236
  case 'flash': {
210
237
  bolt.timer -= delta;
211
- // Flash: briefly crank overall brightness to 2–3x for the "return stroke"
238
+ // Flash: briefly crank overall brightness to 2-3x for the "return stroke"
212
239
  const flashBoost = 1.0 + Math.max(0, bolt.timer / 0.08) * 2.5;
213
240
  refreshColors(bolt, flashBoost);
214
241
  if (bolt.timer <= 0) {
@@ -232,15 +259,10 @@ const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, on
232
259
  }
233
260
  }
234
261
  });
235
- if (animations?.length) {
236
- applyGenerativeAnimations(glowMats, animations, startValuesCacheRef.current, Date.now(), false);
237
- }
238
262
  });
239
- // ── Render ─────────────────────────────────────────────────────────────────
263
+ // Render
240
264
  // Use primitive to render THREE.Line (not THREE.LineSegments)
241
- const lineObjects = useMemo(() => bolts.map(bolt => new THREE.Line(bolt.lineGeo, lineMat)),
242
- // eslint-disable-next-line react-hooks/exhaustive-deps
243
- [bolts, lineMat]);
265
+ const lineObjects = useMemo(() => bolts.map(bolt => new THREE.Line(bolt.lineGeo, lineMat)), [bolts, lineMat]);
244
266
  return (_jsx("group", { ref: rootRef, children: lineObjects.map((lineObj, bi) => (_jsxs("group", { children: [_jsx("primitive", { object: lineObj }), _jsx("points", { geometry: bolts[bi].pointGeo, material: glowMats[bi] })] }, bi))) }));
245
267
  };
246
268
  export default LightningEffect;
@@ -1,10 +1,15 @@
1
- import React from 'react';
2
- import type { AnimationOptions, MoleculesConfig } from '@3driseai/3drise-core';
1
+ import React from "react";
2
+ import type { MoleculesConfig, AnimationOptions, MouseMoveDomain } from "@3driseai/3drise-core";
3
3
  import type { ObjectReadyProps } from '../../types/objectReady';
4
4
  export interface MoleculesEffectProps extends ObjectReadyProps {
5
5
  boundingRadius: number;
6
6
  config: MoleculesConfig;
7
- animations?: AnimationOptions[];
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 MoleculesEffect: React.FC<MoleculesEffectProps>;
10
15
  export default MoleculesEffect;
@@ -1 +1 @@
1
- {"version":3,"file":"MoleculesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/MoleculesEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAG3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAgQD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8FnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"MoleculesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/MoleculesEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGhG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,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;AAqRD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAkFnD,CAAC;AAEF,eAAe,eAAe,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 { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
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
  * A molecule drawn as quantum electron clouds.
9
11
  *
@@ -252,11 +254,29 @@ const nucleusFrag = /* glsl */ `
252
254
  gl_FragColor = vec4(col * g * uIntensity * uOpacity, g * uOpacity);
253
255
  }
254
256
  `;
255
- const MoleculesEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
256
- const { intensity = 1, speed = 1, color = '#00d4ff', opacity = 0.9, atomCount = 6, orbitRadius = 1.5, atomSize = 0.08, showBonds = true, bondColor = '#ffffff', randomizeAxes = true, orbital = -1, phaseColor = '#ff5a8a', cloudDensity = 1, } = config;
257
+ /** Knobs that rebuild the electron clouds or re-tilt the tumble axis: commit only, never live. */
258
+ const STRUCTURAL = ['atomCount', 'cloudDensity', 'randomizeAxes'];
259
+ /** Knobs a keyframe or pointer binding may drive per frame — exactly what applyConfig pushes. */
260
+ const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.molecules.map((p) => p.value));
261
+ /** The single push point: every config knob reaches its uniform here. */
262
+ function applyConfig(u, c, bound) {
263
+ u.uSpeed.value = c.speed;
264
+ u.uBound.value = bound;
265
+ u.uIntensity.value = c.intensity;
266
+ u.uOpacity.value = c.opacity;
267
+ u.uColor.value.set(c.color);
268
+ u.uPhaseColor.value.set(c.phaseColor);
269
+ u.uBondColor.value.set(c.bondColor);
270
+ u.uOrbitRadius.value = c.orbitRadius;
271
+ u.uAtomSize.value = c.atomSize;
272
+ u.uShowBonds.value = c.showBonds ? 1 : 0;
273
+ u.uOrbital.value = c.orbital;
274
+ }
275
+ const MoleculesEffect = ({ boundingRadius, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
276
+ const cfg = useMemo(() => withConfigDefaults(DEFAULT_GENERATIVE_EFFECTS.molecules, config), [config]);
277
+ const { atomCount, cloudDensity, randomizeAxes } = cfg;
257
278
  const rootRef = useRef(null);
258
279
  const spinRef = useRef(null);
259
- const animCache = useRef({});
260
280
  useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
261
281
  // a standalone effect gets boundingRadius 1; guard against an empty host
262
282
  const b = boundingRadius > 0 ? boundingRadius : 1;
@@ -294,22 +314,12 @@ const MoleculesEffect = ({ boundingRadius, config, animations, onObjectReady, on
294
314
  useEffect(() => () => cloudGeometry.dispose(), [cloudGeometry]);
295
315
  const quadGeometry = useMemo(() => new THREE.PlaneGeometry(1, 1), []);
296
316
  useEffect(() => () => quadGeometry.dispose(), [quadGeometry]);
297
- useLayoutEffect(() => {
298
- uniforms.uSpeed.value = speed;
299
- uniforms.uBound.value = b;
300
- uniforms.uIntensity.value = intensity;
301
- uniforms.uOpacity.value = opacity;
302
- uniforms.uColor.value.set(color);
303
- uniforms.uPhaseColor.value.set(phaseColor);
304
- uniforms.uBondColor.value.set(bondColor);
305
- uniforms.uOrbitRadius.value = orbitRadius;
306
- uniforms.uAtomSize.value = atomSize;
307
- uniforms.uShowBonds.value = showBonds ? 1 : 0;
308
- uniforms.uOrbital.value = orbital;
309
- }, [uniforms, speed, b, intensity, opacity, color, phaseColor, bondColor, orbitRadius, atomSize, showBonds, orbital]);
317
+ const push = useCallback((merged) => {
318
+ applyConfig(uniforms, merged, b);
319
+ }, [uniforms, b]);
320
+ useLayoutEffect(() => { push(cfg); }, [push, cfg]);
321
+ useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
310
322
  useFrame((_, delta) => {
311
- if (animations?.length)
312
- applyGenerativeAnimations(materials, animations, animCache.current, Date.now(), false);
313
323
  const t = (uniforms.uTime.value += delta * uniforms.uSpeed.value);
314
324
  if (spinRef.current)
315
325
  spinRef.current.rotation.y = t * 0.15;
@@ -1,10 +1,15 @@
1
1
  import React from 'react';
2
- import type { AnimationOptions, MurmurationConfig } from '@3driseai/3drise-core';
2
+ import type { AnimationOptions, MurmurationConfig, MouseMoveDomain } from '@3driseai/3drise-core';
3
3
  import type { ObjectReadyProps } from '../../types/objectReady';
4
4
  export interface MurmurationEffectProps extends ObjectReadyProps {
5
5
  boundingRadius: number;
6
6
  config: MurmurationConfig;
7
- animations?: AnimationOptions[];
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":"MurmurationEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/MurmurationEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAG3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAGjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAodD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA+BvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"MurmurationEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/MurmurationEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIlG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,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;AA0dD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqCvD,CAAC;AAEF,eAAe,iBAAiB,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 { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
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
  * A starling murmuration: thousands of boids with topological neighbours swirl around a drifting roost, folding into dense, wave-like sheets. Use for dusk, wildlife, flocking, atmospheric scenes.
9
11
  *
@@ -499,7 +501,7 @@ function build(u, c, bound, env) {
499
501
  dispose() { geo.dispose(); mat.dispose(); },
500
502
  };
501
503
  }
502
- /** Defaults for every knob, so an older saved config still renders. */
504
+ /** A value for every knob: the base the renderer draws and keyframes interpolate from. */
503
505
  const DEFAULTS = {
504
506
  intensity: 1,
505
507
  speed: 1,
@@ -512,27 +514,35 @@ const DEFAULTS = {
512
514
  separation: 1,
513
515
  birdSize: 1,
514
516
  };
515
- const MurmurationEffect = ({ boundingRadius, config, animations, hasHost = false, onObjectReady, onObjectDispose }) => {
517
+ /** Knobs that rebuild the object: they change on commit, never through the live path. */
518
+ const STRUCTURAL = ['count'];
519
+ /** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
520
+ const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.murmuration.map((p) => p.value));
521
+ const MurmurationEffect = ({ boundingRadius, config, id, keyframes, mouseMove, hasHost = false, onObjectReady, onObjectDispose }) => {
516
522
  const rootRef = useRef(null);
517
- const animCache = useRef({});
518
523
  useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
519
524
  // a standalone effect gets boundingRadius 1
520
525
  const b = boundingRadius > 0 ? boundingRadius : 1;
521
- const cfg = useMemo(() => ({ ...DEFAULTS, ...config }), [config]);
526
+ const cfg = useMemo(() => withConfigDefaults(DEFAULTS, config), [config]);
522
527
  const env = useMemo(() => ({ hasHost: hasHost }), [hasHost]);
523
528
  // uniforms outlive the objects, so keyframe animations survive a rebuild
524
529
  const uniforms = useMemo(() => createUniforms(), []);
525
530
  // rebuilt only when the host size or a structural knob changes
526
- const instance = useMemo(() => build(uniforms, { ...DEFAULTS, ...config }, b, env), [uniforms, b, env, cfg.count]);
531
+ const instance = useMemo(() => build(uniforms, cfg, b, env), [uniforms, b, env, cfg.count]);
527
532
  useEffect(() => () => instance.dispose(), [instance]);
528
533
  useLayoutEffect(() => {
529
534
  applyConfig(uniforms, cfg, b, env);
530
535
  instance.apply(cfg);
531
536
  }, [instance, uniforms, cfg, b, env]);
537
+ // Committed config + live drag + keyframes + pointer, merged into the one push point
538
+ // (the uniforms, then the instance's own cheap per-config step).
539
+ const push = useCallback((merged) => {
540
+ applyConfig(uniforms, merged, b, env);
541
+ instance.apply(merged);
542
+ }, [instance, uniforms, b, env]);
543
+ useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
532
544
  useFrame((state, delta) => {
533
545
  instance.update(Math.min(delta, 0.1), state.camera);
534
- if (animations?.length)
535
- applyGenerativeAnimations(instance.materials, animations, animCache.current, Date.now(), false);
536
546
  });
537
547
  return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
538
548
  };
@@ -1,10 +1,15 @@
1
1
  import React from "react";
2
- import type { NeuralNetworkConfig, AnimationOptions } from "@3driseai/3drise-core";
2
+ import type { NeuralNetworkConfig, AnimationOptions, MouseMoveDomain } from "@3driseai/3drise-core";
3
3
  import type { ObjectReadyProps } from '../../types/objectReady';
4
- interface NeuralNetworkEffectProps extends ObjectReadyProps {
4
+ export interface NeuralNetworkEffectProps extends ObjectReadyProps {
5
5
  boundingRadius: number;
6
6
  config: NeuralNetworkConfig;
7
- animations?: AnimationOptions[];
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 NeuralNetworkEffect: React.FC<NeuralNetworkEffectProps>;
10
15
  export default NeuralNetworkEffect;
@@ -1 +1 @@
1
- {"version":3,"file":"NeuralNetworkEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/NeuralNetworkEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,wBAAyB,SAAQ,gBAAgB;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA+BD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA4J3D,CAAC;AACF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"NeuralNetworkEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/NeuralNetworkEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,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;CAC/B;AAgED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAmK3D,CAAC;AACF,eAAe,mBAAmB,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRef, useMemo } from 'react';
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 { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
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
  // Tight point sprites for electrical signals moving through the connections.
8
10
  const pulseVert = /* glsl */ `
9
11
  attribute float aBright;
@@ -32,19 +34,44 @@ const pulseFrag = /* glsl */ `
32
34
  }
33
35
  `;
34
36
  const MAX_PULSES = 4;
35
- const NeuralNetworkEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
36
- const { nodeCount, signalSpeed, nodeColor, pulseColor, orbitSpeed, opacity, speed, intensity } = config;
37
- const startValuesCacheRef = useRef({});
37
+ /** Knobs that rebuild the network: commit only, never live. */
38
+ const STRUCTURAL = ['nodeCount'];
39
+ /** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
40
+ const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.neuralNetwork.map((p) => p.value));
41
+ const _color = new THREE.Color();
42
+ const EDGE_DIM = 0.06;
43
+ /** The single push point: every config knob reaches its uniform (or material) here. */
44
+ function applyConfig(s, c) {
45
+ _color.set(c.nodeColor);
46
+ s.nodeMat.color.copy(_color);
47
+ s.nodeMat.opacity = c.opacity * 0.55;
48
+ // edges are drawn in a dim copy of the node colour
49
+ const cols = s.edgeGeo.attributes.color;
50
+ for (let i = 0; i < cols.count; i++)
51
+ cols.setXYZ(i, _color.r * EDGE_DIM, _color.g * EDGE_DIM, _color.b * EDGE_DIM);
52
+ cols.needsUpdate = true;
53
+ _color.set(c.pulseColor);
54
+ const u = s.pulseMat.uniforms;
55
+ u.uColor.value.set(_color.r, _color.g, _color.b);
56
+ u.uSize.value = 7 * c.intensity;
57
+ u.uOpacity.value = c.opacity;
58
+ }
59
+ const NeuralNetworkEffect = ({ boundingRadius, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
60
+ const cfg = useMemo(() => withConfigDefaults(DEFAULT_GENERATIVE_EFFECTS.neuralNetwork, config), [config]);
61
+ const { nodeCount } = cfg;
38
62
  const groupRef = useRef(null);
39
63
  useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
64
+ // the knobs read per frame (speed, orbitSpeed, signalSpeed, intensity), from the last merged config
65
+ const cur = useRef(cfg);
40
66
  // Node orbit state
41
67
  const orbitAngles = useRef(new Float32Array(0));
42
68
  const pulses = useRef([]);
43
69
  const nextPulse = useRef(0);
44
70
  const r = boundingRadius * 1.35;
45
71
  const N = Math.max(8, Math.min(nodeCount, 40));
72
+ // Built once per node count and host size; colours, sizes and opacity are pushed.
46
73
  const scene = useMemo(() => {
47
- // ── Node positions on Fibonacci sphere ────────────────────────────────
74
+ // Node positions on Fibonacci sphere
48
75
  const basePos = [];
49
76
  const goldenAngle = Math.PI * (3 - Math.sqrt(5));
50
77
  for (let i = 0; i < N; i++) {
@@ -53,12 +80,12 @@ const NeuralNetworkEffect = ({ boundingRadius, config, animations, onObjectReady
53
80
  const phi = i * goldenAngle;
54
81
  basePos.push(new THREE.Vector3(Math.cos(phi) * rad, y * r, Math.sin(phi) * rad));
55
82
  }
56
- // Orbit axes — random unit vectors
83
+ // Orbit axes - random unit vectors
57
84
  const orbitAxes = Array.from({ length: N }, () => new THREE.Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5).normalize());
58
85
  const orbitSpeeds = Array.from({ length: N }, () => 0.4 + Math.random() * 0.6);
59
86
  const angles = new Float32Array(N).map((_, i) => i * 0.7);
60
87
  orbitAngles.current = angles;
61
- // ── Edges — connect nearby pairs ─────────────────────────────────────
88
+ // Edges - connect nearby pairs
62
89
  const MAX_DIST = r * 0.85;
63
90
  const edges = [];
64
91
  const degree = new Int32Array(N);
@@ -74,42 +101,35 @@ const NeuralNetworkEffect = ({ boundingRadius, config, animations, onObjectReady
74
101
  }
75
102
  }
76
103
  const edgeVerts = new Float32Array(edges.length * 6);
77
- const edgeCols = new Float32Array(edges.length * 6);
78
- const nc = new THREE.Color(nodeColor);
79
- const DIM = 0.06;
80
104
  for (let e = 0; e < edges.length; e++) {
81
105
  const [a, b] = edges[e];
82
106
  edgeVerts.set([basePos[a].x, basePos[a].y, basePos[a].z, basePos[b].x, basePos[b].y, basePos[b].z], e * 6);
83
- edgeCols.set([nc.r * DIM, nc.g * DIM, nc.b * DIM, nc.r * DIM, nc.g * DIM, nc.b * DIM], e * 6);
84
107
  }
85
108
  const edgeGeo = new THREE.BufferGeometry();
86
109
  edgeGeo.setAttribute('position', new THREE.BufferAttribute(edgeVerts, 3));
87
- edgeGeo.setAttribute('color', new THREE.BufferAttribute(edgeCols, 3));
110
+ edgeGeo.setAttribute('color', new THREE.BufferAttribute(new Float32Array(edges.length * 6), 3));
88
111
  const edgeMat = new THREE.LineBasicMaterial({
89
112
  vertexColors: true, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
90
113
  });
91
- // ── Node instanced mesh ───────────────────────────────────────────────
92
- const nodeGeo = new THREE.SphereGeometry(0.055 * intensity, 8, 8);
93
- const nc2 = new THREE.Color(nodeColor);
114
+ // Node instanced mesh (sized per instance by intensity, so the size can be driven)
115
+ const nodeGeo = new THREE.SphereGeometry(0.055, 8, 8);
94
116
  const nodeMat = new THREE.MeshBasicMaterial({
95
- color: nc2, transparent: true, opacity: opacity * 0.55,
96
- depthWrite: false, blending: THREE.AdditiveBlending,
117
+ transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
97
118
  });
98
119
  const nodeMesh = new THREE.InstancedMesh(nodeGeo, nodeMat, N);
99
120
  nodeMesh.instanceMatrix.setUsage(THREE.DynamicDrawUsage);
100
- // ── Pulse sprites ─────────────────────────────────────────────────────
121
+ // Pulse sprites
101
122
  const pulsePos = new Float32Array(MAX_PULSES * 3);
102
123
  const pulseBright = new Float32Array(MAX_PULSES);
103
124
  const pulseGeo = new THREE.BufferGeometry();
104
125
  pulseGeo.setAttribute('position', new THREE.BufferAttribute(pulsePos, 3));
105
126
  pulseGeo.setAttribute('aBright', new THREE.BufferAttribute(pulseBright, 1));
106
- const pc = new THREE.Color(pulseColor);
107
127
  const pulseMat = new THREE.ShaderMaterial({
108
128
  vertexShader: pulseVert, fragmentShader: pulseFrag,
109
129
  uniforms: {
110
- uSize: { value: 7 * intensity },
111
- uColor: { value: new THREE.Vector3(pc.r, pc.g, pc.b) },
112
- uOpacity: { value: opacity },
130
+ uSize: { value: 7 },
131
+ uColor: { value: new THREE.Vector3(1, 1, 1) },
132
+ uOpacity: { value: 1 },
113
133
  },
114
134
  transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
115
135
  });
@@ -117,17 +137,34 @@ const NeuralNetworkEffect = ({ boundingRadius, config, animations, onObjectReady
117
137
  pulses.current = Array.from({ length: MAX_PULSES }, () => ({
118
138
  fromIdx: 0, toIdx: 1, progress: 0, active: false,
119
139
  }));
120
- return { basePos, orbitAxes, orbitSpeeds, edges, edgeGeo, edgeMat, nodeMesh, pulseGeo, pulseMat };
121
- // eslint-disable-next-line react-hooks/exhaustive-deps
122
- }, [N, r, nodeColor, pulseColor, opacity, intensity]);
140
+ return { basePos, orbitAxes, orbitSpeeds, edges, edgeGeo, edgeMat, nodeGeo, nodeMat, nodeMesh, pulseGeo, pulseMat };
141
+ }, [N, r]);
142
+ useEffect(() => () => {
143
+ scene.edgeGeo.dispose();
144
+ scene.edgeMat.dispose();
145
+ scene.nodeGeo.dispose();
146
+ scene.nodeMat.dispose();
147
+ scene.nodeMesh.dispose();
148
+ scene.pulseGeo.dispose();
149
+ scene.pulseMat.dispose();
150
+ }, [scene]);
151
+ const push = useCallback((merged) => {
152
+ cur.current = merged;
153
+ applyConfig(scene, merged);
154
+ }, [scene]);
155
+ useLayoutEffect(() => { push(cfg); }, [push, cfg]);
156
+ useConfigDriver({ rootRef: groupRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
123
157
  const tmpMat = useMemo(() => new THREE.Matrix4(), []);
124
158
  const tmpQuat = useMemo(() => new THREE.Quaternion(), []);
125
159
  const tmpVec = useMemo(() => new THREE.Vector3(), []);
160
+ const tmpScale = useMemo(() => new THREE.Vector3(), []);
126
161
  useFrame((_, delta) => {
127
162
  if (!groupRef.current)
128
163
  return;
164
+ const { speed, orbitSpeed, signalSpeed, intensity } = cur.current;
129
165
  const dt = delta * speed;
130
- const { basePos, orbitAxes, orbitSpeeds, edges, edgeGeo, nodeMesh, pulseGeo, pulseMat } = scene;
166
+ const { basePos, orbitAxes, orbitSpeeds, edges, edgeGeo, nodeMesh, pulseGeo } = scene;
167
+ tmpScale.setScalar(intensity);
131
168
  // Rotate nodes around their individual axes
132
169
  const angles = orbitAngles.current;
133
170
  const curPos = [];
@@ -141,7 +178,7 @@ const NeuralNetworkEffect = ({ boundingRadius, config, animations, onObjectReady
141
178
  const dot = base.dot(axis);
142
179
  tmpVec.set(base.x * cosA + (axis.y * base.z - axis.z * base.y) * sinA + axis.x * dot * (1 - cosA), base.y * cosA + (axis.z * base.x - axis.x * base.z) * sinA + axis.y * dot * (1 - cosA), base.z * cosA + (axis.x * base.y - axis.y * base.x) * sinA + axis.z * dot * (1 - cosA));
143
180
  curPos.push(tmpVec.clone());
144
- tmpMat.compose(tmpVec, tmpQuat, new THREE.Vector3(1, 1, 1));
181
+ tmpMat.compose(tmpVec, tmpQuat, tmpScale);
145
182
  nodeMesh.setMatrixAt(i, tmpMat);
146
183
  }
147
184
  nodeMesh.instanceMatrix.needsUpdate = true;
@@ -156,7 +193,7 @@ const NeuralNetworkEffect = ({ boundingRadius, config, animations, onObjectReady
156
193
  // Pulse signals along edges
157
194
  nextPulse.current -= delta;
158
195
  if (nextPulse.current <= 0 && edges.length > 0) {
159
- nextPulse.current = 0.4 / speed;
196
+ nextPulse.current = 0.4 / Math.max(speed, 0.05);
160
197
  const idle = pulses.current.findIndex(p => !p.active);
161
198
  if (idle >= 0) {
162
199
  const e = Math.floor(Math.random() * edges.length);
@@ -182,10 +219,6 @@ const NeuralNetworkEffect = ({ boundingRadius, config, animations, onObjectReady
182
219
  });
183
220
  ptPos.needsUpdate = true;
184
221
  ptBright.needsUpdate = true;
185
- pulseMat.uniforms.uSize.value = 7 * intensity;
186
- if (animations?.length) {
187
- applyGenerativeAnimations([pulseMat], animations, startValuesCacheRef.current, Date.now(), false);
188
- }
189
222
  });
190
223
  return (_jsxs("group", { ref: groupRef, children: [_jsx("lineSegments", { geometry: scene.edgeGeo, material: scene.edgeMat }), _jsx("primitive", { object: scene.nodeMesh }), _jsx("points", { geometry: scene.pulseGeo, material: scene.pulseMat })] }));
191
224
  };
@@ -1,10 +1,15 @@
1
1
  import React from "react";
2
- import type { OrbConfig, AnimationOptions } from "@3driseai/3drise-core";
2
+ import type { OrbConfig, AnimationOptions, MouseMoveDomain } from "@3driseai/3drise-core";
3
3
  import type { ObjectReadyProps } from '../../types/objectReady';
4
- interface OrbEffectProps extends ObjectReadyProps {
4
+ export interface OrbEffectProps extends ObjectReadyProps {
5
5
  boundingRadius: number;
6
6
  config: OrbConfig;
7
- animations?: AnimationOptions[];
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 OrbEffect: React.FC<OrbEffectProps>;
10
15
  export default OrbEffect;