@3driseai/3drise-viewer 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (509) hide show
  1. package/dist/animationsV2/ClipPlayer.d.ts +16 -0
  2. package/dist/animationsV2/ClipPlayer.d.ts.map +1 -0
  3. package/dist/animationsV2/ClipPlayer.js +199 -0
  4. package/dist/animationsV2/ClipsRuntime.d.ts +150 -0
  5. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -0
  6. package/dist/animationsV2/ClipsRuntime.js +707 -0
  7. package/dist/animationsV2/appliers.d.ts +21 -0
  8. package/dist/animationsV2/appliers.d.ts.map +1 -0
  9. package/dist/animationsV2/appliers.js +222 -0
  10. package/dist/animationsV2/clipUtils.d.ts +33 -0
  11. package/dist/animationsV2/clipUtils.d.ts.map +1 -0
  12. package/dist/animationsV2/clipUtils.js +164 -0
  13. package/dist/animationsV2/elementSettings.d.ts +15 -0
  14. package/dist/animationsV2/elementSettings.d.ts.map +1 -0
  15. package/dist/animationsV2/elementSettings.js +16 -0
  16. package/dist/animationsV2/index.d.ts +16 -0
  17. package/dist/animationsV2/index.d.ts.map +1 -0
  18. package/dist/animationsV2/index.js +12 -0
  19. package/dist/animationsV2/nodeTracks.d.ts +13 -0
  20. package/dist/animationsV2/nodeTracks.d.ts.map +1 -0
  21. package/dist/animationsV2/nodeTracks.js +165 -0
  22. package/dist/animationsV2/normalize.d.ts +4 -0
  23. package/dist/animationsV2/normalize.d.ts.map +1 -0
  24. package/dist/animationsV2/normalize.js +60 -0
  25. package/dist/animationsV2/sequenceUtils.d.ts +98 -0
  26. package/dist/animationsV2/sequenceUtils.d.ts.map +1 -0
  27. package/dist/animationsV2/sequenceUtils.js +220 -0
  28. package/dist/animationsV2/types.d.ts +115 -0
  29. package/dist/animationsV2/types.d.ts.map +1 -0
  30. package/dist/animationsV2/types.js +8 -0
  31. package/dist/api/sceneHandle.d.ts +56 -17
  32. package/dist/api/sceneHandle.d.ts.map +1 -1
  33. package/dist/api/sceneHandle.js +154 -77
  34. package/dist/components/AdvancedGrid.d.ts +8 -2
  35. package/dist/components/AdvancedGrid.d.ts.map +1 -1
  36. package/dist/components/AdvancedGrid.js +31 -14
  37. package/dist/components/AnimatedObject.d.ts.map +1 -1
  38. package/dist/components/AnimatedObject.js +7 -5
  39. package/dist/components/Bubbles.d.ts +7 -1
  40. package/dist/components/Bubbles.d.ts.map +1 -1
  41. package/dist/components/Bubbles.js +42 -22
  42. package/dist/components/CameraController.d.ts.map +1 -1
  43. package/dist/components/CameraController.js +0 -44
  44. package/dist/components/ChladniGrid.d.ts +8 -4
  45. package/dist/components/ChladniGrid.d.ts.map +1 -1
  46. package/dist/components/ChladniGrid.js +31 -13
  47. package/dist/components/CircuitGrid.d.ts +8 -11
  48. package/dist/components/CircuitGrid.d.ts.map +1 -1
  49. package/dist/components/CircuitGrid.js +31 -13
  50. package/dist/components/Clouds.d.ts.map +1 -1
  51. package/dist/components/Clouds.js +0 -34
  52. package/dist/components/CloudsGenerator.d.ts +1 -1
  53. package/dist/components/CloudsGenerator.js +1 -1
  54. package/dist/components/ContourGrid.d.ts +8 -14
  55. package/dist/components/ContourGrid.d.ts.map +1 -1
  56. package/dist/components/ContourGrid.js +31 -13
  57. package/dist/components/CreatedObject.d.ts.map +1 -1
  58. package/dist/components/CreatedObject.js +19 -1
  59. package/dist/components/EffectsGenerator.d.ts +7 -1
  60. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  61. package/dist/components/EffectsGenerator.js +39 -38
  62. package/dist/components/EnvironmentManager.d.ts +4 -4
  63. package/dist/components/EnvironmentManager.d.ts.map +1 -1
  64. package/dist/components/EnvironmentManager.js +1 -1
  65. package/dist/components/FlowNetGrid.d.ts +8 -4
  66. package/dist/components/FlowNetGrid.d.ts.map +1 -1
  67. package/dist/components/FlowNetGrid.js +31 -13
  68. package/dist/components/FractalGrid.d.ts +8 -12
  69. package/dist/components/FractalGrid.d.ts.map +1 -1
  70. package/dist/components/FractalGrid.js +31 -13
  71. package/dist/components/GirihGrid.d.ts +8 -1
  72. package/dist/components/GirihGrid.d.ts.map +1 -1
  73. package/dist/components/GirihGrid.js +31 -13
  74. package/dist/components/Glyphs.d.ts +7 -1
  75. package/dist/components/Glyphs.d.ts.map +1 -1
  76. package/dist/components/Glyphs.js +40 -34
  77. package/dist/components/GravWaveGrid.d.ts +8 -1
  78. package/dist/components/GravWaveGrid.d.ts.map +1 -1
  79. package/dist/components/GravWaveGrid.js +31 -13
  80. package/dist/components/GridsGenerator.d.ts +7 -1
  81. package/dist/components/GridsGenerator.d.ts.map +1 -1
  82. package/dist/components/GridsGenerator.js +20 -18
  83. package/dist/components/HexGrid.d.ts +8 -10
  84. package/dist/components/HexGrid.d.ts.map +1 -1
  85. package/dist/components/HexGrid.js +31 -13
  86. package/dist/components/HyperbolicGrid.d.ts +8 -4
  87. package/dist/components/HyperbolicGrid.d.ts.map +1 -1
  88. package/dist/components/HyperbolicGrid.js +31 -13
  89. package/dist/components/LandscapeBuilder.d.ts +1 -1
  90. package/dist/components/LandscapeBuilder.d.ts.map +1 -1
  91. package/dist/components/LandscapeBuilder.js +1 -1
  92. package/dist/components/LandscapeObject.d.ts +1 -1
  93. package/dist/components/LandscapeObject.d.ts.map +1 -1
  94. package/dist/components/LandscapeObject.js +1 -1
  95. package/dist/components/MoireGrid.d.ts +8 -12
  96. package/dist/components/MoireGrid.d.ts.map +1 -1
  97. package/dist/components/MoireGrid.js +31 -13
  98. package/dist/components/ObjectNode.d.ts.map +1 -1
  99. package/dist/components/ObjectNode.js +2 -2
  100. package/dist/components/ObjectsRenderer.d.ts +4 -1
  101. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  102. package/dist/components/ObjectsRenderer.js +57 -3
  103. package/dist/components/Ocean.d.ts.map +1 -1
  104. package/dist/components/Ocean.js +0 -63
  105. package/dist/components/OceanBuilder.d.ts +1 -1
  106. package/dist/components/OceanBuilder.js +1 -1
  107. package/dist/components/ParticlesGenerator.d.ts.map +1 -1
  108. package/dist/components/ParticlesGenerator.js +6 -0
  109. package/dist/components/QuasiGrid.d.ts +8 -11
  110. package/dist/components/QuasiGrid.d.ts.map +1 -1
  111. package/dist/components/QuasiGrid.js +31 -13
  112. package/dist/components/RadarGrid.d.ts +8 -13
  113. package/dist/components/RadarGrid.d.ts.map +1 -1
  114. package/dist/components/RadarGrid.js +31 -13
  115. package/dist/components/ReactionDiffusionGrid.d.ts +8 -1
  116. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
  117. package/dist/components/ReactionDiffusionGrid.js +33 -139
  118. package/dist/components/SceneBuilder.d.ts.map +1 -1
  119. package/dist/components/SceneBuilder.js +19 -4
  120. package/dist/components/SkyController.d.ts.map +1 -1
  121. package/dist/components/SkyController.js +0 -39
  122. package/dist/components/SkySystem.d.ts +1 -1
  123. package/dist/components/SparklesBurst.d.ts +7 -1
  124. package/dist/components/SparklesBurst.d.ts.map +1 -1
  125. package/dist/components/SparklesBurst.js +31 -28
  126. package/dist/components/Stars.d.ts.map +1 -1
  127. package/dist/components/Stars.js +3 -47
  128. package/dist/components/TerrainBuilder.d.ts +1 -1
  129. package/dist/components/TerrainBuilder.d.ts.map +1 -1
  130. package/dist/components/TerrainBuilder.js +1 -1
  131. package/dist/components/VoronoiGrid.d.ts +8 -10
  132. package/dist/components/VoronoiGrid.d.ts.map +1 -1
  133. package/dist/components/VoronoiGrid.js +31 -13
  134. package/dist/components/WallpaperGrid.d.ts +8 -1
  135. package/dist/components/WallpaperGrid.d.ts.map +1 -1
  136. package/dist/components/WallpaperGrid.js +33 -210
  137. package/dist/components/effects/AuraEffect.d.ts +8 -3
  138. package/dist/components/effects/AuraEffect.d.ts.map +1 -1
  139. package/dist/components/effects/AuraEffect.js +49 -24
  140. package/dist/components/effects/AuroraEffect.d.ts +8 -3
  141. package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
  142. package/dist/components/effects/AuroraEffect.js +45 -25
  143. package/dist/components/effects/BlackHoleEffect.d.ts +8 -3
  144. package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
  145. package/dist/components/effects/BlackHoleEffect.js +42 -21
  146. package/dist/components/effects/ConstellationEffect.d.ts +8 -3
  147. package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
  148. package/dist/components/effects/ConstellationEffect.js +49 -23
  149. package/dist/components/effects/DandelionSeedsEffect.d.ts +7 -2
  150. package/dist/components/effects/DandelionSeedsEffect.d.ts.map +1 -1
  151. package/dist/components/effects/DandelionSeedsEffect.js +19 -9
  152. package/dist/components/effects/DataStreamEffect.d.ts +8 -3
  153. package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
  154. package/dist/components/effects/DataStreamEffect.js +54 -26
  155. package/dist/components/effects/DnaHelixEffect.d.ts +8 -3
  156. package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
  157. package/dist/components/effects/DnaHelixEffect.js +62 -30
  158. package/dist/components/effects/FallingLeavesEffect.d.ts +7 -2
  159. package/dist/components/effects/FallingLeavesEffect.d.ts.map +1 -1
  160. package/dist/components/effects/FallingLeavesEffect.js +19 -9
  161. package/dist/components/effects/FieldLinesEffect.d.ts +8 -3
  162. package/dist/components/effects/FieldLinesEffect.d.ts.map +1 -1
  163. package/dist/components/effects/FieldLinesEffect.js +30 -20
  164. package/dist/components/effects/Fire.d.ts +8 -3
  165. package/dist/components/effects/Fire.d.ts.map +1 -1
  166. package/dist/components/effects/Fire.js +47 -10
  167. package/dist/components/effects/FireflySwarmEffect.d.ts +7 -2
  168. package/dist/components/effects/FireflySwarmEffect.d.ts.map +1 -1
  169. package/dist/components/effects/FireflySwarmEffect.js +19 -9
  170. package/dist/components/effects/Flares.d.ts +10 -3
  171. package/dist/components/effects/Flares.d.ts.map +1 -1
  172. package/dist/components/effects/Flares.js +53 -56
  173. package/dist/components/effects/ForcefieldEffect.d.ts +8 -3
  174. package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
  175. package/dist/components/effects/ForcefieldEffect.js +52 -33
  176. package/dist/components/effects/GalaxyEffect.d.ts +7 -2
  177. package/dist/components/effects/GalaxyEffect.d.ts.map +1 -1
  178. package/dist/components/effects/GalaxyEffect.js +19 -9
  179. package/dist/components/effects/HarmonicShellEffect.d.ts +8 -3
  180. package/dist/components/effects/HarmonicShellEffect.d.ts.map +1 -1
  181. package/dist/components/effects/HarmonicShellEffect.js +30 -22
  182. package/dist/components/effects/HologramEffect.d.ts +8 -3
  183. package/dist/components/effects/HologramEffect.d.ts.map +1 -1
  184. package/dist/components/effects/HologramEffect.js +52 -23
  185. package/dist/components/effects/IceCrystalsEffect.d.ts +8 -3
  186. package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
  187. package/dist/components/effects/IceCrystalsEffect.js +36 -21
  188. package/dist/components/effects/IceHaloEffect.d.ts +7 -2
  189. package/dist/components/effects/IceHaloEffect.d.ts.map +1 -1
  190. package/dist/components/effects/IceHaloEffect.js +19 -9
  191. package/dist/components/effects/LichtenbergEffect.d.ts +7 -2
  192. package/dist/components/effects/LichtenbergEffect.d.ts.map +1 -1
  193. package/dist/components/effects/LichtenbergEffect.js +19 -9
  194. package/dist/components/effects/LightningEffect.d.ts +8 -3
  195. package/dist/components/effects/LightningEffect.d.ts.map +1 -1
  196. package/dist/components/effects/LightningEffect.js +54 -32
  197. package/dist/components/effects/MoleculesEffect.d.ts +8 -3
  198. package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
  199. package/dist/components/effects/MoleculesEffect.js +31 -21
  200. package/dist/components/effects/MurmurationEffect.d.ts +7 -2
  201. package/dist/components/effects/MurmurationEffect.d.ts.map +1 -1
  202. package/dist/components/effects/MurmurationEffect.js +19 -9
  203. package/dist/components/effects/NeuralNetworkEffect.d.ts +8 -3
  204. package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
  205. package/dist/components/effects/NeuralNetworkEffect.js +66 -33
  206. package/dist/components/effects/OrbEffect.d.ts +8 -3
  207. package/dist/components/effects/OrbEffect.d.ts.map +1 -1
  208. package/dist/components/effects/OrbEffect.js +89 -42
  209. package/dist/components/effects/PlanetaryRingsEffect.d.ts +7 -2
  210. package/dist/components/effects/PlanetaryRingsEffect.d.ts.map +1 -1
  211. package/dist/components/effects/PlanetaryRingsEffect.js +19 -9
  212. package/dist/components/effects/PortalEffect.d.ts +8 -3
  213. package/dist/components/effects/PortalEffect.d.ts.map +1 -1
  214. package/dist/components/effects/PortalEffect.js +41 -25
  215. package/dist/components/effects/ShockwaveEffect.d.ts +7 -2
  216. package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
  217. package/dist/components/effects/ShockwaveEffect.js +19 -9
  218. package/dist/components/effects/SmokePlumeEffect.d.ts +8 -3
  219. package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
  220. package/dist/components/effects/SmokePlumeEffect.js +30 -20
  221. package/dist/components/effects/SmokeRibbon.d.ts +8 -2
  222. package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
  223. package/dist/components/effects/SmokeRibbon.js +34 -24
  224. package/dist/components/effects/SmokeRingEffect.d.ts +8 -3
  225. package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
  226. package/dist/components/effects/SmokeRingEffect.js +33 -21
  227. package/dist/components/effects/StrangeAttractorEffect.d.ts +8 -3
  228. package/dist/components/effects/StrangeAttractorEffect.d.ts.map +1 -1
  229. package/dist/components/effects/StrangeAttractorEffect.js +30 -20
  230. package/dist/components/effects/VolumetricFogEffect.d.ts +8 -3
  231. package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
  232. package/dist/components/effects/VolumetricFogEffect.js +38 -20
  233. package/dist/components/effects/WaterCausticsEffect.d.ts +7 -2
  234. package/dist/components/effects/WaterCausticsEffect.d.ts.map +1 -1
  235. package/dist/components/effects/WaterCausticsEffect.js +19 -9
  236. package/dist/components/effects/index.d.ts +0 -1
  237. package/dist/components/effects/index.d.ts.map +1 -1
  238. package/dist/components/effects/index.js +0 -1
  239. package/dist/components/index.d.ts +0 -1
  240. package/dist/components/index.d.ts.map +1 -1
  241. package/dist/components/index.js +0 -1
  242. package/dist/components/landscape/LandscapeMesh.js +1 -1
  243. package/dist/components/landscape/types.d.ts +1 -1
  244. package/dist/components/landscape/types.d.ts.map +1 -1
  245. package/dist/components/particles/MagneticBottleParticles.d.ts +17 -0
  246. package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -0
  247. package/dist/components/particles/MagneticBottleParticles.js +618 -0
  248. package/dist/components/particles/ShapeBurstParticles.d.ts +17 -0
  249. package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -0
  250. package/dist/components/particles/ShapeBurstParticles.js +588 -0
  251. package/dist/components/particles/ShapeFlowParticles.d.ts +17 -0
  252. package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -0
  253. package/dist/components/particles/ShapeFlowParticles.js +755 -0
  254. package/dist/components/particles/index.d.ts +6 -0
  255. package/dist/components/particles/index.d.ts.map +1 -1
  256. package/dist/components/particles/index.js +3 -0
  257. package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
  258. package/dist/components/terrain/TerrainSurface.js +0 -5
  259. package/dist/components/terrain/types.d.ts +1 -1
  260. package/dist/components/terrain/types.d.ts.map +1 -1
  261. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +1 -1
  262. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
  263. package/dist/components/volumetricClouds/VolumetricCloudsPass.js +0 -6
  264. package/dist/components/volumetricClouds/types.d.ts +1 -1
  265. package/dist/components/volumetricClouds/types.d.ts.map +1 -1
  266. package/dist/components/water/types.d.ts +1 -1
  267. package/dist/components/water/types.d.ts.map +1 -1
  268. package/dist/constants.d.ts +1 -1
  269. package/dist/constants.d.ts.map +1 -1
  270. package/dist/constants.js +1 -1
  271. package/dist/hooks/index.d.ts +2 -2
  272. package/dist/hooks/index.d.ts.map +1 -1
  273. package/dist/hooks/index.js +1 -2
  274. package/dist/hooks/useConfigDriver.d.ts +22 -0
  275. package/dist/hooks/useConfigDriver.d.ts.map +1 -0
  276. package/dist/hooks/useConfigDriver.js +43 -0
  277. package/dist/hooks/useConfigLive.d.ts +1 -1
  278. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  279. package/dist/hooks/useInteraction.d.ts +6 -7
  280. package/dist/hooks/useInteraction.d.ts.map +1 -1
  281. package/dist/hooks/useInteraction.js +87 -268
  282. package/dist/hooks/useLandscapeMaps.d.ts +1 -1
  283. package/dist/hooks/useLandscapeMaps.d.ts.map +1 -1
  284. package/dist/hooks/useObjectAnimation.d.ts.map +1 -1
  285. package/dist/hooks/useObjectAnimation.js +0 -2
  286. package/dist/hooks/useOceanMaterial.d.ts +1 -1
  287. package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
  288. package/dist/hooks/useOceanMaterial.js +0 -5
  289. package/dist/hooks/useRuntimeSettings.d.ts +1 -1
  290. package/dist/hooks/useRuntimeSettings.js +1 -1
  291. package/dist/hooks/useThunder.d.ts +1 -1
  292. package/dist/index.d.ts +6 -4
  293. package/dist/index.d.ts.map +1 -1
  294. package/dist/index.js +4 -2
  295. package/dist/interactions/index.d.ts +4 -0
  296. package/dist/interactions/index.d.ts.map +1 -0
  297. package/dist/interactions/index.js +1 -0
  298. package/dist/interactions/runner.d.ts +24 -0
  299. package/dist/interactions/runner.d.ts.map +1 -0
  300. package/dist/interactions/runner.js +46 -0
  301. package/dist/operations/catalogue/curlSmoke.d.ts +3 -0
  302. package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -0
  303. package/dist/operations/catalogue/curlSmoke.js +178 -0
  304. package/dist/operations/catalogue/displayImage.d.ts +3 -0
  305. package/dist/operations/catalogue/displayImage.d.ts.map +1 -0
  306. package/dist/operations/catalogue/displayImage.js +40 -0
  307. package/dist/operations/catalogue/dissolve.d.ts +3 -0
  308. package/dist/operations/catalogue/dissolve.d.ts.map +1 -0
  309. package/dist/operations/catalogue/dissolve.js +57 -0
  310. package/dist/operations/catalogue/emberAsh.d.ts +3 -0
  311. package/dist/operations/catalogue/emberAsh.d.ts.map +1 -0
  312. package/dist/operations/catalogue/emberAsh.js +171 -0
  313. package/dist/operations/catalogue/fade.d.ts +3 -0
  314. package/dist/operations/catalogue/fade.d.ts.map +1 -0
  315. package/dist/operations/catalogue/fade.js +45 -0
  316. package/dist/operations/catalogue/flip.d.ts +3 -0
  317. package/dist/operations/catalogue/flip.d.ts.map +1 -0
  318. package/dist/operations/catalogue/flip.js +69 -0
  319. package/dist/operations/catalogue/flock.d.ts +3 -0
  320. package/dist/operations/catalogue/flock.d.ts.map +1 -0
  321. package/dist/operations/catalogue/flock.js +163 -0
  322. package/dist/operations/catalogue/focus.d.ts +3 -0
  323. package/dist/operations/catalogue/focus.d.ts.map +1 -0
  324. package/dist/operations/catalogue/focus.js +23 -0
  325. package/dist/operations/catalogue/frame.d.ts +3 -0
  326. package/dist/operations/catalogue/frame.d.ts.map +1 -0
  327. package/dist/operations/catalogue/frame.js +44 -0
  328. package/dist/operations/catalogue/frost.d.ts +3 -0
  329. package/dist/operations/catalogue/frost.d.ts.map +1 -0
  330. package/dist/operations/catalogue/frost.js +111 -0
  331. package/dist/operations/catalogue/fxInstances.d.ts +21 -0
  332. package/dist/operations/catalogue/fxInstances.d.ts.map +1 -0
  333. package/dist/operations/catalogue/fxInstances.js +47 -0
  334. package/dist/operations/catalogue/fxPoints.d.ts +22 -0
  335. package/dist/operations/catalogue/fxPoints.d.ts.map +1 -0
  336. package/dist/operations/catalogue/fxPoints.js +70 -0
  337. package/dist/operations/catalogue/glow.d.ts +3 -0
  338. package/dist/operations/catalogue/glow.d.ts.map +1 -0
  339. package/dist/operations/catalogue/glow.js +50 -0
  340. package/dist/operations/catalogue/heatCracks.d.ts +3 -0
  341. package/dist/operations/catalogue/heatCracks.d.ts.map +1 -0
  342. package/dist/operations/catalogue/heatCracks.js +134 -0
  343. package/dist/operations/catalogue/hologram.d.ts +3 -0
  344. package/dist/operations/catalogue/hologram.d.ts.map +1 -0
  345. package/dist/operations/catalogue/hologram.js +118 -0
  346. package/dist/operations/catalogue/inkBloom.d.ts +3 -0
  347. package/dist/operations/catalogue/inkBloom.d.ts.map +1 -0
  348. package/dist/operations/catalogue/inkBloom.js +156 -0
  349. package/dist/operations/catalogue/ivy.d.ts +13 -0
  350. package/dist/operations/catalogue/ivy.d.ts.map +1 -0
  351. package/dist/operations/catalogue/ivy.js +469 -0
  352. package/dist/operations/catalogue/jelly.d.ts +3 -0
  353. package/dist/operations/catalogue/jelly.d.ts.map +1 -0
  354. package/dist/operations/catalogue/jelly.js +50 -0
  355. package/dist/operations/catalogue/kintsugi.d.ts +3 -0
  356. package/dist/operations/catalogue/kintsugi.d.ts.map +1 -0
  357. package/dist/operations/catalogue/kintsugi.js +173 -0
  358. package/dist/operations/catalogue/lidarScan.d.ts +3 -0
  359. package/dist/operations/catalogue/lidarScan.d.ts.map +1 -0
  360. package/dist/operations/catalogue/lidarScan.js +240 -0
  361. package/dist/operations/catalogue/liquidMetal.d.ts +3 -0
  362. package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -0
  363. package/dist/operations/catalogue/liquidMetal.js +122 -0
  364. package/dist/operations/catalogue/materialFx.d.ts +6 -0
  365. package/dist/operations/catalogue/materialFx.d.ts.map +1 -0
  366. package/dist/operations/catalogue/materialFx.js +13 -0
  367. package/dist/operations/catalogue/metalize.d.ts +3 -0
  368. package/dist/operations/catalogue/metalize.d.ts.map +1 -0
  369. package/dist/operations/catalogue/metalize.js +135 -0
  370. package/dist/operations/catalogue/moveToFront.d.ts +3 -0
  371. package/dist/operations/catalogue/moveToFront.d.ts.map +1 -0
  372. package/dist/operations/catalogue/moveToFront.js +26 -0
  373. package/dist/operations/catalogue/orbit.d.ts +3 -0
  374. package/dist/operations/catalogue/orbit.d.ts.map +1 -0
  375. package/dist/operations/catalogue/orbit.js +29 -0
  376. package/dist/operations/catalogue/particleSwarm.d.ts +3 -0
  377. package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -0
  378. package/dist/operations/catalogue/particleSwarm.js +138 -0
  379. package/dist/operations/catalogue/petalPeel.d.ts +3 -0
  380. package/dist/operations/catalogue/petalPeel.d.ts.map +1 -0
  381. package/dist/operations/catalogue/petalPeel.js +137 -0
  382. package/dist/operations/catalogue/petrify.d.ts +3 -0
  383. package/dist/operations/catalogue/petrify.d.ts.map +1 -0
  384. package/dist/operations/catalogue/petrify.js +94 -0
  385. package/dist/operations/catalogue/portal.d.ts +3 -0
  386. package/dist/operations/catalogue/portal.d.ts.map +1 -0
  387. package/dist/operations/catalogue/portal.js +224 -0
  388. package/dist/operations/catalogue/print3d.d.ts +3 -0
  389. package/dist/operations/catalogue/print3d.d.ts.map +1 -0
  390. package/dist/operations/catalogue/print3d.js +275 -0
  391. package/dist/operations/catalogue/rainBeads.d.ts +3 -0
  392. package/dist/operations/catalogue/rainBeads.d.ts.map +1 -0
  393. package/dist/operations/catalogue/rainBeads.js +223 -0
  394. package/dist/operations/catalogue/restPose.d.ts +21 -0
  395. package/dist/operations/catalogue/restPose.d.ts.map +1 -0
  396. package/dist/operations/catalogue/restPose.js +55 -0
  397. package/dist/operations/catalogue/rimLight.d.ts +3 -0
  398. package/dist/operations/catalogue/rimLight.d.ts.map +1 -0
  399. package/dist/operations/catalogue/rimLight.js +72 -0
  400. package/dist/operations/catalogue/sandErosion.d.ts +3 -0
  401. package/dist/operations/catalogue/sandErosion.d.ts.map +1 -0
  402. package/dist/operations/catalogue/sandErosion.js +167 -0
  403. package/dist/operations/catalogue/shaderLayers.d.ts +74 -0
  404. package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -0
  405. package/dist/operations/catalogue/shaderLayers.js +322 -0
  406. package/dist/operations/catalogue/shatter.d.ts +3 -0
  407. package/dist/operations/catalogue/shatter.d.ts.map +1 -0
  408. package/dist/operations/catalogue/shatter.js +267 -0
  409. package/dist/operations/catalogue/silkDrape.d.ts +3 -0
  410. package/dist/operations/catalogue/silkDrape.d.ts.map +1 -0
  411. package/dist/operations/catalogue/silkDrape.js +340 -0
  412. package/dist/operations/catalogue/spin.d.ts +3 -0
  413. package/dist/operations/catalogue/spin.d.ts.map +1 -0
  414. package/dist/operations/catalogue/spin.js +42 -0
  415. package/dist/operations/catalogue/surfaceSample.d.ts +17 -0
  416. package/dist/operations/catalogue/surfaceSample.d.ts.map +1 -0
  417. package/dist/operations/catalogue/surfaceSample.js +187 -0
  418. package/dist/operations/catalogue/swirl.d.ts +3 -0
  419. package/dist/operations/catalogue/swirl.d.ts.map +1 -0
  420. package/dist/operations/catalogue/swirl.js +69 -0
  421. package/dist/operations/catalogue/teleport.d.ts +3 -0
  422. package/dist/operations/catalogue/teleport.d.ts.map +1 -0
  423. package/dist/operations/catalogue/teleport.js +213 -0
  424. package/dist/operations/catalogue/transitionField.d.ts +124 -0
  425. package/dist/operations/catalogue/transitionField.d.ts.map +1 -0
  426. package/dist/operations/catalogue/transitionField.js +278 -0
  427. package/dist/operations/catalogue/unweave.d.ts +3 -0
  428. package/dist/operations/catalogue/unweave.d.ts.map +1 -0
  429. package/dist/operations/catalogue/unweave.js +233 -0
  430. package/dist/operations/catalogue/visibility.d.ts +3 -0
  431. package/dist/operations/catalogue/visibility.d.ts.map +1 -0
  432. package/dist/operations/catalogue/visibility.js +25 -0
  433. package/dist/operations/catalogue/voxelize.d.ts +3 -0
  434. package/dist/operations/catalogue/voxelize.d.ts.map +1 -0
  435. package/dist/operations/catalogue/voxelize.js +148 -0
  436. package/dist/operations/catalogue/warmup.d.ts +22 -0
  437. package/dist/operations/catalogue/warmup.d.ts.map +1 -0
  438. package/dist/operations/catalogue/warmup.js +106 -0
  439. package/dist/operations/catalogue/zoom.d.ts +3 -0
  440. package/dist/operations/catalogue/zoom.d.ts.map +1 -0
  441. package/dist/operations/catalogue/zoom.js +33 -0
  442. package/dist/operations/index.d.ts +7 -0
  443. package/dist/operations/index.d.ts.map +1 -0
  444. package/dist/operations/index.js +6 -0
  445. package/dist/operations/objectEffects.d.ts +46 -0
  446. package/dist/operations/objectEffects.d.ts.map +1 -0
  447. package/dist/operations/objectEffects.js +136 -0
  448. package/dist/operations/registry.d.ts +16 -0
  449. package/dist/operations/registry.d.ts.map +1 -0
  450. package/dist/operations/registry.js +63 -0
  451. package/dist/operations/runtime.d.ts +60 -0
  452. package/dist/operations/runtime.d.ts.map +1 -0
  453. package/dist/operations/runtime.js +317 -0
  454. package/dist/operations/types.d.ts +122 -0
  455. package/dist/operations/types.d.ts.map +1 -0
  456. package/dist/operations/types.js +9 -0
  457. package/dist/operations/useObjectEffectLayers.d.ts +4 -0
  458. package/dist/operations/useObjectEffectLayers.d.ts.map +1 -0
  459. package/dist/operations/useObjectEffectLayers.js +42 -0
  460. package/dist/operations/useOperationsRuntime.d.ts +3 -0
  461. package/dist/operations/useOperationsRuntime.d.ts.map +1 -0
  462. package/dist/operations/useOperationsRuntime.js +69 -0
  463. package/dist/presets/landscapePresets.d.ts +1 -1
  464. package/dist/presets/landscapePresets.d.ts.map +1 -1
  465. package/dist/presets/landscapePresets.js +1 -1
  466. package/dist/presets/landscapeTypes.d.ts +1 -1
  467. package/dist/presets/landscapeTypes.d.ts.map +1 -1
  468. package/dist/presets/landscapeTypes.js +1 -1
  469. package/dist/presets/oceanSurfacePresets.d.ts +1 -1
  470. package/dist/presets/terrainPresets.d.ts +1 -1
  471. package/dist/presets/terrainPresets.d.ts.map +1 -1
  472. package/dist/presets/volumetricCloudPresets.d.ts +1 -1
  473. package/dist/types/cloudConfigs.d.ts +2 -309
  474. package/dist/types/cloudConfigs.d.ts.map +1 -1
  475. package/dist/types/cloudConfigs.js +2 -339
  476. package/dist/types/index.d.ts +8 -8
  477. package/dist/types/index.d.ts.map +1 -1
  478. package/dist/types/index.js +4 -4
  479. package/dist/types/landscapeConfigs.d.ts +2 -217
  480. package/dist/types/landscapeConfigs.d.ts.map +1 -1
  481. package/dist/types/landscapeConfigs.js +2 -256
  482. package/dist/types/oceanConfigs.d.ts +2 -289
  483. package/dist/types/oceanConfigs.d.ts.map +1 -1
  484. package/dist/types/oceanConfigs.js +2 -380
  485. package/dist/types/terrainConfigs.d.ts +2 -250
  486. package/dist/types/terrainConfigs.d.ts.map +1 -1
  487. package/dist/types/terrainConfigs.js +2 -292
  488. package/dist/utils/cloudUniforms.d.ts +1 -1
  489. package/dist/utils/configAnimations.d.ts +6 -0
  490. package/dist/utils/configAnimations.d.ts.map +1 -1
  491. package/dist/utils/configAnimations.js +14 -0
  492. package/dist/utils/gridConfig.d.ts +19 -0
  493. package/dist/utils/gridConfig.d.ts.map +1 -0
  494. package/dist/utils/gridConfig.js +52 -0
  495. package/dist/utils/handleCloudsAnimations.d.ts +1 -1
  496. package/dist/utils/handleCloudsAnimations.js +1 -1
  497. package/dist/utils/hasHoverAnimation.d.ts.map +1 -1
  498. package/dist/utils/hasHoverAnimation.js +0 -2
  499. package/dist/utils/landscapeUniforms.d.ts +1 -1
  500. package/dist/utils/landscapeUniforms.d.ts.map +1 -1
  501. package/dist/utils/oceanUniforms.d.ts +1 -1
  502. package/dist/utils/particleShape.d.ts +33 -0
  503. package/dist/utils/particleShape.d.ts.map +1 -0
  504. package/dist/utils/particleShape.js +207 -0
  505. package/dist/utils/particleTrails.d.ts.map +1 -1
  506. package/dist/utils/particleTrails.js +29 -14
  507. package/dist/utils/terrainUniforms.d.ts +1 -1
  508. package/dist/utils/terrainUniforms.d.ts.map +1 -1
  509. package/package.json +2 -2
@@ -0,0 +1,469 @@
1
+ // Ivy — vines grow over the object. The growth is space colonisation (the
2
+ // branching algorithm used for trees and leaf veins): surface samples are the
3
+ // attractors, each vine tip steps towards the attractors nearest to it and
4
+ // consumes them, and every new node is snapped back onto the surface, so the
5
+ // vines creep over the object's real shape, branching where there is room.
6
+ // Stems are lit tubes that thicken towards the root (pipe model); ivy leaves
7
+ // (five-lobed, cupped, veined) unfurl from folded as the tip passes, and sway
8
+ // gently while it holds. A state, not an exit: reverting withers the ivy — the
9
+ // leaves brown, droop and fall away, and the vines draw back to their roots.
10
+ import { gsap } from 'gsap';
11
+ import { BufferAttribute, BufferGeometry, Color, Matrix4, Mesh, MeshStandardMaterial, Shape, ShapeGeometry, SplineCurve, Vector2, Vector3, } from 'three';
12
+ import { defineOperation } from '../types.js';
13
+ import { GLSL_ROT, addLayer } from './shaderLayers.js';
14
+ import { createFieldState, fieldUniforms, runProgress } from './transitionField.js';
15
+ import { mulberry32, sampleSurfaceCached } from './surfaceSample.js';
16
+ import { createFxInstances, disposeFxInstances } from './fxInstances.js';
17
+ import { hideUntilWarm } from './warmup.js';
18
+ const P = 'Ivy';
19
+ const STATE = '__opIvy';
20
+ /** Growth runs over progress 0..GROW; the last leaves unfurl by 1. */
21
+ const GROW = 0.8;
22
+ const UNFURL = 0.14;
23
+ class Grid {
24
+ size;
25
+ cells = new Map();
26
+ constructor(size) {
27
+ this.size = size;
28
+ }
29
+ k(x, y, z) { return `${Math.floor(x / this.size)},${Math.floor(y / this.size)},${Math.floor(z / this.size)}`; }
30
+ add(i, x, y, z) { const k = this.k(x, y, z); const c = this.cells.get(k); if (c)
31
+ c.push(i);
32
+ else
33
+ this.cells.set(k, [i]); }
34
+ near(x, y, z, fn) {
35
+ const cx = Math.floor(x / this.size), cy = Math.floor(y / this.size), cz = Math.floor(z / this.size);
36
+ for (let a = -1; a <= 1; a++)
37
+ for (let b = -1; b <= 1; b++)
38
+ for (let c = -1; c <= 1; c++) {
39
+ const l = this.cells.get(`${cx + a},${cy + b},${cz + c}`);
40
+ if (l)
41
+ for (const i of l)
42
+ fn(i);
43
+ }
44
+ }
45
+ }
46
+ export function grow(sample, extent, attractors, from, seed) {
47
+ const rnd = mulberry32(seed);
48
+ const E = extent, D = 0.02 * E, DI = 0.11 * E, DK = 0.036 * E, OFF = 0.006 * E;
49
+ const S = sample.position, SN = sample.normal, N = sample.count;
50
+ const snapGrid = new Grid(0.05 * E);
51
+ for (let i = 0; i < N; i++)
52
+ snapGrid.add(i, S[i * 3], S[i * 3 + 1], S[i * 3 + 2]);
53
+ const A = Math.min(N, attractors);
54
+ // samples come mesh by mesh: take a random subset so every part of the object attracts
55
+ const AI = new Int32Array(N).map((_, i) => i);
56
+ for (let i = N - 1; i > 0; i--) {
57
+ const j = Math.floor(rnd() * (i + 1));
58
+ const t = AI[i];
59
+ AI[i] = AI[j];
60
+ AI[j] = t;
61
+ }
62
+ const alive = new Uint8Array(A).fill(1);
63
+ // each attractor remembers its nearest node within reach; only new nodes can change that
64
+ const nearest = new Int32Array(A).fill(-1);
65
+ const nearD = new Float32Array(A).fill(Infinity);
66
+ const attGrid = new Grid(DI);
67
+ for (let i = 0; i < A; i++)
68
+ attGrid.add(i, S[AI[i] * 3], S[AI[i] * 3 + 1], S[AI[i] * 3 + 2]);
69
+ const g = { pos: [], nrm: [], parent: [], birth: [], desc: [], count: 0 };
70
+ const len = [];
71
+ const addNode = (p, n, parent, l) => {
72
+ const i = g.count++;
73
+ g.pos.push(p.x, p.y, p.z);
74
+ g.nrm.push(n.x, n.y, n.z);
75
+ g.parent.push(parent);
76
+ len.push(l);
77
+ attGrid.near(p.x, p.y, p.z, (a) => {
78
+ if (!alive[a])
79
+ return;
80
+ const s = AI[a];
81
+ const d = (S[s * 3] - p.x) ** 2 + (S[s * 3 + 1] - p.y) ** 2 + (S[s * 3 + 2] - p.z) ** 2;
82
+ if (d < DK * DK) {
83
+ alive[a] = 0;
84
+ nearest[a] = -1;
85
+ return;
86
+ }
87
+ if (d >= DI * DI || d >= nearD[a])
88
+ return;
89
+ // only along the surface: never through the volume to the far side of a wall or tube
90
+ if (SN[s * 3] * n.x + SN[s * 3 + 1] * n.y + SN[s * 3 + 2] * n.z < 0.3)
91
+ return;
92
+ const dl = Math.sqrt(d) || 1;
93
+ if (Math.abs(((S[s * 3] - p.x) * n.x + (S[s * 3 + 1] - p.y) * n.y + (S[s * 3 + 2] - p.z) * n.z) / dl) > 0.6)
94
+ return;
95
+ nearD[a] = d;
96
+ nearest[a] = i;
97
+ });
98
+ return i;
99
+ };
100
+ const snap = (p, n) => {
101
+ let best = -1, bd = Infinity;
102
+ snapGrid.near(p.x, p.y, p.z, (i) => {
103
+ const d = (S[i * 3] - p.x) ** 2 + (S[i * 3 + 1] - p.y) ** 2 + (S[i * 3 + 2] - p.z) ** 2;
104
+ if (d < bd) {
105
+ bd = d;
106
+ best = i;
107
+ }
108
+ });
109
+ if (best < 0)
110
+ return false;
111
+ const s = new Vector3(S[best * 3], S[best * 3 + 1], S[best * 3 + 2]);
112
+ n.set(SN[best * 3], SN[best * 3 + 1], SN[best * 3 + 2]);
113
+ const d = p.clone().sub(s);
114
+ p.copy(s).add(d.sub(n.clone().multiplyScalar(d.dot(n)))).addScaledVector(n, OFF);
115
+ return true;
116
+ };
117
+ // roots: spread apart among the lowest (or highest, or any) samples
118
+ let minY = Infinity, maxY = -Infinity;
119
+ for (let i = 0; i < N; i++) {
120
+ minY = Math.min(minY, S[i * 3 + 1]);
121
+ maxY = Math.max(maxY, S[i * 3 + 1]);
122
+ }
123
+ const band = (maxY - minY) * 0.08;
124
+ const cand = [];
125
+ for (let i = 0; i < N; i++) {
126
+ const y = S[i * 3 + 1];
127
+ if (SN[i * 3 + 1] > -0.3 && (from === 'up' ? y < minY + band : from === 'down' ? y > maxY - band : rnd() < 0.02))
128
+ cand.push(i);
129
+ }
130
+ const roots = [];
131
+ const want = from === 'noise' ? 6 : 4;
132
+ if (cand.length)
133
+ roots.push(cand[Math.floor(rnd() * cand.length)]);
134
+ while (roots.length < want && roots.length < cand.length) {
135
+ let bi = -1, bd = -1;
136
+ for (const c of cand) {
137
+ let dm = Infinity;
138
+ for (const r of roots)
139
+ dm = Math.min(dm, (S[c * 3] - S[r * 3]) ** 2 + (S[c * 3 + 1] - S[r * 3 + 1]) ** 2 + (S[c * 3 + 2] - S[r * 3 + 2]) ** 2);
140
+ if (dm > bd) {
141
+ bd = dm;
142
+ bi = c;
143
+ }
144
+ }
145
+ roots.push(bi);
146
+ }
147
+ for (const r of roots)
148
+ addNode(new Vector3(S[r * 3], S[r * 3 + 1], S[r * 3 + 2]).addScaledVector(new Vector3(SN[r * 3], SN[r * 3 + 1], SN[r * 3 + 2]), OFF), new Vector3(SN[r * 3], SN[r * 3 + 1], SN[r * 3 + 2]), -1, 0);
149
+ const trop = from === 'up' ? 0.25 : from === 'down' ? -0.35 : 0;
150
+ const MAX = 4200;
151
+ // a node never grows two children the same way (the classic stuck-node repeat)
152
+ const childDirs = new Map();
153
+ for (let it = 0; it < 500 && g.count < MAX; it++) {
154
+ const pull = new Map();
155
+ for (let a = 0; a < A; a++) {
156
+ const bn = nearest[a];
157
+ if (bn < 0 || !alive[a])
158
+ continue;
159
+ const sa = AI[a];
160
+ const v = new Vector3(S[sa * 3] - g.pos[bn * 3], S[sa * 3 + 1] - g.pos[bn * 3 + 1], S[sa * 3 + 2] - g.pos[bn * 3 + 2]).normalize();
161
+ const acc = pull.get(bn);
162
+ if (acc)
163
+ acc.add(v);
164
+ else
165
+ pull.set(bn, v);
166
+ }
167
+ if (!pull.size)
168
+ break;
169
+ let grew = 0;
170
+ for (const [i, v] of pull) {
171
+ if (g.count >= MAX)
172
+ break;
173
+ const n = new Vector3(g.nrm[i * 3], g.nrm[i * 3 + 1], g.nrm[i * 3 + 2]);
174
+ const d = v.normalize().add(new Vector3(0, trop, 0)).add(new Vector3(rnd() - 0.5, rnd() - 0.5, rnd() - 0.5).multiplyScalar(0.3));
175
+ d.sub(n.clone().multiplyScalar(d.dot(n)));
176
+ if (d.lengthSq() < 1e-8)
177
+ continue;
178
+ d.normalize();
179
+ const dirs = childDirs.get(i) ?? [];
180
+ if (dirs.length >= 3 || dirs.some(c => c.dot(d) > 0.94))
181
+ continue;
182
+ dirs.push(d.clone());
183
+ childDirs.set(i, dirs);
184
+ const p = new Vector3(g.pos[i * 3], g.pos[i * 3 + 1], g.pos[i * 3 + 2]).addScaledVector(d.normalize(), D);
185
+ const nn = new Vector3();
186
+ if (!snap(p, nn))
187
+ continue;
188
+ // a snap that jumps a gap (onto another part) would draw a vine through the air
189
+ const step = Math.hypot(p.x - g.pos[i * 3], p.y - g.pos[i * 3 + 1], p.z - g.pos[i * 3 + 2]);
190
+ if (step > D * 1.8 || nn.dot(n) < 0.2)
191
+ continue;
192
+ addNode(p, nn, i, len[i] + D);
193
+ grew++;
194
+ }
195
+ if (!grew)
196
+ break;
197
+ }
198
+ let maxLen = 1e-6;
199
+ for (const l of len)
200
+ maxLen = Math.max(maxLen, l);
201
+ g.birth = len.map(l => (l / maxLen) * GROW);
202
+ g.desc = new Array(g.count).fill(0);
203
+ for (let i = g.count - 1; i >= 0; i--)
204
+ if (g.parent[i] >= 0)
205
+ g.desc[g.parent[i]] += g.desc[i] + 1;
206
+ return g;
207
+ }
208
+ const growthCache = new WeakMap();
209
+ // ---------------------------------------------------------------- geometry
210
+ const SIDES = 6;
211
+ function stemGeometry(g, E) {
212
+ // short side stubs carry a leaf but no vine (ivy runs in long vines, not twigs)
213
+ const kids = new Array(g.count).fill(0);
214
+ for (const p of g.parent)
215
+ if (p >= 0)
216
+ kids[p]++;
217
+ const stub = new Uint8Array(g.count);
218
+ const segs = [];
219
+ for (let i = 0; i < g.count; i++) {
220
+ const p = g.parent[i];
221
+ if (p < 0)
222
+ continue;
223
+ stub[i] = stub[p] || (g.desc[i] < 3 && kids[p] > 1) ? 1 : 0; // parents come first
224
+ if (!stub[i])
225
+ segs.push(i);
226
+ }
227
+ const vc = segs.length * 2 * SIDES;
228
+ const pos = new Float32Array(vc * 3), nrm = new Float32Array(vc * 3), ctr = new Float32Array(vc * 3), from = new Float32Array(vc * 3);
229
+ const rad = new Float32Array(vc * 3), bir = new Float32Array(vc * 2);
230
+ const idx = [];
231
+ const radius = (i) => Math.min(E * 0.0015 * Math.pow(1 + g.desc[i], 0.33), E * 0.0075);
232
+ const a = new Vector3(), b = new Vector3(), t = new Vector3(), n = new Vector3(), u = new Vector3(), w = new Vector3(), o = new Vector3();
233
+ let v = 0;
234
+ segs.forEach((c, si) => {
235
+ const pi = g.parent[c];
236
+ a.set(g.pos[pi * 3], g.pos[pi * 3 + 1], g.pos[pi * 3 + 2]);
237
+ b.set(g.pos[c * 3], g.pos[c * 3 + 1], g.pos[c * 3 + 2]);
238
+ t.subVectors(b, a).normalize();
239
+ n.set(g.nrm[c * 3], g.nrm[c * 3 + 1], g.nrm[c * 3 + 2]);
240
+ u.crossVectors(t, n);
241
+ if (u.lengthSq() < 1e-8)
242
+ u.set(1, 0, 0).cross(t);
243
+ u.normalize();
244
+ w.crossVectors(u, t).normalize();
245
+ for (let end = 0; end < 2; end++) {
246
+ const node = end ? c : pi;
247
+ const r = radius(node);
248
+ const cen = end ? b : a;
249
+ for (let k = 0; k < SIDES; k++) {
250
+ const ang = (k / SIDES) * Math.PI * 2;
251
+ o.copy(u).multiplyScalar(Math.cos(ang)).addScaledVector(w, Math.sin(ang));
252
+ pos.set([cen.x + o.x * r, cen.y + o.y * r, cen.z + o.z * r], v * 3);
253
+ nrm.set([o.x, o.y, o.z], v * 3);
254
+ ctr.set([cen.x, cen.y, cen.z], v * 3);
255
+ from.set([a.x, a.y, a.z], v * 3);
256
+ rad.set([o.x * r, o.y * r, o.z * r], v * 3);
257
+ bir.set([g.birth[pi], g.birth[c]], v * 2);
258
+ v++;
259
+ }
260
+ }
261
+ const base = si * 2 * SIDES;
262
+ for (let k = 0; k < SIDES; k++) {
263
+ const k2 = (k + 1) % SIDES;
264
+ idx.push(base + k, base + k2, base + SIDES + k, base + k2, base + SIDES + k2, base + SIDES + k);
265
+ }
266
+ });
267
+ const geo = new BufferGeometry();
268
+ geo.setAttribute('position', new BufferAttribute(pos, 3));
269
+ geo.setAttribute('normal', new BufferAttribute(nrm, 3));
270
+ geo.setAttribute('aIvyCtr', new BufferAttribute(ctr, 3));
271
+ geo.setAttribute('aIvyFrom', new BufferAttribute(from, 3));
272
+ geo.setAttribute('aIvyRad', new BufferAttribute(rad, 3));
273
+ geo.setAttribute('aIvyB', new BufferAttribute(bir, 2));
274
+ geo.setIndex(idx);
275
+ return geo;
276
+ }
277
+ /** A five-lobed ivy leaf in the XY plane, petiole at the origin, blade along +Y (length 1). */
278
+ function leafGeometry() {
279
+ const lobes = [
280
+ [180, 0.14], [150, 0.52], [124, 0.5], [98, 0.72], [72, 0.6], [44, 0.84], [22, 0.76], [0, 1.0],
281
+ ];
282
+ const pts = [];
283
+ const add = (deg, r) => { const a = (deg * Math.PI) / 180; pts.push(new Vector2(Math.sin(a) * r * 0.55, 0.42 + Math.cos(a) * r * 0.58)); };
284
+ for (const [d, r] of lobes)
285
+ add(d, r);
286
+ for (let i = lobes.length - 2; i >= 1; i--)
287
+ add(-lobes[i][0], lobes[i][1]);
288
+ add(-180, 0.12);
289
+ const curve = new SplineCurve(pts);
290
+ const shape = new Shape(curve.getPoints(44));
291
+ const geo = new ShapeGeometry(shape, 1);
292
+ geo.translate(0, -0.05, 0);
293
+ geo.computeVertexNormals();
294
+ return geo;
295
+ }
296
+ // ---------------------------------------------------------------- the operation
297
+ export default defineOperation({
298
+ value: 'ivy',
299
+ label: 'Ivy',
300
+ description: 'Grow ivy over the targets — vines creep along the surface and leaves unfurl; reverting withers it away',
301
+ channel: 'visual',
302
+ multi: true,
303
+ toggles: true,
304
+ usableIn: ['interaction', 'action', 'object'],
305
+ params: {
306
+ from: { type: 'select', label: 'Grows from', default: 'up', options: [{ value: 'up', label: 'The base' }, { value: 'down', label: 'The top' }, { value: 'noise', label: 'Scattered roots' }] },
307
+ coverage: { type: 'number', label: 'Coverage', default: 0.55, min: 0.05, max: 1, step: 0.01 },
308
+ leafSize: { type: 'number', label: 'Leaf size', default: 1, min: 0.3, max: 3, step: 0.05, unit: '×' },
309
+ leaves: { type: 'number', label: 'Leaves', default: 0.6, min: 0, max: 1, step: 0.01, hint: 'Share of the nodes that carry a leaf' },
310
+ leafColor: { type: 'color', label: 'Leaves', default: '#2f5a1f' },
311
+ stemColor: { type: 'color', label: 'Vines', default: '#4a3a24' },
312
+ duration: { type: 'number', label: 'Duration', default: 5, min: 0.3, max: 20, step: 0.1, unit: 's' },
313
+ },
314
+ apply(target, p) {
315
+ const key = `${p.from}|${p.coverage}|${p.leafSize}|${p.leaves}`;
316
+ let st = target.userData[STATE];
317
+ let keep;
318
+ if (st && st.key !== key) {
319
+ // the shape of the growth changed (object-effect edit): rebuild on the same field (same progress, same clock)
320
+ disposeIvy(st);
321
+ keep = st.field;
322
+ delete target.userData[STATE];
323
+ st = undefined;
324
+ }
325
+ if (!st) {
326
+ const field = keep ?? createFieldState(target);
327
+ const E = field.extent.value;
328
+ const sample = sampleSurfaceCached(target, 9000, 61);
329
+ const cached = growthCache.get(target);
330
+ const gkey = `${p.from}|${p.coverage}|${sample.count}|${E.toFixed(4)}`;
331
+ const g = cached?.key === gkey ? cached.g : grow(sample, E, Math.round(500 + Number(p.coverage) * 3500), String(p.from), 71);
332
+ growthCache.set(target, { key: gkey, g });
333
+ const own = {
334
+ field, key, leaf: { value: new Color() }, stem: { value: new Color() }, wither: { value: 0 }, sway: { value: 1 },
335
+ };
336
+ // stems
337
+ const stemMat = new MeshStandardMaterial({ roughness: 0.75, metalness: 0 });
338
+ addLayer(stemMat, 'ivyStem', {
339
+ uniforms: { ...fieldUniforms(P, field), uIvyStem: own.stem, uIvyWither: own.wither },
340
+ common: 'varying float vIvyYoung;',
341
+ vertexPars: 'attribute vec3 aIvyCtr; attribute vec3 aIvyFrom; attribute vec3 aIvyRad; attribute vec2 aIvyB;',
342
+ vertex: /* glsl */ `
343
+ {
344
+ float pr = uIvyProgress;
345
+ float gr = clamp((pr - aIvyB.x) / max(aIvyB.y - aIvyB.x, 1e-5), 0.0, 1.0);
346
+ float thick = pr <= aIvyB.x ? 0.0 : (0.35 + 0.65 * smoothstep(aIvyB.x, aIvyB.x + 0.25, pr));
347
+ transformed = mix(aIvyFrom, aIvyCtr, gr) + aIvyRad * thick;
348
+ vIvyYoung = 1.0 - smoothstep(0.0, 0.3, pr - aIvyB.y);
349
+ }`,
350
+ // fresh growth is green, older vine woody
351
+ diffuse: `diffuseColor.rgb = mix(mix(uIvyStem, vec3(0.2, 0.3, 0.08), vIvyYoung * 0.8), uIvyStem * vec3(0.7, 0.6, 0.5), uIvyWither);`,
352
+ }, { immediate: true });
353
+ own.stems = new Mesh(stemGeometry(g, E), stemMat);
354
+ own.stems.castShadow = true;
355
+ own.stems.receiveShadow = true;
356
+ own.stems.frustumCulled = false;
357
+ own.stems.userData.__opFxHelper = true;
358
+ own.stems.raycast = () => { };
359
+ target.add(own.stems);
360
+ hideUntilWarm(own.stems);
361
+ // leaves: on a share of the nodes, oriented along the growth, lifted off the surface
362
+ const rnd = mulberry32(83);
363
+ const picks = [];
364
+ for (let i = 0; i < g.count; i++)
365
+ if (g.parent[i] >= 0 && rnd() < Number(p.leaves))
366
+ picks.push(i);
367
+ const count = Math.max(1, picks.length);
368
+ const positions = new Float32Array(count * 3), colors = new Float32Array(count * 3), births = new Float32Array(count), rands = new Float32Array(count * 4);
369
+ const mats = [];
370
+ const t = new Vector3(), n = new Vector3(), x = new Vector3(), y = new Vector3(), z = new Vector3(), side = new Vector3();
371
+ picks.forEach((i, k) => {
372
+ const pi = g.parent[i];
373
+ t.set(g.pos[i * 3] - g.pos[pi * 3], g.pos[i * 3 + 1] - g.pos[pi * 3 + 1], g.pos[i * 3 + 2] - g.pos[pi * 3 + 2]).normalize();
374
+ n.set(g.nrm[i * 3], g.nrm[i * 3 + 1], g.nrm[i * 3 + 2]);
375
+ side.crossVectors(n, t);
376
+ const th = (rnd() - 0.5) * 2.4;
377
+ y.copy(t).multiplyScalar(Math.cos(th)).addScaledVector(side, Math.sin(th)).addScaledVector(n, 0.55 + 0.4 * rnd()).normalize();
378
+ x.crossVectors(y, n).normalize();
379
+ z.crossVectors(x, y).normalize();
380
+ const young = 1 - g.birth[i] / GROW;
381
+ const s = E * 0.052 * Number(p.leafSize) * (0.55 + 0.5 * rnd()) * (0.75 + 0.4 * young);
382
+ const m = new Matrix4().makeBasis(x.multiplyScalar(s), y.multiplyScalar(s), z.multiplyScalar(s));
383
+ m.setPosition(g.pos[i * 3] + n.x * E * 0.004, g.pos[i * 3 + 1] + n.y * E * 0.004, g.pos[i * 3 + 2] + n.z * E * 0.004);
384
+ mats.push(m);
385
+ positions.set([g.pos[i * 3], g.pos[i * 3 + 1], g.pos[i * 3 + 2]], k * 3);
386
+ const v = 0.75 + 0.45 * rnd();
387
+ colors.set([v * (0.9 + 0.2 * rnd()), v, v * (0.85 + 0.2 * rnd())], k * 3);
388
+ births[k] = g.birth[i] + 0.02;
389
+ rands.set([rnd(), rnd(), rnd(), rnd()], k * 4);
390
+ });
391
+ own.leaves = createFxInstances(target, {
392
+ geometry: leafGeometry(), count, positions, colors,
393
+ attributes: { aIvyLB: [births, 1], aIvyLR: [rands, 4] },
394
+ layerKey: 'ivyLeaves', roughness: 0.42, metalness: 0, doubleSided: true,
395
+ layer: {
396
+ uniforms: { ...fieldUniforms(P, field), uIvyLeaf: own.leaf, uIvyWither: own.wither, uIvySway: own.sway },
397
+ common: `varying vec2 vIvyUv;\nvarying float vIvyAge;\n${GLSL_ROT}`,
398
+ vertexPars: /* glsl */ `
399
+ attribute float aIvyLB; attribute vec4 aIvyLR;
400
+ mat3 ivyPose(vec3 p) {
401
+ float g = smoothstep(aIvyLB, aIvyLB + ${UNFURL.toFixed(2)}, uIvyProgress);
402
+ // unfurl: the halves open about the midrib, the blade lifts from the stem
403
+ float fold = (1.0 - g) * 1.25 * sign(p.x);
404
+ float sway = uIvySway * (sin(uIvyTime * (1.1 + aIvyLR.x) + aIvyLR.y * 6.28) * 0.07 + sin(uIvyTime * 2.7 + aIvyLR.z * 6.28) * 0.03);
405
+ float droop = uIvyWither * (0.6 + 0.6 * aIvyLR.w);
406
+ return fxRot(vec3(1.0, 0.0, 0.0), (1.0 - g) * 0.9 + sway + droop) * fxRot(vec3(0.0, 1.0, 0.0), fold);
407
+ }`,
408
+ normal: `objectNormal = ivyPose(position) * objectNormal;`,
409
+ vertex: /* glsl */ `
410
+ {
411
+ vIvyUv = position.xy;
412
+ float g = smoothstep(aIvyLB, aIvyLB + ${UNFURL.toFixed(2)}, uIvyProgress);
413
+ vIvyAge = g;
414
+ vec3 p = transformed;
415
+ p.z += 0.09 * p.x * p.x - 0.04 * p.y; // cupped across the midrib
416
+ transformed = ivyPose(position) * p * g;
417
+ }`,
418
+ diffuse: /* glsl */ `
419
+ {
420
+ // veins: a pale midrib and lateral veins running out to the lobes
421
+ vec2 u = vIvyUv;
422
+ float mid = 1.0 - smoothstep(0.0, 0.018, abs(u.x)) ;
423
+ float ang = atan(u.x, u.y - 0.05);
424
+ float lat = 1.0 - smoothstep(0.0, 0.05, abs(fract(ang / 0.62 + 0.5) - 0.5) * length(u));
425
+ float vein = max(mid * step(0.0, u.y), lat * 0.6) * smoothstep(0.02, 0.2, length(u - vec2(0.0, 0.05)));
426
+ vec3 leaf = uIvyLeaf * diffuseColor.rgb; // instance colour carries the variation
427
+ leaf = mix(leaf, leaf * 1.7 + vec3(0.05, 0.06, 0.02), vein * 0.55);
428
+ // young leaves are lighter and fresher
429
+ leaf = mix(leaf * vec3(1.25, 1.35, 1.0), leaf, vIvyAge);
430
+ vec3 dry = mix(vec3(0.13, 0.08, 0.035), vec3(0.24, 0.15, 0.06), diffuseColor.g);
431
+ diffuseColor.rgb = mix(leaf, dry, uIvyWither);
432
+ }`,
433
+ },
434
+ });
435
+ mats.forEach((m, k) => own.leaves.setMatrixAt(k, m));
436
+ own.leaves.instanceMatrix.needsUpdate = true;
437
+ st = own;
438
+ target.userData[STATE] = st;
439
+ }
440
+ const s = st;
441
+ s.leaf.value.set(String(p.leafColor));
442
+ s.stem.value.set(String(p.stemColor));
443
+ gsap.killTweensOf(s.wither);
444
+ s.wither.value = 0;
445
+ return runProgress(target, s.field, 1, { duration: Number(p.duration), ease: 'power1.inOut', hold: true });
446
+ },
447
+ revert(target, p) {
448
+ const s = target.userData[STATE];
449
+ if (!s)
450
+ return;
451
+ const d = Number(p.duration);
452
+ gsap.killTweensOf(s.wither);
453
+ if (d > 0)
454
+ gsap.to(s.wither, { value: 1, duration: d * 0.35, ease: 'power1.out' });
455
+ else
456
+ s.wither.value = 1;
457
+ return runProgress(target, s.field, 0, {
458
+ duration: d, ease: 'power1.in',
459
+ onComplete: () => { disposeIvy(s); delete target.userData[STATE]; },
460
+ });
461
+ },
462
+ });
463
+ function disposeIvy(s) {
464
+ gsap.killTweensOf(s.wither);
465
+ s.stems.removeFromParent();
466
+ s.stems.geometry.dispose();
467
+ s.stems.material.dispose();
468
+ disposeFxInstances(s.leaves);
469
+ }
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=jelly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jelly.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/jelly.ts"],"names":[],"mappings":";AAWA,wBAqCG"}
@@ -0,0 +1,50 @@
1
+ // Jelly — a volume-preserving squash-and-stretch spring, anchored at the base:
2
+ // it squashes first, then rings out like soft rubber (critically tuned so it
3
+ // settles exactly at rest when the duration ends). One-shot.
4
+ import { gsap } from 'gsap';
5
+ import { Quaternion, Vector3 } from 'three';
6
+ import { defineOperation } from '../types.js';
7
+ import { acquireRest, poseAbout, releaseRest } from './restPose.js';
8
+ const KEY = '__opJelly';
9
+ const NO_TURN = new Quaternion();
10
+ export default defineOperation({
11
+ value: 'jelly',
12
+ label: 'Jelly',
13
+ description: 'Squash and wobble like soft rubber, keeping its volume — settles back to rest',
14
+ channel: 'transform',
15
+ multi: true,
16
+ toggles: false,
17
+ usableIn: ['interaction', 'action'],
18
+ params: {
19
+ strength: { type: 'number', label: 'Squash', default: 0.28, min: 0.02, max: 0.7, step: 0.01 },
20
+ wobbles: { type: 'number', label: 'Wobbles', default: 3, min: 1, max: 8, step: 0.5 },
21
+ duration: { type: 'number', label: 'Duration', default: 1.1, min: 0.2, max: 5, step: 0.05, unit: 's' },
22
+ },
23
+ apply(target, p) {
24
+ const running = target.userData[KEY];
25
+ if (running) {
26
+ gsap.killTweensOf(running.proxy);
27
+ releaseRest(target);
28
+ }
29
+ const rest = acquireRest(target);
30
+ const proxy = { t: 0 };
31
+ target.userData[KEY] = { proxy };
32
+ const A = Number(p.strength);
33
+ const D = Number(p.duration);
34
+ const w = 2 * Math.PI * (Number(p.wobbles) / D); // rad/s
35
+ const k = 4.6 / D; // decays to 1% by the end
36
+ const s = new Vector3();
37
+ gsap.to(proxy, {
38
+ t: D, duration: D, ease: 'none',
39
+ onUpdate: () => {
40
+ const t = proxy.t;
41
+ // damped spring, squash first
42
+ const sy = 1 - A * Math.exp(-k * t) * Math.sin(w * t);
43
+ const sxz = 1 / Math.sqrt(Math.max(sy, 0.05)); // keep the volume
44
+ s.set(sxz, sy, sxz);
45
+ poseAbout(target, rest, rest.bottomLocal, NO_TURN, s);
46
+ },
47
+ onComplete: () => { delete target.userData[KEY]; releaseRest(target); },
48
+ });
49
+ },
50
+ });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=kintsugi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kintsugi.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/kintsugi.ts"],"names":[],"mappings":";AAmIA,wBA+CG"}