@3driseai/3drise-viewer 0.1.2 → 0.1.3

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 (331) hide show
  1. package/dist/components/AnimatedObject.d.ts +2 -1
  2. package/dist/components/AnimatedObject.d.ts.map +1 -1
  3. package/dist/components/AnimatedObject.js +11 -3
  4. package/dist/components/Bubbles.d.ts +2 -1
  5. package/dist/components/Bubbles.d.ts.map +1 -1
  6. package/dist/components/Bubbles.js +5 -2
  7. package/dist/components/CameraController.d.ts +9 -1
  8. package/dist/components/CameraController.d.ts.map +1 -1
  9. package/dist/components/CameraController.js +12 -1
  10. package/dist/components/Clouds.d.ts +2 -1
  11. package/dist/components/Clouds.d.ts.map +1 -1
  12. package/dist/components/Clouds.js +3 -1
  13. package/dist/components/CreatedObject.d.ts +2 -2
  14. package/dist/components/CreatedObject.d.ts.map +1 -1
  15. package/dist/components/CreatedObject.js +5 -6
  16. package/dist/components/CustomPrimitive.d.ts +2 -2
  17. package/dist/components/CustomPrimitive.d.ts.map +1 -1
  18. package/dist/components/CustomPrimitive.js +6 -2
  19. package/dist/components/Earth.d.ts +2 -4
  20. package/dist/components/Earth.d.ts.map +1 -1
  21. package/dist/components/Earth.js +6 -4
  22. package/dist/components/EffectsGenerator.d.ts +2 -1
  23. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  24. package/dist/components/EffectsGenerator.js +26 -25
  25. package/dist/components/EffectsGroup.d.ts +2 -1
  26. package/dist/components/EffectsGroup.d.ts.map +1 -1
  27. package/dist/components/EffectsGroup.js +7 -2
  28. package/dist/components/EnvironmentManager.js +2 -2
  29. package/dist/components/EnvironmentObject.d.ts +2 -1
  30. package/dist/components/EnvironmentObject.d.ts.map +1 -1
  31. package/dist/components/EnvironmentObject.js +2 -2
  32. package/dist/components/Frame.d.ts +3 -2
  33. package/dist/components/Frame.d.ts.map +1 -1
  34. package/dist/components/Frame.js +3 -1
  35. package/dist/components/Galaxy.d.ts +2 -3
  36. package/dist/components/Galaxy.d.ts.map +1 -1
  37. package/dist/components/Galaxy.js +10 -10
  38. package/dist/components/GalleryLayout.d.ts +2 -1
  39. package/dist/components/GalleryLayout.d.ts.map +1 -1
  40. package/dist/components/GalleryLayout.js +3 -1
  41. package/dist/components/GeometryShape.d.ts +3 -2
  42. package/dist/components/GeometryShape.d.ts.map +1 -1
  43. package/dist/components/GeometryShape.js +17 -6
  44. package/dist/components/Glyphs.d.ts +2 -1
  45. package/dist/components/Glyphs.d.ts.map +1 -1
  46. package/dist/components/Glyphs.js +6 -2
  47. package/dist/components/GridHelper.d.ts +2 -1
  48. package/dist/components/GridHelper.d.ts.map +1 -1
  49. package/dist/components/GridHelper.js +3 -1
  50. package/dist/components/GridsGenerator.d.ts +2 -1
  51. package/dist/components/GridsGenerator.d.ts.map +1 -1
  52. package/dist/components/GridsGenerator.js +12 -4
  53. package/dist/components/HdrPlaylistRenderer.d.ts +2 -1
  54. package/dist/components/HdrPlaylistRenderer.d.ts.map +1 -1
  55. package/dist/components/HdrPlaylistRenderer.js +3 -1
  56. package/dist/components/Lensflare.d.ts +2 -1
  57. package/dist/components/Lensflare.d.ts.map +1 -1
  58. package/dist/components/Lensflare.js +3 -1
  59. package/dist/components/Letter.d.ts +3 -2
  60. package/dist/components/Letter.d.ts.map +1 -1
  61. package/dist/components/Letter.js +3 -1
  62. package/dist/components/Letters.d.ts +3 -2
  63. package/dist/components/Letters.d.ts.map +1 -1
  64. package/dist/components/Letters.js +3 -1
  65. package/dist/components/LightObject.d.ts +2 -1
  66. package/dist/components/LightObject.d.ts.map +1 -1
  67. package/dist/components/LightObject.js +11 -7
  68. package/dist/components/LightsManager.d.ts +2 -1
  69. package/dist/components/LightsManager.d.ts.map +1 -1
  70. package/dist/components/LightsManager.js +6 -3
  71. package/dist/components/Lines.d.ts +2 -1
  72. package/dist/components/Lines.d.ts.map +1 -1
  73. package/dist/components/Lines.js +2 -2
  74. package/dist/components/Moon.d.ts +2 -3
  75. package/dist/components/Moon.d.ts.map +1 -1
  76. package/dist/components/Moon.js +6 -4
  77. package/dist/components/MyGrid.d.ts +3 -2
  78. package/dist/components/MyGrid.d.ts.map +1 -1
  79. package/dist/components/MyGrid.js +5 -2
  80. package/dist/components/ObjectNode.d.ts +2 -2
  81. package/dist/components/ObjectNode.d.ts.map +1 -1
  82. package/dist/components/ObjectNode.js +29 -24
  83. package/dist/components/ObjectNodeApi.d.ts +2 -2
  84. package/dist/components/ObjectNodeApi.d.ts.map +1 -1
  85. package/dist/components/ObjectNodeApi.js +2 -2
  86. package/dist/components/ObjectsRenderer.d.ts +2 -1
  87. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  88. package/dist/components/ObjectsRenderer.js +15 -4
  89. package/dist/components/ObjectsRendererApi.d.ts +2 -1
  90. package/dist/components/ObjectsRendererApi.d.ts.map +1 -1
  91. package/dist/components/ObjectsRendererApi.js +2 -2
  92. package/dist/components/Ocean.d.ts +2 -1
  93. package/dist/components/Ocean.d.ts.map +1 -1
  94. package/dist/components/Ocean.js +3 -1
  95. package/dist/components/Outline.d.ts +3 -2
  96. package/dist/components/Outline.d.ts.map +1 -1
  97. package/dist/components/Outline.js +6 -2
  98. package/dist/components/ParticlesR3f.d.ts +2 -1
  99. package/dist/components/ParticlesR3f.d.ts.map +1 -1
  100. package/dist/components/ParticlesR3f.js +3 -1
  101. package/dist/components/Path.d.ts +2 -1
  102. package/dist/components/Path.d.ts.map +1 -1
  103. package/dist/components/Path.js +14 -3
  104. package/dist/components/PathGeometry.d.ts +2 -1
  105. package/dist/components/PathGeometry.d.ts.map +1 -1
  106. package/dist/components/PathGeometry.js +6 -2
  107. package/dist/components/PathRenderer.d.ts +2 -1
  108. package/dist/components/PathRenderer.d.ts.map +1 -1
  109. package/dist/components/PathRenderer.js +6 -2
  110. package/dist/components/Planet.d.ts +2 -3
  111. package/dist/components/Planet.d.ts.map +1 -1
  112. package/dist/components/Planet.js +6 -4
  113. package/dist/components/PointCloud.d.ts +2 -1
  114. package/dist/components/PointCloud.d.ts.map +1 -1
  115. package/dist/components/PointCloud.js +3 -1
  116. package/dist/components/ProjectLoader.d.ts +2 -1
  117. package/dist/components/ProjectLoader.d.ts.map +1 -1
  118. package/dist/components/ProjectLoader.js +6 -3
  119. package/dist/components/Rain.d.ts +2 -1
  120. package/dist/components/Rain.d.ts.map +1 -1
  121. package/dist/components/Rain.js +7 -1
  122. package/dist/components/SceneBuilder.d.ts +2 -1
  123. package/dist/components/SceneBuilder.d.ts.map +1 -1
  124. package/dist/components/SceneBuilder.js +2 -2
  125. package/dist/components/ShootingStar.d.ts +2 -1
  126. package/dist/components/ShootingStar.d.ts.map +1 -1
  127. package/dist/components/ShootingStar.js +5 -2
  128. package/dist/components/ShootingStars.d.ts +2 -1
  129. package/dist/components/ShootingStars.d.ts.map +1 -1
  130. package/dist/components/ShootingStars.js +2 -2
  131. package/dist/components/SkyController.d.ts +3 -2
  132. package/dist/components/SkyController.d.ts.map +1 -1
  133. package/dist/components/SkyController.js +9 -6
  134. package/dist/components/SkyMesh.d.ts +2 -3
  135. package/dist/components/SkyMesh.d.ts.map +1 -1
  136. package/dist/components/SkyMesh.js +3 -5
  137. package/dist/components/SkySystem.d.ts +2 -1
  138. package/dist/components/SkySystem.d.ts.map +1 -1
  139. package/dist/components/SkySystem.js +6 -2
  140. package/dist/components/Skybox.d.ts +2 -1
  141. package/dist/components/Skybox.d.ts.map +1 -1
  142. package/dist/components/Skybox.js +5 -2
  143. package/dist/components/SolarSystem.d.ts +2 -4
  144. package/dist/components/SolarSystem.d.ts.map +1 -1
  145. package/dist/components/SolarSystem.js +3 -1
  146. package/dist/components/SparklesBurst.d.ts +2 -1
  147. package/dist/components/SparklesBurst.d.ts.map +1 -1
  148. package/dist/components/SparklesBurst.js +5 -2
  149. package/dist/components/Stars.d.ts +2 -3
  150. package/dist/components/Stars.d.ts.map +1 -1
  151. package/dist/components/Stars.js +3 -2
  152. package/dist/components/Sun.d.ts +3 -2
  153. package/dist/components/Sun.d.ts.map +1 -1
  154. package/dist/components/Sun.js +7 -3
  155. package/dist/components/SunCore.d.ts +3 -2
  156. package/dist/components/SunCore.d.ts.map +1 -1
  157. package/dist/components/SunCore.js +3 -1
  158. package/dist/components/SunLight.d.ts +2 -1
  159. package/dist/components/SunLight.d.ts.map +1 -1
  160. package/dist/components/SunLight.js +3 -1
  161. package/dist/components/Text2D.d.ts +2 -1
  162. package/dist/components/Text2D.d.ts.map +1 -1
  163. package/dist/components/Text2D.js +3 -1
  164. package/dist/components/Text3D.d.ts +2 -1
  165. package/dist/components/Text3D.d.ts.map +1 -1
  166. package/dist/components/Text3D.js +2 -2
  167. package/dist/components/VolumePoints.d.ts +3 -2
  168. package/dist/components/VolumePoints.d.ts.map +1 -1
  169. package/dist/components/VolumePoints.js +6 -2
  170. package/dist/components/cursor/AuraCursor.d.ts.map +1 -1
  171. package/dist/components/cursor/AuraCursor.js +3 -1
  172. package/dist/components/cursor/AuroraCursor.d.ts.map +1 -1
  173. package/dist/components/cursor/AuroraCursor.js +5 -2
  174. package/dist/components/cursor/BubblesCursor.d.ts.map +1 -1
  175. package/dist/components/cursor/BubblesCursor.js +5 -2
  176. package/dist/components/cursor/CometCursor.d.ts.map +1 -1
  177. package/dist/components/cursor/CometCursor.js +6 -3
  178. package/dist/components/cursor/CrosshairCursor.d.ts.map +1 -1
  179. package/dist/components/cursor/CrosshairCursor.js +6 -3
  180. package/dist/components/cursor/CursorActions.d.ts +2 -1
  181. package/dist/components/cursor/CursorActions.d.ts.map +1 -1
  182. package/dist/components/cursor/CursorActions.js +12 -10
  183. package/dist/components/cursor/CursorController.d.ts +2 -1
  184. package/dist/components/cursor/CursorController.d.ts.map +1 -1
  185. package/dist/components/cursor/CursorController.js +1 -1
  186. package/dist/components/cursor/CursorEffects.d.ts +3 -2
  187. package/dist/components/cursor/CursorEffects.d.ts.map +1 -1
  188. package/dist/components/cursor/CursorEffects.js +3 -1
  189. package/dist/components/cursor/FerrofluidCursor.d.ts.map +1 -1
  190. package/dist/components/cursor/FerrofluidCursor.js +3 -1
  191. package/dist/components/cursor/GlyphRingCursor.d.ts.map +1 -1
  192. package/dist/components/cursor/GlyphRingCursor.js +3 -1
  193. package/dist/components/cursor/LightningCursor.d.ts.map +1 -1
  194. package/dist/components/cursor/LightningCursor.js +3 -1
  195. package/dist/components/cursor/LiquidMetalCursor.d.ts.map +1 -1
  196. package/dist/components/cursor/LiquidMetalCursor.js +3 -1
  197. package/dist/components/cursor/OrbCursor.d.ts.map +1 -1
  198. package/dist/components/cursor/OrbCursor.js +3 -1
  199. package/dist/components/cursor/PlasmaWhipCursor.d.ts.map +1 -1
  200. package/dist/components/cursor/PlasmaWhipCursor.js +3 -1
  201. package/dist/components/cursor/SparklesCursor.d.ts.map +1 -1
  202. package/dist/components/cursor/SparklesCursor.js +5 -2
  203. package/dist/components/cursor/TeslaCursor.d.ts.map +1 -1
  204. package/dist/components/cursor/TeslaCursor.js +6 -9
  205. package/dist/components/cursor/clickActions/BoltFlashAction.d.ts +2 -1
  206. package/dist/components/cursor/clickActions/BoltFlashAction.d.ts.map +1 -1
  207. package/dist/components/cursor/clickActions/BoltFlashAction.js +5 -2
  208. package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts +2 -1
  209. package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts.map +1 -1
  210. package/dist/components/cursor/clickActions/GlyphInscriptionAction.js +3 -1
  211. package/dist/components/cursor/clickActions/ImplosionAction.d.ts +2 -1
  212. package/dist/components/cursor/clickActions/ImplosionAction.d.ts.map +1 -1
  213. package/dist/components/cursor/clickActions/ImplosionAction.js +3 -1
  214. package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts +2 -1
  215. package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts.map +1 -1
  216. package/dist/components/cursor/clickActions/PhaseShiftAction.js +5 -2
  217. package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts +2 -1
  218. package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts.map +1 -1
  219. package/dist/components/cursor/clickActions/PlasmaBombAction.js +5 -2
  220. package/dist/components/cursor/clickActions/RealityTearAction.d.ts +2 -1
  221. package/dist/components/cursor/clickActions/RealityTearAction.d.ts.map +1 -1
  222. package/dist/components/cursor/clickActions/RealityTearAction.js +3 -1
  223. package/dist/components/cursor/clickActions/ShockwaveAction.d.ts +2 -1
  224. package/dist/components/cursor/clickActions/ShockwaveAction.d.ts.map +1 -1
  225. package/dist/components/cursor/clickActions/ShockwaveAction.js +5 -2
  226. package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts +2 -1
  227. package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts.map +1 -1
  228. package/dist/components/cursor/clickActions/SparklesBurstAction.js +3 -1
  229. package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts +2 -1
  230. package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts.map +1 -1
  231. package/dist/components/cursor/clickActions/VoronoiFractureAction.js +3 -1
  232. package/dist/components/cursor/clickActions/index.d.ts +11 -0
  233. package/dist/components/cursor/clickActions/index.d.ts.map +1 -0
  234. package/dist/components/cursor/clickActions/index.js +10 -0
  235. package/dist/components/cursor/index.d.ts +21 -0
  236. package/dist/components/cursor/index.d.ts.map +1 -0
  237. package/dist/components/cursor/index.js +19 -0
  238. package/dist/components/effects/AuraEffect.d.ts +2 -1
  239. package/dist/components/effects/AuraEffect.d.ts.map +1 -1
  240. package/dist/components/effects/AuraEffect.js +5 -2
  241. package/dist/components/effects/AuroraEffect.d.ts +2 -1
  242. package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
  243. package/dist/components/effects/AuroraEffect.js +3 -1
  244. package/dist/components/effects/BlackHoleEffect.d.ts +2 -1
  245. package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
  246. package/dist/components/effects/BlackHoleEffect.js +3 -1
  247. package/dist/components/effects/ConstellationEffect.d.ts +2 -1
  248. package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
  249. package/dist/components/effects/ConstellationEffect.js +3 -1
  250. package/dist/components/effects/Corona.d.ts +19 -0
  251. package/dist/components/effects/Corona.d.ts.map +1 -0
  252. package/dist/components/effects/Corona.js +15 -0
  253. package/dist/components/effects/DataStreamEffect.d.ts +2 -1
  254. package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
  255. package/dist/components/effects/DataStreamEffect.js +5 -2
  256. package/dist/components/effects/DnaHelixEffect.d.ts +2 -1
  257. package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
  258. package/dist/components/effects/DnaHelixEffect.js +3 -1
  259. package/dist/components/effects/Fire.d.ts +3 -2
  260. package/dist/components/effects/Fire.d.ts.map +1 -1
  261. package/dist/components/effects/Fire.js +3 -1
  262. package/dist/components/effects/FireEffect.d.ts +2 -1
  263. package/dist/components/effects/FireEffect.d.ts.map +1 -1
  264. package/dist/components/effects/FireEffect.js +5 -2
  265. package/dist/components/effects/Flares.d.ts +25 -0
  266. package/dist/components/effects/Flares.d.ts.map +1 -0
  267. package/dist/components/effects/Flares.js +136 -0
  268. package/dist/components/effects/ForcefieldEffect.d.ts +2 -1
  269. package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
  270. package/dist/components/effects/ForcefieldEffect.js +3 -1
  271. package/dist/components/effects/HologramEffect.d.ts +2 -1
  272. package/dist/components/effects/HologramEffect.d.ts.map +1 -1
  273. package/dist/components/effects/HologramEffect.js +5 -2
  274. package/dist/components/effects/IceCrystalsEffect.d.ts +2 -1
  275. package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
  276. package/dist/components/effects/IceCrystalsEffect.js +3 -1
  277. package/dist/components/effects/LightningEffect.d.ts +2 -1
  278. package/dist/components/effects/LightningEffect.d.ts.map +1 -1
  279. package/dist/components/effects/LightningEffect.js +5 -2
  280. package/dist/components/effects/MoleculesEffect.d.ts +2 -1
  281. package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
  282. package/dist/components/effects/MoleculesEffect.js +5 -2
  283. package/dist/components/effects/NeuralNetworkEffect.d.ts +2 -1
  284. package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
  285. package/dist/components/effects/NeuralNetworkEffect.js +3 -1
  286. package/dist/components/effects/OrbEffect.d.ts +2 -1
  287. package/dist/components/effects/OrbEffect.d.ts.map +1 -1
  288. package/dist/components/effects/OrbEffect.js +5 -2
  289. package/dist/components/effects/PortalEffect.d.ts +2 -1
  290. package/dist/components/effects/PortalEffect.d.ts.map +1 -1
  291. package/dist/components/effects/PortalEffect.js +5 -2
  292. package/dist/components/effects/ShockwaveEffect.d.ts +2 -1
  293. package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
  294. package/dist/components/effects/ShockwaveEffect.js +5 -2
  295. package/dist/components/effects/SmokePlumeEffect.d.ts +2 -1
  296. package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
  297. package/dist/components/effects/SmokePlumeEffect.js +5 -2
  298. package/dist/components/effects/SmokeRibbon.d.ts +3 -2
  299. package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
  300. package/dist/components/effects/SmokeRibbon.js +5 -2
  301. package/dist/components/effects/SmokeRingEffect.d.ts +2 -1
  302. package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
  303. package/dist/components/effects/SmokeRingEffect.js +5 -2
  304. package/dist/components/effects/VolumetricFogEffect.d.ts +2 -1
  305. package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
  306. package/dist/components/effects/VolumetricFogEffect.js +5 -2
  307. package/dist/components/effects/index.d.ts +28 -0
  308. package/dist/components/effects/index.d.ts.map +1 -0
  309. package/dist/components/effects/index.js +24 -0
  310. package/dist/components/index.d.ts +112 -0
  311. package/dist/components/index.d.ts.map +1 -0
  312. package/dist/components/index.js +77 -0
  313. package/dist/constants.d.ts +1 -1
  314. package/dist/constants.d.ts.map +1 -1
  315. package/dist/constants.js +1 -1
  316. package/dist/hooks/index.d.ts +55 -0
  317. package/dist/hooks/index.d.ts.map +1 -1
  318. package/dist/hooks/index.js +46 -1
  319. package/dist/hooks/useObjectReady.d.ts +29 -0
  320. package/dist/hooks/useObjectReady.d.ts.map +1 -0
  321. package/dist/hooks/useObjectReady.js +59 -0
  322. package/dist/index.d.ts +4 -135
  323. package/dist/index.d.ts.map +1 -1
  324. package/dist/index.js +6 -108
  325. package/dist/types/index.d.ts +2 -0
  326. package/dist/types/index.d.ts.map +1 -0
  327. package/dist/types/index.js +1 -0
  328. package/dist/types/objectReady.d.ts +24 -0
  329. package/dist/types/objectReady.d.ts.map +1 -0
  330. package/dist/types/objectReady.js +1 -0
  331. package/package.json +1 -1
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  const shieldVert = /* glsl */ `
7
8
  varying vec3 vNormal;
8
9
  varying vec3 vWorldPos;
@@ -77,10 +78,11 @@ const shieldFrag = /* glsl */ `
77
78
  gl_FragColor = vec4(col + uRimColor * ripple * 0.3, alpha);
78
79
  }
79
80
  `;
80
- const ForcefieldEffect = ({ boundingRadius, config, animations }) => {
81
+ const ForcefieldEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
81
82
  const { hexSize, rippleEnabled, shieldColor, rimColor, opacity, speed, intensity } = config;
82
83
  const startValuesCacheRef = useRef({});
83
84
  const meshRef = useRef(null);
85
+ useObjectReady(meshRef, config, onObjectReady, onObjectDispose);
84
86
  const hitSlot = useRef(0);
85
87
  const nextHit = useRef(0);
86
88
  const mat = useMemo(() => {
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { HologramConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface HologramEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface HologramEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: HologramConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"HologramEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/HologramEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,UAAU,mBAAmB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqFD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsDjD,CAAC;AACF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"HologramEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/HologramEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,mBAAoB,SAAQ,gBAAgB;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqFD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwDjD,CAAC;AACF,eAAe,cAAc,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // Single rich shader handles scanlines, grid, RGB aberration, interference fringes, flicker
7
8
  const vertexShader = /* glsl */ `
8
9
  varying vec2 vUv;
@@ -85,9 +86,11 @@ const fragmentShader = /* glsl */ `
85
86
  gl_FragColor = vec4(hologramColor + uColor * fringe, intensity * uOpacity);
86
87
  }
87
88
  `;
88
- const HologramEffect = ({ boundingRadius, config, animations }) => {
89
+ const HologramEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
89
90
  const { scanlineCount, scanSpeed, scanColor, gridEnabled, flickerAmount, glitchEnabled, opacity, speed, intensity } = config;
90
91
  const startValuesCacheRef = useRef({});
92
+ const rootRef = useRef(null);
93
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
91
94
  const meshRefs = useRef([]);
92
95
  const colorVec = useMemo(() => {
93
96
  const c = new THREE.Color(scanColor);
@@ -135,7 +138,7 @@ const HologramEffect = ({ boundingRadius, config, animations }) => {
135
138
  applyGenerativeAnimations(materials, animations, startValuesCacheRef.current, Date.now(), false);
136
139
  }
137
140
  });
138
- return (_jsx("group", { children: Array.from({ length: scanlineCount }, (_, i) => {
141
+ return (_jsx("group", { ref: rootRef, children: Array.from({ length: scanlineCount }, (_, i) => {
139
142
  const y = -boundingRadius * 1.25 + i * stepY;
140
143
  return (_jsx("mesh", { ref: el => { meshRefs.current[i] = el; }, material: materials[i], position: [0, y, 0], rotation: [-Math.PI / 2, 0, 0], children: _jsx("planeGeometry", { args: [planeSize, planeSize, 2, 2] }) }, i));
141
144
  }) }));
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { IceCrystalsConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface IceCrystalsEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface IceCrystalsEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: IceCrystalsConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"IceCrystalsEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/IceCrystalsEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACjF,UAAU,sBAAsB;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAmED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAuHvD,CAAC;AACF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"IceCrystalsEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/IceCrystalsEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,sBAAuB,SAAQ,gBAAgB;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAmED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAwHvD,CAAC;AACF,eAAe,iBAAiB,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // ── Crystal spike shader ──────────────────────────────────────────────────────
7
8
  const spikeVert = /* glsl */ `
8
9
  varying vec3 vNormal;
@@ -67,10 +68,11 @@ const frostFrag = /* glsl */ `
67
68
  gl_FragColor = vec4(0.85, 0.95, 1.0, g * vA * uOpacity);
68
69
  }
69
70
  `;
70
- const IceCrystalsEffect = ({ boundingRadius, config, animations }) => {
71
+ const IceCrystalsEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
71
72
  const { spikeCount, spikeLength, frostEnabled, iceColor, pulseSpeed, opacity, intensity } = config;
72
73
  const startValuesCacheRef = useRef({});
73
74
  const groupRef = useRef(null);
75
+ useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
74
76
  const timeRef = useRef(0);
75
77
  const r = boundingRadius;
76
78
  const N = Math.max(10, Math.min(spikeCount, 60));
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { LightningConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface LightningEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface LightningEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: LightningConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"LightningEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/LightningEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAsDD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsLnD,CAAC;AACF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"LightningEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/LightningEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,oBAAqB,SAAQ,gBAAgB;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAsDD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwLnD,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // ── Seeded LCG RNG — deterministic, no Math.random ───────────────────────────
7
8
  function makeRng(seed) {
8
9
  let s = (seed * 1664525 + 1013904223) >>> 0;
@@ -54,9 +55,11 @@ const glowFrag = /* glsl */ `
54
55
  }
55
56
  `;
56
57
  const FADE_DUR = 0.22;
57
- const LightningEffect = ({ boundingRadius, config, animations }) => {
58
+ const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
58
59
  const { boltCount, branchDepth, color, glowColor, opacity, speed, intensity, strikeRadius } = config;
59
60
  const startValuesCacheRef = useRef({});
61
+ const rootRef = useRef(null);
62
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
60
63
  const depth = Math.min(Math.max(branchDepth, 2), 6);
61
64
  const N = Math.pow(2, depth) + 1; // vertex count: 5, 9, 17, 33, 65
62
65
  const coreCol = useMemo(() => new THREE.Color(color), [color]);
@@ -235,6 +238,6 @@ const LightningEffect = ({ boundingRadius, config, animations }) => {
235
238
  const lineObjects = useMemo(() => bolts.map(bolt => new THREE.Line(bolt.lineGeo, lineMat)),
236
239
  // eslint-disable-next-line react-hooks/exhaustive-deps
237
240
  [bolts, lineMat]);
238
- return (_jsx("group", { children: lineObjects.map((lineObj, bi) => (_jsxs("group", { children: [_jsx("primitive", { object: lineObj }), _jsx("points", { geometry: bolts[bi].pointGeo, material: glowMats[bi] })] }, bi))) }));
241
+ 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))) }));
239
242
  };
240
243
  export default LightningEffect;
@@ -1,6 +1,7 @@
1
1
  import type { MoleculesConfig, AnimationOptions } from '@3driseai/3drise-core';
2
2
  import React from "react";
3
- interface MoleculesEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface MoleculesEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: MoleculesConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"MoleculesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/MoleculesEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA+CD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAyHnD,CAAC;AACF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"MoleculesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/MoleculesEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,oBAAqB,SAAQ,gBAAgB;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA+CD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA2HnD,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -4,6 +4,7 @@ import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { getShaderByName } from '@3driseai/3drise-core';
6
6
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
7
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
7
8
  // Glowing node points at each atom position
8
9
  // const nodeVertShader = /* glsl */`
9
10
  // attribute float aPhase;
@@ -48,9 +49,11 @@ import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAn
48
49
  // gl_FragColor = vec4(col, vAlpha * uOpacity * (glow + spike * 0.6 + core));
49
50
  // }
50
51
  // `;
51
- const MoleculesEffect = ({ boundingRadius, config, animations }) => {
52
+ const MoleculesEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
52
53
  const { atomCount, orbitRadius, atomSize, showBonds, opacity, speed, intensity } = config;
53
54
  const startValuesCacheRef = useRef({});
55
+ const rootRef = useRef(null);
56
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
54
57
  const shaderData = getShaderByName('Molecules');
55
58
  const tRef = useRef(new Float32Array(atomCount));
56
59
  const r = boundingRadius * orbitRadius;
@@ -168,6 +171,6 @@ const MoleculesEffect = ({ boundingRadius, config, animations }) => {
168
171
  applyGenerativeAnimations([nodeMat, bondMat], animations, startValuesCacheRef.current, Date.now(), false);
169
172
  }
170
173
  });
171
- return (_jsxs("group", { name: "MoleculesEffect", children: [_jsx("points", { geometry: nodeGeo, material: nodeMat }), showBonds && (_jsx("lineSegments", { geometry: bondGeo, material: bondMat }))] }));
174
+ return (_jsxs("group", { ref: rootRef, name: "MoleculesEffect", children: [_jsx("points", { geometry: nodeGeo, material: nodeMat }), showBonds && (_jsx("lineSegments", { geometry: bondGeo, material: bondMat }))] }));
172
175
  };
173
176
  export default MoleculesEffect;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { NeuralNetworkConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface NeuralNetworkEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface NeuralNetworkEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: NeuralNetworkConfig;
6
7
  animations?: AnimationOptions[];
@@ -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;AACnF,UAAU,wBAAwB;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA6BD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA2J3D,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;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;AA6BD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA4J3D,CAAC;AACF,eAAe,mBAAmB,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // Glow sprite for pulse signals and node flashes
7
8
  const pulseVert = /* glsl */ `
8
9
  attribute float aBright;
@@ -29,10 +30,11 @@ const pulseFrag = /* glsl */ `
29
30
  }
30
31
  `;
31
32
  const MAX_PULSES = 4;
32
- const NeuralNetworkEffect = ({ boundingRadius, config, animations }) => {
33
+ const NeuralNetworkEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
33
34
  const { nodeCount, signalSpeed, nodeColor, pulseColor, orbitSpeed, opacity, speed, intensity } = config;
34
35
  const startValuesCacheRef = useRef({});
35
36
  const groupRef = useRef(null);
37
+ useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
36
38
  // Node orbit state
37
39
  const orbitAngles = useRef(new Float32Array(0));
38
40
  const pulses = useRef([]);
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { OrbConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface OrbEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface OrbEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: OrbConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"OrbEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/OrbEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzE,UAAU,cAAc;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqLD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0GvC,CAAC;AACF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"OrbEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/OrbEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,cAAe,SAAQ,gBAAgB;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqLD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA4GvC,CAAC;AACF,eAAe,SAAS,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // ── Shared vert (normal + viewDir) ────────────────────────────────────────────
7
8
  const sharedVert = /* glsl */ `
8
9
  varying vec3 vNormal;
@@ -181,9 +182,11 @@ const coronaFrag = /* glsl */ `
181
182
  gl_FragColor = vec4(col * (1.0 + pulse), alpha);
182
183
  }
183
184
  `;
184
- const OrbEffect = ({ boundingRadius, config, animations }) => {
185
+ const OrbEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
185
186
  const { coreSize, glowLayers, innerColor, outerColor, coronaEnabled, coronaColor, noiseAmount, pulseSpeed, opacity, speed, intensity } = config;
186
187
  const startValuesCacheRef = useRef({});
188
+ const rootRef = useRef(null);
189
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
187
190
  const innerColorVec = useMemo(() => { const c = new THREE.Color(innerColor); return new THREE.Vector3(c.r, c.g, c.b); }, [innerColor]);
188
191
  const outerColorVec = useMemo(() => { const c = new THREE.Color(outerColor); return new THREE.Vector3(c.r, c.g, c.b); }, [outerColor]);
189
192
  const coronaColorVec = useMemo(() => { const c = new THREE.Color(coronaColor); return new THREE.Vector3(c.r, c.g, c.b); }, [coronaColor]);
@@ -282,7 +285,7 @@ const OrbEffect = ({ boundingRadius, config, animations }) => {
282
285
  }
283
286
  });
284
287
  const glowR = coreR * (3.5 + glowLayers * 0.6);
285
- return (_jsxs("group", { children: [_jsx("mesh", { material: coreMat, children: _jsx("sphereGeometry", { args: [coreR, 48, 48] }) }), Array.from({ length: glowLayers }, (_, i) => {
288
+ return (_jsxs("group", { ref: rootRef, children: [_jsx("mesh", { material: coreMat, children: _jsx("sphereGeometry", { args: [coreR, 48, 48] }) }), Array.from({ length: glowLayers }, (_, i) => {
286
289
  const layerT = glowLayers > 1 ? i / (glowLayers - 1) : 0;
287
290
  const r = coreR * (1.35 + layerT * layerT * 1.8);
288
291
  return (_jsx("mesh", { material: shellMats[i], children: _jsx("sphereGeometry", { args: [r, 40, 40] }) }, i));
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { PortalConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface PortalEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface PortalEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: PortalConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"PortalEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/PortalEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,UAAU,iBAAiB;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAgHD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2E7C,CAAC;AACF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"PortalEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/PortalEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,iBAAkB,SAAQ,gBAAgB;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAgHD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA6E7C,CAAC;AACF,eAAe,YAAY,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // Multi-layer vortex disc
7
8
  const discVertShader = /* glsl */ `
8
9
  varying vec2 vUv;
@@ -112,9 +113,11 @@ const dustFragShader = /* glsl */ `
112
113
  gl_FragColor = vec4(uColor, vAlpha * uOpacity * glow);
113
114
  }
114
115
  `;
115
- const PortalEffect = ({ boundingRadius, config, animations }) => {
116
+ const PortalEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
116
117
  const { radius, spiralTurns, innerGlowColor, outerGlowColor, rotationSpeed, particleRingEnabled, particleCount, opacity, speed, intensity } = config;
117
118
  const startValuesCacheRef = useRef({});
119
+ const rootRef = useRef(null);
120
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
118
121
  const r = boundingRadius * radius;
119
122
  const innerColorVec = useMemo(() => { const c = new THREE.Color(innerGlowColor); return new THREE.Vector3(c.r, c.g, c.b); }, [innerGlowColor]);
120
123
  const outerColorVec = useMemo(() => { const c = new THREE.Color(outerGlowColor); return new THREE.Vector3(c.r, c.g, c.b); }, [outerGlowColor]);
@@ -186,6 +189,6 @@ const PortalEffect = ({ boundingRadius, config, animations }) => {
186
189
  applyGenerativeAnimations([discMaterial, dustMat], animations, startValuesCacheRef.current, Date.now(), false);
187
190
  }
188
191
  });
189
- return (_jsxs("group", { rotation: [-Math.PI / 2, 0, 0], position: [0, -boundingRadius * 0.75, 0], children: [_jsx("mesh", { material: discMaterial, children: _jsx("circleGeometry", { args: [r, 80] }) }), particleRingEnabled && (_jsx("points", { geometry: dustGeo, material: dustMat }))] }));
192
+ return (_jsxs("group", { ref: rootRef, rotation: [-Math.PI / 2, 0, 0], position: [0, -boundingRadius * 0.75, 0], children: [_jsx("mesh", { material: discMaterial, children: _jsx("circleGeometry", { args: [r, 80] }) }), particleRingEnabled && (_jsx("points", { geometry: dustGeo, material: dustMat }))] }));
190
193
  };
191
194
  export default PortalEffect;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { ShockwaveConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface ShockwaveEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface ShockwaveEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: ShockwaveConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"ShockwaveEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ShockwaveEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAkFD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0EnD,CAAC;AACF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ShockwaveEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ShockwaveEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,oBAAqB,SAAQ,gBAAgB;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAkFD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA4EnD,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo, useEffect } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // Ring vertex — organic warp + vertical ripple
7
8
  const vertexShader = /* glsl */ `
8
9
  uniform float uProgress;
@@ -82,9 +83,11 @@ const flashVert = /* glsl */ `
82
83
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
83
84
  }
84
85
  `;
85
- const ShockwaveEffect = ({ boundingRadius, config, animations }) => {
86
+ const ShockwaveEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
86
87
  const { ringCount, expansionRadius, thickness, intervalSeconds, color, rimColor, opacity, speed, intensity } = config;
87
88
  const startValuesCacheRef = useRef({});
89
+ const rootRef = useRef(null);
90
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
88
91
  const meshRefs = useRef([]);
89
92
  const flashRefs = useRef([]);
90
93
  const makeRingStates = (count, interval) => Array.from({ length: count }, (_, i) => ({
@@ -155,6 +158,6 @@ const ShockwaveEffect = ({ boundingRadius, config, animations }) => {
155
158
  }
156
159
  });
157
160
  const flashR = radius * 1.05;
158
- return (_jsx("group", { children: Array.from({ length: ringCount }, (_, i) => (_jsxs("group", { children: [_jsx("mesh", { ref: el => { meshRefs.current[i] = el; }, material: materials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("torusGeometry", { args: [radius, thickness * intensity, 10, 80] }) }), _jsx("mesh", { ref: el => { flashRefs.current[i] = el; }, material: flashMaterials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("circleGeometry", { args: [flashR, 48] }) })] }, i))) }));
161
+ return (_jsx("group", { ref: rootRef, children: Array.from({ length: ringCount }, (_, i) => (_jsxs("group", { children: [_jsx("mesh", { ref: el => { meshRefs.current[i] = el; }, material: materials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("torusGeometry", { args: [radius, thickness * intensity, 10, 80] }) }), _jsx("mesh", { ref: el => { flashRefs.current[i] = el; }, material: flashMaterials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("circleGeometry", { args: [flashR, 48] }) })] }, i))) }));
159
162
  };
160
163
  export default ShockwaveEffect;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { SmokePlumeConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface SmokePlumeEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface SmokePlumeEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: SmokePlumeConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"SmokePlumeEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokePlumeEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAChF,UAAU,qBAAqB;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA6ED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA4DrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"SmokePlumeEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokePlumeEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,qBAAsB,SAAQ,gBAAgB;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA6ED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8DrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // ── Fully GPU-animated smoke puff vertex shader ───────────────────────────────
7
8
  // Each particle has a lifetime t ∈ [0,1). It rises, expands, and billows.
8
9
  // All motion driven by u_time — zero CPU writes per frame.
@@ -77,9 +78,11 @@ const smokeFrag = /* glsl */ `
77
78
  gl_FragColor = vec4(col, g * vAlpha * uOpacity);
78
79
  }
79
80
  `;
80
- const SmokePlumeEffect = ({ boundingRadius, config, animations }) => {
81
+ const SmokePlumeEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
81
82
  const { particleCount, height, spread, smokeColor, turbulence, opacity, speed, intensity } = config;
82
83
  const startValuesCacheRef = useRef({});
84
+ const rootRef = useRef(null);
85
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
83
86
  const h = boundingRadius * height;
84
87
  const s = boundingRadius * spread;
85
88
  const { geo, mat } = useMemo(() => {
@@ -136,6 +139,6 @@ const SmokePlumeEffect = ({ boundingRadius, config, animations }) => {
136
139
  applyGenerativeAnimations([mat], animations, startValuesCacheRef.current, Date.now(), false);
137
140
  }
138
141
  });
139
- return _jsx("points", { geometry: geo, material: mat });
142
+ return _jsx("points", { ref: rootRef, geometry: geo, material: mat });
140
143
  };
141
144
  export default SmokePlumeEffect;
@@ -1,5 +1,6 @@
1
1
  import type { SmokeRibbonConfig } from '@3driseai/3drise-core';
2
- export interface SmokeRibbonProps {
2
+ import type { ObjectReadyProps } from '../../types/objectReady';
3
+ export interface SmokeRibbonProps extends ObjectReadyProps {
3
4
  config?: SmokeRibbonConfig;
4
5
  boundingRadius?: number;
5
6
  }
@@ -8,6 +9,6 @@ export interface SmokeRibbonProps {
8
9
  *
9
10
  * <SmokeRibbon position={[0, 0, 0]} config={{ planes: 2, twistStart: 0.2 }} />
10
11
  */
11
- declare const SmokeRibbon: ({ config, boundingRadius, ...groupProps }: SmokeRibbonProps) => import("react").JSX.Element;
12
+ declare const SmokeRibbon: ({ config, boundingRadius, onObjectReady, onObjectDispose, ...groupProps }: SmokeRibbonProps) => import("react").JSX.Element;
12
13
  export default SmokeRibbon;
13
14
  //# sourceMappingURL=SmokeRibbon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SmokeRibbon.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokeRibbon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,MAAM,WAAW,gBAAgB;IAC7B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,QAAA,MAAM,WAAW,GAAI,2CAAoD,gBAAgB,gCAyDxF,CAAC;AACF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"SmokeRibbon.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokeRibbon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACtD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,QAAA,MAAM,WAAW,GAAI,2EAAoF,gBAAgB,gCA2DxH,CAAC;AACF,eAAe,WAAW,CAAC"}
@@ -3,12 +3,13 @@ import { PlaneGeometry } from 'three';
3
3
  import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
4
4
  import { useFrame, useThree } from '@react-three/fiber';
5
5
  import { SmokeRibbonMaterial } from '@3driseai/3drise-core';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  /**
7
8
  * Place where you want the smoke to rise from — it climbs the parent's local +Y:
8
9
  *
9
10
  * <SmokeRibbon position={[0, 0, 0]} config={{ planes: 2, twistStart: 0.2 }} />
10
11
  */
11
- const SmokeRibbon = ({ config = {}, boundingRadius = 1, ...groupProps }) => {
12
+ const SmokeRibbon = ({ config = {}, boundingRadius = 1, onObjectReady, onObjectDispose, ...groupProps }) => {
12
13
  const { width = 1.5, height = 5, segmentsPerLength = 12, planes = 2, color = '#f2f2f7', colorTop = '#b3b8c7', speed = 0.18, detail = 1.4, remapLow = 0.38, remapHigh = 1.0, edgeX = 0.4, edgeY = 0.32, density = 1.0, twistStrength = 9, twistSpeed = 0.4, twistScale = 0.9, twistStart = 0.18, wind = [0.15, 0], animate = true, interactive = false, } = config;
13
14
  // One material instance shared across the crossed planes -> one set of uniforms.
14
15
  const material = useMemo(() => new SmokeRibbonMaterial(), []);
@@ -50,6 +51,8 @@ const SmokeRibbon = ({ config = {}, boundingRadius = 1, ...groupProps }) => {
50
51
  ]);
51
52
  const { pointer } = useThree();
52
53
  const hovering = useRef(false);
54
+ const rootRef = useRef(null);
55
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
53
56
  useFrame(({ clock }) => {
54
57
  if (animate)
55
58
  material.u_time = clock.getElapsedTime();
@@ -64,6 +67,6 @@ const SmokeRibbon = ({ config = {}, boundingRadius = 1, ...groupProps }) => {
64
67
  }
65
68
  });
66
69
  console.log('SmokeRibbon render with config:', config, 'and groupProps:', groupProps);
67
- return (_jsx("group", { ...groupProps, onPointerOver: interactive ? () => (hovering.current = true) : undefined, onPointerOut: interactive ? () => (hovering.current = false) : undefined, children: angles.map((a, i) => (_jsx("mesh", { geometry: geometry, material: material, "rotation-y": a }, i))) }));
70
+ return (_jsx("group", { ref: rootRef, ...groupProps, onPointerOver: interactive ? () => (hovering.current = true) : undefined, onPointerOut: interactive ? () => (hovering.current = false) : undefined, children: angles.map((a, i) => (_jsx("mesh", { geometry: geometry, material: material, "rotation-y": a }, i))) }));
68
71
  };
69
72
  export default SmokeRibbon;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { SmokeRingConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface SmokeRingEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface SmokeRingEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: SmokeRingConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"SmokeRingEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokeRingEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAiED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAyFnD,CAAC;AACF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"SmokeRingEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokeRingEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,oBAAqB,SAAQ,gBAAgB;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAiED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA2FnD,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // ── Per-ring puff shader (one Points per ring — GPU computes torus positions) ──
7
8
  const ringVert = /* glsl */ `
8
9
  attribute float aAngle; // 0..TAU position around torus
@@ -65,9 +66,11 @@ const ringFrag = /* glsl */ `
65
66
  }
66
67
  `;
67
68
  const PUFFS_PER_RING = 120;
68
- const SmokeRingEffect = ({ boundingRadius, config, animations }) => {
69
+ const SmokeRingEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
69
70
  const { ringCount, expansionRadius, riseSpeed, intervalSeconds, smokeColor, thickness, opacity, speed, intensity } = config;
70
71
  const startValuesCacheRef = useRef({});
72
+ const rootRef = useRef(null);
73
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
71
74
  const N = Math.max(1, Math.min(ringCount, 4));
72
75
  // Ring states — one per slot
73
76
  const ringStates = useRef([]);
@@ -153,6 +156,6 @@ const SmokeRingEffect = ({ boundingRadius, config, animations }) => {
153
156
  applyGenerativeAnimations(mats, animations, startValuesCacheRef.current, Date.now(), false);
154
157
  }
155
158
  });
156
- return (_jsx("group", { children: geos.map((geo, i) => (_jsx("points", { geometry: geo, material: mats[i] }, i))) }));
159
+ return (_jsx("group", { ref: rootRef, children: geos.map((geo, i) => (_jsx("points", { geometry: geo, material: mats[i] }, i))) }));
157
160
  };
158
161
  export default SmokeRingEffect;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { VolumetricFogConfig, AnimationOptions } from "@3driseai/3drise-core";
3
- interface VolumetricFogEffectProps {
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ interface VolumetricFogEffectProps extends ObjectReadyProps {
4
5
  boundingRadius: number;
5
6
  config: VolumetricFogConfig;
6
7
  animations?: AnimationOptions[];
@@ -1 +1 @@
1
- {"version":3,"file":"VolumetricFogEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/VolumetricFogEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACnF,UAAU,wBAAwB;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAoDD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAuD3D,CAAC;AACF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"VolumetricFogEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/VolumetricFogEffect.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;AAoDD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAyD3D,CAAC;AACF,eAAe,mBAAmB,CAAC"}
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
6
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
6
7
  // ── Billboard fog puff — drifts slowly, never rises far ───────────────────────
7
8
  const fogVert = /* glsl */ `
8
9
  attribute float aT; // stagger offset 0..1
@@ -52,9 +53,11 @@ const fogFrag = /* glsl */ `
52
53
  gl_FragColor = vec4(uFogColor, g * vAlpha * uDensity);
53
54
  }
54
55
  `;
55
- const VolumetricFogEffect = ({ boundingRadius, config, animations }) => {
56
+ const VolumetricFogEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
56
57
  const { particleCount, fogRadius, driftSpeed, fogColor, density, opacity, intensity } = config;
57
58
  const startValuesCacheRef = useRef({});
59
+ const rootRef = useRef(null);
60
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
58
61
  const r = boundingRadius * fogRadius;
59
62
  const { geo, mat } = useMemo(() => {
60
63
  const N = Math.max(20, Math.min(particleCount, 200));
@@ -106,6 +109,6 @@ const VolumetricFogEffect = ({ boundingRadius, config, animations }) => {
106
109
  applyGenerativeAnimations([mat], animations, startValuesCacheRef.current, Date.now(), false);
107
110
  }
108
111
  });
109
- return _jsx("points", { geometry: geo, material: mat });
112
+ return _jsx("points", { ref: rootRef, geometry: geo, material: mat });
110
113
  };
111
114
  export default VolumetricFogEffect;
@@ -0,0 +1,28 @@
1
+ export type { CoronaProps } from './Corona';
2
+ export type { FireProps } from './Fire';
3
+ export type { FlaresProps } from './Flares';
4
+ export type { SmokeRibbonProps } from './SmokeRibbon';
5
+ export { default as AuraEffect } from './AuraEffect';
6
+ export { default as AuroraEffect } from './AuroraEffect';
7
+ export { default as BlackHoleEffect } from './BlackHoleEffect';
8
+ export { default as ConstellationEffect } from './ConstellationEffect';
9
+ export { default as Corona } from './Corona';
10
+ export { default as DataStreamEffect } from './DataStreamEffect';
11
+ export { default as DnaHelixEffect } from './DnaHelixEffect';
12
+ export { default as Fire } from './Fire';
13
+ export { default as FireEffect } from './FireEffect';
14
+ export { default as Flares } from './Flares';
15
+ export { default as ForcefieldEffect } from './ForcefieldEffect';
16
+ export { default as HologramEffect } from './HologramEffect';
17
+ export { default as IceCrystalsEffect } from './IceCrystalsEffect';
18
+ export { default as LightningEffect } from './LightningEffect';
19
+ export { default as MoleculesEffect } from './MoleculesEffect';
20
+ export { default as NeuralNetworkEffect } from './NeuralNetworkEffect';
21
+ export { default as OrbEffect } from './OrbEffect';
22
+ export { default as PortalEffect } from './PortalEffect';
23
+ export { default as ShockwaveEffect } from './ShockwaveEffect';
24
+ export { default as SmokePlumeEffect } from './SmokePlumeEffect';
25
+ export { default as SmokeRibbon } from './SmokeRibbon';
26
+ export { default as SmokeRingEffect } from './SmokeRingEffect';
27
+ export { default as VolumetricFogEffect } from './VolumetricFogEffect';
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/effects/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}