@3driseai/3drise-viewer 0.1.28 → 0.1.29

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 (684) 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 +44 -3
  4. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  5. package/dist/animationsV2/ClipsRuntime.js +173 -55
  6. package/dist/animationsV2/appliers.d.ts.map +1 -1
  7. package/dist/animationsV2/appliers.js +21 -5
  8. package/dist/animationsV2/index.d.ts +1 -1
  9. package/dist/animationsV2/index.d.ts.map +1 -1
  10. package/dist/animationsV2/normalize.d.ts.map +1 -1
  11. package/dist/animationsV2/normalize.js +7 -3
  12. package/dist/animationsV2/sequenceUtils.d.ts +44 -6
  13. package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
  14. package/dist/animationsV2/sequenceUtils.js +58 -12
  15. package/dist/animationsV2/types.d.ts +22 -12
  16. package/dist/animationsV2/types.d.ts.map +1 -1
  17. package/dist/api/sceneHandle.d.ts +35 -1
  18. package/dist/api/sceneHandle.d.ts.map +1 -1
  19. package/dist/api/sceneHandle.js +88 -17
  20. package/dist/components/AdvancedGrid.d.ts +1 -5
  21. package/dist/components/AdvancedGrid.d.ts.map +1 -1
  22. package/dist/components/AdvancedGrid.js +6 -35
  23. package/dist/components/AnimatedObject.d.ts.map +1 -1
  24. package/dist/components/AnimatedObject.js +9 -4
  25. package/dist/components/ApollonianGrid.d.ts +1 -1
  26. package/dist/components/ApollonianGrid.d.ts.map +1 -1
  27. package/dist/components/ApollonianGrid.js +3 -28
  28. package/dist/components/ChladniGrid.d.ts +1 -1
  29. package/dist/components/ChladniGrid.d.ts.map +1 -1
  30. package/dist/components/ChladniGrid.js +6 -35
  31. package/dist/components/CircuitGrid.d.ts +1 -1
  32. package/dist/components/CircuitGrid.d.ts.map +1 -1
  33. package/dist/components/CircuitGrid.js +6 -34
  34. package/dist/components/ConformalGrid.d.ts +1 -1
  35. package/dist/components/ConformalGrid.d.ts.map +1 -1
  36. package/dist/components/ConformalGrid.js +3 -34
  37. package/dist/components/ContourGrid.d.ts +1 -1
  38. package/dist/components/ContourGrid.d.ts.map +1 -1
  39. package/dist/components/ContourGrid.js +6 -34
  40. package/dist/components/CustomPrimitive.js +1 -1
  41. package/dist/components/EnvironmentObject.d.ts.map +1 -1
  42. package/dist/components/EnvironmentObject.js +9 -7
  43. package/dist/components/FlowNetGrid.d.ts +1 -1
  44. package/dist/components/FlowNetGrid.d.ts.map +1 -1
  45. package/dist/components/FlowNetGrid.js +6 -34
  46. package/dist/components/FractalGrid.d.ts +1 -1
  47. package/dist/components/FractalGrid.d.ts.map +1 -1
  48. package/dist/components/FractalGrid.js +6 -37
  49. package/dist/components/Galaxy.d.ts.map +1 -1
  50. package/dist/components/Galaxy.js +9 -23
  51. package/dist/components/GirihGrid.d.ts +1 -1
  52. package/dist/components/GirihGrid.d.ts.map +1 -1
  53. package/dist/components/GirihGrid.js +6 -35
  54. package/dist/components/GravWaveGrid.d.ts +1 -1
  55. package/dist/components/GravWaveGrid.d.ts.map +1 -1
  56. package/dist/components/GravWaveGrid.js +6 -35
  57. package/dist/components/HexGrid.d.ts +1 -5
  58. package/dist/components/HexGrid.d.ts.map +1 -1
  59. package/dist/components/HexGrid.js +6 -36
  60. package/dist/components/HilbertGrid.d.ts +1 -1
  61. package/dist/components/HilbertGrid.d.ts.map +1 -1
  62. package/dist/components/HilbertGrid.js +3 -30
  63. package/dist/components/HyperbolicGrid.d.ts +1 -1
  64. package/dist/components/HyperbolicGrid.d.ts.map +1 -1
  65. package/dist/components/HyperbolicGrid.js +6 -34
  66. package/dist/components/LandObject.d.ts +9 -0
  67. package/dist/components/LandObject.d.ts.map +1 -0
  68. package/dist/components/LandObject.js +15 -0
  69. package/dist/components/LensingGrid.d.ts +1 -1
  70. package/dist/components/LensingGrid.d.ts.map +1 -1
  71. package/dist/components/LensingGrid.js +3 -29
  72. package/dist/components/LightsManager.d.ts.map +1 -1
  73. package/dist/components/LightsManager.js +8 -0
  74. package/dist/components/ModelBoundary.d.ts +2 -0
  75. package/dist/components/ModelBoundary.d.ts.map +1 -1
  76. package/dist/components/ModelBoundary.js +3 -0
  77. package/dist/components/ModelPrimitive.d.ts.map +1 -1
  78. package/dist/components/ModelPrimitive.js +6 -0
  79. package/dist/components/MoireGrid.d.ts +1 -1
  80. package/dist/components/MoireGrid.d.ts.map +1 -1
  81. package/dist/components/MoireGrid.js +6 -35
  82. package/dist/components/MoonDisc.d.ts +11 -0
  83. package/dist/components/MoonDisc.d.ts.map +1 -0
  84. package/dist/components/MoonDisc.js +128 -0
  85. package/dist/components/ObjectNode.d.ts.map +1 -1
  86. package/dist/components/ObjectNode.js +15 -4
  87. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  88. package/dist/components/ObjectsRenderer.js +7 -5
  89. package/dist/components/OceanBuilder.d.ts.map +1 -1
  90. package/dist/components/OceanBuilder.js +2 -0
  91. package/dist/components/ParastichyGrid.d.ts +1 -1
  92. package/dist/components/ParastichyGrid.d.ts.map +1 -1
  93. package/dist/components/ParastichyGrid.js +3 -30
  94. package/dist/components/PhyllotaxisGrid.d.ts +1 -1
  95. package/dist/components/PhyllotaxisGrid.d.ts.map +1 -1
  96. package/dist/components/PhyllotaxisGrid.js +3 -32
  97. package/dist/components/ProjectLoader.d.ts +5 -3
  98. package/dist/components/ProjectLoader.d.ts.map +1 -1
  99. package/dist/components/ProjectLoader.js +6 -3
  100. package/dist/components/QuasiGrid.d.ts +1 -1
  101. package/dist/components/QuasiGrid.d.ts.map +1 -1
  102. package/dist/components/QuasiGrid.js +6 -33
  103. package/dist/components/RadarGrid.d.ts +1 -1
  104. package/dist/components/RadarGrid.d.ts.map +1 -1
  105. package/dist/components/RadarGrid.js +6 -34
  106. package/dist/components/ReactionDiffusionGrid.d.ts +1 -1
  107. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
  108. package/dist/components/ReactionDiffusionGrid.js +6 -35
  109. package/dist/components/SceneBuilder.d.ts +25 -3
  110. package/dist/components/SceneBuilder.d.ts.map +1 -1
  111. package/dist/components/SceneBuilder.js +68 -38
  112. package/dist/components/SkyController.d.ts +25 -1
  113. package/dist/components/SkyController.d.ts.map +1 -1
  114. package/dist/components/SkyController.js +189 -130
  115. package/dist/components/SkyMesh.d.ts.map +1 -1
  116. package/dist/components/SkyMesh.js +26 -1
  117. package/dist/components/SkyStars.d.ts +11 -0
  118. package/dist/components/SkyStars.d.ts.map +1 -0
  119. package/dist/components/SkyStars.js +187 -0
  120. package/dist/components/SkySystem.d.ts +3 -3
  121. package/dist/components/SkySystem.d.ts.map +1 -1
  122. package/dist/components/SkySystem.js +8 -2
  123. package/dist/components/Sun.d.ts +15 -1
  124. package/dist/components/Sun.d.ts.map +1 -1
  125. package/dist/components/Sun.js +64 -3
  126. package/dist/components/SunLight.d.ts +6 -1
  127. package/dist/components/SunLight.d.ts.map +1 -1
  128. package/dist/components/SunLight.js +96 -44
  129. package/dist/components/TerrainBuilder.d.ts.map +1 -1
  130. package/dist/components/TerrainBuilder.js +2 -0
  131. package/dist/components/TextGenerator.d.ts +9 -0
  132. package/dist/components/TextGenerator.d.ts.map +1 -0
  133. package/dist/components/TextGenerator.js +29 -0
  134. package/dist/components/TruchetGrid.d.ts +1 -1
  135. package/dist/components/TruchetGrid.d.ts.map +1 -1
  136. package/dist/components/TruchetGrid.js +3 -30
  137. package/dist/components/VoronoiGrid.d.ts +1 -1
  138. package/dist/components/VoronoiGrid.d.ts.map +1 -1
  139. package/dist/components/VoronoiGrid.js +6 -33
  140. package/dist/components/WallpaperGrid.d.ts +1 -1
  141. package/dist/components/WallpaperGrid.d.ts.map +1 -1
  142. package/dist/components/WallpaperGrid.js +6 -35
  143. package/dist/components/environment/Rain.d.ts +15 -0
  144. package/dist/components/environment/Rain.d.ts.map +1 -0
  145. package/dist/components/environment/Rain.js +110 -0
  146. package/dist/components/environment/Rainbow.d.ts +20 -0
  147. package/dist/components/environment/Rainbow.d.ts.map +1 -0
  148. package/dist/components/environment/Rainbow.js +974 -0
  149. package/dist/components/environment/Sandstorm.d.ts +20 -0
  150. package/dist/components/environment/Sandstorm.d.ts.map +1 -0
  151. package/dist/components/environment/Sandstorm.js +776 -0
  152. package/dist/components/environment/Snow.d.ts +20 -0
  153. package/dist/components/environment/Snow.d.ts.map +1 -0
  154. package/dist/components/environment/Snow.js +609 -0
  155. package/dist/components/environment/Thunderstorm.d.ts +20 -0
  156. package/dist/components/environment/Thunderstorm.d.ts.map +1 -0
  157. package/dist/components/environment/Thunderstorm.js +731 -0
  158. package/dist/components/environment/Tornado.d.ts +20 -0
  159. package/dist/components/environment/Tornado.d.ts.map +1 -0
  160. package/dist/components/environment/Tornado.js +762 -0
  161. package/dist/components/environment/index.d.ts +13 -0
  162. package/dist/components/environment/index.d.ts.map +1 -0
  163. package/dist/components/environment/index.js +7 -0
  164. package/dist/components/index.d.ts +10 -10
  165. package/dist/components/index.d.ts.map +1 -1
  166. package/dist/components/index.js +8 -6
  167. package/dist/components/land/LandPatch.d.ts +15 -0
  168. package/dist/components/land/LandPatch.d.ts.map +1 -0
  169. package/dist/components/land/LandPatch.js +170 -0
  170. package/dist/components/land/index.d.ts +3 -0
  171. package/dist/components/land/index.d.ts.map +1 -0
  172. package/dist/components/land/index.js +1 -0
  173. package/dist/components/space/Earth.d.ts +16 -0
  174. package/dist/components/space/Earth.d.ts.map +1 -0
  175. package/dist/components/space/Earth.js +75 -0
  176. package/dist/components/space/ShootingStar.d.ts +21 -0
  177. package/dist/components/space/ShootingStar.d.ts.map +1 -0
  178. package/dist/components/space/ShootingStar.js +101 -0
  179. package/dist/components/space/ShootingStars.d.ts +16 -0
  180. package/dist/components/space/ShootingStars.d.ts.map +1 -0
  181. package/dist/components/space/ShootingStars.js +71 -0
  182. package/dist/components/space/SolarSystem.d.ts +16 -0
  183. package/dist/components/space/SolarSystem.d.ts.map +1 -0
  184. package/dist/components/space/SolarSystem.js +141 -0
  185. package/dist/components/space/Stars.d.ts +20 -0
  186. package/dist/components/space/Stars.d.ts.map +1 -0
  187. package/dist/components/space/Stars.js +160 -0
  188. package/dist/components/space/index.d.ts +11 -0
  189. package/dist/components/space/index.d.ts.map +1 -0
  190. package/dist/components/space/index.js +8 -0
  191. package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
  192. package/dist/components/terrain/TerrainSurface.js +27 -3
  193. package/dist/components/terrain/types.d.ts +5 -1
  194. package/dist/components/terrain/types.d.ts.map +1 -1
  195. package/dist/components/text/BurnAwayText.d.ts +15 -0
  196. package/dist/components/text/BurnAwayText.d.ts.map +1 -0
  197. package/dist/components/text/BurnAwayText.js +4 -0
  198. package/dist/components/text/ChalkboardText.d.ts +15 -0
  199. package/dist/components/text/ChalkboardText.d.ts.map +1 -0
  200. package/dist/components/text/ChalkboardText.js +4 -0
  201. package/dist/components/text/ConstellationText.d.ts +15 -0
  202. package/dist/components/text/ConstellationText.d.ts.map +1 -0
  203. package/dist/components/text/ConstellationText.js +4 -0
  204. package/dist/components/text/EmbroideryText.d.ts +15 -0
  205. package/dist/components/text/EmbroideryText.d.ts.map +1 -0
  206. package/dist/components/text/EmbroideryText.js +4 -0
  207. package/dist/components/text/FourierSketchText.d.ts +15 -0
  208. package/dist/components/text/FourierSketchText.d.ts.map +1 -0
  209. package/dist/components/text/FourierSketchText.js +4 -0
  210. package/dist/components/text/FrostGrowthText.d.ts +15 -0
  211. package/dist/components/text/FrostGrowthText.d.ts.map +1 -0
  212. package/dist/components/text/FrostGrowthText.js +4 -0
  213. package/dist/components/text/HandwritingText.d.ts +15 -0
  214. package/dist/components/text/HandwritingText.d.ts.map +1 -0
  215. package/dist/components/text/HandwritingText.js +4 -0
  216. package/dist/components/text/InkBleedText.d.ts +15 -0
  217. package/dist/components/text/InkBleedText.d.ts.map +1 -0
  218. package/dist/components/text/InkBleedText.js +4 -0
  219. package/dist/components/text/LightPaintingText.d.ts +15 -0
  220. package/dist/components/text/LightPaintingText.d.ts.map +1 -0
  221. package/dist/components/text/LightPaintingText.js +4 -0
  222. package/dist/components/text/LiquidMetalText.d.ts +15 -0
  223. package/dist/components/text/LiquidMetalText.d.ts.map +1 -0
  224. package/dist/components/text/LiquidMetalText.js +4 -0
  225. package/dist/components/text/NeonTubeText.d.ts +15 -0
  226. package/dist/components/text/NeonTubeText.d.ts.map +1 -0
  227. package/dist/components/text/NeonTubeText.js +4 -0
  228. package/dist/components/text/PlasmaDischargeText.d.ts +15 -0
  229. package/dist/components/text/PlasmaDischargeText.d.ts.map +1 -0
  230. package/dist/components/text/PlasmaDischargeText.js +4 -0
  231. package/dist/components/text/TextObjectView.d.ts +12 -0
  232. package/dist/components/text/TextObjectView.d.ts.map +1 -0
  233. package/dist/components/text/TextObjectView.js +11 -0
  234. package/dist/components/text/engine/fieldkit.d.ts +24 -0
  235. package/dist/components/text/engine/fieldkit.d.ts.map +1 -0
  236. package/dist/components/text/engine/fieldkit.js +201 -0
  237. package/dist/components/text/engine/glyphs.d.ts +19 -0
  238. package/dist/components/text/engine/glyphs.d.ts.map +1 -0
  239. package/dist/components/text/engine/glyphs.js +269 -0
  240. package/dist/components/text/engine/looks/burnAway.d.ts +144 -0
  241. package/dist/components/text/engine/looks/burnAway.d.ts.map +1 -0
  242. package/dist/components/text/engine/looks/burnAway.js +593 -0
  243. package/dist/components/text/engine/looks/chalkboard.d.ts +135 -0
  244. package/dist/components/text/engine/looks/chalkboard.d.ts.map +1 -0
  245. package/dist/components/text/engine/looks/chalkboard.js +426 -0
  246. package/dist/components/text/engine/looks/constellation.d.ts +111 -0
  247. package/dist/components/text/engine/looks/constellation.d.ts.map +1 -0
  248. package/dist/components/text/engine/looks/constellation.js +496 -0
  249. package/dist/components/text/engine/looks/embroidery.d.ts +165 -0
  250. package/dist/components/text/engine/looks/embroidery.d.ts.map +1 -0
  251. package/dist/components/text/engine/looks/embroidery.js +645 -0
  252. package/dist/components/text/engine/looks/frostGrowth.d.ts +109 -0
  253. package/dist/components/text/engine/looks/frostGrowth.d.ts.map +1 -0
  254. package/dist/components/text/engine/looks/frostGrowth.js +727 -0
  255. package/dist/components/text/engine/looks/index.d.ts +2 -0
  256. package/dist/components/text/engine/looks/index.d.ts.map +1 -0
  257. package/dist/components/text/engine/looks/index.js +48 -0
  258. package/dist/components/text/engine/looks/inkBleed.d.ts +103 -0
  259. package/dist/components/text/engine/looks/inkBleed.d.ts.map +1 -0
  260. package/dist/components/text/engine/looks/inkBleed.js +590 -0
  261. package/dist/components/text/engine/looks/lightPainting.d.ts +132 -0
  262. package/dist/components/text/engine/looks/lightPainting.d.ts.map +1 -0
  263. package/dist/components/text/engine/looks/lightPainting.js +567 -0
  264. package/dist/components/text/engine/looks/liquidMetal.d.ts +135 -0
  265. package/dist/components/text/engine/looks/liquidMetal.d.ts.map +1 -0
  266. package/dist/components/text/engine/looks/liquidMetal.js +655 -0
  267. package/dist/components/text/engine/looks/plasmaDischarge.d.ts +126 -0
  268. package/dist/components/text/engine/looks/plasmaDischarge.d.ts.map +1 -0
  269. package/dist/components/text/engine/looks/plasmaDischarge.js +763 -0
  270. package/dist/components/text/engine/methods.d.ts +19 -0
  271. package/dist/components/text/engine/methods.d.ts.map +1 -0
  272. package/dist/components/text/engine/methods.js +126 -0
  273. package/dist/components/text/engine/playback.d.ts +40 -0
  274. package/dist/components/text/engine/playback.d.ts.map +1 -0
  275. package/dist/components/text/engine/playback.js +114 -0
  276. package/dist/components/text/engine/ribbon.d.ts +58 -0
  277. package/dist/components/text/engine/ribbon.d.ts.map +1 -0
  278. package/dist/components/text/engine/ribbon.js +250 -0
  279. package/dist/components/text/engine/variants.d.ts +159 -0
  280. package/dist/components/text/engine/variants.d.ts.map +1 -0
  281. package/dist/components/text/engine/variants.js +378 -0
  282. package/dist/components/text/fonts/architects-daughter.outline.d.ts +3 -0
  283. package/dist/components/text/fonts/architects-daughter.outline.d.ts.map +1 -0
  284. package/dist/components/text/fonts/architects-daughter.outline.js +4 -0
  285. package/dist/components/text/fonts/architects-daughter.strokes.d.ts +3 -0
  286. package/dist/components/text/fonts/architects-daughter.strokes.d.ts.map +1 -0
  287. package/dist/components/text/fonts/architects-daughter.strokes.js +4 -0
  288. package/dist/components/text/fonts/caveat.outline.d.ts +3 -0
  289. package/dist/components/text/fonts/caveat.outline.d.ts.map +1 -0
  290. package/dist/components/text/fonts/caveat.outline.js +4 -0
  291. package/dist/components/text/fonts/caveat.strokes.d.ts +3 -0
  292. package/dist/components/text/fonts/caveat.strokes.d.ts.map +1 -0
  293. package/dist/components/text/fonts/caveat.strokes.js +4 -0
  294. package/dist/components/text/fonts/courgette.outline.d.ts +3 -0
  295. package/dist/components/text/fonts/courgette.outline.d.ts.map +1 -0
  296. package/dist/components/text/fonts/courgette.outline.js +4 -0
  297. package/dist/components/text/fonts/courgette.strokes.d.ts +3 -0
  298. package/dist/components/text/fonts/courgette.strokes.d.ts.map +1 -0
  299. package/dist/components/text/fonts/courgette.strokes.js +4 -0
  300. package/dist/components/text/fonts/dancing-script.outline.d.ts +3 -0
  301. package/dist/components/text/fonts/dancing-script.outline.d.ts.map +1 -0
  302. package/dist/components/text/fonts/dancing-script.outline.js +4 -0
  303. package/dist/components/text/fonts/dancing-script.strokes.d.ts +3 -0
  304. package/dist/components/text/fonts/dancing-script.strokes.d.ts.map +1 -0
  305. package/dist/components/text/fonts/dancing-script.strokes.js +4 -0
  306. package/dist/components/text/fonts/gochi-hand.outline.d.ts +3 -0
  307. package/dist/components/text/fonts/gochi-hand.outline.d.ts.map +1 -0
  308. package/dist/components/text/fonts/gochi-hand.outline.js +4 -0
  309. package/dist/components/text/fonts/gochi-hand.strokes.d.ts +3 -0
  310. package/dist/components/text/fonts/gochi-hand.strokes.d.ts.map +1 -0
  311. package/dist/components/text/fonts/gochi-hand.strokes.js +4 -0
  312. package/dist/components/text/fonts/handlee.outline.d.ts +3 -0
  313. package/dist/components/text/fonts/handlee.outline.d.ts.map +1 -0
  314. package/dist/components/text/fonts/handlee.outline.js +4 -0
  315. package/dist/components/text/fonts/handlee.strokes.d.ts +3 -0
  316. package/dist/components/text/fonts/handlee.strokes.d.ts.map +1 -0
  317. package/dist/components/text/fonts/handlee.strokes.js +4 -0
  318. package/dist/components/text/fonts/index.d.ts +5 -0
  319. package/dist/components/text/fonts/index.d.ts.map +1 -0
  320. package/dist/components/text/fonts/index.js +44 -0
  321. package/dist/components/text/fonts/indie-flower.outline.d.ts +3 -0
  322. package/dist/components/text/fonts/indie-flower.outline.d.ts.map +1 -0
  323. package/dist/components/text/fonts/indie-flower.outline.js +4 -0
  324. package/dist/components/text/fonts/indie-flower.strokes.d.ts +3 -0
  325. package/dist/components/text/fonts/indie-flower.strokes.d.ts.map +1 -0
  326. package/dist/components/text/fonts/indie-flower.strokes.js +4 -0
  327. package/dist/components/text/fonts/kalam.outline.d.ts +3 -0
  328. package/dist/components/text/fonts/kalam.outline.d.ts.map +1 -0
  329. package/dist/components/text/fonts/kalam.outline.js +4 -0
  330. package/dist/components/text/fonts/kalam.strokes.d.ts +3 -0
  331. package/dist/components/text/fonts/kalam.strokes.d.ts.map +1 -0
  332. package/dist/components/text/fonts/kalam.strokes.js +4 -0
  333. package/dist/components/text/fonts/kaushan-script.outline.d.ts +3 -0
  334. package/dist/components/text/fonts/kaushan-script.outline.d.ts.map +1 -0
  335. package/dist/components/text/fonts/kaushan-script.outline.js +4 -0
  336. package/dist/components/text/fonts/kaushan-script.strokes.d.ts +3 -0
  337. package/dist/components/text/fonts/kaushan-script.strokes.d.ts.map +1 -0
  338. package/dist/components/text/fonts/kaushan-script.strokes.js +4 -0
  339. package/dist/components/text/fonts/mynerve.outline.d.ts +3 -0
  340. package/dist/components/text/fonts/mynerve.outline.d.ts.map +1 -0
  341. package/dist/components/text/fonts/mynerve.outline.js +4 -0
  342. package/dist/components/text/fonts/mynerve.strokes.d.ts +3 -0
  343. package/dist/components/text/fonts/mynerve.strokes.d.ts.map +1 -0
  344. package/dist/components/text/fonts/mynerve.strokes.js +4 -0
  345. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts +3 -0
  346. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts.map +1 -0
  347. package/dist/components/text/fonts/nanum-pen-script.outline.js +4 -0
  348. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts +3 -0
  349. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts.map +1 -0
  350. package/dist/components/text/fonts/nanum-pen-script.strokes.js +4 -0
  351. package/dist/components/text/fonts/pacifico.outline.d.ts +3 -0
  352. package/dist/components/text/fonts/pacifico.outline.d.ts.map +1 -0
  353. package/dist/components/text/fonts/pacifico.outline.js +4 -0
  354. package/dist/components/text/fonts/pacifico.strokes.d.ts +3 -0
  355. package/dist/components/text/fonts/pacifico.strokes.d.ts.map +1 -0
  356. package/dist/components/text/fonts/pacifico.strokes.js +4 -0
  357. package/dist/components/text/fonts/patrick-hand.outline.d.ts +3 -0
  358. package/dist/components/text/fonts/patrick-hand.outline.d.ts.map +1 -0
  359. package/dist/components/text/fonts/patrick-hand.outline.js +4 -0
  360. package/dist/components/text/fonts/patrick-hand.strokes.d.ts +3 -0
  361. package/dist/components/text/fonts/patrick-hand.strokes.d.ts.map +1 -0
  362. package/dist/components/text/fonts/patrick-hand.strokes.js +4 -0
  363. package/dist/components/text/fonts/poppins.outline.d.ts +3 -0
  364. package/dist/components/text/fonts/poppins.outline.d.ts.map +1 -0
  365. package/dist/components/text/fonts/poppins.outline.js +4 -0
  366. package/dist/components/text/fonts/poppins.strokes.d.ts +3 -0
  367. package/dist/components/text/fonts/poppins.strokes.d.ts.map +1 -0
  368. package/dist/components/text/fonts/poppins.strokes.js +4 -0
  369. package/dist/components/text/fonts/satisfy.outline.d.ts +3 -0
  370. package/dist/components/text/fonts/satisfy.outline.d.ts.map +1 -0
  371. package/dist/components/text/fonts/satisfy.outline.js +4 -0
  372. package/dist/components/text/fonts/satisfy.strokes.d.ts +3 -0
  373. package/dist/components/text/fonts/satisfy.strokes.d.ts.map +1 -0
  374. package/dist/components/text/fonts/satisfy.strokes.js +4 -0
  375. package/dist/components/text/fonts/sriracha.outline.d.ts +3 -0
  376. package/dist/components/text/fonts/sriracha.outline.d.ts.map +1 -0
  377. package/dist/components/text/fonts/sriracha.outline.js +4 -0
  378. package/dist/components/text/fonts/sriracha.strokes.d.ts +3 -0
  379. package/dist/components/text/fonts/sriracha.strokes.d.ts.map +1 -0
  380. package/dist/components/text/fonts/sriracha.strokes.js +4 -0
  381. package/dist/components/text/index.d.ts +27 -0
  382. package/dist/components/text/index.d.ts.map +1 -0
  383. package/dist/components/text/index.js +13 -0
  384. package/dist/components/text/useTextObject.d.ts +21 -0
  385. package/dist/components/text/useTextObject.d.ts.map +1 -0
  386. package/dist/components/text/useTextObject.js +118 -0
  387. package/dist/components/water/OceanSurface.d.ts.map +1 -1
  388. package/dist/components/water/OceanSurface.js +3 -1
  389. package/dist/components/water/WaterBody.d.ts.map +1 -1
  390. package/dist/components/water/WaterBody.js +3 -1
  391. package/dist/components/water/types.d.ts +5 -1
  392. package/dist/components/water/types.d.ts.map +1 -1
  393. package/dist/constants.d.ts.map +1 -1
  394. package/dist/constants.js +4 -0
  395. package/dist/hooks/index.d.ts +2 -0
  396. package/dist/hooks/index.d.ts.map +1 -1
  397. package/dist/hooks/index.js +1 -0
  398. package/dist/hooks/useCloudSun.d.ts +9 -4
  399. package/dist/hooks/useCloudSun.d.ts.map +1 -1
  400. package/dist/hooks/useCloudSun.js +17 -7
  401. package/dist/hooks/useConfigLive.d.ts +3 -2
  402. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  403. package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
  404. package/dist/hooks/useContinuousEffects.js +4 -10
  405. package/dist/hooks/useEnvironmentProbe.d.ts +3 -22
  406. package/dist/hooks/useEnvironmentProbe.d.ts.map +1 -1
  407. package/dist/hooks/useEnvironmentProbe.js +47 -8
  408. package/dist/hooks/useGridSurface.d.ts +3 -10
  409. package/dist/hooks/useGridSurface.d.ts.map +1 -1
  410. package/dist/hooks/useGridSurface.js +5 -31
  411. package/dist/hooks/useInteraction.d.ts.map +1 -1
  412. package/dist/hooks/useInteraction.js +19 -72
  413. package/dist/hooks/useLightConfig.d.ts +2 -1
  414. package/dist/hooks/useLightConfig.d.ts.map +1 -1
  415. package/dist/hooks/useOceanMaterial.d.ts +6 -2
  416. package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
  417. package/dist/hooks/useOceanMaterial.js +37 -2
  418. package/dist/hooks/useSkyLive.d.ts +23 -0
  419. package/dist/hooks/useSkyLive.d.ts.map +1 -0
  420. package/dist/hooks/useSkyLive.js +30 -0
  421. package/dist/hooks/useSkyUniforms.d.ts.map +1 -1
  422. package/dist/hooks/useSkyUniforms.js +2 -10
  423. package/dist/hooks/useTerrainLive.d.ts +3 -1
  424. package/dist/hooks/useTerrainLive.d.ts.map +1 -1
  425. package/dist/hooks/useTerrainTextures.d.ts +38 -0
  426. package/dist/hooks/useTerrainTextures.d.ts.map +1 -0
  427. package/dist/hooks/useTerrainTextures.js +149 -0
  428. package/dist/index.d.ts +11 -2
  429. package/dist/index.d.ts.map +1 -1
  430. package/dist/index.js +8 -1
  431. package/dist/operations/catalogue/blastOff.d.ts +3 -0
  432. package/dist/operations/catalogue/blastOff.d.ts.map +1 -0
  433. package/dist/operations/catalogue/blastOff.js +118 -0
  434. package/dist/operations/catalogue/bounce.d.ts +3 -0
  435. package/dist/operations/catalogue/bounce.d.ts.map +1 -0
  436. package/dist/operations/catalogue/bounce.js +34 -0
  437. package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -1
  438. package/dist/operations/catalogue/curlSmoke.js +3 -1
  439. package/dist/operations/catalogue/dissolve.d.ts.map +1 -1
  440. package/dist/operations/catalogue/dissolve.js +2 -1
  441. package/dist/operations/catalogue/driftUp.d.ts +3 -0
  442. package/dist/operations/catalogue/driftUp.d.ts.map +1 -0
  443. package/dist/operations/catalogue/driftUp.js +57 -0
  444. package/dist/operations/catalogue/emberAsh.d.ts.map +1 -1
  445. package/dist/operations/catalogue/emberAsh.js +2 -1
  446. package/dist/operations/catalogue/flip.d.ts.map +1 -1
  447. package/dist/operations/catalogue/flip.js +19 -9
  448. package/dist/operations/catalogue/float.d.ts +3 -0
  449. package/dist/operations/catalogue/float.d.ts.map +1 -0
  450. package/dist/operations/catalogue/float.js +39 -0
  451. package/dist/operations/catalogue/flyBy.d.ts +3 -0
  452. package/dist/operations/catalogue/flyBy.d.ts.map +1 -0
  453. package/dist/operations/catalogue/flyBy.js +79 -0
  454. package/dist/operations/catalogue/frost.d.ts.map +1 -1
  455. package/dist/operations/catalogue/frost.js +10 -3
  456. package/dist/operations/catalogue/grow.d.ts +3 -0
  457. package/dist/operations/catalogue/grow.d.ts.map +1 -0
  458. package/dist/operations/catalogue/grow.js +19 -0
  459. package/dist/operations/catalogue/hologram.d.ts.map +1 -1
  460. package/dist/operations/catalogue/hologram.js +11 -5
  461. package/dist/operations/catalogue/jelly.d.ts.map +1 -1
  462. package/dist/operations/catalogue/jelly.js +18 -8
  463. package/dist/operations/catalogue/knockAway.d.ts +3 -0
  464. package/dist/operations/catalogue/knockAway.d.ts.map +1 -0
  465. package/dist/operations/catalogue/knockAway.js +74 -0
  466. package/dist/operations/catalogue/leafFall.d.ts +3 -0
  467. package/dist/operations/catalogue/leafFall.d.ts.map +1 -0
  468. package/dist/operations/catalogue/leafFall.js +74 -0
  469. package/dist/operations/catalogue/lidarScan.d.ts.map +1 -1
  470. package/dist/operations/catalogue/lidarScan.js +4 -1
  471. package/dist/operations/catalogue/metalize.d.ts.map +1 -1
  472. package/dist/operations/catalogue/metalize.js +8 -2
  473. package/dist/operations/catalogue/motionTrail.d.ts +6 -0
  474. package/dist/operations/catalogue/motionTrail.d.ts.map +1 -0
  475. package/dist/operations/catalogue/motionTrail.js +221 -0
  476. package/dist/operations/catalogue/petrify.d.ts.map +1 -1
  477. package/dist/operations/catalogue/petrify.js +9 -3
  478. package/dist/operations/catalogue/physicalExit.d.ts +55 -0
  479. package/dist/operations/catalogue/physicalExit.d.ts.map +1 -0
  480. package/dist/operations/catalogue/physicalExit.js +165 -0
  481. package/dist/operations/catalogue/physicalHeld.d.ts +41 -0
  482. package/dist/operations/catalogue/physicalHeld.d.ts.map +1 -0
  483. package/dist/operations/catalogue/physicalHeld.js +78 -0
  484. package/dist/operations/catalogue/physicalMix.d.ts +45 -0
  485. package/dist/operations/catalogue/physicalMix.d.ts.map +1 -0
  486. package/dist/operations/catalogue/physicalMix.js +144 -0
  487. package/dist/operations/catalogue/pop.d.ts +3 -0
  488. package/dist/operations/catalogue/pop.d.ts.map +1 -0
  489. package/dist/operations/catalogue/pop.js +44 -0
  490. package/dist/operations/catalogue/print3d.d.ts.map +1 -1
  491. package/dist/operations/catalogue/print3d.js +5 -1
  492. package/dist/operations/catalogue/pulse.d.ts +3 -0
  493. package/dist/operations/catalogue/pulse.d.ts.map +1 -0
  494. package/dist/operations/catalogue/pulse.js +29 -0
  495. package/dist/operations/catalogue/restPose.d.ts +5 -7
  496. package/dist/operations/catalogue/restPose.d.ts.map +1 -1
  497. package/dist/operations/catalogue/restPose.js +18 -48
  498. package/dist/operations/catalogue/rotate.d.ts +3 -0
  499. package/dist/operations/catalogue/rotate.d.ts.map +1 -0
  500. package/dist/operations/catalogue/rotate.js +49 -0
  501. package/dist/operations/catalogue/shake.d.ts +3 -0
  502. package/dist/operations/catalogue/shake.d.ts.map +1 -0
  503. package/dist/operations/catalogue/shake.js +31 -0
  504. package/dist/operations/catalogue/shatter.d.ts.map +1 -1
  505. package/dist/operations/catalogue/shatter.js +5 -1
  506. package/dist/operations/catalogue/slam.d.ts +3 -0
  507. package/dist/operations/catalogue/slam.d.ts.map +1 -0
  508. package/dist/operations/catalogue/slam.js +89 -0
  509. package/dist/operations/catalogue/slingshot.d.ts +3 -0
  510. package/dist/operations/catalogue/slingshot.d.ts.map +1 -0
  511. package/dist/operations/catalogue/slingshot.js +88 -0
  512. package/dist/operations/catalogue/spin.d.ts.map +1 -1
  513. package/dist/operations/catalogue/spin.js +24 -13
  514. package/dist/operations/catalogue/sway.d.ts +3 -0
  515. package/dist/operations/catalogue/sway.d.ts.map +1 -0
  516. package/dist/operations/catalogue/sway.js +23 -0
  517. package/dist/operations/catalogue/swirl.d.ts.map +1 -1
  518. package/dist/operations/catalogue/swirl.js +6 -5
  519. package/dist/operations/catalogue/trailCore.d.ts +89 -0
  520. package/dist/operations/catalogue/trailCore.d.ts.map +1 -0
  521. package/dist/operations/catalogue/trailCore.js +190 -0
  522. package/dist/operations/catalogue/trailGhosts.d.ts +5 -0
  523. package/dist/operations/catalogue/trailGhosts.d.ts.map +1 -0
  524. package/dist/operations/catalogue/trailGhosts.js +179 -0
  525. package/dist/operations/catalogue/trailStampStyles.d.ts +11 -0
  526. package/dist/operations/catalogue/trailStampStyles.d.ts.map +1 -0
  527. package/dist/operations/catalogue/trailStampStyles.js +479 -0
  528. package/dist/operations/catalogue/trailStamps.d.ts +57 -0
  529. package/dist/operations/catalogue/trailStamps.d.ts.map +1 -0
  530. package/dist/operations/catalogue/trailStamps.js +349 -0
  531. package/dist/operations/catalogue/trailStreaks.d.ts +3 -0
  532. package/dist/operations/catalogue/trailStreaks.d.ts.map +1 -0
  533. package/dist/operations/catalogue/trailStreaks.js +147 -0
  534. package/dist/operations/catalogue/transitionField.d.ts +30 -0
  535. package/dist/operations/catalogue/transitionField.d.ts.map +1 -1
  536. package/dist/operations/catalogue/transitionField.js +21 -0
  537. package/dist/operations/catalogue/turnAway.d.ts +3 -0
  538. package/dist/operations/catalogue/turnAway.d.ts.map +1 -0
  539. package/dist/operations/catalogue/turnAway.js +54 -0
  540. package/dist/operations/catalogue/vortexDrain.d.ts +3 -0
  541. package/dist/operations/catalogue/vortexDrain.d.ts.map +1 -0
  542. package/dist/operations/catalogue/vortexDrain.js +68 -0
  543. package/dist/operations/catalogue/warp.d.ts +3 -0
  544. package/dist/operations/catalogue/warp.d.ts.map +1 -0
  545. package/dist/operations/catalogue/warp.js +73 -0
  546. package/dist/operations/catalogue/whoosh.d.ts +3 -0
  547. package/dist/operations/catalogue/whoosh.d.ts.map +1 -0
  548. package/dist/operations/catalogue/whoosh.js +84 -0
  549. package/dist/operations/catalogue/wobble.d.ts +3 -0
  550. package/dist/operations/catalogue/wobble.d.ts.map +1 -0
  551. package/dist/operations/catalogue/wobble.js +23 -0
  552. package/dist/operations/clipPreview.d.ts +3 -0
  553. package/dist/operations/clipPreview.d.ts.map +1 -0
  554. package/dist/operations/clipPreview.js +20 -0
  555. package/dist/operations/groupFanout.d.ts +96 -0
  556. package/dist/operations/groupFanout.d.ts.map +1 -0
  557. package/dist/operations/groupFanout.js +365 -0
  558. package/dist/operations/groups.d.ts +20 -0
  559. package/dist/operations/groups.d.ts.map +1 -0
  560. package/dist/operations/groups.js +66 -0
  561. package/dist/operations/index.d.ts +5 -2
  562. package/dist/operations/index.d.ts.map +1 -1
  563. package/dist/operations/index.js +5 -2
  564. package/dist/operations/objectEffects.d.ts +161 -6
  565. package/dist/operations/objectEffects.d.ts.map +1 -1
  566. package/dist/operations/objectEffects.js +1091 -17
  567. package/dist/operations/registry.d.ts.map +1 -1
  568. package/dist/operations/registry.js +24 -2
  569. package/dist/operations/runtime.d.ts +57 -2
  570. package/dist/operations/runtime.d.ts.map +1 -1
  571. package/dist/operations/runtime.js +161 -18
  572. package/dist/operations/types.d.ts +60 -3
  573. package/dist/operations/types.d.ts.map +1 -1
  574. package/dist/operations/types.js +5 -1
  575. package/dist/operations/useObjectEffectLayers.d.ts +2 -2
  576. package/dist/operations/useObjectEffectLayers.d.ts.map +1 -1
  577. package/dist/operations/useObjectEffectLayers.js +31 -10
  578. package/dist/operations/usePresentedVisibility.d.ts +10 -0
  579. package/dist/operations/usePresentedVisibility.d.ts.map +1 -0
  580. package/dist/operations/usePresentedVisibility.js +53 -0
  581. package/dist/presets/terrainBiomes.d.ts +67 -0
  582. package/dist/presets/terrainBiomes.d.ts.map +1 -0
  583. package/dist/presets/terrainBiomes.js +294 -0
  584. package/dist/presets/terrainPresets.d.ts +6 -0
  585. package/dist/presets/terrainPresets.d.ts.map +1 -1
  586. package/dist/presets/terrainPresets.js +26 -38
  587. package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
  588. package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
  589. package/dist/shaders/glsl/oceanCore.glsl.js +17 -0
  590. package/dist/shaders/glsl/surfaceCore.glsl.d.ts +21 -0
  591. package/dist/shaders/glsl/surfaceCore.glsl.d.ts.map +1 -0
  592. package/dist/shaders/glsl/surfaceCore.glsl.js +120 -0
  593. package/dist/shaders/glsl/terrainCore.glsl.d.ts +16 -3
  594. package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -1
  595. package/dist/shaders/glsl/terrainCore.glsl.js +266 -20
  596. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +2 -0
  597. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
  598. package/dist/shaders/ocean/OceanSurfaceMaterial.js +3 -0
  599. package/dist/shaders/terrain/TerrainMaterial.d.ts +17 -0
  600. package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
  601. package/dist/shaders/terrain/TerrainMaterial.js +107 -8
  602. package/dist/triggers/engine.d.ts +44 -0
  603. package/dist/triggers/engine.d.ts.map +1 -0
  604. package/dist/triggers/engine.js +165 -0
  605. package/dist/triggers/hosts/actions.d.ts +8 -0
  606. package/dist/triggers/hosts/actions.d.ts.map +1 -0
  607. package/dist/triggers/hosts/actions.js +22 -0
  608. package/dist/triggers/hosts/interactions.d.ts +6 -0
  609. package/dist/triggers/hosts/interactions.d.ts.map +1 -0
  610. package/dist/triggers/hosts/interactions.js +4 -0
  611. package/dist/triggers/hosts/timelineCues.d.ts +2 -0
  612. package/dist/triggers/hosts/timelineCues.d.ts.map +1 -0
  613. package/dist/triggers/hosts/timelineCues.js +22 -0
  614. package/dist/triggers/index.d.ts +13 -0
  615. package/dist/triggers/index.d.ts.map +1 -0
  616. package/dist/triggers/index.js +9 -0
  617. package/dist/triggers/kinds/action.d.ts +2 -0
  618. package/dist/triggers/kinds/action.d.ts.map +1 -0
  619. package/dist/triggers/kinds/action.js +31 -0
  620. package/dist/triggers/kinds/animations.d.ts +2 -0
  621. package/dist/triggers/kinds/animations.d.ts.map +1 -0
  622. package/dist/triggers/kinds/animations.js +75 -0
  623. package/dist/triggers/kinds/effects.d.ts +2 -0
  624. package/dist/triggers/kinds/effects.d.ts.map +1 -0
  625. package/dist/triggers/kinds/effects.js +27 -0
  626. package/dist/triggers/kinds/index.d.ts +4 -0
  627. package/dist/triggers/kinds/index.d.ts.map +1 -0
  628. package/dist/triggers/kinds/index.js +4 -0
  629. package/dist/triggers/log.d.ts +21 -0
  630. package/dist/triggers/log.d.ts.map +1 -0
  631. package/dist/triggers/log.js +43 -0
  632. package/dist/triggers/readiness.d.ts +40 -0
  633. package/dist/triggers/readiness.d.ts.map +1 -0
  634. package/dist/triggers/readiness.js +158 -0
  635. package/dist/triggers/registry.d.ts +41 -0
  636. package/dist/triggers/registry.d.ts.map +1 -0
  637. package/dist/triggers/registry.js +7 -0
  638. package/dist/types/gridConfigs.d.ts +18 -23
  639. package/dist/types/gridConfigs.d.ts.map +1 -1
  640. package/dist/ui/UiAnchorUpdater.d.ts +10 -0
  641. package/dist/ui/UiAnchorUpdater.d.ts.map +1 -0
  642. package/dist/ui/UiAnchorUpdater.js +111 -0
  643. package/dist/ui/UiLayers.d.ts +20 -0
  644. package/dist/ui/UiLayers.d.ts.map +1 -0
  645. package/dist/ui/UiLayers.js +57 -0
  646. package/dist/ui/index.d.ts +9 -0
  647. package/dist/ui/index.d.ts.map +1 -0
  648. package/dist/ui/index.js +6 -0
  649. package/dist/ui/uiAnchors.d.ts +21 -0
  650. package/dist/ui/uiAnchors.d.ts.map +1 -0
  651. package/dist/ui/uiAnchors.js +22 -0
  652. package/dist/ui/uiBaseStyles.d.ts +2 -0
  653. package/dist/ui/uiBaseStyles.d.ts.map +1 -0
  654. package/dist/ui/uiBaseStyles.js +100 -0
  655. package/dist/ui/uiBinder.d.ts +30 -0
  656. package/dist/ui/uiBinder.d.ts.map +1 -0
  657. package/dist/ui/uiBinder.js +344 -0
  658. package/dist/utils/configAnimations.d.ts.map +1 -1
  659. package/dist/utils/configAnimations.js +5 -1
  660. package/dist/utils/gridConfig.d.ts +1 -1
  661. package/dist/utils/gridConfig.d.ts.map +1 -1
  662. package/dist/utils/gridConfig.js +1 -1
  663. package/dist/utils/landPatch.d.ts +33 -0
  664. package/dist/utils/landPatch.d.ts.map +1 -0
  665. package/dist/utils/landPatch.js +114 -0
  666. package/dist/utils/renderedSky.d.ts +32 -0
  667. package/dist/utils/renderedSky.d.ts.map +1 -0
  668. package/dist/utils/renderedSky.js +57 -0
  669. package/dist/utils/skyMoon.d.ts +35 -0
  670. package/dist/utils/skyMoon.d.ts.map +1 -0
  671. package/dist/utils/skyMoon.js +41 -0
  672. package/dist/utils/terrainHeight.d.ts +4 -0
  673. package/dist/utils/terrainHeight.d.ts.map +1 -0
  674. package/dist/utils/terrainHeight.js +150 -0
  675. package/dist/utils/terrainTextureResolver.d.ts +18 -0
  676. package/dist/utils/terrainTextureResolver.d.ts.map +1 -0
  677. package/dist/utils/terrainTextureResolver.js +17 -0
  678. package/dist/utils/terrainUniforms.d.ts +17 -0
  679. package/dist/utils/terrainUniforms.d.ts.map +1 -1
  680. package/dist/utils/terrainUniforms.js +84 -0
  681. package/dist/utils/textureArrays.d.ts +29 -0
  682. package/dist/utils/textureArrays.d.ts.map +1 -0
  683. package/dist/utils/textureArrays.js +140 -0
  684. package/package.json +2 -2
@@ -1,91 +1,116 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useObjectReady } from '../hooks/useObjectReady.js';
3
- import { useRef, useEffect, useCallback } from 'react';
4
- import { useFrame } from '@react-three/fiber';
5
- import { useSkyUniforms } from '../hooks/useSkyUniforms.js';
6
- import { useSkyAnimation } from '../hooks/useSkyAnimation.js';
7
- import { useSkySystem } from '../hooks/useSkySystem.js';
8
- import { findById } from '../utils/sceneQuery.js';
9
- import { cubeCameraManager } from '@3driseai/3drise-core';
3
+ import { useRef, useEffect, useCallback, useMemo } from 'react';
4
+ import { useFrame, useThree } from '@react-three/fiber';
5
+ import { SKY_LIVE_KEY } from '../hooks/useSkyLive.js';
6
+ import { createSunPosition } from '../utils/utils3d.js';
7
+ import { applyConfigKeyframeAnimations, applyConfigMouseMove, hasConfigOverrides, resolveConfig, } from '../utils/configAnimations.js';
8
+ import { publishRenderedSky, clearRenderedSky } from '../utils/renderedSky.js';
9
+ import { cubeCameraManager, getAnimatableProperties, skySystemManager, atmosphereForSunElevation, skyBrightnessForSunElevation, nightAmount } from '@3driseai/3drise-core';
10
10
  import SkyMesh from './SkyMesh.js';
11
- function SkyController({ settings, timeSettings, scale = 1000, onSettingsChange, onObjectReady, onObjectDispose, }) {
11
+ /** The sky's animatable knobs, from the property registry — the same list the
12
+ * Animation and MouseMove panels offer, so a binding can never target a knob
13
+ * this loop does not push. */
14
+ const SKY_ANIMATABLE = new Set(getAnimatableProperties({ type: 'sky' }, 'sky').map(p => p.value));
15
+ /** While the sky is being driven, refresh the environment probe at most this often.
16
+ * Six cube faces per frame is the one thing an animated sky must never do. */
17
+ const ENV_REFRESH_MS = 500;
18
+ const renderedOf = (s) => ({
19
+ turbidity: s.turbidity ?? 2,
20
+ rayleigh: s.rayleigh ?? 1,
21
+ mieCoefficient: s.mieCoefficient ?? 0.005,
22
+ mieDirectionalG: s.mieDirectionalG ?? 0.7,
23
+ elevation: s.elevation ?? 0,
24
+ azimuth: s.azimuth ?? 0,
25
+ });
26
+ /**
27
+ * The analytic (Preetham) sky.
28
+ *
29
+ * What it draws, each frame, in order:
30
+ * 1. the stored settings — or, while time of day is enabled, the time-driven
31
+ * sun and atmosphere (time owns all six knobs then);
32
+ * 2. the `sky` keyframe domain (settings.animations.sky)
33
+ * 3. the `sky` pointer domain on top (settings.mouseMove.sky)
34
+ * 4. a controller's live drag (SKY_LIVE_KEY handle on the mesh)
35
+ * With time of day on, the clock owns the sun's position (elevation/azimuth), and
36
+ * 1–4 above are the DAY look: atmosphereForSunElevation blends them into golden
37
+ * hour, twilight and night by the sun's height. Sliders, keyframes and pointer
38
+ * bindings on the atmosphere keep working with the clock running.
39
+ *
40
+ * Whatever it draws is published per scene (renderedSky) so the key light, the
41
+ * clouds, the water and the terrain are lit by the same sun and atmosphere.
42
+ *
43
+ * It draws only. The sun LIGHT is SkySystem's SunLight, which reads what this
44
+ * publishes; a second light here used to double the sun (always white, always
45
+ * on, lit from below the ground at night).
46
+ */
47
+ function SkyController({ settings, timeSettings, scale = 1000, onObjectReady, onObjectDispose }) {
12
48
  const skyRef = useRef(null);
13
49
  const rootRef = useRef(null);
14
50
  useObjectReady(rootRef, settings, onObjectReady, onObjectDispose);
15
- const sunLightRef = useRef(null);
16
- const isAnimatingRef = useRef(false);
17
51
  const previousSettings = useRef(null);
18
- // const cubeCameraManager = CubeCameraManager.getInstance();
19
- const { updateUniforms, getCurrentValues } = useSkyUniforms();
20
- const { animateSkyTransition } = useSkyAnimation();
52
+ const scene = useThree(s => s.scene);
53
+ const timeOwns = !!(settings.visible && timeSettings?.enabled);
54
+ // Frame scratch, kept in refs so a keyframed turbidity does not re-render React.
55
+ const override = useRef({});
56
+ const startValues = useRef({});
57
+ const liveRef = useRef({});
58
+ const animStart = useRef(0);
59
+ const driving = useRef(false);
60
+ const lastEnvRefresh = useRef(0);
61
+ const envDirty = useRef(false);
62
+ const timeAtmos = useRef({ turbidity: 0, rayleigh: 0, mieCoefficient: 0, mieDirectionalG: 0 });
63
+ const timeApplied = useRef(null);
64
+ // Restart the keyframes from their beginning whenever they are edited.
21
65
  useEffect(() => {
22
- return () => {
23
- sunLightRef.current?.shadow?.map?.dispose();
24
- };
25
- }, []);
66
+ animStart.current = performance.now();
67
+ startValues.current = {};
68
+ }, [settings.animations]);
69
+ // A slider end commits the dragged value, which arrives here as new settings.
70
+ useEffect(() => { liveRef.current = {}; }, [settings]);
26
71
  useEffect(() => {
27
- handleSettings(settings);
28
- }, [settings]);
29
- const handleTimeUpdate = useCallback((state) => {
30
- const { sunAzimuth, sunElevation, timeInHours } = state;
31
- const atmosphericParams = calculateSkyParamsForTime(timeInHours);
32
- const newSettings = {
33
- ...settings,
34
- elevation: sunElevation,
35
- azimuth: sunAzimuth,
36
- ...atmosphericParams,
72
+ return () => {
73
+ clearRenderedSky(scene);
37
74
  };
38
- // While time is advancing, the environment probe is already re-capturing
39
- // the cube map on its own timer. Letting handleSettings capture as well
40
- // meant six faces rendered from two independent schedulers for the same
41
- // moving sun.
42
- const applied = handleSettings(newSettings, state.advancing);
43
- // Only on a real change, and only when time is not running: this runs
44
- // every frame now, and an unconditional call would dispatch a settings
45
- // write per frame in a host that supplies this callback.
46
- if (applied && !state.advancing) {
47
- onSettingsChange?.(newSettings);
75
+ }, [scene]);
76
+ /** Push the six knobs into the sky shader. Writes this mesh, never a findById
77
+ * result, so a second canvas cannot drive the editor's sky. */
78
+ const applyUniforms = useCallback((values) => {
79
+ const uniforms = skyRef.current?.material?.uniforms;
80
+ if (!uniforms)
81
+ return;
82
+ if (values.turbidity !== undefined)
83
+ uniforms.turbidity.value = values.turbidity;
84
+ if (values.rayleigh !== undefined)
85
+ uniforms.rayleigh.value = values.rayleigh;
86
+ if (values.mieCoefficient !== undefined)
87
+ uniforms.mieCoefficient.value = values.mieCoefficient;
88
+ if (values.mieDirectionalG !== undefined)
89
+ uniforms.mieDirectionalG.value = values.mieDirectionalG;
90
+ if (values.elevation !== undefined && values.azimuth !== undefined && uniforms.sunPosition) {
91
+ uniforms.sunPosition.value.copy(createSunPosition(values.elevation, values.azimuth));
48
92
  }
49
- }, [settings, onSettingsChange]);
50
- useSkySystem({
51
- timeSettings,
52
- onTimeUpdate: handleTimeUpdate,
53
- enabled: settings.visible && timeSettings.enabled,
54
- });
55
- const handleSkyMeshReady = useCallback((object, mesh) => {
56
- skyRef.current = mesh;
57
- updateUniforms(settings);
58
- previousSettings.current = { ...settings };
59
- onObjectReady && onObjectReady(object, mesh);
60
- }, [settings, updateUniforms, onObjectReady]);
93
+ // Darken the dome after sunset (see SkyMesh addNightDarkening). By the
94
+ // sun's height, so a hand-set sun below the horizon gets night too.
95
+ if (values.elevation !== undefined && uniforms.uSkyBrightness) {
96
+ uniforms.uSkyBrightness.value = skyBrightnessForSunElevation(values.elevation);
97
+ const n = nightAmount(values.elevation);
98
+ uniforms.uNightTint.value.set(0.0006 * n, 0.0016 * n, 0.0045 * n);
99
+ }
100
+ }, []);
61
101
  const toggleSky = useCallback((show) => {
62
102
  if (!skyRef.current)
63
103
  return;
64
104
  skyRef.current.visible = show;
65
- if (sunLightRef.current)
66
- sunLightRef.current.visible = show;
67
105
  if (!show) {
68
106
  cubeCameraManager.dispose();
107
+ clearRenderedSky(scene);
69
108
  }
70
109
  else {
71
110
  cubeCameraManager.updateEnvironment();
72
111
  }
73
- }, []);
74
- const updateSun = useCallback(() => {
75
- if (!skyRef.current?.material || !sunLightRef.current)
76
- return;
77
- const uniforms = skyRef.current.material.uniforms;
78
- if (!uniforms?.sunPosition)
79
- return;
80
- const distance = 100;
81
- const sp = uniforms.sunPosition.value;
82
- sunLightRef.current.position.set(sp.x * distance, sp.y * distance, sp.z * distance);
83
- sunLightRef.current.shadow.camera.updateProjectionMatrix();
84
- const moon = findById('3drise-moon');
85
- if (moon)
86
- moon.position.set(sp.x * scale, sp.y * scale, sp.z * scale);
87
- }, [scale]);
88
- const hasActualChanges = useCallback((next, prev) => {
112
+ }, [scene]);
113
+ const hasActualChanges = (next, prev) => {
89
114
  if (!prev)
90
115
  return true;
91
116
  return (next.visible !== prev.visible ||
@@ -95,16 +120,12 @@ function SkyController({ settings, timeSettings, scale = 1000, onSettingsChange,
95
120
  Math.abs(next.mieDirectionalG - prev.mieDirectionalG) > 0.001 ||
96
121
  Math.abs(next.elevation - prev.elevation) > 0.1 ||
97
122
  Math.abs(next.azimuth - prev.azimuth) > 0.1);
98
- }, []);
99
- const handleCompletedUniforms = (_finalValues) => {
100
- isAnimatingRef.current = false;
101
- cubeCameraManager.updateEnvironment();
102
123
  };
103
- /** Returns whether the settings were actually applied, so callers can tell a
104
- * real change from a no-op. `skipEnvUpdate` leaves the cube-camera capture
105
- * to whoever else is already scheduling it. */
124
+ /** Applies a settings object (stored or time-driven). Returns whether anything
125
+ * changed. `skipEnvUpdate` leaves the cube capture to whoever already
126
+ * schedules it (the probe re-captures on its own timer while time advances). */
106
127
  const handleSettings = (newSettings, skipEnvUpdate = false) => {
107
- if (!skyRef.current || isAnimatingRef.current || !newSettings)
128
+ if (!skyRef.current || !newSettings)
108
129
  return false;
109
130
  if (!hasActualChanges(newSettings, previousSettings.current))
110
131
  return false;
@@ -115,68 +136,106 @@ function SkyController({ settings, timeSettings, scale = 1000, onSettingsChange,
115
136
  previousSettings.current = { ...newSettings };
116
137
  return false;
117
138
  }
118
- updateUniforms(newSettings);
119
- updateSun();
120
- if (!skipEnvUpdate) {
139
+ applyUniforms(newSettings);
140
+ publishRenderedSky(scene, renderedOf(newSettings));
141
+ if (!skipEnvUpdate)
121
142
  cubeCameraManager.updateEnvironment();
122
- }
123
143
  previousSettings.current = { ...newSettings };
124
144
  return true;
125
145
  };
126
- const handleMouseMove = (mouse) => {
127
- const handlers = settings.handlers;
128
- if (!handlers || isAnimatingRef.current || !skyRef.current)
146
+ // With the clock on, the frame loop draws; applying stored elevation here would
147
+ // flash the authored sun for a frame. Re-runs when the clock is switched off so
148
+ // the stored sky comes back.
149
+ useEffect(() => {
150
+ if (timeOwns)
129
151
  return;
130
- if (!handlers.onMouseMove?.enabled)
152
+ handleSettings(settings);
153
+ }, [settings, timeOwns]);
154
+ const liveHandle = useMemo(() => ({
155
+ set: (key, value) => { liveRef.current[key] = value; },
156
+ }), []);
157
+ const attachLive = (mesh) => {
158
+ if (mesh)
159
+ mesh.userData[SKY_LIVE_KEY] = liveHandle;
160
+ };
161
+ useEffect(() => {
162
+ const mesh = skyRef.current;
163
+ attachLive(mesh);
164
+ return () => { if (mesh)
165
+ delete mesh.userData[SKY_LIVE_KEY]; };
166
+ }, [liveHandle]);
167
+ const handleSkyMeshReady = useCallback((object, mesh) => {
168
+ skyRef.current = mesh;
169
+ attachLive(mesh);
170
+ applyUniforms(settings);
171
+ if (settings.visible)
172
+ publishRenderedSky(scene, renderedOf(settings));
173
+ previousSettings.current = { ...settings };
174
+ onObjectReady && onObjectReady(object, mesh);
175
+ }, [settings, applyUniforms, onObjectReady, scene]);
176
+ /** Clock on: the clock's sun, the day look blended by the sun's height. Pushes
177
+ * only on a visible change, and leaves the cube capture to the probe while
178
+ * time is advancing (it refreshes on sun movement); a manual seek or a slider
179
+ * re-captures here, trailing-throttled so a scrub ends on a fresh capture. */
180
+ const drawTimeOfDay = (day) => {
181
+ const sky = skyRef.current;
182
+ if (!sky)
131
183
  return;
132
- let updated = { ...settings };
133
- handlers.onMouseMove.properties.forEach((propConfig) => {
134
- const { property } = propConfig;
135
- const { sensitivity, min: minVal, max: maxVal, axis } = propConfig.propertySettings;
136
- let movement = axis === 'x' ? mouse.x * sensitivity
137
- : axis === 'y' ? mouse.y * sensitivity
138
- : (mouse.x + mouse.y) * 0.5 * sensitivity;
139
- if (movement !== 0) {
140
- let newVal = updated[property] + movement;
141
- if (typeof minVal === 'number')
142
- newVal = Math.max(newVal, minVal);
143
- if (typeof maxVal === 'number')
144
- newVal = Math.min(newVal, maxVal);
145
- updated[property] = newVal;
146
- }
147
- });
148
- handleSettings(updated);
184
+ if (!sky.visible)
185
+ toggleSky(true);
186
+ const t = skySystemManager.getState();
187
+ const atmos = atmosphereForSunElevation(t.sunElevation, day, timeAtmos.current);
188
+ const next = { ...day, ...atmos, visible: true, elevation: t.sunElevation, azimuth: t.sunAzimuth };
189
+ if (hasActualChanges(next, timeApplied.current)) {
190
+ applyUniforms(next);
191
+ publishRenderedSky(scene, renderedOf(next));
192
+ timeApplied.current = next;
193
+ previousSettings.current = next;
194
+ if (!t.advancing)
195
+ envDirty.current = true;
196
+ }
197
+ const now = performance.now();
198
+ if (envDirty.current && now - lastEnvRefresh.current > ENV_REFRESH_MS) {
199
+ envDirty.current = false;
200
+ lastEnvRefresh.current = now;
201
+ cubeCameraManager.updateEnvironment();
202
+ }
149
203
  };
150
204
  useFrame((state) => {
151
- handleMouseMove({ x: state.pointer.x, y: state.pointer.y });
152
- });
153
- return (_jsxs("group", { ref: rootRef, children: [_jsx(SkyMesh, { ref: skyRef, settings: settings, scale: scale, onObjectReady: handleSkyMeshReady, onObjectDispose: onObjectDispose }), settings.visible && (_jsx("directionalLight", { ref: sunLightRef, color: "#ffffff", intensity: 1, castShadow: true }))] }));
154
- }
155
- function calculateSkyParamsForTime(timeInHours) {
156
- const nightParams = { turbidity: 0.5, rayleigh: 0.1, mieCoefficient: 0.001, mieDirectionalG: 0.8 };
157
- const sunriseParams = { turbidity: 4, rayleigh: 3, mieCoefficient: 0.01, mieDirectionalG: 0.9 };
158
- const dayParams = { turbidity: 0.7, rayleigh: 0.54, mieCoefficient: 0.005, mieDirectionalG: 0.7 };
159
- const sunsetParams = { turbidity: 4.5, rayleigh: 3.5, mieCoefficient: 0.012, mieDirectionalG: 0.92 };
160
- const lerp = (a, b, t) => a + (b - a) * Math.max(0, Math.min(1, t));
161
- const ss = (t) => t * t * (3 - 2 * t);
162
- const lerpP = (from, to, t) => ({
163
- turbidity: lerp(from.turbidity, to.turbidity, ss(t)),
164
- rayleigh: lerp(from.rayleigh, to.rayleigh, ss(t)),
165
- mieCoefficient: lerp(from.mieCoefficient, to.mieCoefficient, ss(t)),
166
- mieDirectionalG: lerp(from.mieDirectionalG, to.mieDirectionalG, ss(t)),
205
+ if (!skyRef.current || !settings.visible)
206
+ return;
207
+ const o = override.current;
208
+ const base = settings;
209
+ applyConfigKeyframeAnimations(settings.animations?.sky?.animations, startValues.current, base, o, performance.now() - animStart.current, SKY_ANIMATABLE);
210
+ const mm = settings.mouseMove;
211
+ if (mm?.enabled && mm.sky?.enabled) {
212
+ applyConfigMouseMove(mm.sky.properties, base, o, state.pointer, SKY_ANIMATABLE);
213
+ }
214
+ if (timeOwns) {
215
+ drawTimeOfDay(resolveConfig(settings, o, liveRef.current));
216
+ return;
217
+ }
218
+ timeApplied.current = null;
219
+ if (hasConfigOverrides(o) || hasConfigOverrides(liveRef.current)) {
220
+ const resolved = resolveConfig(settings, o, liveRef.current);
221
+ applyUniforms(resolved);
222
+ publishRenderedSky(scene, renderedOf(resolved));
223
+ driving.current = true;
224
+ const now = performance.now();
225
+ if (now - lastEnvRefresh.current > ENV_REFRESH_MS) {
226
+ lastEnvRefresh.current = now;
227
+ cubeCameraManager.updateEnvironment();
228
+ }
229
+ }
230
+ else if (driving.current) {
231
+ // A binding was removed or the pointer stopped mattering: go back to the
232
+ // stored sky once, including the probe.
233
+ driving.current = false;
234
+ applyUniforms(settings);
235
+ publishRenderedSky(scene, renderedOf(settings));
236
+ cubeCameraManager.updateEnvironment();
237
+ }
167
238
  });
168
- if (timeInHours < 5)
169
- return nightParams;
170
- if (timeInHours < 6.5)
171
- return lerpP(nightParams, sunriseParams, (timeInHours - 5) / 1.5);
172
- if (timeInHours < 8)
173
- return lerpP(sunriseParams, dayParams, (timeInHours - 6.5) / 1.5);
174
- if (timeInHours < 17)
175
- return dayParams;
176
- if (timeInHours < 19)
177
- return lerpP(dayParams, sunsetParams, (timeInHours - 17) / 2);
178
- if (timeInHours < 21)
179
- return lerpP(sunsetParams, nightParams, (timeInHours - 19) / 2);
180
- return nightParams;
239
+ return (_jsx("group", { ref: rootRef, children: _jsx(SkyMesh, { ref: skyRef, settings: settings, scale: scale, onObjectReady: handleSkyMeshReady, onObjectDispose: onObjectDispose }) }));
181
240
  }
182
241
  export default SkyController;
@@ -1 +1 @@
1
- {"version":3,"file":"SkyMesh.d.ts","sourceRoot":"","sources":["../../src/components/SkyMesh.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IAClD,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,QAAA,MAAM,OAAO,EA2BP,GAAI,CAAC;AAEX,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"SkyMesh.d.ts","sourceRoot":"","sources":["../../src/components/SkyMesh.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IAClD,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAqBD,QAAA,MAAM,OAAO,EAgCP,GAAI,CAAC;AAEX,eAAe,OAAO,CAAC"}
@@ -2,12 +2,37 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useObjectReady } from '../hooks/useObjectReady.js';
3
3
  import React, { useRef, useMemo, useEffect } from 'react';
4
4
  import { Sky } from 'three/examples/jsm/objects/Sky.js';
5
+ import { Vector3 } from "three";
6
+ import { SKY_ID } from "@3driseai/3drise-core";
7
+ /**
8
+ * Lets SkyController darken the dome after sunset. Preetham alone bottoms out at
9
+ * a flat grey (its constant 0.1 base term), which reads as overcast dusk, not
10
+ * night. `uSkyBrightness` scales the output (1 by day, core
11
+ * skyBrightnessForSunElevation), `uNightTint` adds a faint blue so the dark sky
12
+ * is not neutral grey. Patched by string: if a three upgrade changes the line,
13
+ * the sky simply stays undarkened rather than breaking.
14
+ */
15
+ const SKY_OUT = 'gl_FragColor = vec4( retColor, 1.0 );';
16
+ function addNightDarkening(material) {
17
+ material.uniforms.uSkyBrightness = { value: 1 };
18
+ material.uniforms.uNightTint = { value: new Vector3(0, 0, 0) };
19
+ if (!material.fragmentShader.includes(SKY_OUT))
20
+ return;
21
+ material.fragmentShader = material.fragmentShader
22
+ .replace('void main() {', 'uniform float uSkyBrightness;\nuniform vec3 uNightTint;\nvoid main() {')
23
+ .replace(SKY_OUT, 'gl_FragColor = vec4( retColor * uSkyBrightness + uNightTint, 1.0 );');
24
+ }
5
25
  const SkyMesh = React.forwardRef(({ settings, scale = 1000, onObjectReady, onObjectDispose }, ref) => {
6
26
  const meshRef = useRef(null);
7
27
  useObjectReady(meshRef, settings, onObjectReady, onObjectDispose);
8
28
  const skyObject = useMemo(() => {
9
29
  const sky = new Sky();
30
+ addNightDarkening(sky.material);
10
31
  sky.scale.setScalar(scale);
32
+ // Set once on the object, never as a userData JSX prop: R3F replaces the
33
+ // whole userData object on every render, which would drop the live handle
34
+ // SkyController hangs here.
35
+ sky.userData.id = SKY_ID;
11
36
  return sky;
12
37
  }, [scale]);
13
38
  useEffect(() => {
@@ -28,7 +53,7 @@ const SkyMesh = React.forwardRef(({ settings, scale = 1000, onObjectReady, onObj
28
53
  else if (ref)
29
54
  ref.current = node;
30
55
  };
31
- return (_jsx("primitive", { ref: combinedRef, object: skyObject, visible: settings.visible, scale: scale, userData: { id: '3drise-sky' } }));
56
+ return (_jsx("primitive", { ref: combinedRef, object: skyObject, visible: settings.visible, scale: scale }));
32
57
  });
33
58
  SkyMesh.displayName = 'SkyMesh';
34
59
  export default SkyMesh;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { SkySettings, SkyStarsSettings, TimeSettings } from '@3driseai/3drise-core';
3
+ export interface SkyStarsProps {
4
+ timeSettings: TimeSettings;
5
+ skySettings?: SkySettings;
6
+ /** The stars block of SkySettings; missing fields fill in from SKY_STARS_DEFAULTS. */
7
+ stars?: SkyStarsSettings | null;
8
+ }
9
+ declare const SkyStars: React.FC<SkyStarsProps>;
10
+ export default SkyStars;
11
+ //# sourceMappingURL=SkyStars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkyStars.d.ts","sourceRoot":"","sources":["../../src/components/SkyStars.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGzF,MAAM,WAAW,aAAa;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,sFAAsF;IACtF,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACnC;AA4HD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA8DrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,187 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef } from 'react';
3
+ import * as THREE from 'three';
4
+ import { useFrame } from '@react-three/fiber';
5
+ import { nightAmount, skySystemManager, normalizeSkyStars } from '@3driseai/3drise-core';
6
+ import { useCloudSun } from '../hooks/useCloudSun.js';
7
+ /**
8
+ * The night sky's stars, built into the sky for either renderer.
9
+ *
10
+ * A star dome centred on the camera just inside the far plane (the sky is drawn
11
+ * at the far plane, so stars sit in front of it and terrain occludes them).
12
+ * Brightness follows a magnitude-like distribution — a few bright stars, many
13
+ * faint ones — with a slight colour temperature spread and a gentle twinkle.
14
+ *
15
+ * With the clock on they appear with the night (nightAmount: by the SUN'S HEIGHT,
16
+ * the same phase keys as the atmosphere), fade toward the horizon where real air
17
+ * extinguishes them, and turn about the celestial pole with the clock: rising in
18
+ * the same quarter the sun rises, setting where it sets. With the clock off they
19
+ * are a stand-alone layer: on whenever `stars.visible` is, at full strength.
20
+ */
21
+ /** Height of the celestial pole above the horizon = observer latitude. */
22
+ const LATITUDE_DEG = 40;
23
+ /** North is opposite the noon sun. The noon sun is toward +X in core's
24
+ * convention, so the pole leans toward −X. */
25
+ const POLE = new THREE.Vector3(-Math.cos(THREE.MathUtils.degToRad(LATITUDE_DEG)), Math.sin(THREE.MathUtils.degToRad(LATITUDE_DEG)), 0).normalize();
26
+ /** Sidereal day, hours: the sky turns once in this much clock time. */
27
+ const SIDEREAL_HOURS = 23.934;
28
+ const vertexShader = /* glsl */ `
29
+ attribute float aMag;
30
+ attribute float aPhase;
31
+ attribute vec3 aTint;
32
+ uniform float uTime;
33
+ uniform float uNight;
34
+ uniform float uPixelRatio;
35
+ uniform float uBrightness;
36
+ uniform float uSize;
37
+ uniform float uTwinkle;
38
+ uniform float uWarmth;
39
+ varying vec3 vColor;
40
+ varying float vAlpha;
41
+ void main() {
42
+ vec4 world = modelMatrix * vec4(position, 1.0);
43
+ // direction from the camera: stars live on a camera-centred dome
44
+ vec3 dir = normalize(world.xyz - cameraPosition);
45
+ float horizon = smoothstep(-0.02, 0.18, dir.y); // extinction near the horizon
46
+ // twinkle depth: 0 = steady, 1 = the full 36% flicker
47
+ float twinkle = 1.0 - 0.36 * uTwinkle * (0.5 + 0.5 * sin(uTime * (1.3 + aPhase * 2.1) + aPhase * 37.0));
48
+ float b = aMag * twinkle * horizon * uNight * uBrightness;
49
+ // aTint holds the full-temperature colour; uWarmth blends it toward white
50
+ vColor = mix(vec3(1.0), aTint, uWarmth);
51
+ vAlpha = b;
52
+ gl_PointSize = (1.0 + 2.6 * aMag) * uPixelRatio * uSize;
53
+ gl_Position = projectionMatrix * viewMatrix * world;
54
+ }
55
+ `;
56
+ const fragmentShader = /* glsl */ `
57
+ varying vec3 vColor;
58
+ varying float vAlpha;
59
+ void main() {
60
+ vec2 d = gl_PointCoord * 2.0 - 1.0;
61
+ float r2 = dot(d, d);
62
+ if (r2 > 1.0 || vAlpha < 0.003) discard;
63
+ float core = exp(-r2 * 4.0);
64
+ gl_FragColor = vec4(vColor * core * vAlpha, 1.0);
65
+ }
66
+ `;
67
+ /** Great-circle normal of the Milky Way band: tilted ~60° from the celestial pole
68
+ * (the real galactic plane is ~63° off), so the band arches across the sky
69
+ * rather than circling the pole. */
70
+ const BAND_NORMAL = new THREE.Vector3(0.5, 0.55, 0.67).normalize();
71
+ const BAND_U = new THREE.Vector3().crossVectors(BAND_NORMAL, new THREE.Vector3(0, 1, 0)).normalize();
72
+ const BAND_V = new THREE.Vector3().crossVectors(BAND_NORMAL, BAND_U).normalize();
73
+ /** Box–Muller normal deviate. */
74
+ const gauss = () => Math.sqrt(-2 * Math.log(1 - Math.random())) * Math.cos(Math.random() * Math.PI * 2);
75
+ /**
76
+ * Builds the dome. `milkyWay` (0..1) moves that fraction (× 0.7) of the stars into a
77
+ * dense band of faint stars along a great circle, with a wider, sparser halo — the
78
+ * unresolved glow reads as the band even though every point is still a star. The
79
+ * full colour-temperature tint is baked per star; the shader scales it by warmth.
80
+ */
81
+ function buildStars(count, milkyWay) {
82
+ const pos = new Float32Array(count * 3);
83
+ const mag = new Float32Array(count);
84
+ const phase = new Float32Array(count);
85
+ const tint = new Float32Array(count * 3);
86
+ const inBand = Math.round(count * 0.7 * THREE.MathUtils.clamp(milkyWay, 0, 1));
87
+ const p = new THREE.Vector3();
88
+ for (let i = 0; i < count; i++) {
89
+ if (i < inBand) {
90
+ // along the band: uniform angle; across it: gaussian, 60% in a tight core, 40% in a halo
91
+ const a = Math.random() * Math.PI * 2;
92
+ const sigma = Math.random() < 0.6 ? 0.07 : 0.22;
93
+ const lat = THREE.MathUtils.clamp(gauss() * sigma, -1.2, 1.2);
94
+ p.copy(BAND_U).multiplyScalar(Math.cos(a) * Math.cos(lat))
95
+ .addScaledVector(BAND_V, Math.sin(a) * Math.cos(lat))
96
+ .addScaledVector(BAND_NORMAL, Math.sin(lat));
97
+ // the band is dust: many faint stars, rarely a bright one
98
+ mag[i] = 0.06 + 0.3 * Math.pow(Math.random(), 3);
99
+ }
100
+ else {
101
+ // uniform on the sphere
102
+ const u = Math.random() * 2 - 1;
103
+ const th = Math.random() * Math.PI * 2;
104
+ const sr = Math.sqrt(1 - u * u);
105
+ p.set(sr * Math.cos(th), u, sr * Math.sin(th));
106
+ // many faint, few bright
107
+ mag[i] = 0.12 + 0.88 * Math.pow(Math.random(), 6);
108
+ }
109
+ pos[i * 3] = p.x;
110
+ pos[i * 3 + 1] = p.y;
111
+ pos[i * 3 + 2] = p.z;
112
+ phase[i] = Math.random();
113
+ const t = Math.random();
114
+ // full temperature spread (warmth 1): blue giants, orange dwarfs, the rest near white
115
+ const c = t < 0.12 ? [0.62, 0.74, 1.0] : t < 0.25 ? [1.0, 0.8, 0.55] : [1.0, 0.97, 0.92];
116
+ tint.set(c, i * 3);
117
+ }
118
+ const g = new THREE.BufferGeometry();
119
+ g.setAttribute('position', new THREE.BufferAttribute(pos, 3));
120
+ g.setAttribute('aMag', new THREE.BufferAttribute(mag, 1));
121
+ g.setAttribute('aPhase', new THREE.BufferAttribute(phase, 1));
122
+ g.setAttribute('aTint', new THREE.BufferAttribute(tint, 3));
123
+ return g;
124
+ }
125
+ const SkyStars = ({ timeSettings, skySettings, stars }) => {
126
+ const pointsRef = useRef(null);
127
+ const { update } = useCloudSun({ skySettings, timeSettings });
128
+ const { count, milkyWay, brightness, size, twinkle, warmth } = normalizeSkyStars(stars);
129
+ // Structural: a new dome only when count or the band changes.
130
+ const geometry = useMemo(() => buildStars(count, milkyWay), [count, milkyWay]);
131
+ const material = useMemo(() => new THREE.ShaderMaterial({
132
+ uniforms: {
133
+ uTime: { value: 0 },
134
+ uNight: { value: 0 },
135
+ uPixelRatio: { value: 1 },
136
+ uBrightness: { value: 1 },
137
+ uSize: { value: 1 },
138
+ uTwinkle: { value: 0.5 },
139
+ uWarmth: { value: 0.5 },
140
+ },
141
+ vertexShader,
142
+ fragmentShader,
143
+ transparent: true,
144
+ depthWrite: false,
145
+ depthTest: true,
146
+ blending: THREE.AdditiveBlending,
147
+ fog: false,
148
+ toneMapped: false,
149
+ }), []);
150
+ useEffect(() => () => geometry.dispose(), [geometry]);
151
+ useEffect(() => () => material.dispose(), [material]);
152
+ const spin = useMemo(() => new THREE.Quaternion(), []);
153
+ useFrame(({ camera, gl, clock }) => {
154
+ const points = pointsRef.current;
155
+ if (!points)
156
+ return;
157
+ // With the clock on, the stars belong to the day cycle: they come out as the sun
158
+ // sets (nightAmount). With the clock off they stand alone — the user adds them
159
+ // whenever they want, at full strength, whatever the sun's elevation.
160
+ let night = 1;
161
+ if (timeSettings?.enabled) {
162
+ const sunDir = update().direction;
163
+ const sunElevation = THREE.MathUtils.radToDeg(Math.asin(THREE.MathUtils.clamp(sunDir.y, -1, 1)));
164
+ night = nightAmount(sunElevation);
165
+ }
166
+ if (night <= 0.001) {
167
+ points.visible = false;
168
+ return;
169
+ }
170
+ points.visible = true;
171
+ const far = camera.far ?? 1000;
172
+ points.position.copy(camera.position);
173
+ points.scale.setScalar(far * 0.85);
174
+ // Turn with the clock about the pole, same sense as the sun (rises −Z, sets +Z).
175
+ const hours = timeSettings?.enabled ? skySystemManager.getTimeInHours() : 0;
176
+ points.quaternion.copy(spin.setFromAxisAngle(POLE, -(hours / SIDEREAL_HOURS) * Math.PI * 2));
177
+ material.uniforms.uTime.value = clock.elapsedTime;
178
+ material.uniforms.uNight.value = night;
179
+ material.uniforms.uPixelRatio.value = gl.getPixelRatio();
180
+ material.uniforms.uBrightness.value = brightness;
181
+ material.uniforms.uSize.value = size;
182
+ material.uniforms.uTwinkle.value = twinkle;
183
+ material.uniforms.uWarmth.value = warmth;
184
+ });
185
+ return _jsx("points", { ref: pointsRef, geometry: geometry, material: material, frustumCulled: false, renderOrder: -2 });
186
+ };
187
+ export default SkyStars;
@@ -26,9 +26,9 @@ export interface SkySystemRef {
26
26
  export interface SkySystemProps extends ObjectReadyProps {
27
27
  timeSettings: TimeSettings;
28
28
  visible?: boolean;
29
- /** True mounts the physical sun rig (skybox + lensflare + directional light);
30
- * false mounts the analytic Preetham sky instead. They are alternatives, not
31
- * layers — the sun rig draws its own background. */
29
+ /** True mounts the sun rig background (skybox + lensflare); false mounts the
30
+ * analytic Preetham sky instead. The key light (SunLight) is the same in both
31
+ * and is mounted whenever either sky is active. */
32
32
  sunSystemVisible?: boolean;
33
33
  sunSize?: number;
34
34
  moonSize?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"SkySystem.d.ts","sourceRoot":"","sources":["../../src/components/SkySystem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAOtE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACpD,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;yDAEqD;IACrD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAC/B;;;uBAGmB;IACnB,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,qBAAqB,CAAC,EAAE,WAAW,CAAC;IACpC;wDACoD;IACpD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;;;;;;;gFAU4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,SAAS,qFAwJb,CAAC;AAGH,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"SkySystem.d.ts","sourceRoot":"","sources":["../../src/components/SkySystem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAStE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACpD,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;wDAEoD;IACpD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAC/B;;;uBAGmB;IACnB,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,qBAAqB,CAAC,EAAE,WAAW,CAAC;IACpC;wDACoD;IACpD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;;;;;;;gFAU4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,SAAS,qFAmLb,CAAC;AAGH,eAAe,SAAS,CAAC"}