@3driseai/3drise-viewer 0.1.28 → 0.1.30

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 (804) hide show
  1. package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
  2. package/dist/animationsV2/ClipPlayer.js +13 -9
  3. package/dist/animationsV2/ClipsRuntime.d.ts +48 -3
  4. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  5. package/dist/animationsV2/ClipsRuntime.js +239 -57
  6. package/dist/animationsV2/appliers.d.ts.map +1 -1
  7. package/dist/animationsV2/appliers.js +21 -5
  8. package/dist/animationsV2/clipUtils.js +1 -1
  9. package/dist/animationsV2/index.d.ts +1 -1
  10. package/dist/animationsV2/index.d.ts.map +1 -1
  11. package/dist/animationsV2/normalize.d.ts.map +1 -1
  12. package/dist/animationsV2/normalize.js +7 -3
  13. package/dist/animationsV2/sequenceUtils.d.ts +49 -6
  14. package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
  15. package/dist/animationsV2/sequenceUtils.js +68 -12
  16. package/dist/animationsV2/types.d.ts +28 -12
  17. package/dist/animationsV2/types.d.ts.map +1 -1
  18. package/dist/api/sceneHandle.d.ts +35 -1
  19. package/dist/api/sceneHandle.d.ts.map +1 -1
  20. package/dist/api/sceneHandle.js +88 -17
  21. package/dist/components/AdvancedGrid.d.ts +1 -5
  22. package/dist/components/AdvancedGrid.d.ts.map +1 -1
  23. package/dist/components/AdvancedGrid.js +6 -35
  24. package/dist/components/AnimatedObject.d.ts.map +1 -1
  25. package/dist/components/AnimatedObject.js +9 -4
  26. package/dist/components/ApollonianGrid.d.ts +1 -1
  27. package/dist/components/ApollonianGrid.d.ts.map +1 -1
  28. package/dist/components/ApollonianGrid.js +3 -28
  29. package/dist/components/ChladniGrid.d.ts +1 -1
  30. package/dist/components/ChladniGrid.d.ts.map +1 -1
  31. package/dist/components/ChladniGrid.js +6 -35
  32. package/dist/components/CircuitGrid.d.ts +1 -1
  33. package/dist/components/CircuitGrid.d.ts.map +1 -1
  34. package/dist/components/CircuitGrid.js +6 -34
  35. package/dist/components/ConformalGrid.d.ts +1 -1
  36. package/dist/components/ConformalGrid.d.ts.map +1 -1
  37. package/dist/components/ConformalGrid.js +3 -34
  38. package/dist/components/ContourGrid.d.ts +1 -1
  39. package/dist/components/ContourGrid.d.ts.map +1 -1
  40. package/dist/components/ContourGrid.js +6 -34
  41. package/dist/components/CustomPrimitive.js +1 -1
  42. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  43. package/dist/components/EffectsGenerator.js +43 -38
  44. package/dist/components/EnvironmentObject.d.ts.map +1 -1
  45. package/dist/components/EnvironmentObject.js +9 -7
  46. package/dist/components/FlowNetGrid.d.ts +1 -1
  47. package/dist/components/FlowNetGrid.d.ts.map +1 -1
  48. package/dist/components/FlowNetGrid.js +6 -34
  49. package/dist/components/FractalGrid.d.ts +1 -1
  50. package/dist/components/FractalGrid.d.ts.map +1 -1
  51. package/dist/components/FractalGrid.js +6 -37
  52. package/dist/components/Galaxy.d.ts.map +1 -1
  53. package/dist/components/Galaxy.js +9 -23
  54. package/dist/components/GeometryShape.d.ts.map +1 -1
  55. package/dist/components/GeometryShape.js +22 -2
  56. package/dist/components/GirihGrid.d.ts +1 -1
  57. package/dist/components/GirihGrid.d.ts.map +1 -1
  58. package/dist/components/GirihGrid.js +6 -35
  59. package/dist/components/GravWaveGrid.d.ts +1 -1
  60. package/dist/components/GravWaveGrid.d.ts.map +1 -1
  61. package/dist/components/GravWaveGrid.js +6 -35
  62. package/dist/components/HexGrid.d.ts +1 -5
  63. package/dist/components/HexGrid.d.ts.map +1 -1
  64. package/dist/components/HexGrid.js +6 -36
  65. package/dist/components/HilbertGrid.d.ts +1 -1
  66. package/dist/components/HilbertGrid.d.ts.map +1 -1
  67. package/dist/components/HilbertGrid.js +3 -30
  68. package/dist/components/HyperbolicGrid.d.ts +1 -1
  69. package/dist/components/HyperbolicGrid.d.ts.map +1 -1
  70. package/dist/components/HyperbolicGrid.js +6 -34
  71. package/dist/components/LandObject.d.ts +9 -0
  72. package/dist/components/LandObject.d.ts.map +1 -0
  73. package/dist/components/LandObject.js +15 -0
  74. package/dist/components/LensingGrid.d.ts +1 -1
  75. package/dist/components/LensingGrid.d.ts.map +1 -1
  76. package/dist/components/LensingGrid.js +3 -29
  77. package/dist/components/LightsManager.d.ts.map +1 -1
  78. package/dist/components/LightsManager.js +8 -0
  79. package/dist/components/ModelBoundary.d.ts +2 -0
  80. package/dist/components/ModelBoundary.d.ts.map +1 -1
  81. package/dist/components/ModelBoundary.js +3 -0
  82. package/dist/components/ModelPrimitive.d.ts.map +1 -1
  83. package/dist/components/ModelPrimitive.js +6 -0
  84. package/dist/components/MoireGrid.d.ts +1 -1
  85. package/dist/components/MoireGrid.d.ts.map +1 -1
  86. package/dist/components/MoireGrid.js +6 -35
  87. package/dist/components/MoonDisc.d.ts +11 -0
  88. package/dist/components/MoonDisc.d.ts.map +1 -0
  89. package/dist/components/MoonDisc.js +128 -0
  90. package/dist/components/ObjectNode.d.ts.map +1 -1
  91. package/dist/components/ObjectNode.js +10 -10
  92. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  93. package/dist/components/ObjectsRenderer.js +7 -5
  94. package/dist/components/OceanBuilder.d.ts.map +1 -1
  95. package/dist/components/OceanBuilder.js +2 -0
  96. package/dist/components/ParastichyGrid.d.ts +1 -1
  97. package/dist/components/ParastichyGrid.d.ts.map +1 -1
  98. package/dist/components/ParastichyGrid.js +3 -30
  99. package/dist/components/ParticlesGenerator.d.ts.map +1 -1
  100. package/dist/components/ParticlesGenerator.js +44 -24
  101. package/dist/components/PhyllotaxisGrid.d.ts +1 -1
  102. package/dist/components/PhyllotaxisGrid.d.ts.map +1 -1
  103. package/dist/components/PhyllotaxisGrid.js +3 -32
  104. package/dist/components/PickVolume.d.ts +17 -0
  105. package/dist/components/PickVolume.d.ts.map +1 -0
  106. package/dist/components/PickVolume.js +20 -0
  107. package/dist/components/ProjectLoader.d.ts +5 -3
  108. package/dist/components/ProjectLoader.d.ts.map +1 -1
  109. package/dist/components/ProjectLoader.js +6 -3
  110. package/dist/components/QuasiGrid.d.ts +1 -1
  111. package/dist/components/QuasiGrid.d.ts.map +1 -1
  112. package/dist/components/QuasiGrid.js +6 -33
  113. package/dist/components/RadarGrid.d.ts +1 -1
  114. package/dist/components/RadarGrid.d.ts.map +1 -1
  115. package/dist/components/RadarGrid.js +6 -34
  116. package/dist/components/ReactionDiffusionGrid.d.ts +1 -1
  117. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
  118. package/dist/components/ReactionDiffusionGrid.js +6 -35
  119. package/dist/components/SceneBuilder.d.ts +25 -3
  120. package/dist/components/SceneBuilder.d.ts.map +1 -1
  121. package/dist/components/SceneBuilder.js +68 -38
  122. package/dist/components/SkyController.d.ts +25 -1
  123. package/dist/components/SkyController.d.ts.map +1 -1
  124. package/dist/components/SkyController.js +189 -130
  125. package/dist/components/SkyMesh.d.ts.map +1 -1
  126. package/dist/components/SkyMesh.js +26 -1
  127. package/dist/components/SkyStars.d.ts +11 -0
  128. package/dist/components/SkyStars.d.ts.map +1 -0
  129. package/dist/components/SkyStars.js +268 -0
  130. package/dist/components/SkySystem.d.ts +3 -3
  131. package/dist/components/SkySystem.d.ts.map +1 -1
  132. package/dist/components/SkySystem.js +8 -2
  133. package/dist/components/Sun.d.ts +15 -1
  134. package/dist/components/Sun.d.ts.map +1 -1
  135. package/dist/components/Sun.js +64 -3
  136. package/dist/components/SunLight.d.ts +6 -1
  137. package/dist/components/SunLight.d.ts.map +1 -1
  138. package/dist/components/SunLight.js +96 -44
  139. package/dist/components/TerrainBuilder.d.ts.map +1 -1
  140. package/dist/components/TerrainBuilder.js +2 -0
  141. package/dist/components/TextGenerator.d.ts +9 -0
  142. package/dist/components/TextGenerator.d.ts.map +1 -0
  143. package/dist/components/TextGenerator.js +30 -0
  144. package/dist/components/TruchetGrid.d.ts +1 -1
  145. package/dist/components/TruchetGrid.d.ts.map +1 -1
  146. package/dist/components/TruchetGrid.js +3 -30
  147. package/dist/components/VoronoiGrid.d.ts +1 -1
  148. package/dist/components/VoronoiGrid.d.ts.map +1 -1
  149. package/dist/components/VoronoiGrid.js +6 -33
  150. package/dist/components/WallpaperGrid.d.ts +1 -1
  151. package/dist/components/WallpaperGrid.d.ts.map +1 -1
  152. package/dist/components/WallpaperGrid.js +6 -35
  153. package/dist/components/environment/Rain.d.ts +15 -0
  154. package/dist/components/environment/Rain.d.ts.map +1 -0
  155. package/dist/components/environment/Rain.js +110 -0
  156. package/dist/components/environment/Rainbow.d.ts +20 -0
  157. package/dist/components/environment/Rainbow.d.ts.map +1 -0
  158. package/dist/components/environment/Rainbow.js +974 -0
  159. package/dist/components/environment/Sandstorm.d.ts +20 -0
  160. package/dist/components/environment/Sandstorm.d.ts.map +1 -0
  161. package/dist/components/environment/Sandstorm.js +776 -0
  162. package/dist/components/environment/Snow.d.ts +20 -0
  163. package/dist/components/environment/Snow.d.ts.map +1 -0
  164. package/dist/components/environment/Snow.js +609 -0
  165. package/dist/components/environment/Thunderstorm.d.ts +20 -0
  166. package/dist/components/environment/Thunderstorm.d.ts.map +1 -0
  167. package/dist/components/environment/Thunderstorm.js +731 -0
  168. package/dist/components/environment/Tornado.d.ts +20 -0
  169. package/dist/components/environment/Tornado.d.ts.map +1 -0
  170. package/dist/components/environment/Tornado.js +762 -0
  171. package/dist/components/environment/index.d.ts +13 -0
  172. package/dist/components/environment/index.d.ts.map +1 -0
  173. package/dist/components/environment/index.js +7 -0
  174. package/dist/components/index.d.ts +11 -18
  175. package/dist/components/index.d.ts.map +1 -1
  176. package/dist/components/index.js +9 -10
  177. package/dist/components/land/LandPatch.d.ts +15 -0
  178. package/dist/components/land/LandPatch.d.ts.map +1 -0
  179. package/dist/components/land/LandPatch.js +170 -0
  180. package/dist/components/land/index.d.ts +3 -0
  181. package/dist/components/land/index.d.ts.map +1 -0
  182. package/dist/components/land/index.js +1 -0
  183. package/dist/components/particles/BioluminescentWakeParticles.d.ts +5 -0
  184. package/dist/components/particles/BioluminescentWakeParticles.d.ts.map +1 -1
  185. package/dist/components/particles/BioluminescentWakeParticles.js +2 -1
  186. package/dist/components/particles/BrownianDustParticles.d.ts +5 -0
  187. package/dist/components/particles/BrownianDustParticles.d.ts.map +1 -1
  188. package/dist/components/particles/BrownianDustParticles.js +2 -0
  189. package/dist/components/particles/ChladniSandParticles.d.ts +5 -0
  190. package/dist/components/particles/ChladniSandParticles.d.ts.map +1 -1
  191. package/dist/components/particles/ChladniSandParticles.js +2 -1
  192. package/dist/components/particles/ElectronOrbitalsParticles.d.ts +5 -0
  193. package/dist/components/particles/ElectronOrbitalsParticles.d.ts.map +1 -1
  194. package/dist/components/particles/ElectronOrbitalsParticles.js +2 -1
  195. package/dist/components/particles/FaradayPowderParticles.d.ts +5 -0
  196. package/dist/components/particles/FaradayPowderParticles.d.ts.map +1 -1
  197. package/dist/components/particles/FaradayPowderParticles.js +2 -1
  198. package/dist/components/particles/GrinderSparksParticles.d.ts +5 -0
  199. package/dist/components/particles/GrinderSparksParticles.d.ts.map +1 -1
  200. package/dist/components/particles/GrinderSparksParticles.js +2 -1
  201. package/dist/components/particles/MagneticBottleParticles.d.ts +5 -0
  202. package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -1
  203. package/dist/components/particles/MagneticBottleParticles.js +2 -1
  204. package/dist/components/particles/NeonRainParticles.d.ts +5 -0
  205. package/dist/components/particles/NeonRainParticles.d.ts.map +1 -1
  206. package/dist/components/particles/NeonRainParticles.js +2 -1
  207. package/dist/components/particles/ShapeBurstParticles.d.ts +5 -0
  208. package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -1
  209. package/dist/components/particles/ShapeBurstParticles.js +2 -1
  210. package/dist/components/particles/ShapeFlowParticles.d.ts +5 -0
  211. package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -1
  212. package/dist/components/particles/ShapeFlowParticles.js +2 -1
  213. package/dist/components/particles/TidalStreamParticles.d.ts +5 -0
  214. package/dist/components/particles/TidalStreamParticles.d.ts.map +1 -1
  215. package/dist/components/particles/TidalStreamParticles.js +2 -0
  216. package/dist/components/space/Earth.d.ts +16 -0
  217. package/dist/components/space/Earth.d.ts.map +1 -0
  218. package/dist/components/space/Earth.js +75 -0
  219. package/dist/components/space/ShootingStar.d.ts +21 -0
  220. package/dist/components/space/ShootingStar.d.ts.map +1 -0
  221. package/dist/components/space/ShootingStar.js +101 -0
  222. package/dist/components/space/ShootingStars.d.ts +16 -0
  223. package/dist/components/space/ShootingStars.d.ts.map +1 -0
  224. package/dist/components/space/ShootingStars.js +71 -0
  225. package/dist/components/space/SolarSystem.d.ts +16 -0
  226. package/dist/components/space/SolarSystem.d.ts.map +1 -0
  227. package/dist/components/space/SolarSystem.js +141 -0
  228. package/dist/components/space/Stars.d.ts +20 -0
  229. package/dist/components/space/Stars.d.ts.map +1 -0
  230. package/dist/components/space/Stars.js +160 -0
  231. package/dist/components/space/index.d.ts +11 -0
  232. package/dist/components/space/index.d.ts.map +1 -0
  233. package/dist/components/space/index.js +8 -0
  234. package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
  235. package/dist/components/terrain/TerrainSurface.js +27 -3
  236. package/dist/components/terrain/types.d.ts +5 -1
  237. package/dist/components/terrain/types.d.ts.map +1 -1
  238. package/dist/components/text/BurnAwayText.d.ts +15 -0
  239. package/dist/components/text/BurnAwayText.d.ts.map +1 -0
  240. package/dist/components/text/BurnAwayText.js +4 -0
  241. package/dist/components/text/ChalkboardText.d.ts +15 -0
  242. package/dist/components/text/ChalkboardText.d.ts.map +1 -0
  243. package/dist/components/text/ChalkboardText.js +4 -0
  244. package/dist/components/text/ConstellationText.d.ts +15 -0
  245. package/dist/components/text/ConstellationText.d.ts.map +1 -0
  246. package/dist/components/text/ConstellationText.js +4 -0
  247. package/dist/components/text/EmbroideryText.d.ts +15 -0
  248. package/dist/components/text/EmbroideryText.d.ts.map +1 -0
  249. package/dist/components/text/EmbroideryText.js +4 -0
  250. package/dist/components/text/FourierSketchText.d.ts +15 -0
  251. package/dist/components/text/FourierSketchText.d.ts.map +1 -0
  252. package/dist/components/text/FourierSketchText.js +4 -0
  253. package/dist/components/text/FrostGrowthText.d.ts +15 -0
  254. package/dist/components/text/FrostGrowthText.d.ts.map +1 -0
  255. package/dist/components/text/FrostGrowthText.js +4 -0
  256. package/dist/components/text/HandwritingText.d.ts +15 -0
  257. package/dist/components/text/HandwritingText.d.ts.map +1 -0
  258. package/dist/components/text/HandwritingText.js +4 -0
  259. package/dist/components/text/InkBleedText.d.ts +15 -0
  260. package/dist/components/text/InkBleedText.d.ts.map +1 -0
  261. package/dist/components/text/InkBleedText.js +4 -0
  262. package/dist/components/text/LightPaintingText.d.ts +15 -0
  263. package/dist/components/text/LightPaintingText.d.ts.map +1 -0
  264. package/dist/components/text/LightPaintingText.js +4 -0
  265. package/dist/components/text/LiquidMetalText.d.ts +15 -0
  266. package/dist/components/text/LiquidMetalText.d.ts.map +1 -0
  267. package/dist/components/text/LiquidMetalText.js +4 -0
  268. package/dist/components/text/NeonTubeText.d.ts +15 -0
  269. package/dist/components/text/NeonTubeText.d.ts.map +1 -0
  270. package/dist/components/text/NeonTubeText.js +4 -0
  271. package/dist/components/text/PlainText.d.ts +15 -0
  272. package/dist/components/text/PlainText.d.ts.map +1 -0
  273. package/dist/components/text/PlainText.js +4 -0
  274. package/dist/components/text/PlasmaDischargeText.d.ts +15 -0
  275. package/dist/components/text/PlasmaDischargeText.d.ts.map +1 -0
  276. package/dist/components/text/PlasmaDischargeText.js +4 -0
  277. package/dist/components/text/TextObjectView.d.ts +14 -0
  278. package/dist/components/text/TextObjectView.d.ts.map +1 -0
  279. package/dist/components/text/TextObjectView.js +17 -0
  280. package/dist/components/text/engine/fieldkit.d.ts +24 -0
  281. package/dist/components/text/engine/fieldkit.d.ts.map +1 -0
  282. package/dist/components/text/engine/fieldkit.js +201 -0
  283. package/dist/components/text/engine/glyphs.d.ts +19 -0
  284. package/dist/components/text/engine/glyphs.d.ts.map +1 -0
  285. package/dist/components/text/engine/glyphs.js +269 -0
  286. package/dist/components/text/engine/looks/burnAway.d.ts +144 -0
  287. package/dist/components/text/engine/looks/burnAway.d.ts.map +1 -0
  288. package/dist/components/text/engine/looks/burnAway.js +593 -0
  289. package/dist/components/text/engine/looks/chalkboard.d.ts +135 -0
  290. package/dist/components/text/engine/looks/chalkboard.d.ts.map +1 -0
  291. package/dist/components/text/engine/looks/chalkboard.js +426 -0
  292. package/dist/components/text/engine/looks/constellation.d.ts +111 -0
  293. package/dist/components/text/engine/looks/constellation.d.ts.map +1 -0
  294. package/dist/components/text/engine/looks/constellation.js +496 -0
  295. package/dist/components/text/engine/looks/embroidery.d.ts +165 -0
  296. package/dist/components/text/engine/looks/embroidery.d.ts.map +1 -0
  297. package/dist/components/text/engine/looks/embroidery.js +645 -0
  298. package/dist/components/text/engine/looks/frostGrowth.d.ts +109 -0
  299. package/dist/components/text/engine/looks/frostGrowth.d.ts.map +1 -0
  300. package/dist/components/text/engine/looks/frostGrowth.js +727 -0
  301. package/dist/components/text/engine/looks/index.d.ts +2 -0
  302. package/dist/components/text/engine/looks/index.d.ts.map +1 -0
  303. package/dist/components/text/engine/looks/index.js +49 -0
  304. package/dist/components/text/engine/looks/inkBleed.d.ts +103 -0
  305. package/dist/components/text/engine/looks/inkBleed.d.ts.map +1 -0
  306. package/dist/components/text/engine/looks/inkBleed.js +590 -0
  307. package/dist/components/text/engine/looks/lightPainting.d.ts +132 -0
  308. package/dist/components/text/engine/looks/lightPainting.d.ts.map +1 -0
  309. package/dist/components/text/engine/looks/lightPainting.js +567 -0
  310. package/dist/components/text/engine/looks/liquidMetal.d.ts +135 -0
  311. package/dist/components/text/engine/looks/liquidMetal.d.ts.map +1 -0
  312. package/dist/components/text/engine/looks/liquidMetal.js +655 -0
  313. package/dist/components/text/engine/looks/plain.d.ts +146 -0
  314. package/dist/components/text/engine/looks/plain.d.ts.map +1 -0
  315. package/dist/components/text/engine/looks/plain.js +104 -0
  316. package/dist/components/text/engine/looks/plasmaDischarge.d.ts +126 -0
  317. package/dist/components/text/engine/looks/plasmaDischarge.d.ts.map +1 -0
  318. package/dist/components/text/engine/looks/plasmaDischarge.js +763 -0
  319. package/dist/components/text/engine/methods.d.ts +19 -0
  320. package/dist/components/text/engine/methods.d.ts.map +1 -0
  321. package/dist/components/text/engine/methods.js +126 -0
  322. package/dist/components/text/engine/playback.d.ts +40 -0
  323. package/dist/components/text/engine/playback.d.ts.map +1 -0
  324. package/dist/components/text/engine/playback.js +114 -0
  325. package/dist/components/text/engine/ribbon.d.ts +58 -0
  326. package/dist/components/text/engine/ribbon.d.ts.map +1 -0
  327. package/dist/components/text/engine/ribbon.js +250 -0
  328. package/dist/components/text/engine/variants.d.ts +159 -0
  329. package/dist/components/text/engine/variants.d.ts.map +1 -0
  330. package/dist/components/text/engine/variants.js +378 -0
  331. package/dist/components/text/fonts/architects-daughter.outline.d.ts +3 -0
  332. package/dist/components/text/fonts/architects-daughter.outline.d.ts.map +1 -0
  333. package/dist/components/text/fonts/architects-daughter.outline.js +4 -0
  334. package/dist/components/text/fonts/architects-daughter.strokes.d.ts +3 -0
  335. package/dist/components/text/fonts/architects-daughter.strokes.d.ts.map +1 -0
  336. package/dist/components/text/fonts/architects-daughter.strokes.js +4 -0
  337. package/dist/components/text/fonts/bebas-neue.outline.d.ts +3 -0
  338. package/dist/components/text/fonts/bebas-neue.outline.d.ts.map +1 -0
  339. package/dist/components/text/fonts/bebas-neue.outline.js +4 -0
  340. package/dist/components/text/fonts/bebas-neue.strokes.d.ts +3 -0
  341. package/dist/components/text/fonts/bebas-neue.strokes.d.ts.map +1 -0
  342. package/dist/components/text/fonts/bebas-neue.strokes.js +4 -0
  343. package/dist/components/text/fonts/caveat.outline.d.ts +3 -0
  344. package/dist/components/text/fonts/caveat.outline.d.ts.map +1 -0
  345. package/dist/components/text/fonts/caveat.outline.js +4 -0
  346. package/dist/components/text/fonts/caveat.strokes.d.ts +3 -0
  347. package/dist/components/text/fonts/caveat.strokes.d.ts.map +1 -0
  348. package/dist/components/text/fonts/caveat.strokes.js +4 -0
  349. package/dist/components/text/fonts/courgette.outline.d.ts +3 -0
  350. package/dist/components/text/fonts/courgette.outline.d.ts.map +1 -0
  351. package/dist/components/text/fonts/courgette.outline.js +4 -0
  352. package/dist/components/text/fonts/courgette.strokes.d.ts +3 -0
  353. package/dist/components/text/fonts/courgette.strokes.d.ts.map +1 -0
  354. package/dist/components/text/fonts/courgette.strokes.js +4 -0
  355. package/dist/components/text/fonts/dancing-script.outline.d.ts +3 -0
  356. package/dist/components/text/fonts/dancing-script.outline.d.ts.map +1 -0
  357. package/dist/components/text/fonts/dancing-script.outline.js +4 -0
  358. package/dist/components/text/fonts/dancing-script.strokes.d.ts +3 -0
  359. package/dist/components/text/fonts/dancing-script.strokes.d.ts.map +1 -0
  360. package/dist/components/text/fonts/dancing-script.strokes.js +4 -0
  361. package/dist/components/text/fonts/gochi-hand.outline.d.ts +3 -0
  362. package/dist/components/text/fonts/gochi-hand.outline.d.ts.map +1 -0
  363. package/dist/components/text/fonts/gochi-hand.outline.js +4 -0
  364. package/dist/components/text/fonts/gochi-hand.strokes.d.ts +3 -0
  365. package/dist/components/text/fonts/gochi-hand.strokes.d.ts.map +1 -0
  366. package/dist/components/text/fonts/gochi-hand.strokes.js +4 -0
  367. package/dist/components/text/fonts/handlee.outline.d.ts +3 -0
  368. package/dist/components/text/fonts/handlee.outline.d.ts.map +1 -0
  369. package/dist/components/text/fonts/handlee.outline.js +4 -0
  370. package/dist/components/text/fonts/handlee.strokes.d.ts +3 -0
  371. package/dist/components/text/fonts/handlee.strokes.d.ts.map +1 -0
  372. package/dist/components/text/fonts/handlee.strokes.js +4 -0
  373. package/dist/components/text/fonts/index.d.ts +5 -0
  374. package/dist/components/text/fonts/index.d.ts.map +1 -0
  375. package/dist/components/text/fonts/index.js +58 -0
  376. package/dist/components/text/fonts/indie-flower.outline.d.ts +3 -0
  377. package/dist/components/text/fonts/indie-flower.outline.d.ts.map +1 -0
  378. package/dist/components/text/fonts/indie-flower.outline.js +4 -0
  379. package/dist/components/text/fonts/indie-flower.strokes.d.ts +3 -0
  380. package/dist/components/text/fonts/indie-flower.strokes.d.ts.map +1 -0
  381. package/dist/components/text/fonts/indie-flower.strokes.js +4 -0
  382. package/dist/components/text/fonts/inter.outline.d.ts +3 -0
  383. package/dist/components/text/fonts/inter.outline.d.ts.map +1 -0
  384. package/dist/components/text/fonts/inter.outline.js +4 -0
  385. package/dist/components/text/fonts/inter.strokes.d.ts +3 -0
  386. package/dist/components/text/fonts/inter.strokes.d.ts.map +1 -0
  387. package/dist/components/text/fonts/inter.strokes.js +4 -0
  388. package/dist/components/text/fonts/kalam.outline.d.ts +3 -0
  389. package/dist/components/text/fonts/kalam.outline.d.ts.map +1 -0
  390. package/dist/components/text/fonts/kalam.outline.js +4 -0
  391. package/dist/components/text/fonts/kalam.strokes.d.ts +3 -0
  392. package/dist/components/text/fonts/kalam.strokes.d.ts.map +1 -0
  393. package/dist/components/text/fonts/kalam.strokes.js +4 -0
  394. package/dist/components/text/fonts/kaushan-script.outline.d.ts +3 -0
  395. package/dist/components/text/fonts/kaushan-script.outline.d.ts.map +1 -0
  396. package/dist/components/text/fonts/kaushan-script.outline.js +4 -0
  397. package/dist/components/text/fonts/kaushan-script.strokes.d.ts +3 -0
  398. package/dist/components/text/fonts/kaushan-script.strokes.d.ts.map +1 -0
  399. package/dist/components/text/fonts/kaushan-script.strokes.js +4 -0
  400. package/dist/components/text/fonts/lora.outline.d.ts +3 -0
  401. package/dist/components/text/fonts/lora.outline.d.ts.map +1 -0
  402. package/dist/components/text/fonts/lora.outline.js +4 -0
  403. package/dist/components/text/fonts/lora.strokes.d.ts +3 -0
  404. package/dist/components/text/fonts/lora.strokes.d.ts.map +1 -0
  405. package/dist/components/text/fonts/lora.strokes.js +4 -0
  406. package/dist/components/text/fonts/montserrat.outline.d.ts +3 -0
  407. package/dist/components/text/fonts/montserrat.outline.d.ts.map +1 -0
  408. package/dist/components/text/fonts/montserrat.outline.js +4 -0
  409. package/dist/components/text/fonts/montserrat.strokes.d.ts +3 -0
  410. package/dist/components/text/fonts/montserrat.strokes.d.ts.map +1 -0
  411. package/dist/components/text/fonts/montserrat.strokes.js +4 -0
  412. package/dist/components/text/fonts/mynerve.outline.d.ts +3 -0
  413. package/dist/components/text/fonts/mynerve.outline.d.ts.map +1 -0
  414. package/dist/components/text/fonts/mynerve.outline.js +4 -0
  415. package/dist/components/text/fonts/mynerve.strokes.d.ts +3 -0
  416. package/dist/components/text/fonts/mynerve.strokes.d.ts.map +1 -0
  417. package/dist/components/text/fonts/mynerve.strokes.js +4 -0
  418. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts +3 -0
  419. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts.map +1 -0
  420. package/dist/components/text/fonts/nanum-pen-script.outline.js +4 -0
  421. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts +3 -0
  422. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts.map +1 -0
  423. package/dist/components/text/fonts/nanum-pen-script.strokes.js +4 -0
  424. package/dist/components/text/fonts/oswald.outline.d.ts +3 -0
  425. package/dist/components/text/fonts/oswald.outline.d.ts.map +1 -0
  426. package/dist/components/text/fonts/oswald.outline.js +4 -0
  427. package/dist/components/text/fonts/oswald.strokes.d.ts +3 -0
  428. package/dist/components/text/fonts/oswald.strokes.d.ts.map +1 -0
  429. package/dist/components/text/fonts/oswald.strokes.js +4 -0
  430. package/dist/components/text/fonts/pacifico.outline.d.ts +3 -0
  431. package/dist/components/text/fonts/pacifico.outline.d.ts.map +1 -0
  432. package/dist/components/text/fonts/pacifico.outline.js +4 -0
  433. package/dist/components/text/fonts/pacifico.strokes.d.ts +3 -0
  434. package/dist/components/text/fonts/pacifico.strokes.d.ts.map +1 -0
  435. package/dist/components/text/fonts/pacifico.strokes.js +4 -0
  436. package/dist/components/text/fonts/patrick-hand.outline.d.ts +3 -0
  437. package/dist/components/text/fonts/patrick-hand.outline.d.ts.map +1 -0
  438. package/dist/components/text/fonts/patrick-hand.outline.js +4 -0
  439. package/dist/components/text/fonts/patrick-hand.strokes.d.ts +3 -0
  440. package/dist/components/text/fonts/patrick-hand.strokes.d.ts.map +1 -0
  441. package/dist/components/text/fonts/patrick-hand.strokes.js +4 -0
  442. package/dist/components/text/fonts/playfair-display.outline.d.ts +3 -0
  443. package/dist/components/text/fonts/playfair-display.outline.d.ts.map +1 -0
  444. package/dist/components/text/fonts/playfair-display.outline.js +4 -0
  445. package/dist/components/text/fonts/playfair-display.strokes.d.ts +3 -0
  446. package/dist/components/text/fonts/playfair-display.strokes.d.ts.map +1 -0
  447. package/dist/components/text/fonts/playfair-display.strokes.js +4 -0
  448. package/dist/components/text/fonts/poppins.outline.d.ts +3 -0
  449. package/dist/components/text/fonts/poppins.outline.d.ts.map +1 -0
  450. package/dist/components/text/fonts/poppins.outline.js +4 -0
  451. package/dist/components/text/fonts/poppins.strokes.d.ts +3 -0
  452. package/dist/components/text/fonts/poppins.strokes.d.ts.map +1 -0
  453. package/dist/components/text/fonts/poppins.strokes.js +4 -0
  454. package/dist/components/text/fonts/roboto.outline.d.ts +3 -0
  455. package/dist/components/text/fonts/roboto.outline.d.ts.map +1 -0
  456. package/dist/components/text/fonts/roboto.outline.js +4 -0
  457. package/dist/components/text/fonts/roboto.strokes.d.ts +3 -0
  458. package/dist/components/text/fonts/roboto.strokes.d.ts.map +1 -0
  459. package/dist/components/text/fonts/roboto.strokes.js +4 -0
  460. package/dist/components/text/fonts/satisfy.outline.d.ts +3 -0
  461. package/dist/components/text/fonts/satisfy.outline.d.ts.map +1 -0
  462. package/dist/components/text/fonts/satisfy.outline.js +4 -0
  463. package/dist/components/text/fonts/satisfy.strokes.d.ts +3 -0
  464. package/dist/components/text/fonts/satisfy.strokes.d.ts.map +1 -0
  465. package/dist/components/text/fonts/satisfy.strokes.js +4 -0
  466. package/dist/components/text/fonts/sriracha.outline.d.ts +3 -0
  467. package/dist/components/text/fonts/sriracha.outline.d.ts.map +1 -0
  468. package/dist/components/text/fonts/sriracha.outline.js +4 -0
  469. package/dist/components/text/fonts/sriracha.strokes.d.ts +3 -0
  470. package/dist/components/text/fonts/sriracha.strokes.d.ts.map +1 -0
  471. package/dist/components/text/fonts/sriracha.strokes.js +4 -0
  472. package/dist/components/text/index.d.ts +29 -0
  473. package/dist/components/text/index.d.ts.map +1 -0
  474. package/dist/components/text/index.js +14 -0
  475. package/dist/components/text/useTextObject.d.ts +22 -0
  476. package/dist/components/text/useTextObject.d.ts.map +1 -0
  477. package/dist/components/text/useTextObject.js +130 -0
  478. package/dist/components/water/OceanSurface.d.ts.map +1 -1
  479. package/dist/components/water/OceanSurface.js +3 -1
  480. package/dist/components/water/WaterBody.d.ts.map +1 -1
  481. package/dist/components/water/WaterBody.js +3 -1
  482. package/dist/components/water/types.d.ts +5 -1
  483. package/dist/components/water/types.d.ts.map +1 -1
  484. package/dist/constants.d.ts.map +1 -1
  485. package/dist/constants.js +6 -0
  486. package/dist/hooks/index.d.ts +2 -0
  487. package/dist/hooks/index.d.ts.map +1 -1
  488. package/dist/hooks/index.js +1 -0
  489. package/dist/hooks/useCloudSun.d.ts +9 -4
  490. package/dist/hooks/useCloudSun.d.ts.map +1 -1
  491. package/dist/hooks/useCloudSun.js +17 -7
  492. package/dist/hooks/useConfigLive.d.ts +3 -2
  493. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  494. package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
  495. package/dist/hooks/useContinuousEffects.js +4 -10
  496. package/dist/hooks/useEnvironmentProbe.d.ts +3 -22
  497. package/dist/hooks/useEnvironmentProbe.d.ts.map +1 -1
  498. package/dist/hooks/useEnvironmentProbe.js +47 -8
  499. package/dist/hooks/useGridSurface.d.ts +3 -10
  500. package/dist/hooks/useGridSurface.d.ts.map +1 -1
  501. package/dist/hooks/useGridSurface.js +5 -31
  502. package/dist/hooks/useInteraction.d.ts.map +1 -1
  503. package/dist/hooks/useInteraction.js +19 -72
  504. package/dist/hooks/useLightConfig.d.ts +2 -1
  505. package/dist/hooks/useLightConfig.d.ts.map +1 -1
  506. package/dist/hooks/useOceanMaterial.d.ts +6 -2
  507. package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
  508. package/dist/hooks/useOceanMaterial.js +37 -2
  509. package/dist/hooks/useSkyLive.d.ts +23 -0
  510. package/dist/hooks/useSkyLive.d.ts.map +1 -0
  511. package/dist/hooks/useSkyLive.js +30 -0
  512. package/dist/hooks/useSkyUniforms.d.ts.map +1 -1
  513. package/dist/hooks/useSkyUniforms.js +2 -10
  514. package/dist/hooks/useTerrainLive.d.ts +3 -1
  515. package/dist/hooks/useTerrainLive.d.ts.map +1 -1
  516. package/dist/hooks/useTerrainTextures.d.ts +38 -0
  517. package/dist/hooks/useTerrainTextures.d.ts.map +1 -0
  518. package/dist/hooks/useTerrainTextures.js +149 -0
  519. package/dist/index.d.ts +12 -3
  520. package/dist/index.d.ts.map +1 -1
  521. package/dist/index.js +9 -2
  522. package/dist/operations/catalogue/blastOff.d.ts +3 -0
  523. package/dist/operations/catalogue/blastOff.d.ts.map +1 -0
  524. package/dist/operations/catalogue/blastOff.js +118 -0
  525. package/dist/operations/catalogue/bounce.d.ts +3 -0
  526. package/dist/operations/catalogue/bounce.d.ts.map +1 -0
  527. package/dist/operations/catalogue/bounce.js +34 -0
  528. package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -1
  529. package/dist/operations/catalogue/curlSmoke.js +3 -1
  530. package/dist/operations/catalogue/dissolve.d.ts.map +1 -1
  531. package/dist/operations/catalogue/dissolve.js +2 -1
  532. package/dist/operations/catalogue/driftUp.d.ts +3 -0
  533. package/dist/operations/catalogue/driftUp.d.ts.map +1 -0
  534. package/dist/operations/catalogue/driftUp.js +57 -0
  535. package/dist/operations/catalogue/emberAsh.d.ts.map +1 -1
  536. package/dist/operations/catalogue/emberAsh.js +2 -1
  537. package/dist/operations/catalogue/flip.d.ts.map +1 -1
  538. package/dist/operations/catalogue/flip.js +19 -9
  539. package/dist/operations/catalogue/float.d.ts +3 -0
  540. package/dist/operations/catalogue/float.d.ts.map +1 -0
  541. package/dist/operations/catalogue/float.js +39 -0
  542. package/dist/operations/catalogue/flock.d.ts.map +1 -1
  543. package/dist/operations/catalogue/flock.js +44 -9
  544. package/dist/operations/catalogue/flyBy.d.ts +3 -0
  545. package/dist/operations/catalogue/flyBy.d.ts.map +1 -0
  546. package/dist/operations/catalogue/flyBy.js +79 -0
  547. package/dist/operations/catalogue/frost.d.ts.map +1 -1
  548. package/dist/operations/catalogue/frost.js +10 -3
  549. package/dist/operations/catalogue/grow.d.ts +3 -0
  550. package/dist/operations/catalogue/grow.d.ts.map +1 -0
  551. package/dist/operations/catalogue/grow.js +19 -0
  552. package/dist/operations/catalogue/hologram.d.ts.map +1 -1
  553. package/dist/operations/catalogue/hologram.js +11 -5
  554. package/dist/operations/catalogue/inkBloom.d.ts.map +1 -1
  555. package/dist/operations/catalogue/inkBloom.js +46 -9
  556. package/dist/operations/catalogue/jelly.d.ts.map +1 -1
  557. package/dist/operations/catalogue/jelly.js +18 -8
  558. package/dist/operations/catalogue/knockAway.d.ts +3 -0
  559. package/dist/operations/catalogue/knockAway.d.ts.map +1 -0
  560. package/dist/operations/catalogue/knockAway.js +74 -0
  561. package/dist/operations/catalogue/leafFall.d.ts +3 -0
  562. package/dist/operations/catalogue/leafFall.d.ts.map +1 -0
  563. package/dist/operations/catalogue/leafFall.js +74 -0
  564. package/dist/operations/catalogue/lidarScan.d.ts.map +1 -1
  565. package/dist/operations/catalogue/lidarScan.js +4 -1
  566. package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -1
  567. package/dist/operations/catalogue/liquidMetal.js +41 -12
  568. package/dist/operations/catalogue/metalize.d.ts.map +1 -1
  569. package/dist/operations/catalogue/metalize.js +8 -2
  570. package/dist/operations/catalogue/motionTrail.d.ts +6 -0
  571. package/dist/operations/catalogue/motionTrail.d.ts.map +1 -0
  572. package/dist/operations/catalogue/motionTrail.js +221 -0
  573. package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -1
  574. package/dist/operations/catalogue/particleSwarm.js +29 -9
  575. package/dist/operations/catalogue/petalPeel.d.ts.map +1 -1
  576. package/dist/operations/catalogue/petalPeel.js +33 -9
  577. package/dist/operations/catalogue/petrify.d.ts.map +1 -1
  578. package/dist/operations/catalogue/petrify.js +9 -3
  579. package/dist/operations/catalogue/physicalExit.d.ts +55 -0
  580. package/dist/operations/catalogue/physicalExit.d.ts.map +1 -0
  581. package/dist/operations/catalogue/physicalExit.js +165 -0
  582. package/dist/operations/catalogue/physicalHeld.d.ts +41 -0
  583. package/dist/operations/catalogue/physicalHeld.d.ts.map +1 -0
  584. package/dist/operations/catalogue/physicalHeld.js +78 -0
  585. package/dist/operations/catalogue/physicalMix.d.ts +45 -0
  586. package/dist/operations/catalogue/physicalMix.d.ts.map +1 -0
  587. package/dist/operations/catalogue/physicalMix.js +144 -0
  588. package/dist/operations/catalogue/pop.d.ts +3 -0
  589. package/dist/operations/catalogue/pop.d.ts.map +1 -0
  590. package/dist/operations/catalogue/pop.js +44 -0
  591. package/dist/operations/catalogue/portal.d.ts.map +1 -1
  592. package/dist/operations/catalogue/portal.js +33 -11
  593. package/dist/operations/catalogue/print3d.d.ts.map +1 -1
  594. package/dist/operations/catalogue/print3d.js +5 -1
  595. package/dist/operations/catalogue/pulse.d.ts +3 -0
  596. package/dist/operations/catalogue/pulse.d.ts.map +1 -0
  597. package/dist/operations/catalogue/pulse.js +29 -0
  598. package/dist/operations/catalogue/restPose.d.ts +5 -7
  599. package/dist/operations/catalogue/restPose.d.ts.map +1 -1
  600. package/dist/operations/catalogue/restPose.js +18 -48
  601. package/dist/operations/catalogue/rotate.d.ts +3 -0
  602. package/dist/operations/catalogue/rotate.d.ts.map +1 -0
  603. package/dist/operations/catalogue/rotate.js +49 -0
  604. package/dist/operations/catalogue/sandErosion.d.ts.map +1 -1
  605. package/dist/operations/catalogue/sandErosion.js +36 -14
  606. package/dist/operations/catalogue/shake.d.ts +3 -0
  607. package/dist/operations/catalogue/shake.d.ts.map +1 -0
  608. package/dist/operations/catalogue/shake.js +31 -0
  609. package/dist/operations/catalogue/shatter.d.ts.map +1 -1
  610. package/dist/operations/catalogue/shatter.js +5 -1
  611. package/dist/operations/catalogue/slam.d.ts +3 -0
  612. package/dist/operations/catalogue/slam.d.ts.map +1 -0
  613. package/dist/operations/catalogue/slam.js +89 -0
  614. package/dist/operations/catalogue/slingshot.d.ts +3 -0
  615. package/dist/operations/catalogue/slingshot.d.ts.map +1 -0
  616. package/dist/operations/catalogue/slingshot.js +88 -0
  617. package/dist/operations/catalogue/spin.d.ts.map +1 -1
  618. package/dist/operations/catalogue/spin.js +24 -13
  619. package/dist/operations/catalogue/sway.d.ts +3 -0
  620. package/dist/operations/catalogue/sway.d.ts.map +1 -0
  621. package/dist/operations/catalogue/sway.js +23 -0
  622. package/dist/operations/catalogue/swirl.d.ts.map +1 -1
  623. package/dist/operations/catalogue/swirl.js +6 -5
  624. package/dist/operations/catalogue/teleport.d.ts.map +1 -1
  625. package/dist/operations/catalogue/teleport.js +43 -12
  626. package/dist/operations/catalogue/trailCore.d.ts +89 -0
  627. package/dist/operations/catalogue/trailCore.d.ts.map +1 -0
  628. package/dist/operations/catalogue/trailCore.js +190 -0
  629. package/dist/operations/catalogue/trailGhosts.d.ts +5 -0
  630. package/dist/operations/catalogue/trailGhosts.d.ts.map +1 -0
  631. package/dist/operations/catalogue/trailGhosts.js +179 -0
  632. package/dist/operations/catalogue/trailStampStyles.d.ts +11 -0
  633. package/dist/operations/catalogue/trailStampStyles.d.ts.map +1 -0
  634. package/dist/operations/catalogue/trailStampStyles.js +479 -0
  635. package/dist/operations/catalogue/trailStamps.d.ts +57 -0
  636. package/dist/operations/catalogue/trailStamps.d.ts.map +1 -0
  637. package/dist/operations/catalogue/trailStamps.js +349 -0
  638. package/dist/operations/catalogue/trailStreaks.d.ts +3 -0
  639. package/dist/operations/catalogue/trailStreaks.d.ts.map +1 -0
  640. package/dist/operations/catalogue/trailStreaks.js +147 -0
  641. package/dist/operations/catalogue/transitionField.d.ts +30 -0
  642. package/dist/operations/catalogue/transitionField.d.ts.map +1 -1
  643. package/dist/operations/catalogue/transitionField.js +21 -0
  644. package/dist/operations/catalogue/turnAway.d.ts +3 -0
  645. package/dist/operations/catalogue/turnAway.d.ts.map +1 -0
  646. package/dist/operations/catalogue/turnAway.js +54 -0
  647. package/dist/operations/catalogue/unweave.d.ts.map +1 -1
  648. package/dist/operations/catalogue/unweave.js +34 -15
  649. package/dist/operations/catalogue/vortexDrain.d.ts +3 -0
  650. package/dist/operations/catalogue/vortexDrain.d.ts.map +1 -0
  651. package/dist/operations/catalogue/vortexDrain.js +68 -0
  652. package/dist/operations/catalogue/voxelize.d.ts.map +1 -1
  653. package/dist/operations/catalogue/voxelize.js +37 -10
  654. package/dist/operations/catalogue/warp.d.ts +3 -0
  655. package/dist/operations/catalogue/warp.d.ts.map +1 -0
  656. package/dist/operations/catalogue/warp.js +73 -0
  657. package/dist/operations/catalogue/whoosh.d.ts +3 -0
  658. package/dist/operations/catalogue/whoosh.d.ts.map +1 -0
  659. package/dist/operations/catalogue/whoosh.js +84 -0
  660. package/dist/operations/catalogue/wobble.d.ts +3 -0
  661. package/dist/operations/catalogue/wobble.d.ts.map +1 -0
  662. package/dist/operations/catalogue/wobble.js +23 -0
  663. package/dist/operations/clipPreview.d.ts +3 -0
  664. package/dist/operations/clipPreview.d.ts.map +1 -0
  665. package/dist/operations/clipPreview.js +20 -0
  666. package/dist/operations/groupFanout.d.ts +96 -0
  667. package/dist/operations/groupFanout.d.ts.map +1 -0
  668. package/dist/operations/groupFanout.js +365 -0
  669. package/dist/operations/groups.d.ts +20 -0
  670. package/dist/operations/groups.d.ts.map +1 -0
  671. package/dist/operations/groups.js +66 -0
  672. package/dist/operations/index.d.ts +5 -2
  673. package/dist/operations/index.d.ts.map +1 -1
  674. package/dist/operations/index.js +5 -2
  675. package/dist/operations/objectEffects.d.ts +161 -6
  676. package/dist/operations/objectEffects.d.ts.map +1 -1
  677. package/dist/operations/objectEffects.js +1091 -17
  678. package/dist/operations/registry.d.ts.map +1 -1
  679. package/dist/operations/registry.js +24 -2
  680. package/dist/operations/runtime.d.ts +57 -2
  681. package/dist/operations/runtime.d.ts.map +1 -1
  682. package/dist/operations/runtime.js +161 -18
  683. package/dist/operations/types.d.ts +60 -3
  684. package/dist/operations/types.d.ts.map +1 -1
  685. package/dist/operations/types.js +5 -1
  686. package/dist/operations/useObjectEffectLayers.d.ts +2 -2
  687. package/dist/operations/useObjectEffectLayers.d.ts.map +1 -1
  688. package/dist/operations/useObjectEffectLayers.js +31 -10
  689. package/dist/operations/usePresentedVisibility.d.ts +10 -0
  690. package/dist/operations/usePresentedVisibility.d.ts.map +1 -0
  691. package/dist/operations/usePresentedVisibility.js +53 -0
  692. package/dist/presets/terrainBiomes.d.ts +67 -0
  693. package/dist/presets/terrainBiomes.d.ts.map +1 -0
  694. package/dist/presets/terrainBiomes.js +294 -0
  695. package/dist/presets/terrainPresets.d.ts +6 -0
  696. package/dist/presets/terrainPresets.d.ts.map +1 -1
  697. package/dist/presets/terrainPresets.js +26 -38
  698. package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
  699. package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
  700. package/dist/shaders/glsl/oceanCore.glsl.js +17 -0
  701. package/dist/shaders/glsl/surfaceCore.glsl.d.ts +21 -0
  702. package/dist/shaders/glsl/surfaceCore.glsl.d.ts.map +1 -0
  703. package/dist/shaders/glsl/surfaceCore.glsl.js +120 -0
  704. package/dist/shaders/glsl/terrainCore.glsl.d.ts +16 -3
  705. package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -1
  706. package/dist/shaders/glsl/terrainCore.glsl.js +266 -20
  707. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +2 -0
  708. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
  709. package/dist/shaders/ocean/OceanSurfaceMaterial.js +3 -0
  710. package/dist/shaders/terrain/TerrainMaterial.d.ts +17 -0
  711. package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
  712. package/dist/shaders/terrain/TerrainMaterial.js +107 -8
  713. package/dist/triggers/engine.d.ts +44 -0
  714. package/dist/triggers/engine.d.ts.map +1 -0
  715. package/dist/triggers/engine.js +168 -0
  716. package/dist/triggers/hosts/actions.d.ts +8 -0
  717. package/dist/triggers/hosts/actions.d.ts.map +1 -0
  718. package/dist/triggers/hosts/actions.js +22 -0
  719. package/dist/triggers/hosts/interactions.d.ts +6 -0
  720. package/dist/triggers/hosts/interactions.d.ts.map +1 -0
  721. package/dist/triggers/hosts/interactions.js +4 -0
  722. package/dist/triggers/hosts/timelineCues.d.ts +2 -0
  723. package/dist/triggers/hosts/timelineCues.d.ts.map +1 -0
  724. package/dist/triggers/hosts/timelineCues.js +22 -0
  725. package/dist/triggers/index.d.ts +13 -0
  726. package/dist/triggers/index.d.ts.map +1 -0
  727. package/dist/triggers/index.js +9 -0
  728. package/dist/triggers/kinds/action.d.ts +2 -0
  729. package/dist/triggers/kinds/action.d.ts.map +1 -0
  730. package/dist/triggers/kinds/action.js +31 -0
  731. package/dist/triggers/kinds/animations.d.ts +2 -0
  732. package/dist/triggers/kinds/animations.d.ts.map +1 -0
  733. package/dist/triggers/kinds/animations.js +75 -0
  734. package/dist/triggers/kinds/effects.d.ts +2 -0
  735. package/dist/triggers/kinds/effects.d.ts.map +1 -0
  736. package/dist/triggers/kinds/effects.js +27 -0
  737. package/dist/triggers/kinds/index.d.ts +4 -0
  738. package/dist/triggers/kinds/index.d.ts.map +1 -0
  739. package/dist/triggers/kinds/index.js +4 -0
  740. package/dist/triggers/log.d.ts +21 -0
  741. package/dist/triggers/log.d.ts.map +1 -0
  742. package/dist/triggers/log.js +43 -0
  743. package/dist/triggers/readiness.d.ts +40 -0
  744. package/dist/triggers/readiness.d.ts.map +1 -0
  745. package/dist/triggers/readiness.js +158 -0
  746. package/dist/triggers/registry.d.ts +41 -0
  747. package/dist/triggers/registry.d.ts.map +1 -0
  748. package/dist/triggers/registry.js +7 -0
  749. package/dist/types/gridConfigs.d.ts +18 -23
  750. package/dist/types/gridConfigs.d.ts.map +1 -1
  751. package/dist/ui/UiAnchorUpdater.d.ts +10 -0
  752. package/dist/ui/UiAnchorUpdater.d.ts.map +1 -0
  753. package/dist/ui/UiAnchorUpdater.js +111 -0
  754. package/dist/ui/UiLayers.d.ts +20 -0
  755. package/dist/ui/UiLayers.d.ts.map +1 -0
  756. package/dist/ui/UiLayers.js +57 -0
  757. package/dist/ui/index.d.ts +9 -0
  758. package/dist/ui/index.d.ts.map +1 -0
  759. package/dist/ui/index.js +6 -0
  760. package/dist/ui/uiAnchors.d.ts +21 -0
  761. package/dist/ui/uiAnchors.d.ts.map +1 -0
  762. package/dist/ui/uiAnchors.js +22 -0
  763. package/dist/ui/uiBaseStyles.d.ts +2 -0
  764. package/dist/ui/uiBaseStyles.d.ts.map +1 -0
  765. package/dist/ui/uiBaseStyles.js +100 -0
  766. package/dist/ui/uiBinder.d.ts +30 -0
  767. package/dist/ui/uiBinder.d.ts.map +1 -0
  768. package/dist/ui/uiBinder.js +344 -0
  769. package/dist/utils/configAnimations.d.ts.map +1 -1
  770. package/dist/utils/configAnimations.js +5 -1
  771. package/dist/utils/gridConfig.d.ts +1 -1
  772. package/dist/utils/gridConfig.d.ts.map +1 -1
  773. package/dist/utils/gridConfig.js +1 -1
  774. package/dist/utils/landPatch.d.ts +33 -0
  775. package/dist/utils/landPatch.d.ts.map +1 -0
  776. package/dist/utils/landPatch.js +114 -0
  777. package/dist/utils/pickProxy.d.ts +11 -0
  778. package/dist/utils/pickProxy.d.ts.map +1 -0
  779. package/dist/utils/pickProxy.js +36 -0
  780. package/dist/utils/renderedSky.d.ts +32 -0
  781. package/dist/utils/renderedSky.d.ts.map +1 -0
  782. package/dist/utils/renderedSky.js +57 -0
  783. package/dist/utils/shapes.d.ts +4 -0
  784. package/dist/utils/shapes.d.ts.map +1 -1
  785. package/dist/utils/shapes.js +4 -1
  786. package/dist/utils/skyMoon.d.ts +35 -0
  787. package/dist/utils/skyMoon.d.ts.map +1 -0
  788. package/dist/utils/skyMoon.js +41 -0
  789. package/dist/utils/terrainHeight.d.ts +4 -0
  790. package/dist/utils/terrainHeight.d.ts.map +1 -0
  791. package/dist/utils/terrainHeight.js +150 -0
  792. package/dist/utils/terrainTextureResolver.d.ts +18 -0
  793. package/dist/utils/terrainTextureResolver.d.ts.map +1 -0
  794. package/dist/utils/terrainTextureResolver.js +17 -0
  795. package/dist/utils/terrainUniforms.d.ts +17 -0
  796. package/dist/utils/terrainUniforms.d.ts.map +1 -1
  797. package/dist/utils/terrainUniforms.js +84 -0
  798. package/dist/utils/textShape.d.ts +24 -0
  799. package/dist/utils/textShape.d.ts.map +1 -0
  800. package/dist/utils/textShape.js +102 -0
  801. package/dist/utils/textureArrays.d.ts +29 -0
  802. package/dist/utils/textureArrays.d.ts.map +1 -0
  803. package/dist/utils/textureArrays.js +140 -0
  804. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { useMemo, useRef } from 'react';
1
+ import { useRef } from 'react';
2
2
  import * as THREE from 'three';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  /**
@@ -6,28 +6,16 @@ import { useFrame } from '@react-three/fiber';
6
6
  *
7
7
  * Advances `u_time` with the raw clock (each shader applies its own
8
8
  * `u_animSpeed`, matching MyGridMaterial), mirrors the pointer into `u_mouse`
9
- * as NDC — the 3drise convention — projects the pointer onto the grid's own
10
- * plane for `u_focus` when `followMouse` is on, and drives `u_reveal` toward
11
- * its target.
12
- *
13
- * The pick plane is derived from the mesh's world matrix rather than hard-coded
14
- * to XZ, so the projection stays correct whether the grid lies flat or stands
15
- * upright, and whether or not the host applied a transform above it.
9
+ * as NDC — the 3drise convention — and drives `u_reveal` toward its target.
10
+ * `u_focus` stays at the origin: pointer behaviour is a Pointer-tab binding.
16
11
  *
17
12
  * Reveal is driven at a constant *rate* rather than by replaying a fixed
18
13
  * timeline, so retargeting mid-flight — the dissolve that starts while the
19
14
  * build is still running — continues smoothly from wherever it had got to
20
15
  * instead of snapping back to the start.
21
16
  */
22
- export function useGridSurface(materialRef, meshRef, options = {}) {
23
- const { followMouse = false, reveal = 1, revealDuration = 0 } = options;
24
- const scratch = useMemo(() => ({
25
- ray: new THREE.Raycaster(),
26
- plane: new THREE.Plane(),
27
- hit: new THREE.Vector3(),
28
- origin: new THREE.Vector3(),
29
- normal: new THREE.Vector3(),
30
- }), []);
17
+ export function useGridSurface(materialRef, _meshRef, options = {}) {
18
+ const { reveal = 1, revealDuration = 0 } = options;
31
19
  // Starts at 0 when it has a duration to travel, so the first frame is the
32
20
  // beginning of the build rather than a flash of the finished grid.
33
21
  const revealNow = useRef(revealDuration > 0 ? 0 : reveal);
@@ -47,20 +35,6 @@ export function useGridSurface(materialRef, meshRef, options = {}) {
47
35
  revealNow.current = target;
48
36
  }
49
37
  material.u_reveal = revealNow.current;
50
- const mesh = meshRef.current;
51
- if (!followMouse || !mesh)
52
- return;
53
- const { ray, plane, hit, origin, normal } = scratch;
54
- mesh.updateWorldMatrix(true, false);
55
- // A PlaneGeometry lives in local XY, so local +Z is its normal.
56
- normal.set(0, 0, 1).transformDirection(mesh.matrixWorld).normalize();
57
- origin.setFromMatrixPosition(mesh.matrixWorld);
58
- plane.setFromNormalAndCoplanarPoint(normal, origin);
59
- ray.setFromCamera(state.pointer, state.camera);
60
- if (ray.ray.intersectPlane(plane, hit)) {
61
- mesh.worldToLocal(hit);
62
- material.u_focus.set(hit.x, hit.y);
63
- }
64
38
  });
65
39
  }
66
40
  export default useGridSurface;
@@ -1 +1 @@
1
- {"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAGnG,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI9E,wBAAgB,cAAc,CAAC,EAC3B,cAAc,EAAE,SAAc,EAAE,KAAU,EAAE,eAAoB,GACnE,EAAE;IACC,cAAc,EAAE,WAAW,CAAC;IAC5B,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACtC;iCAkBmD,wBAAwB;EA8C3E;AACD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEnG,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI9E,wBAAgB,cAAc,CAAC,EAC3B,cAAc,EAAE,SAAc,EAAE,KAAU,EAAE,eAAoB,GACnE,EAAE;IACC,cAAc,EAAE,WAAW,CAAC;IAC5B,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACtC;iCAkBmD,wBAAwB;EAS3E;AACD,eAAe,cAAc,CAAC"}
@@ -15,88 +15,35 @@
15
15
  * actions apply / revert / toggle an action (SceneActions; its own effects
16
16
  * run through the same runtime).
17
17
  */
18
- import { useCallback, useMemo, useRef } from 'react';
19
- import { SceneActions } from '@3driseai/3drise-core';
20
- import ClipsRuntime from '../animationsV2/ClipsRuntime.js';
18
+ import { useCallback, useEffect, useMemo, useRef } from 'react';
21
19
  import { clipMap } from '../animationsV2/sequenceUtils.js';
22
- import { runEffect } from '../operations/runtime.js';
23
20
  import { useOperationsRuntime } from '../operations/useOperationsRuntime.js';
21
+ import { commandsOf, registerTriggerCatalog, runCommand } from '../triggers/index.js';
24
22
  export function useInteraction({ cameraSettings, sequences = [], clips = [], actionSequences = [], }) {
25
23
  // The scene's operation tools (camera, bring-to-front…) for the shared runtime.
26
24
  useOperationsRuntime(cameraSettings);
27
- // Toggle state: animation ids whose last toggle went "forward".
28
- const toggledRef = useRef(new Set());
29
25
  const clipsById = useMemo(() => clipMap(clips), [clips]);
30
- /** First trigger → forward (false), next → back (true), … per key. */
31
- const nextIsBack = useCallback((key) => {
32
- const toggled = toggledRef.current;
33
- const back = toggled.has(key);
34
- if (back)
35
- toggled.delete(key);
36
- else
37
- toggled.add(key);
38
- return back;
39
- }, []);
26
+ // Where the commands find their action / clip / sequence (read live: the lists change while editing).
27
+ const lists = useRef({ clipsById, sequences, actionSequences });
28
+ lists.current = { clipsById, sequences, actionSequences };
29
+ const catalog = useMemo(() => ({
30
+ action: (id) => lists.current.actionSequences.find(x => x.id === id),
31
+ clip: (id) => lists.current.clipsById.get(id),
32
+ sequence: (id) => lists.current.sequences.find(s => s.id === id),
33
+ clips: () => lists.current.clipsById,
34
+ }), []);
35
+ // …and the scene's catalog for commands that come without one (studio buttons, nested triggers).
36
+ useEffect(() => registerTriggerCatalog(catalog), [catalog]);
40
37
  // ---------------------------------------------------------------- run
41
38
  const executeInteraction = useCallback((params) => {
42
- const { interaction, ref } = params;
39
+ const { interaction, ref, createdObject } = params;
43
40
  if (!interaction?.enabled)
44
41
  return;
45
- // 1. Effects — each on its own targets.
46
- for (const effect of interaction.effects ?? [])
47
- runEffect(effect, 'trigger', ref);
48
- // 2. Animations.
49
- for (const a of interaction.animations ?? []) {
50
- if (a.kind === 'clip') {
51
- const clip = clipsById.get(a.ref);
52
- if (!clip)
53
- continue;
54
- if (a.command === 'pause')
55
- ClipsRuntime.pause(clip.id);
56
- else if (a.command === 'stop')
57
- ClipsRuntime.stop(clip.id);
58
- else if (a.command === 'toggle')
59
- ClipsRuntime.play(clip, { reverse: nextIsBack(`clip:${clip.id}`) });
60
- else if (ClipsRuntime.isActive(clip.id) && !ClipsRuntime.isPlaying(clip.id) && ClipsRuntime.getTime(clip.id) < clip.duration)
61
- ClipsRuntime.resume(clip.id);
62
- else
63
- ClipsRuntime.play(clip, { from: 0 });
64
- }
65
- else {
66
- const seq = sequences.find(s => s.id === a.ref);
67
- if (!seq)
68
- continue;
69
- if (a.command === 'pause')
70
- ClipsRuntime.pauseSequence(seq.id);
71
- else if (a.command === 'stop')
72
- ClipsRuntime.stopSequence(seq.id);
73
- else if (a.command === 'toggle') {
74
- const back = nextIsBack(`seq:${seq.id}`);
75
- ClipsRuntime.playSequence(seq, clipsById, { reverse: back ? !seq.reverse : seq.reverse });
76
- }
77
- else if (ClipsRuntime.isSequenceActive(seq.id) && !ClipsRuntime.isSequencePlaying(seq.id) && ClipsRuntime.getSequenceProgress(seq.id) < 1) {
78
- ClipsRuntime.resumeSequence(seq.id);
79
- }
80
- else {
81
- // From the start edge of its own direction.
82
- const total = ClipsRuntime.getSequenceDuration(seq.id);
83
- ClipsRuntime.playSequence(seq, clipsById, { from: seq.reverse && total > 0 ? total : 0 });
84
- }
85
- }
86
- }
87
- // 3. Actions.
88
- for (const a of interaction.actions ?? []) {
89
- const action = actionSequences.find(x => x.id === a.ref);
90
- if (!action)
91
- continue;
92
- if (a.command === 'revert')
93
- SceneActions.revertAction(action);
94
- else if (a.command === 'toggle')
95
- SceneActions.toggleAction(action);
96
- else
97
- SceneActions.applyAction(action);
98
- }
99
- }, [clipsById, sequences, actionSequences, nextIsBack]);
42
+ // Every reaction goes through the triggers engine, in the order they always ran.
43
+ const source = { host: 'interaction', id: `${createdObject?.id ?? '?'}:${interaction.mouseEvent}` };
44
+ for (const cmd of commandsOf(interaction))
45
+ runCommand(cmd, { source, self: ref, catalog, chain: [] });
46
+ }, [catalog]);
100
47
  return { executeInteraction };
101
48
  }
102
49
  export default useInteraction;
@@ -1,6 +1,7 @@
1
1
  import type { MutableRefObject, RefObject } from 'react';
2
2
  import type { Light, Object3D } from 'three';
3
3
  import type { AnimationOptions, MouseMoveDomain } from '@3driseai/3drise-core';
4
+ import type { ConfigLiveValue } from './useConfigLive';
4
5
  /**
5
6
  * Push a light config onto a THREE light. Only properties the light actually
6
7
  * has are written, so one function covers every light type.
@@ -10,7 +11,7 @@ export interface UseLightConfigResult {
10
11
  /** Committed config + live drags + animation overrides, refreshed every frame. */
11
12
  merged: MutableRefObject<Record<string, any>>;
12
13
  /** What the slider drags have written since the last commit. */
13
- live: MutableRefObject<Record<string, string | number | boolean>>;
14
+ live: MutableRefObject<Record<string, ConfigLiveValue>>;
14
15
  }
15
16
  /**
16
17
  * Registers the live-edit handle, evaluates the light's keyframe animations and
@@ -1 +1 @@
1
- {"version":3,"file":"useLightConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useLightConfig.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAU/E;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CA6B7E;AAED,MAAM,WAAW,oBAAoB;IACjC,kFAAkF;IAClF,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAC9C,gEAAgE;IAChE,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CACrE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,EACnC,QAAQ,EAAE,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC,EACjC,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,UAAU,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAC1C,SAAS,CAAC,EAAE,eAAe,GAC5B,oBAAoB,CAiEtB;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"useLightConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useLightConfig.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMvD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CA6B7E;AAED,MAAM,WAAW,oBAAoB;IACjC,kFAAkF;IAClF,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAC9C,gEAAgE;IAChE,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;CAC3D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,EACnC,QAAQ,EAAE,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC,EACjC,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,UAAU,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAC1C,SAAS,CAAC,EAAE,eAAe,GAC5B,oBAAoB,CAiEtB;AAED,eAAe,cAAc,CAAC"}
@@ -2,7 +2,7 @@ import * as THREE from 'three';
2
2
  import { type RootState } from '@react-three/fiber';
3
3
  import type { SkySettings, TimeSettings } from '@3driseai/3drise-core';
4
4
  import { OceanSurfaceMaterial } from '../shaders/ocean/OceanSurfaceMaterial';
5
- import type { OceanConfig, OceanQualityConfig } from '@3driseai/3drise-core';
5
+ import type { OceanConfig, OceanQualityConfig, ObjectAnimations, MouseMoveInteractions } from '@3driseai/3drise-core';
6
6
  /**
7
7
  * Everything the two water hosts share: the material, the live-edit handle, and
8
8
  * the per-frame uniform push.
@@ -23,6 +23,10 @@ export interface UseOceanMaterialOptions {
23
23
  skySettings?: SkySettings;
24
24
  timeSettings?: TimeSettings;
25
25
  sunIntensity?: number;
26
+ /** Keyframes; the `ocean` domain drives config knobs per frame. */
27
+ animations?: ObjectAnimations;
28
+ /** Pointer bindings; same `ocean` domain. */
29
+ mouseMove?: MouseMoveInteractions;
26
30
  /** Runs after the uniforms are pushed, with the live overrides already
27
31
  * merged in — where a host does its own per-frame work (snapping the
28
32
  * clipmap to the camera, say) with the config it is actually rendering. */
@@ -34,6 +38,6 @@ export interface OceanMaterialHandle {
34
38
  * handle a controller reaches through `findById`. */
35
39
  rootRef: React.RefObject<THREE.Group | null>;
36
40
  }
37
- export declare function useOceanMaterial({ id, config, quality, skySettings, timeSettings, sunIntensity, onFrame, }: UseOceanMaterialOptions): OceanMaterialHandle;
41
+ export declare function useOceanMaterial({ id, config, quality, skySettings, timeSettings, sunIntensity, animations, mouseMove, onFrame, }: UseOceanMaterialOptions): OceanMaterialHandle;
38
42
  export default useOceanMaterial;
39
43
  //# sourceMappingURL=useOceanMaterial.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOceanMaterial.d.ts","sourceRoot":"","sources":["../../src/hooks/useOceanMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAI7E,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;gFAE4E;IAC5E,OAAO,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACtF;AAED,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B;0DACsD;IACtD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;CAChD;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,EAAE,EACF,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,EACZ,YAAgB,EAChB,OAAO,GACV,EAAE,uBAAuB,GAAG,mBAAmB,CAkE/C;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"useOceanMaterial.d.ts","sourceRoot":"","sources":["../../src/hooks/useOceanMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAU7E,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAStH;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC;;gFAE4E;IAC5E,OAAO,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACtF;AAED,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B;0DACsD;IACtD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;CAChD;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,EAAE,EACF,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,EACZ,YAAgB,EAChB,UAAU,EACV,SAAS,EACT,OAAO,GACV,EAAE,uBAAuB,GAAG,mBAAmB,CAuG/C;AAED,eAAe,gBAAgB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import * as THREE from 'three';
1
2
  import { useEffect, useMemo, useRef } from 'react';
2
3
  import { useFrame } from '@react-three/fiber';
3
4
  import { useCloudSun } from './useCloudSun.js';
@@ -6,8 +7,16 @@ import { OceanSurfaceMaterial } from '../shaders/ocean/OceanSurfaceMaterial.js';
6
7
  import { applySunUniforms } from '../utils/cloudUniforms.js';
7
8
  import { applyTerrainAmbient } from '../utils/terrainUniforms.js';
8
9
  import { applyOceanUniforms } from '../utils/oceanUniforms.js';
9
- export function useOceanMaterial({ id, config, quality, skySettings, timeSettings, sunIntensity = 1, onFrame, }) {
10
+ import { resolveMoon, moonlightFactor, MOON_LIGHT_COLOR } from '../utils/skyMoon.js';
11
+ /** Moonlight on the water relative to the sun's (sunIntensity 1). The key light
12
+ * runs the moon at ~0.1 of the sun; the water gets a little more so the glitter
13
+ * path reads at night. Tuning knob. */
14
+ const MOON_WATER_STRENGTH = 0.15;
15
+ import { getAnimatableProperties } from '@3driseai/3drise-core';
16
+ import { applyConfigKeyframeAnimations, applyConfigMouseMove, } from '../utils/configAnimations.js';
17
+ export function useOceanMaterial({ id, config, quality, skySettings, timeSettings, sunIntensity = 1, animations, mouseMove, onFrame, }) {
10
18
  const { state: sun, update: updateSun } = useCloudSun({ skySettings, timeSettings });
19
+ const moon = useRef({ direction: new THREE.Vector3(), illumination: 0 });
11
20
  const material = useMemo(() => new OceanSurfaceMaterial(), []);
12
21
  useEffect(() => () => { material.dispose(); }, [material]);
13
22
  // Live controller overrides. A slider drag writes here on every pointer-move
@@ -19,6 +28,17 @@ export function useOceanMaterial({ id, config, quality, skySettings, timeSetting
19
28
  const liveQuality = useRef({});
20
29
  useEffect(() => { liveConfig.current = {}; }, [config]);
21
30
  useEffect(() => { liveQuality.current = {}; }, [quality]);
31
+ // The `ocean` keyframe / pointer domains. Same order as the clouds:
32
+ // config -> keyframes -> pointer -> live controller drag. The allowed set is the
33
+ // registry's, so it follows the water type and host exactly as the panels do.
34
+ const animatable = useMemo(() => new Set(getAnimatableProperties({ type: 'ocean', config }, 'ocean').map(p => p.value)), [config.waterType, config.host]);
35
+ const override = useRef({});
36
+ const startValues = useRef({});
37
+ const animStart = useRef(0);
38
+ useEffect(() => {
39
+ animStart.current = performance.now();
40
+ startValues.current = {};
41
+ }, [animations]);
22
42
  const rootRef = useRef(null);
23
43
  // Set in an effect, never as a userData JSX prop: R3F replaces the whole
24
44
  // userData object on every render, which would drop the handle whenever
@@ -44,7 +64,22 @@ export function useOceanMaterial({ id, config, quality, skySettings, timeSetting
44
64
  // reflect — the sky actually being drawn behind it, or a sunset sea comes
45
65
  // out black under a blazing sky.
46
66
  applyTerrainAmbient(shader, sun);
47
- const cfg = { ...config, ...liveConfig.current };
67
+ // The moon's glitter path and light on the water, from the same moon
68
+ // as the key light and the disc (resolveMoon), and the same strength
69
+ // curve (moonlightFactor), so all three appear and fade together.
70
+ const m = resolveMoon(timeSettings, sun.direction, moon.current);
71
+ const sunElevation = THREE.MathUtils.radToDeg(Math.asin(THREE.MathUtils.clamp(sun.direction.y, -1, 1)));
72
+ const k = MOON_WATER_STRENGTH * moonlightFactor(sunElevation, m) * (skySettings?.sunSystem?.moonIntensity ?? 1);
73
+ if (shader.uniforms.u_moonDir)
74
+ shader.uniforms.u_moonDir.value.copy(m.direction);
75
+ if (shader.uniforms.u_moonColor)
76
+ shader.uniforms.u_moonColor.value.setRGB(MOON_LIGHT_COLOR.r * k, MOON_LIGHT_COLOR.g * k, MOON_LIGHT_COLOR.b * k);
77
+ const o = override.current;
78
+ applyConfigKeyframeAnimations(animations?.ocean?.animations, startValues.current, config, o, performance.now() - animStart.current, animatable);
79
+ if (mouseMove?.enabled && mouseMove.ocean?.enabled) {
80
+ applyConfigMouseMove(mouseMove.ocean.properties, config, o, state.pointer, animatable);
81
+ }
82
+ const cfg = { ...config, ...o, ...liveConfig.current };
48
83
  const qual = { ...quality, ...liveQuality.current };
49
84
  applyOceanUniforms(shader, cfg, qual);
50
85
  shader.uniforms.u_time.value = state.clock.getElapsedTime();
@@ -0,0 +1,23 @@
1
+ import type { Object3D } from 'three';
2
+ /**
3
+ * Live sky editing, the counterpart to `useCloudLive` and `useOceanLive`.
4
+ *
5
+ * A slider drag writes here on every pointer-move; SkyController's frame loop
6
+ * lays it over the stored settings (and over any keyframe / pointer domain) and
7
+ * pushes the uniforms. Redux only hears about it on slider end.
8
+ *
9
+ * const live = useSkyLive(sky.id);
10
+ * <BaseControllerUi onLiveChange={live.set} onSettingsChange={dispatch} ... />
11
+ *
12
+ * Pass the ID, not a resolved Object3D: the sky mesh is not in the scene while
13
+ * the sun rig is drawing the background, and a findById() memoised in the
14
+ * controller would resolve to null once and stay null.
15
+ */
16
+ /** Where SkyController stashes its handle on the sky mesh's userData. */
17
+ export declare const SKY_LIVE_KEY = "__skyLive";
18
+ export interface SkyLiveHandle {
19
+ set(key: string, value: number): void;
20
+ }
21
+ export declare function useSkyLive(target?: Object3D | string | null): SkyLiveHandle;
22
+ export default useSkyLive;
23
+ //# sourceMappingURL=useSkyLive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSkyLive.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkyLive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC;;;;;;;;;;;;;GAaG;AAEH,yEAAyE;AACzE,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC,MAAM,WAAW,aAAa;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC;AAID,wBAAgB,UAAU,CAAC,MAAM,GAAE,QAAQ,GAAG,MAAM,GAAG,IAAa,GAAG,aAAa,CAQnF;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { useMemo } from 'react';
2
+ import { SKY_ID } from '@3driseai/3drise-core';
3
+ import { findById } from '../utils/sceneQuery.js';
4
+ /**
5
+ * Live sky editing, the counterpart to `useCloudLive` and `useOceanLive`.
6
+ *
7
+ * A slider drag writes here on every pointer-move; SkyController's frame loop
8
+ * lays it over the stored settings (and over any keyframe / pointer domain) and
9
+ * pushes the uniforms. Redux only hears about it on slider end.
10
+ *
11
+ * const live = useSkyLive(sky.id);
12
+ * <BaseControllerUi onLiveChange={live.set} onSettingsChange={dispatch} ... />
13
+ *
14
+ * Pass the ID, not a resolved Object3D: the sky mesh is not in the scene while
15
+ * the sun rig is drawing the background, and a findById() memoised in the
16
+ * controller would resolve to null once and stay null.
17
+ */
18
+ /** Where SkyController stashes its handle on the sky mesh's userData. */
19
+ export const SKY_LIVE_KEY = '__skyLive';
20
+ const NOOP = { set: () => { } };
21
+ export function useSkyLive(target = SKY_ID) {
22
+ return useMemo(() => {
23
+ const resolve = () => {
24
+ const object = typeof target === 'string' ? findById(target) : target;
25
+ return object?.userData?.[SKY_LIVE_KEY] ?? NOOP;
26
+ };
27
+ return { set: (key, value) => resolve().set(key, value) };
28
+ }, [target]);
29
+ }
30
+ export default useSkyLive;
@@ -1 +1 @@
1
- {"version":3,"file":"useSkyUniforms.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkyUniforms.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,wBAAgB,cAAc,IAAI;IAC1B,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,gBAAgB,EAAE,MAAM;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,GAAG,CAAC;QACf,QAAQ,EAAE,GAAG,CAAC;QACd,cAAc,EAAE,GAAG,CAAC;QACpB,eAAe,EAAE,GAAG,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,sBAAsB,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK;QAC9C,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;CACL,CAmEJ"}
1
+ {"version":3,"file":"useSkyUniforms.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkyUniforms.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,wBAAgB,cAAc,IAAI;IAC1B,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,gBAAgB,EAAE,MAAM;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,GAAG,CAAC;QACf,QAAQ,EAAE,GAAG,CAAC;QACd,cAAc,EAAE,GAAG,CAAC;QACpB,eAAe,EAAE,GAAG,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,sBAAsB,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK;QAC9C,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;CACL,CA0DJ"}
@@ -1,5 +1,6 @@
1
1
  import { useRef, useCallback } from 'react';
2
2
  import { createSunPosition } from '../utils/utils3d.js';
3
+ import { sunAnglesFromDirection } from '@3driseai/3drise-core';
3
4
  import { findById } from '@3driseai/3drise-core';
4
5
  export function useSkyUniforms() {
5
6
  const skyMeshRef = useRef(null);
@@ -15,16 +16,7 @@ export function useSkyUniforms() {
15
16
  skyMeshRef.current = findById('3drise-sky') || null;
16
17
  return skyMeshRef.current;
17
18
  }, []);
18
- const getElevationAndAzimuth = useCallback((sunPosition) => {
19
- const { x, y, z } = sunPosition;
20
- const r = Math.sqrt(x * x + y * y + z * z);
21
- const phi = Math.acos(y / r);
22
- const theta = Math.atan2(z, x);
23
- return {
24
- elevation: 90 - phi * (180 / Math.PI),
25
- azimuth: theta * (180 / Math.PI),
26
- };
27
- }, []);
19
+ const getElevationAndAzimuth = useCallback((sunPosition) => sunAnglesFromDirection(sunPosition), []);
28
20
  const updateUniforms = useCallback((settings) => {
29
21
  const skyRef = getSkyRef();
30
22
  if (!skyRef?.material)
@@ -21,7 +21,9 @@ import type { Object3D } from 'three';
21
21
  /** Where TerrainSurface stashes its handle on the root object's userData. */
22
22
  export declare const TERRAIN_LIVE_KEY = "__terrainLive";
23
23
  export interface TerrainLiveHandle {
24
- config(key: string, value: number | boolean | string): void;
24
+ /** `textures` takes the whole layer block — a texture-layer slider drags it
25
+ * live (tile size, strength, tint are uniforms; nothing repacks). */
26
+ config(key: string, value: number | boolean | string | object): void;
25
27
  quality(key: string, value: number | boolean | string): void;
26
28
  }
27
29
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useTerrainLive.d.ts","sourceRoot":"","sources":["../../src/hooks/useTerrainLive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAC9B,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5D,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;CAChE;AAID;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,iBAAiB,CAcnF;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"useTerrainLive.d.ts","sourceRoot":"","sources":["../../src/hooks/useTerrainLive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAC9B;0EACsE;IACtE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACrE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;CAChE;AAID;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,iBAAiB,CAcnF;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,38 @@
1
+ import * as THREE from 'three';
2
+ import { type TerrainTextures } from '@3driseai/3drise-core';
3
+ /**
4
+ * The terrain's four texture layers, loaded and packed into three arrays.
5
+ *
6
+ * | array | R | G | B | A |
7
+ * |--------|--------|-----------|-----|----------|
8
+ * | color | albedo (sRGB) || 255 |
9
+ * | normal | tangent normal, GL || height |
10
+ * | orm | AO | roughness | 0 | 255 |
11
+ *
12
+ * Height is the set's displacement map; a set without one falls back to its AO,
13
+ * which tracks height closely on ground scans (cavities are dark), and to a flat
14
+ * mid value without either. Three arrays rather than five: 4 layers x 1024^2 x 3
15
+ * is ~50 MB, ~67 MB with mips.
16
+ *
17
+ * Returns a ref-stable state object that is mutated when a new set of arrays is
18
+ * ready, so the frame loop reads it without React re-rendering. The previous
19
+ * arrays are released only after the new ones are in, so a set change does not
20
+ * blink the ground.
21
+ *
22
+ * The arrays are SHARED: a module-level cache keyed by the URLs, reference
23
+ * counted. The environment terrain and every land object on the same ground use
24
+ * one copy — at ~67 MB a copy, five patches of Alpine meadow must not cost five.
25
+ */
26
+ export interface TerrainTextureState {
27
+ ready: boolean;
28
+ color: THREE.DataArrayTexture | null;
29
+ normal: THREE.DataArrayTexture | null;
30
+ orm: THREE.DataArrayTexture | null;
31
+ /** Per layer: has a colour map, so it draws textured. */
32
+ textured: boolean[];
33
+ meanColor: THREE.Vector3[];
34
+ meanNormal: THREE.Vector3[];
35
+ meanOrm: THREE.Vector3[];
36
+ }
37
+ export declare function useTerrainTextures(textures: TerrainTextures | undefined, anisotropy?: number): TerrainTextureState;
38
+ //# sourceMappingURL=useTerrainTextures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTerrainTextures.d.ts","sourceRoot":"","sources":["../../src/hooks/useTerrainTextures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAGhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAA;IACpC,MAAM,EAAE,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAA;IACrC,GAAG,EAAE,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAA;IAClC,yDAAyD;IACzD,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;IAC1B,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;IAC3B,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;CAC3B;AAwHD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,EAAE,UAAU,SAAI,GAAG,mBAAmB,CAwC7G"}
@@ -0,0 +1,149 @@
1
+ import { useEffect, useMemo, useRef } from 'react';
2
+ import * as THREE from 'three';
3
+ import { TERRAIN_LAYER_KEYS } from '@3driseai/3drise-core';
4
+ import { buildChannelArray, loadArrayImageOrNull } from '../utils/textureArrays.js';
5
+ /** Array layer size. Every source is redrawn at this size. */
6
+ const ARRAY_SIZE = 1024;
7
+ /** Only the URLs matter: tile size, tint and strength are uniforms and must not
8
+ * trigger a repack. */
9
+ function urlsKey(textures) {
10
+ return JSON.stringify(TERRAIN_LAYER_KEYS.map((k) => {
11
+ const m = textures?.[k]?.maps ?? {};
12
+ return [m.color ?? '', m.normal ?? '', m.roughness ?? '', m.ao ?? '', m.displacement ?? ''];
13
+ }));
14
+ }
15
+ const cache = new Map();
16
+ function disposeData(d) {
17
+ d?.color?.dispose();
18
+ d?.normal?.dispose();
19
+ d?.orm?.dispose();
20
+ }
21
+ async function buildArrays(urls, anisotropy) {
22
+ const images = await Promise.all(urls.map((layer) => Promise.all(layer.map((u) => loadArrayImageOrNull(u)))));
23
+ const colorLayers = [];
24
+ const normalLayers = [];
25
+ const ormLayers = [];
26
+ const textured = [];
27
+ for (const [color, normal, roughness, ao, displacement] of images) {
28
+ textured.push(!!color);
29
+ colorLayers.push([
30
+ { image: color, channel: 0, fallback: 128 },
31
+ { image: color, channel: 1, fallback: 128 },
32
+ { image: color, channel: 2, fallback: 128 },
33
+ { image: null, fallback: 255 },
34
+ ]);
35
+ const height = displacement ?? ao;
36
+ normalLayers.push([
37
+ { image: normal, channel: 0, fallback: 128 },
38
+ { image: normal, channel: 1, fallback: 128 },
39
+ { image: normal, channel: 2, fallback: 255 },
40
+ { image: height, channel: 0, fallback: 128 },
41
+ ]);
42
+ ormLayers.push([
43
+ { image: ao, channel: 0, fallback: 255 },
44
+ { image: roughness, channel: 0, fallback: 230 },
45
+ { image: null, fallback: 0 },
46
+ { image: null, fallback: 255 },
47
+ ]);
48
+ }
49
+ try {
50
+ const color = buildChannelArray(colorLayers, ARRAY_SIZE, THREE.SRGBColorSpace);
51
+ const normal = buildChannelArray(normalLayers, ARRAY_SIZE, THREE.NoColorSpace);
52
+ const orm = buildChannelArray(ormLayers, ARRAY_SIZE, THREE.NoColorSpace);
53
+ for (const b of [color, normal, orm])
54
+ b.texture.anisotropy = anisotropy;
55
+ return {
56
+ color: color.texture,
57
+ normal: normal.texture,
58
+ orm: orm.texture,
59
+ meanColor: color.means,
60
+ meanNormal: normal.means,
61
+ meanOrm: orm.means,
62
+ textured,
63
+ };
64
+ }
65
+ catch (error) {
66
+ console.warn('[terrain] texture packing failed:', error);
67
+ return null;
68
+ }
69
+ }
70
+ function acquire(urlKey, anisotropy) {
71
+ const key = `${anisotropy}|${urlKey}`;
72
+ let entry = cache.get(key);
73
+ if (!entry) {
74
+ const created = { key, refs: 0, data: null, disposed: false, promise: Promise.resolve(null) };
75
+ created.promise = buildArrays(JSON.parse(urlKey), anisotropy).then((data) => {
76
+ // Released while loading: nobody will ever read it.
77
+ if (created.disposed) {
78
+ disposeData(data);
79
+ return null;
80
+ }
81
+ created.data = data;
82
+ return data;
83
+ });
84
+ cache.set(key, created);
85
+ entry = created;
86
+ }
87
+ entry.refs++;
88
+ return entry;
89
+ }
90
+ function release(entry) {
91
+ if (!entry)
92
+ return;
93
+ entry.refs--;
94
+ if (entry.refs > 0)
95
+ return;
96
+ entry.disposed = true;
97
+ cache.delete(entry.key);
98
+ disposeData(entry.data);
99
+ entry.data = null;
100
+ }
101
+ const EMPTY = () => ({
102
+ ready: false,
103
+ color: null,
104
+ normal: null,
105
+ orm: null,
106
+ textured: [false, false, false, false],
107
+ meanColor: [],
108
+ meanNormal: [],
109
+ meanOrm: [],
110
+ });
111
+ export function useTerrainTextures(textures, anisotropy = 8) {
112
+ const key = useMemo(() => urlsKey(textures), [textures]);
113
+ const state = useRef(EMPTY()).current;
114
+ /** The cache entry `state` currently shows. */
115
+ const held = useRef(null);
116
+ useEffect(() => {
117
+ const urls = JSON.parse(key);
118
+ if (!urls.some((layer) => !!layer[0])) {
119
+ Object.assign(state, EMPTY());
120
+ release(held.current);
121
+ held.current = null;
122
+ return;
123
+ }
124
+ let cancelled = false;
125
+ const entry = acquire(key, anisotropy);
126
+ entry.promise.then((data) => {
127
+ if (cancelled || !data)
128
+ return;
129
+ Object.assign(state, data, { ready: true });
130
+ const old = held.current;
131
+ held.current = entry;
132
+ // Same entry re-acquired (anisotropy unchanged, key back): drop the extra ref.
133
+ release(old);
134
+ });
135
+ return () => {
136
+ cancelled = true;
137
+ // Never shown: give it back. A shown entry is released when its
138
+ // replacement arrives, or on unmount.
139
+ if (held.current !== entry)
140
+ release(entry);
141
+ };
142
+ }, [key, anisotropy, state]);
143
+ useEffect(() => () => {
144
+ release(held.current);
145
+ held.current = null;
146
+ Object.assign(state, EMPTY());
147
+ }, [state]);
148
+ return state;
149
+ }