@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
@@ -0,0 +1,57 @@
1
+ import { Vector3 } from 'three';
2
+ import { sunDirectionFromAngles } from '@3driseai/3drise-core';
3
+ const rendered = new WeakMap();
4
+ export function publishRenderedSky(scene, values) {
5
+ let out = rendered.get(scene);
6
+ if (!out) {
7
+ out = { ...values, sunDirection: new Vector3() };
8
+ rendered.set(scene, out);
9
+ }
10
+ out.turbidity = values.turbidity;
11
+ out.rayleigh = values.rayleigh;
12
+ out.mieCoefficient = values.mieCoefficient;
13
+ out.mieDirectionalG = values.mieDirectionalG;
14
+ out.elevation = values.elevation;
15
+ out.azimuth = values.azimuth;
16
+ sunDirectionFromAngles(values.elevation, values.azimuth, out.sunDirection);
17
+ }
18
+ export function clearRenderedSky(scene) {
19
+ rendered.delete(scene);
20
+ }
21
+ export function getRenderedSky(scene) {
22
+ return rendered.get(scene);
23
+ }
24
+ /**
25
+ * Who owns the sun light. While a sky is active, SkySystem's key light (SunLight)
26
+ * is the scene's sun; the general lighting rig (LightsManager) keeps its ambient
27
+ * but turns its own `sun` off, so a scene never has two shadow-casting suns
28
+ * pointing different ways. A scene with no sky keeps LightsManager's sun as is.
29
+ *
30
+ * Counted, not a flag: a remount (the sky mode switching) claims before the old
31
+ * light releases.
32
+ */
33
+ const sunClaims = new WeakMap();
34
+ export function claimSceneSun(scene) {
35
+ sunClaims.set(scene, (sunClaims.get(scene) ?? 0) + 1);
36
+ let released = false;
37
+ return () => {
38
+ if (released)
39
+ return;
40
+ released = true;
41
+ const n = (sunClaims.get(scene) ?? 1) - 1;
42
+ if (n > 0)
43
+ sunClaims.set(scene, n);
44
+ else
45
+ sunClaims.delete(scene);
46
+ };
47
+ }
48
+ export function skyOwnsSun(scene) {
49
+ return (sunClaims.get(scene) ?? 0) > 0;
50
+ }
51
+ /** The scene an object lives in (its top-most ancestor). */
52
+ export function sceneOf(object) {
53
+ let o = object;
54
+ while (o.parent)
55
+ o = o.parent;
56
+ return o;
57
+ }
@@ -39,6 +39,10 @@ export interface ShapeOptions {
39
39
  tube?: number;
40
40
  size?: number;
41
41
  text?: string;
42
+ /** text: packed outline font id, extra letter advance (em), bevel on/off */
43
+ font?: string;
44
+ letterSpacing?: number;
45
+ bevelEnabled?: boolean;
42
46
  vertices?: number[];
43
47
  indices?: number[];
44
48
  normals?: number[];
@@ -1 +1 @@
1
- {"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../src/utils/shapes.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../src/utils/shapes.ts"],"names":[],"mappings":"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"}
@@ -1,5 +1,6 @@
1
1
  import { BoxGeometry, BufferGeometry, CapsuleGeometry, ConeGeometry, CylinderGeometry, DodecahedronGeometry, ExtrudeGeometry, Float32BufferAttribute, IcosahedronGeometry, OctahedronGeometry, Path, PlaneGeometry, RingGeometry, Shape, ShapeGeometry, SphereGeometry, TetrahedronGeometry, TorusGeometry, } from 'three';
2
2
  import { mergeGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
3
+ import { buildTextGeometry, outlineFontSync } from './textShape.js';
3
4
  const safeNumber = (value, fallback, min) => {
4
5
  const num = typeof value === 'number' && !Number.isNaN(value) ? value : fallback;
5
6
  return min !== undefined ? Math.max(num, min) : num;
@@ -175,7 +176,9 @@ export const shapeGenerators = {
175
176
  octahedron: ({ radius, detail }) => new OctahedronGeometry(safeNumber(radius, 0.5, 0.0001), safeNumber(detail, 0, 0)),
176
177
  tetrahedron: ({ radius, detail }) => new TetrahedronGeometry(safeNumber(radius, 0.5, 0.0001), safeNumber(detail, 0, 0)),
177
178
  dodecahedron: ({ radius, detail }) => new DodecahedronGeometry(safeNumber(radius, 0.5, 0.0001), safeNumber(detail, 0, 0)),
178
- text: ({ text = 'Hello', size, height }) => new BoxGeometry(text.length * safeNumber(size, 1, 0.0001) * 0.6, safeNumber(size, 1, 0.0001), safeNumber(height, 0.2, 0.0001)),
179
+ // the string extruded from a packed outline font (utils/textShape); empty until the font has loaded,
180
+ // GeometryShape re-renders when it lands
181
+ text: (o) => { const f = outlineFontSync(o.font); return f ? buildTextGeometry(f, o) : new BufferGeometry(); },
179
182
  point: ({ size }) => new SphereGeometry(safeNumber(size, 0.1, 0.0001), 16, 16),
180
183
  custom: ({ vertices = [], indices = [], normals, uvs }) => {
181
184
  const geometry = new BufferGeometry();
@@ -0,0 +1,35 @@
1
+ import type { Vector3 } from 'three';
2
+ import type { TimeSettings } from '@3driseai/3drise-core';
3
+ export interface MoonState {
4
+ /** Unit vector toward the moon (core sunUtils convention). */
5
+ direction: Vector3;
6
+ /** Lit fraction of the disc, 0 new … 1 full. */
7
+ illumination: number;
8
+ }
9
+ /**
10
+ * Where the moon is, for the key light and the moon disc.
11
+ *
12
+ * With time of day on it is the clock's moon — the sun's own arc, `moonPhase`
13
+ * of a day behind (see SkySystemManager.calculateMoon). With time off there are
14
+ * no hours to lag by, so it is a full moon opposite the sun: set the sun below
15
+ * the horizon and the moon stands above it on the other side.
16
+ *
17
+ * `sunDirection` is the resolved sun (useCloudSun), so the moon is always
18
+ * placed against the sun that is actually drawn and lit.
19
+ */
20
+ export declare function resolveMoon(timeSettings: TimeSettings | undefined, sunDirection: Vector3, out: MoonState): MoonState;
21
+ /** Night tint for moonlight (perceived, not physical — real moonlight is
22
+ * slightly red; at night the eye reads it blue). Shared by the key light and
23
+ * the water so the moon lights both the same colour. */
24
+ export declare const MOON_LIGHT_COLOR: {
25
+ readonly r: 0.62;
26
+ readonly g: 0.72;
27
+ readonly b: 1;
28
+ };
29
+ /**
30
+ * 0..1 strength of moonlight: the sun must be down (fades in from −1° to −8°),
31
+ * the moon up (−1° … 4°), scaled by how much of the disc is lit. The key light
32
+ * and the ocean's moon glitter both use this, so they come and go together.
33
+ */
34
+ export declare function moonlightFactor(sunElevationDeg: number, moon: MoonState): number;
35
+ //# sourceMappingURL=skyMoon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skyMoon.d.ts","sourceRoot":"","sources":["../../src/utils/skyMoon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,WAAW,SAAS;IACtB,8DAA8D;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,GAAG,SAAS,CAWpH;AAED;;yDAEyD;AACzD,eAAO,MAAM,gBAAgB;;;;CAAwC,CAAC;AAOtE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAGhF"}
@@ -0,0 +1,41 @@
1
+ import { skySystemManager } from '@3driseai/3drise-core';
2
+ /**
3
+ * Where the moon is, for the key light and the moon disc.
4
+ *
5
+ * With time of day on it is the clock's moon — the sun's own arc, `moonPhase`
6
+ * of a day behind (see SkySystemManager.calculateMoon). With time off there are
7
+ * no hours to lag by, so it is a full moon opposite the sun: set the sun below
8
+ * the horizon and the moon stands above it on the other side.
9
+ *
10
+ * `sunDirection` is the resolved sun (useCloudSun), so the moon is always
11
+ * placed against the sun that is actually drawn and lit.
12
+ */
13
+ export function resolveMoon(timeSettings, sunDirection, out) {
14
+ if (timeSettings?.enabled) {
15
+ const s = skySystemManager.getState();
16
+ out.direction.copy(s.moonDirection);
17
+ out.illumination = s.moonIllumination;
18
+ }
19
+ else {
20
+ out.direction.copy(sunDirection).negate();
21
+ out.illumination = 1;
22
+ }
23
+ return out;
24
+ }
25
+ /** Night tint for moonlight (perceived, not physical — real moonlight is
26
+ * slightly red; at night the eye reads it blue). Shared by the key light and
27
+ * the water so the moon lights both the same colour. */
28
+ export const MOON_LIGHT_COLOR = { r: 0.62, g: 0.72, b: 1.0 };
29
+ const smooth01 = (edge0, edge1, x) => {
30
+ const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));
31
+ return t * t * (3 - 2 * t);
32
+ };
33
+ /**
34
+ * 0..1 strength of moonlight: the sun must be down (fades in from −1° to −8°),
35
+ * the moon up (−1° … 4°), scaled by how much of the disc is lit. The key light
36
+ * and the ocean's moon glitter both use this, so they come and go together.
37
+ */
38
+ export function moonlightFactor(sunElevationDeg, moon) {
39
+ const moonElevation = (Math.asin(Math.max(-1, Math.min(1, moon.direction.y))) * 180) / Math.PI;
40
+ return smooth01(-1, -8, sunElevationDeg) * smooth01(-1, 4, moonElevation) * moon.illumination;
41
+ }
@@ -0,0 +1,4 @@
1
+ import type { TerrainConfig } from '@3driseai/3drise-core';
2
+ /** World height of the terrain surface at world (x, z). */
3
+ export declare function terrainHeightAt(config: TerrainConfig, x: number, z: number, lodCell?: number): number;
4
+ //# sourceMappingURL=terrainHeight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terrainHeight.d.ts","sourceRoot":"","sources":["../../src/utils/terrainHeight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA6E3D,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,SAAI,GAAG,MAAM,CAmFhG"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * The terrain's height field on the CPU — a line-for-line port of
3
+ * `terrainHeightAt` in shaders/glsl/terrainCore.glsl.ts.
4
+ *
5
+ * Until this existed the shader was the only thing that knew where the ground
6
+ * was: nothing could stand on the terrain, and the studio camera could sit 200 m
7
+ * above it (or inside a hill) with no way to tell. Now the panel can put the
8
+ * camera on the ground and the agent can ask `env.terrain.heightAt(x, z)`.
9
+ *
10
+ * KEEP IT IN STEP WITH THE GLSL. Any change to the height field there — an
11
+ * octave rule, a shaping operator, a constant — must land here too, or a query
12
+ * and the rendered surface disagree.
13
+ *
14
+ * The hash runs through Math.fround so its fract() lands where the GPU's float32
15
+ * one does; everything else is plain double precision, which differs from the
16
+ * GPU by far less than a centimetre.
17
+ *
18
+ * `lodCell` is the shading cell, as in the shader: octaves finer than about two
19
+ * cells are faded out. The default is the finest clipmap cell, which is what the
20
+ * mesh under a camera standing on the ground is built from. Curvature is not
21
+ * applied — it is a view-relative bend, and is negligible within a kilometre.
22
+ */
23
+ const f32 = Math.fround;
24
+ const fract = (x) => x - Math.floor(x);
25
+ const clamp = (x, lo, hi) => Math.min(hi, Math.max(lo, x));
26
+ const mix = (a, b, t) => a + (b - a) * t;
27
+ const smoothstep = (e0, e1, x) => {
28
+ const t = clamp((x - e0) / (e1 - e0), 0, 1);
29
+ return t * t * (3 - 2 * t);
30
+ };
31
+ /** tHash: Hoskins, float32. Returns two components in [-1, 1]. */
32
+ function tHash(px, py) {
33
+ let a = f32(fract(f32(px * 0.1031)));
34
+ let b = f32(fract(f32(py * 0.1030)));
35
+ let c = f32(fract(f32(px * 0.0973)));
36
+ const d = f32(f32(a * f32(b + 33.33)) + f32(b * f32(c + 33.33)) + f32(c * f32(a + 33.33)));
37
+ a = f32(a + d);
38
+ b = f32(b + d);
39
+ c = f32(c + d);
40
+ // fract((p3.xx + p3.yz) * p3.zy)
41
+ const x = f32(fract(f32(f32(a + b) * c)));
42
+ const y = f32(fract(f32(f32(a + c) * b)));
43
+ return [-1 + 2 * x, -1 + 2 * y];
44
+ }
45
+ /** tNoised: gradient noise with derivative. [value, d/dx, d/dy]. */
46
+ function tNoised(x, y) {
47
+ const ix = Math.floor(x), iy = Math.floor(y);
48
+ const fx = x - ix, fy = y - iy;
49
+ const ux = fx * fx * fx * (fx * (fx * 6 - 15) + 10);
50
+ const uy = fy * fy * fy * (fy * (fy * 6 - 15) + 10);
51
+ const dux = 30 * fx * fx * (fx * (fx - 2) + 1);
52
+ const duy = 30 * fy * fy * (fy * (fy - 2) + 1);
53
+ const ga = tHash(ix, iy);
54
+ const gb = tHash(ix + 1, iy);
55
+ const gc = tHash(ix, iy + 1);
56
+ const gd = tHash(ix + 1, iy + 1);
57
+ const va = ga[0] * fx + ga[1] * fy;
58
+ const vb = gb[0] * (fx - 1) + gb[1] * fy;
59
+ const vc = gc[0] * fx + gc[1] * (fy - 1);
60
+ const vd = gd[0] * (fx - 1) + gd[1] * (fy - 1);
61
+ const k = va - vb - vc + vd;
62
+ const v = va + ux * (vb - va) + uy * (vc - va) + ux * uy * k;
63
+ const dx = ga[0] + ux * (gb[0] - ga[0]) + uy * (gc[0] - ga[0]) + ux * uy * (ga[0] - gb[0] - gc[0] + gd[0])
64
+ + dux * (uy * k + vb - va);
65
+ const dy = ga[1] + ux * (gb[1] - ga[1]) + uy * (gc[1] - ga[1]) + ux * uy * (ga[1] - gb[1] - gc[1] + gd[1])
66
+ + duy * (ux * k + vc - va);
67
+ return [v, dx, dy];
68
+ }
69
+ const TYPE_INDEX = { mountains: 0, dunes: 1, hills: 2, canyon: 3 };
70
+ /** World height of the terrain surface at world (x, z). */
71
+ export function terrainHeightAt(config, x, z, lodCell = 2) {
72
+ const baseScale = 1 / (config.featureSize > 1e-6 ? config.featureSize : 2600);
73
+ const octaves = Math.round(clamp(config.octaves, 1, 12));
74
+ const lacunarity = config.lacunarity;
75
+ const gain = config.gain;
76
+ const ridge = config.ridgeSharpness;
77
+ const warpStrength = config.warpStrength;
78
+ const warpScale = config.warpSize;
79
+ const erosion = config.erosion;
80
+ const elevation = Math.max(config.elevation, 0.01);
81
+ const type = TYPE_INDEX[config.terrainType] ?? 2;
82
+ let qx = x * baseScale;
83
+ let qy = z * baseScale;
84
+ if (warpStrength > 0) {
85
+ const w0 = tNoised(qx * warpScale + 11.3, qy * warpScale + 5.7)[0];
86
+ const w1 = tNoised(qx * warpScale - 7.1, qy * warpScale + 19.2)[0];
87
+ qx += w0 * warpStrength;
88
+ qy += w1 * warpStrength;
89
+ }
90
+ let amp = 1, freq = 1, sum = 0, norm = 0;
91
+ let sx = 0, sy = 0;
92
+ let wl = 1 / Math.max(baseScale, 1e-9);
93
+ for (let i = 0; i < 12; i++) {
94
+ if (i >= octaves)
95
+ break;
96
+ const fade = clamp(wl / Math.max(2 * lodCell, 1e-4) - 1, 0, 1);
97
+ if (fade <= 0.001)
98
+ break;
99
+ const n = tNoised(qx * freq + i * 37.13, qy * freq + i * 61.91);
100
+ let v = n[0];
101
+ let gx = n[1], gy = n[2];
102
+ if (ridge > 0) {
103
+ const ridgeAmt = ridge * clamp(i * 0.5, 0, 1);
104
+ const sg = Math.sign(v);
105
+ const r = 1 - Math.abs(v);
106
+ v = mix(v, r * r * 2 - 1, ridgeAmt);
107
+ gx = mix(gx, -4 * r * sg * gx, ridgeAmt);
108
+ gy = mix(gy, -4 * r * sg * gy, ridgeAmt);
109
+ }
110
+ const damp = 1 / (1 + erosion * 1.5 * (sx * sx + sy * sy));
111
+ sum += amp * damp * fade * v;
112
+ norm += amp * fade;
113
+ sx += gx * amp * damp;
114
+ sy += gy * amp * damp;
115
+ amp *= gain;
116
+ freq *= lacunarity;
117
+ wl /= lacunarity;
118
+ }
119
+ const t = (sum / Math.max(norm, 1e-4)) * 3.2;
120
+ let h = 0.5 + 0.5 * t / Math.sqrt(1 + t * t);
121
+ if (type === 1) {
122
+ const a = (config.bearing * Math.PI) / 180;
123
+ let bx = Math.sin(a), by = Math.cos(a);
124
+ const bl = Math.hypot(bx, by) || 1;
125
+ bx /= bl;
126
+ by /= bl;
127
+ // d = vec2(bearingDir.y, -bearingDir.x)
128
+ const duneFreq = (Math.PI * 2) / Math.max(config.duneWavelength, 1);
129
+ const u = 0.5 + 0.5 * Math.sin((x * by + z * -bx) * duneFreq + 7 * h);
130
+ const s = Math.pow(Math.max(u, 1e-4), mix(1, 3.2, config.duneAsymmetry));
131
+ h = mix(0.15 + 0.5 * h, s * (0.45 + 0.55 * h), 0.8);
132
+ }
133
+ else if (type === 3) {
134
+ const om = 1 - h;
135
+ const mesa = mix(h, 1 - om * om * om, config.plateau);
136
+ const ch = 1 - Math.abs(tNoised(x * (baseScale * 1.7) + 4.2, z * (baseScale * 1.7) - 9.1)[0]);
137
+ h = mesa - config.valleyDepth * smoothstep(1 - config.valleyWidth, 1, ch);
138
+ }
139
+ const terraces = Math.round(config.terraces);
140
+ if (terraces >= 0.5) {
141
+ const n = terraces;
142
+ const featureSize = 1 / Math.max(baseScale, 1e-9);
143
+ const soft = clamp((lodCell * n * 8) / featureSize, 0, 1);
144
+ const w = Math.max(1 - 0.95 * config.terraceSharpness, 0.02);
145
+ const xh = h * n;
146
+ const fr = fract(xh);
147
+ h = (Math.floor(xh) + mix(smoothstep(0, w, fr), fr, soft)) / n;
148
+ }
149
+ return config.seaLevel + elevation * h;
150
+ }
@@ -0,0 +1,18 @@
1
+ import type { TerrainTextures } from '@3driseai/3drise-core';
2
+ /**
3
+ * Turns texture-set NAMES into map URLs for terrain textures that name a set but
4
+ * carry no URLs yet (a land object fresh from the catalog, a ground picked before
5
+ * the files were uploaded).
6
+ *
7
+ * The viewer does not know the app's file tree, so the client registers the
8
+ * resolver (it owns the texture library) and re-registers it when the library
9
+ * changes; renderers subscribe to the version so they re-resolve. Without one — an
10
+ * embed, a test harness — the stored URLs are used as they are. Must return the
11
+ * SAME object when nothing changes, so renderer memos hold.
12
+ */
13
+ export type TerrainTextureResolver = (textures: TerrainTextures | undefined) => TerrainTextures | undefined;
14
+ export declare function setTerrainTextureResolver(fn: TerrainTextureResolver | null): void;
15
+ export declare function resolveTerrainTextureSets(textures: TerrainTextures | undefined): TerrainTextures | undefined;
16
+ /** Changes whenever the resolver does: a memo dependency for resolved textures. */
17
+ export declare function useTerrainTextureResolverVersion(): number;
18
+ //# sourceMappingURL=terrainTextureResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terrainTextureResolver.d.ts","sourceRoot":"","sources":["../../src/utils/terrainTextureResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,KAAK,eAAe,GAAG,SAAS,CAAC;AAM5G,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAIjF;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,eAAe,GAAG,SAAS,CAE5G;AAED,mFAAmF;AACnF,wBAAgB,gCAAgC,IAAI,MAAM,CAMzD"}
@@ -0,0 +1,17 @@
1
+ import { useSyncExternalStore } from 'react';
2
+ let resolver = null;
3
+ let version = 0;
4
+ const listeners = new Set();
5
+ export function setTerrainTextureResolver(fn) {
6
+ resolver = fn;
7
+ version++;
8
+ for (const l of listeners)
9
+ l();
10
+ }
11
+ export function resolveTerrainTextureSets(textures) {
12
+ return resolver ? (resolver(textures) ?? textures) : textures;
13
+ }
14
+ /** Changes whenever the resolver does: a memo dependency for resolved textures. */
15
+ export function useTerrainTextureResolverVersion() {
16
+ return useSyncExternalStore((l) => { listeners.add(l); return () => { listeners.delete(l); }; }, () => version, () => version);
17
+ }
@@ -1,8 +1,25 @@
1
1
  import * as THREE from 'three';
2
2
  import type { TerrainConfig, TerrainQualityConfig } from '@3driseai/3drise-core';
3
+ import type { TerrainTextureState } from '../hooks/useTerrainTextures';
3
4
  import type { CloudSunState } from '../hooks/useCloudSun';
4
5
  export declare function applyTerrainUniforms(material: THREE.ShaderMaterial, config: TerrainConfig, quality: TerrainQualityConfig): void;
5
6
  export default applyTerrainUniforms;
7
+ /**
8
+ * The texture layer uniforms, and the TERRAIN_TEXTURED define.
9
+ *
10
+ * Called every frame after `applyTerrainUniforms`, like it, so tile size, tint,
11
+ * brightness and normal strength are live.
12
+ *
13
+ * A textured layer is the set's own colours, brought to the luminance of the
14
+ * layer's tuned colour, × tint × brightness. Its far colour —
15
+ * what the near field fades into past the texture distance — is the texture's mean
16
+ * × the same factors, so the fade has nothing to jump. An untextured layer is its
17
+ * flat hex colour, near and far.
18
+ *
19
+ * The define only flips when the arrays arrive or go, so the recompile happens
20
+ * once per texture change, never per frame.
21
+ */
22
+ export declare function applyTerrainTextures(material: THREE.ShaderMaterial, config: TerrainConfig, tex: TerrainTextureState): void;
6
23
  /** skyRadiance(rd), in the units the shader returns. */
7
24
  export declare function skyRadianceAt(rd: THREE.Vector3, sun: CloudSunState, out: THREE.Color): THREE.Color;
8
25
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"terrainUniforms.d.ts","sourceRoot":"","sources":["../../src/utils/terrainUniforms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAe,MAAM,uBAAuB,CAAC;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAoD1D,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,oBAAoB,GAC9B,IAAI,CAwDN;AAED,eAAe,oBAAoB,CAAC;AAiCpC,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CA4BlG;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CAwC5F"}
1
+ {"version":3,"file":"terrainUniforms.d.ts","sourceRoot":"","sources":["../../src/utils/terrainUniforms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAe,MAAM,uBAAuB,CAAC;AAE9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAoD1D,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,oBAAoB,GAC9B,IAAI,CAwDN;AAED,eAAe,oBAAoB,CAAC;AAUpC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,mBAAmB,GACzB,IAAI,CAyDN;AAiCD,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CA4BlG;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CAwC5F"}
@@ -1,4 +1,5 @@
1
1
  import * as THREE from 'three';
2
+ import { TERRAIN_LAYER_KEYS } from '@3driseai/3drise-core';
2
3
  /**
3
4
  * Config to uniform mapping for the terrain material.
4
5
  *
@@ -98,6 +99,89 @@ export function applyTerrainUniforms(material, config, quality) {
98
99
  }
99
100
  export default applyTerrainUniforms;
100
101
  // -----------------------------------------------------------------------------
102
+ // Ground textures
103
+ // -----------------------------------------------------------------------------
104
+ const _flat = new THREE.Color();
105
+ const luma = (r, g, b) => 0.2126 * r + 0.7152 * g + 0.0722 * b;
106
+ const LAYER_COLOR_KEY = ['lowColor', 'midColor', 'rockColor', 'peakColor'];
107
+ /**
108
+ * The texture layer uniforms, and the TERRAIN_TEXTURED define.
109
+ *
110
+ * Called every frame after `applyTerrainUniforms`, like it, so tile size, tint,
111
+ * brightness and normal strength are live.
112
+ *
113
+ * A textured layer is the set's own colours, brought to the luminance of the
114
+ * layer's tuned colour, × tint × brightness. Its far colour —
115
+ * what the near field fades into past the texture distance — is the texture's mean
116
+ * × the same factors, so the fade has nothing to jump. An untextured layer is its
117
+ * flat hex colour, near and far.
118
+ *
119
+ * The define only flips when the arrays arrive or go, so the recompile happens
120
+ * once per texture change, never per frame.
121
+ */
122
+ export function applyTerrainTextures(material, config, tex) {
123
+ const u = material.uniforms;
124
+ if (!u || !u.u_tFar)
125
+ return;
126
+ const textures = config.textures;
127
+ const far = u.u_tFar.value;
128
+ const layer = u.u_tLayer.value;
129
+ const tint = u.u_tTint.value;
130
+ let any = false;
131
+ TERRAIN_LAYER_KEYS.forEach((key, i) => {
132
+ const t = textures?.[key];
133
+ const textured = !!(tex.ready && tex.textured[i]);
134
+ any = any || textured;
135
+ if (textured) {
136
+ const m = tex.meanColor[i];
137
+ // Exposure: scans are photographed at any brightness, so a textured
138
+ // layer is first brought to the LUMINANCE of the layer's tuned colour
139
+ // (the biome sets it), keeping the scan's own hue and detail. Then the
140
+ // user's brightness and tint act on top of that.
141
+ _flat.setStyle(config[LAYER_COLOR_KEY[i]], THREE.SRGBColorSpace);
142
+ const auto = THREE.MathUtils.clamp(luma(_flat.r, _flat.g, _flat.b) / Math.max(luma(m.x, m.y, m.z), 1e-3), 0.25, 4);
143
+ _flat.setStyle(t?.tint || '#ffffff', THREE.SRGBColorSpace);
144
+ const k = Math.max(t?.brightness ?? 1, 0) * auto;
145
+ tint[i].setRGB(_flat.r * k, _flat.g * k, _flat.b * k);
146
+ far[i].setRGB(m.x * tint[i].r, m.y * tint[i].g, m.z * tint[i].b);
147
+ }
148
+ else {
149
+ _flat.setStyle(config[LAYER_COLOR_KEY[i]], THREE.SRGBColorSpace);
150
+ far[i].copy(_flat);
151
+ tint[i].setRGB(1, 1, 1);
152
+ }
153
+ layer[i].set(1 / Math.max(t?.tileSize ?? 3, 0.05), t?.normalStrength ?? 1, textured ? 1 : 0, 0);
154
+ });
155
+ if (any) {
156
+ u.u_tColor.value = tex.color;
157
+ u.u_tNormal.value = tex.normal;
158
+ u.u_tOrm.value = tex.orm;
159
+ const mc = u.u_tMeanC.value;
160
+ const mn = u.u_tMeanN.value;
161
+ const mo = u.u_tMeanO.value;
162
+ for (let i = 0; i < 4; i++) {
163
+ const c = tex.meanColor[i], n = tex.meanNormal[i], o = tex.meanOrm[i];
164
+ if (c)
165
+ mc[i].set(c.x, c.y, c.z, 1);
166
+ if (n)
167
+ mn[i].set(n.x, n.y, n.z, 0.5);
168
+ if (o)
169
+ mo[i].set(o.x, o.y, o.z, 1);
170
+ }
171
+ }
172
+ u.u_tDistance.value = Math.max(config.textureDistance ?? 1500, 1);
173
+ u.u_tHeightBlend.value = THREE.MathUtils.clamp(config.textureHeightBlend ?? 0.7, 0, 1);
174
+ const defines = (material.defines ??= {});
175
+ const has = 'TERRAIN_TEXTURED' in defines;
176
+ if (any !== has) {
177
+ if (any)
178
+ defines.TERRAIN_TEXTURED = '';
179
+ else
180
+ delete defines.TERRAIN_TEXTURED;
181
+ material.needsUpdate = true;
182
+ }
183
+ }
184
+ // -----------------------------------------------------------------------------
101
185
  // Ambient
102
186
  // -----------------------------------------------------------------------------
103
187
  /**
@@ -0,0 +1,24 @@
1
+ import { BufferGeometry } from 'three';
2
+ export declare const DEFAULT_TEXT_SHAPE_FONT = "inter";
3
+ export declare const isOutlineFontLoaded: (id: string | undefined) => boolean;
4
+ /** The packed outline font when it is already loaded, else null (and the load is started). */
5
+ export declare function outlineFontSync(id: string | undefined): any | null;
6
+ /** Loads (once) and caches a packed outline font. */
7
+ export declare function loadOutlineFont(id: string | undefined): Promise<any>;
8
+ export interface TextShapeOptions {
9
+ text?: string;
10
+ font?: string;
11
+ /** Em size in world units. */
12
+ size?: number;
13
+ /** Extrusion depth in world units. */
14
+ height?: number;
15
+ /** Extra advance between letters, in em. */
16
+ letterSpacing?: number;
17
+ bevelEnabled?: boolean;
18
+ bevelThickness?: number;
19
+ bevelSize?: number;
20
+ bevelSegments?: number;
21
+ }
22
+ /** The string as an extruded, centred geometry. `font` is a loaded packed outline font (outlineFontSync / loadOutlineFont). */
23
+ export declare function buildTextGeometry(font: any, o: TextShapeOptions): BufferGeometry;
24
+ //# sourceMappingURL=textShape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textShape.d.ts","sourceRoot":"","sources":["../../src/utils/textShape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgC,MAAM,OAAO,CAAC;AAgBrE,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAG/C,eAAO,MAAM,mBAAmB,GAAI,IAAI,MAAM,GAAG,SAAS,KAAG,OAAgC,CAAC;AAE9F,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,GAAG,IAAI,CAMlE;AAED,qDAAqD;AACrD,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAUpE;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAqBD,+HAA+H;AAC/H,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAgChF"}
@@ -0,0 +1,102 @@
1
+ import { BufferGeometry, ExtrudeGeometry, Path, Shape } from 'three';
2
+ import { layoutOutline } from '../components/text/engine/glyphs.js';
3
+ import { loadOutline, TEXT_FONT_IDS } from '../components/text/fonts/index.js';
4
+ // =============================================================================
5
+ // Mesh text — the `text` shape of the mesh family: the string extruded into a solid, from the same packed
6
+ // outline fonts the text looks use (components/text/fonts), so one font list serves every text in 3drise.
7
+ //
8
+ // The outline fonts load lazily (one import() per font, a few hundred KB each). Shape generators are
9
+ // synchronous, so a font is read from this cache; the first build of a font yields an empty geometry and
10
+ // starts the load, and GeometryShape re-renders once it lands (useTextShapeFont).
11
+ // =============================================================================
12
+ const fonts = new Map();
13
+ const pending = new Map();
14
+ export const DEFAULT_TEXT_SHAPE_FONT = 'inter';
15
+ const fontId = (id) => (id && TEXT_FONT_IDS.includes(id) ? id : DEFAULT_TEXT_SHAPE_FONT);
16
+ export const isOutlineFontLoaded = (id) => fonts.has(fontId(id));
17
+ /** The packed outline font when it is already loaded, else null (and the load is started). */
18
+ export function outlineFontSync(id) {
19
+ const k = fontId(id);
20
+ const f = fonts.get(k);
21
+ if (f)
22
+ return f;
23
+ void loadOutlineFont(k);
24
+ return null;
25
+ }
26
+ /** Loads (once) and caches a packed outline font. */
27
+ export function loadOutlineFont(id) {
28
+ const k = fontId(id);
29
+ const f = fonts.get(k);
30
+ if (f)
31
+ return Promise.resolve(f);
32
+ let p = pending.get(k);
33
+ if (!p) {
34
+ p = loadOutline(k).then((font) => { fonts.set(k, font); pending.delete(k); return font; });
35
+ pending.set(k, p);
36
+ }
37
+ return p;
38
+ }
39
+ // even-odd point in polygon (flat [x, y, ...] array)
40
+ function inside(px, py, p) {
41
+ let c = false;
42
+ const n = p.length / 2;
43
+ for (let i = 0, j = n - 1; i < n; j = i++) {
44
+ const xi = p[2 * i], yi = p[2 * i + 1], xj = p[2 * j], yj = p[2 * j + 1];
45
+ if (((yi > py) !== (yj > py)) && (px < ((xj - xi) * (py - yi)) / (yj - yi) + xi))
46
+ c = !c;
47
+ }
48
+ return c;
49
+ }
50
+ const pathOf = (pts, P, s) => {
51
+ // layoutOutline closes every contour by repeating its first point: drop it, Shape closes itself
52
+ const n = pts.length / 2 - 1;
53
+ P.moveTo(pts[0] * s, pts[1] * s);
54
+ for (let i = 1; i < n; i++)
55
+ P.lineTo(pts[2 * i] * s, pts[2 * i + 1] * s);
56
+ P.closePath();
57
+ return P;
58
+ };
59
+ /** The string as an extruded, centred geometry. `font` is a loaded packed outline font (outlineFontSync / loadOutlineFont). */
60
+ export function buildTextGeometry(font, o) {
61
+ const size = Math.max(1e-4, o.size ?? 1), depth = Math.max(1e-4, o.height ?? 0.2);
62
+ const text = String(o.text ?? 'Hello');
63
+ const layout = layoutOutline(font, text.length ? text : ' ', { align: 'center', letterSpacing: o.letterSpacing ?? 0 });
64
+ const shapes = [];
65
+ // contours come per glyph, outer first then counters (layoutOutline sorts them so); a counter belongs to the
66
+ // outer contour of its glyph that contains it
67
+ const byGlyph = new Map();
68
+ for (const s of layout.strokes) {
69
+ let g = byGlyph.get(s.glyph);
70
+ if (!g) {
71
+ g = { outers: [], holes: [] };
72
+ byGlyph.set(s.glyph, g);
73
+ }
74
+ if (s.hole)
75
+ g.holes.push(s.pts);
76
+ else {
77
+ const shape = pathOf(s.pts, new Shape(), size);
78
+ g.outers.push({ pts: s.pts, shape });
79
+ shapes.push(shape);
80
+ }
81
+ }
82
+ for (const g of byGlyph.values()) {
83
+ if (!g.outers.length)
84
+ continue;
85
+ for (const h of g.holes) {
86
+ const owner = g.outers.find((oc) => inside(h[0], h[1], oc.pts.subarray(0, oc.pts.length - 2))) ?? g.outers[0];
87
+ owner.shape.holes.push(pathOf(h, new Path(), size));
88
+ }
89
+ }
90
+ if (!shapes.length)
91
+ return new BufferGeometry();
92
+ const bevel = !!o.bevelEnabled;
93
+ const geo = new ExtrudeGeometry(shapes, {
94
+ depth, curveSegments: 1, bevelEnabled: bevel,
95
+ bevelThickness: bevel ? Math.max(0, o.bevelThickness ?? 0.03) : 0,
96
+ bevelSize: bevel ? Math.max(0, o.bevelSize ?? 0.02) : 0,
97
+ bevelOffset: 0,
98
+ bevelSegments: bevel ? Math.max(1, Math.round(o.bevelSegments ?? 3)) : 1,
99
+ });
100
+ geo.center();
101
+ return geo;
102
+ }