@3driseai/3drise-viewer 0.1.42 → 0.1.43

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 (408) hide show
  1. package/dist/animationsV2/ClipsRuntime.d.ts +16 -1
  2. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  3. package/dist/animationsV2/ClipsRuntime.js +144 -25
  4. package/dist/animationsV2/appliers.d.ts +9 -0
  5. package/dist/animationsV2/appliers.d.ts.map +1 -1
  6. package/dist/animationsV2/appliers.js +62 -2
  7. package/dist/animationsV2/clipUtils.d.ts +30 -0
  8. package/dist/animationsV2/clipUtils.d.ts.map +1 -1
  9. package/dist/animationsV2/clipUtils.js +163 -17
  10. package/dist/animationsV2/elementSettings.d.ts +5 -0
  11. package/dist/animationsV2/elementSettings.d.ts.map +1 -1
  12. package/dist/animationsV2/elementSettings.js +6 -3
  13. package/dist/animationsV2/sequenceUtils.js +4 -4
  14. package/dist/animationsV2/types.d.ts +23 -0
  15. package/dist/animationsV2/types.d.ts.map +1 -1
  16. package/dist/api/sceneHandle.js +2 -2
  17. package/dist/components/CreatedObject.d.ts +3 -0
  18. package/dist/components/CreatedObject.d.ts.map +1 -1
  19. package/dist/components/CreatedObject.js +6 -2
  20. package/dist/components/CustomPrimitive.d.ts.map +1 -1
  21. package/dist/components/CustomPrimitive.js +1 -10
  22. package/dist/components/EnvironmentManager.d.ts.map +1 -1
  23. package/dist/components/EnvironmentManager.js +11 -5
  24. package/dist/components/GeometryShape.d.ts +5 -2
  25. package/dist/components/GeometryShape.d.ts.map +1 -1
  26. package/dist/components/GeometryShape.js +71 -10
  27. package/dist/components/LandObject.d.ts.map +1 -1
  28. package/dist/components/LandObject.js +1 -1
  29. package/dist/components/LayoutInstances.d.ts +2 -1
  30. package/dist/components/LayoutInstances.d.ts.map +1 -1
  31. package/dist/components/LayoutInstances.js +39 -6
  32. package/dist/components/LightObject.d.ts.map +1 -1
  33. package/dist/components/LightObject.js +3 -0
  34. package/dist/components/ObjectNode.d.ts.map +1 -1
  35. package/dist/components/ObjectNode.js +62 -13
  36. package/dist/components/OceanBuilder.d.ts +2 -0
  37. package/dist/components/OceanBuilder.d.ts.map +1 -1
  38. package/dist/components/OceanBuilder.js +2 -1
  39. package/dist/components/RenderEffects.d.ts +8 -0
  40. package/dist/components/RenderEffects.d.ts.map +1 -0
  41. package/dist/components/RenderEffects.js +120 -0
  42. package/dist/components/SceneBuilder.d.ts.map +1 -1
  43. package/dist/components/SceneBuilder.js +18 -9
  44. package/dist/components/SportsObject.d.ts +9 -0
  45. package/dist/components/SportsObject.d.ts.map +1 -0
  46. package/dist/components/SportsObject.js +20 -0
  47. package/dist/components/UrbanObject.d.ts +9 -0
  48. package/dist/components/UrbanObject.d.ts.map +1 -0
  49. package/dist/components/UrbanObject.js +28 -0
  50. package/dist/components/VegetationObject.d.ts +9 -0
  51. package/dist/components/VegetationObject.d.ts.map +1 -0
  52. package/dist/components/VegetationObject.js +26 -0
  53. package/dist/components/WaterObject.d.ts +15 -0
  54. package/dist/components/WaterObject.d.ts.map +1 -0
  55. package/dist/components/WaterObject.js +29 -0
  56. package/dist/components/index.d.ts +7 -2
  57. package/dist/components/index.d.ts.map +1 -1
  58. package/dist/components/index.js +6 -1
  59. package/dist/components/land/LandPatch.d.ts +3 -1
  60. package/dist/components/land/LandPatch.d.ts.map +1 -1
  61. package/dist/components/land/LandPatch.js +80 -7
  62. package/dist/components/layout/InstancedLayout.d.ts +19 -0
  63. package/dist/components/layout/InstancedLayout.d.ts.map +1 -0
  64. package/dist/components/layout/InstancedLayout.js +154 -0
  65. package/dist/components/layout/LayoutGrounds.d.ts +19 -0
  66. package/dist/components/layout/LayoutGrounds.d.ts.map +1 -0
  67. package/dist/components/layout/LayoutGrounds.js +104 -0
  68. package/dist/components/layout/LinkProxies.d.ts +5 -0
  69. package/dist/components/layout/LinkProxies.d.ts.map +1 -0
  70. package/dist/components/layout/LinkProxies.js +51 -0
  71. package/dist/components/layout/LinkedSource.d.ts +14 -0
  72. package/dist/components/layout/LinkedSource.d.ts.map +1 -0
  73. package/dist/components/layout/LinkedSource.js +129 -0
  74. package/dist/components/projector/Projector.d.ts +14 -0
  75. package/dist/components/projector/Projector.d.ts.map +1 -0
  76. package/dist/components/projector/Projector.js +44 -0
  77. package/dist/components/projector/index.d.ts +4 -0
  78. package/dist/components/projector/index.d.ts.map +1 -0
  79. package/dist/components/projector/index.js +2 -0
  80. package/dist/components/projector/projectorCore.d.ts +19 -0
  81. package/dist/components/projector/projectorCore.d.ts.map +1 -0
  82. package/dist/components/projector/projectorCore.js +545 -0
  83. package/dist/components/sports/SportsBall.d.ts +9 -0
  84. package/dist/components/sports/SportsBall.d.ts.map +1 -0
  85. package/dist/components/sports/SportsBall.js +23 -0
  86. package/dist/components/sports/SportsCourt.d.ts +9 -0
  87. package/dist/components/sports/SportsCourt.d.ts.map +1 -0
  88. package/dist/components/sports/SportsCourt.js +23 -0
  89. package/dist/components/sports/SportsEquipment.d.ts +9 -0
  90. package/dist/components/sports/SportsEquipment.d.ts.map +1 -0
  91. package/dist/components/sports/SportsEquipment.js +23 -0
  92. package/dist/components/sports/SportsGoal.d.ts +9 -0
  93. package/dist/components/sports/SportsGoal.d.ts.map +1 -0
  94. package/dist/components/sports/SportsGoal.js +23 -0
  95. package/dist/components/sports/core/ball.d.ts +166 -0
  96. package/dist/components/sports/core/ball.d.ts.map +1 -0
  97. package/dist/components/sports/core/ball.js +402 -0
  98. package/dist/components/sports/core/court.d.ts +442 -0
  99. package/dist/components/sports/core/court.d.ts.map +1 -0
  100. package/dist/components/sports/core/court.js +658 -0
  101. package/dist/components/sports/core/equipment.d.ts +103 -0
  102. package/dist/components/sports/core/equipment.d.ts.map +1 -0
  103. package/dist/components/sports/core/equipment.js +403 -0
  104. package/dist/components/sports/core/goal.d.ts +98 -0
  105. package/dist/components/sports/core/goal.d.ts.map +1 -0
  106. package/dist/components/sports/core/goal.js +44 -0
  107. package/dist/components/sports/index.d.ts +11 -0
  108. package/dist/components/sports/index.d.ts.map +1 -0
  109. package/dist/components/sports/index.js +8 -0
  110. package/dist/components/sports/sportsCore.d.ts +195 -0
  111. package/dist/components/sports/sportsCore.d.ts.map +1 -0
  112. package/dist/components/sports/sportsCore.js +758 -0
  113. package/dist/components/sports/useSportsInstance.d.ts +35 -0
  114. package/dist/components/sports/useSportsInstance.d.ts.map +1 -0
  115. package/dist/components/sports/useSportsInstance.js +47 -0
  116. package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
  117. package/dist/components/terrain/TerrainSurface.js +14 -0
  118. package/dist/components/urban/UrbanBlock.d.ts +9 -0
  119. package/dist/components/urban/UrbanBlock.d.ts.map +1 -0
  120. package/dist/components/urban/UrbanBlock.js +23 -0
  121. package/dist/components/urban/UrbanBuilding.d.ts +9 -0
  122. package/dist/components/urban/UrbanBuilding.d.ts.map +1 -0
  123. package/dist/components/urban/UrbanBuilding.js +23 -0
  124. package/dist/components/urban/UrbanJunction.d.ts +9 -0
  125. package/dist/components/urban/UrbanJunction.d.ts.map +1 -0
  126. package/dist/components/urban/UrbanJunction.js +23 -0
  127. package/dist/components/urban/UrbanPark.d.ts +9 -0
  128. package/dist/components/urban/UrbanPark.d.ts.map +1 -0
  129. package/dist/components/urban/UrbanPark.js +23 -0
  130. package/dist/components/urban/UrbanParkingLot.d.ts +9 -0
  131. package/dist/components/urban/UrbanParkingLot.d.ts.map +1 -0
  132. package/dist/components/urban/UrbanParkingLot.js +23 -0
  133. package/dist/components/urban/UrbanPlaza.d.ts +9 -0
  134. package/dist/components/urban/UrbanPlaza.d.ts.map +1 -0
  135. package/dist/components/urban/UrbanPlaza.js +23 -0
  136. package/dist/components/urban/UrbanRoad.d.ts +9 -0
  137. package/dist/components/urban/UrbanRoad.d.ts.map +1 -0
  138. package/dist/components/urban/UrbanRoad.js +23 -0
  139. package/dist/components/urban/UrbanSignage.d.ts +9 -0
  140. package/dist/components/urban/UrbanSignage.d.ts.map +1 -0
  141. package/dist/components/urban/UrbanSignage.js +23 -0
  142. package/dist/components/urban/UrbanSkyline.d.ts +9 -0
  143. package/dist/components/urban/UrbanSkyline.d.ts.map +1 -0
  144. package/dist/components/urban/UrbanSkyline.js +23 -0
  145. package/dist/components/urban/UrbanStreetFurniture.d.ts +9 -0
  146. package/dist/components/urban/UrbanStreetFurniture.d.ts.map +1 -0
  147. package/dist/components/urban/UrbanStreetFurniture.js +23 -0
  148. package/dist/components/urban/UrbanStreetGrid.d.ts +9 -0
  149. package/dist/components/urban/UrbanStreetGrid.d.ts.map +1 -0
  150. package/dist/components/urban/UrbanStreetGrid.js +34 -0
  151. package/dist/components/urban/UrbanTraffic.d.ts +9 -0
  152. package/dist/components/urban/UrbanTraffic.d.ts.map +1 -0
  153. package/dist/components/urban/UrbanTraffic.js +23 -0
  154. package/dist/components/urban/core/block.d.ts +119 -0
  155. package/dist/components/urban/core/block.d.ts.map +1 -0
  156. package/dist/components/urban/core/block.js +266 -0
  157. package/dist/components/urban/core/building.d.ts +128 -0
  158. package/dist/components/urban/core/building.d.ts.map +1 -0
  159. package/dist/components/urban/core/building.js +741 -0
  160. package/dist/components/urban/core/junction.d.ts +152 -0
  161. package/dist/components/urban/core/junction.d.ts.map +1 -0
  162. package/dist/components/urban/core/junction.js +617 -0
  163. package/dist/components/urban/core/park.d.ts +67 -0
  164. package/dist/components/urban/core/park.d.ts.map +1 -0
  165. package/dist/components/urban/core/park.js +176 -0
  166. package/dist/components/urban/core/parkingLot.d.ts +82 -0
  167. package/dist/components/urban/core/parkingLot.d.ts.map +1 -0
  168. package/dist/components/urban/core/parkingLot.js +284 -0
  169. package/dist/components/urban/core/plaza.d.ts +24 -0
  170. package/dist/components/urban/core/plaza.d.ts.map +1 -0
  171. package/dist/components/urban/core/plaza.js +243 -0
  172. package/dist/components/urban/core/road.d.ts +113 -0
  173. package/dist/components/urban/core/road.d.ts.map +1 -0
  174. package/dist/components/urban/core/road.js +347 -0
  175. package/dist/components/urban/core/signage.d.ts +83 -0
  176. package/dist/components/urban/core/signage.d.ts.map +1 -0
  177. package/dist/components/urban/core/signage.js +209 -0
  178. package/dist/components/urban/core/skyline.d.ts +100 -0
  179. package/dist/components/urban/core/skyline.d.ts.map +1 -0
  180. package/dist/components/urban/core/skyline.js +89 -0
  181. package/dist/components/urban/core/streetFurniture.d.ts +75 -0
  182. package/dist/components/urban/core/streetFurniture.d.ts.map +1 -0
  183. package/dist/components/urban/core/streetFurniture.js +193 -0
  184. package/dist/components/urban/core/streetGrid.d.ts +134 -0
  185. package/dist/components/urban/core/streetGrid.d.ts.map +1 -0
  186. package/dist/components/urban/core/streetGrid.js +422 -0
  187. package/dist/components/urban/core/traffic.d.ts +125 -0
  188. package/dist/components/urban/core/traffic.d.ts.map +1 -0
  189. package/dist/components/urban/core/traffic.js +305 -0
  190. package/dist/components/urban/index.d.ts +29 -0
  191. package/dist/components/urban/index.d.ts.map +1 -0
  192. package/dist/components/urban/index.js +16 -0
  193. package/dist/components/urban/textureSetResolver.d.ts +8 -0
  194. package/dist/components/urban/textureSetResolver.d.ts.map +1 -0
  195. package/dist/components/urban/textureSetResolver.js +16 -0
  196. package/dist/components/urban/urbanCore.d.ts +262 -0
  197. package/dist/components/urban/urbanCore.d.ts.map +1 -0
  198. package/dist/components/urban/urbanCore.js +928 -0
  199. package/dist/components/urban/useUrbanInstance.d.ts +53 -0
  200. package/dist/components/urban/useUrbanInstance.d.ts.map +1 -0
  201. package/dist/components/urban/useUrbanInstance.js +100 -0
  202. package/dist/components/vegetation/VegetationBush.d.ts +9 -0
  203. package/dist/components/vegetation/VegetationBush.d.ts.map +1 -0
  204. package/dist/components/vegetation/VegetationBush.js +23 -0
  205. package/dist/components/vegetation/VegetationCrops.d.ts +9 -0
  206. package/dist/components/vegetation/VegetationCrops.d.ts.map +1 -0
  207. package/dist/components/vegetation/VegetationCrops.js +23 -0
  208. package/dist/components/vegetation/VegetationFlowers.d.ts +9 -0
  209. package/dist/components/vegetation/VegetationFlowers.d.ts.map +1 -0
  210. package/dist/components/vegetation/VegetationFlowers.js +23 -0
  211. package/dist/components/vegetation/VegetationForest.d.ts +9 -0
  212. package/dist/components/vegetation/VegetationForest.d.ts.map +1 -0
  213. package/dist/components/vegetation/VegetationForest.js +23 -0
  214. package/dist/components/vegetation/VegetationFruit.d.ts +9 -0
  215. package/dist/components/vegetation/VegetationFruit.d.ts.map +1 -0
  216. package/dist/components/vegetation/VegetationFruit.js +23 -0
  217. package/dist/components/vegetation/VegetationGrass.d.ts +9 -0
  218. package/dist/components/vegetation/VegetationGrass.d.ts.map +1 -0
  219. package/dist/components/vegetation/VegetationGrass.js +23 -0
  220. package/dist/components/vegetation/VegetationHedge.d.ts +9 -0
  221. package/dist/components/vegetation/VegetationHedge.d.ts.map +1 -0
  222. package/dist/components/vegetation/VegetationHedge.js +23 -0
  223. package/dist/components/vegetation/VegetationIvy.d.ts +9 -0
  224. package/dist/components/vegetation/VegetationIvy.d.ts.map +1 -0
  225. package/dist/components/vegetation/VegetationIvy.js +23 -0
  226. package/dist/components/vegetation/VegetationTree.d.ts +9 -0
  227. package/dist/components/vegetation/VegetationTree.d.ts.map +1 -0
  228. package/dist/components/vegetation/VegetationTree.js +23 -0
  229. package/dist/components/vegetation/VegetationVegetable.d.ts +9 -0
  230. package/dist/components/vegetation/VegetationVegetable.d.ts.map +1 -0
  231. package/dist/components/vegetation/VegetationVegetable.js +23 -0
  232. package/dist/components/vegetation/core/bush.d.ts +1256 -0
  233. package/dist/components/vegetation/core/bush.d.ts.map +1 -0
  234. package/dist/components/vegetation/core/bush.js +376 -0
  235. package/dist/components/vegetation/core/crops.d.ts +1033 -0
  236. package/dist/components/vegetation/core/crops.d.ts.map +1 -0
  237. package/dist/components/vegetation/core/crops.js +378 -0
  238. package/dist/components/vegetation/core/flowers.d.ts +648 -0
  239. package/dist/components/vegetation/core/flowers.d.ts.map +1 -0
  240. package/dist/components/vegetation/core/flowers.js +225 -0
  241. package/dist/components/vegetation/core/forest.d.ts +138 -0
  242. package/dist/components/vegetation/core/forest.d.ts.map +1 -0
  243. package/dist/components/vegetation/core/forest.js +310 -0
  244. package/dist/components/vegetation/core/fruit.d.ts +99 -0
  245. package/dist/components/vegetation/core/fruit.d.ts.map +1 -0
  246. package/dist/components/vegetation/core/fruit.js +77 -0
  247. package/dist/components/vegetation/core/grass.d.ts +103 -0
  248. package/dist/components/vegetation/core/grass.d.ts.map +1 -0
  249. package/dist/components/vegetation/core/grass.js +102 -0
  250. package/dist/components/vegetation/core/hedge.d.ts +193 -0
  251. package/dist/components/vegetation/core/hedge.d.ts.map +1 -0
  252. package/dist/components/vegetation/core/hedge.js +243 -0
  253. package/dist/components/vegetation/core/ivy.d.ts +213 -0
  254. package/dist/components/vegetation/core/ivy.d.ts.map +1 -0
  255. package/dist/components/vegetation/core/ivy.js +173 -0
  256. package/dist/components/vegetation/core/tree.d.ts +1117 -0
  257. package/dist/components/vegetation/core/tree.d.ts.map +1 -0
  258. package/dist/components/vegetation/core/tree.js +408 -0
  259. package/dist/components/vegetation/core/vegetable.d.ts +99 -0
  260. package/dist/components/vegetation/core/vegetable.d.ts.map +1 -0
  261. package/dist/components/vegetation/core/vegetable.js +76 -0
  262. package/dist/components/vegetation/index.d.ts +23 -0
  263. package/dist/components/vegetation/index.d.ts.map +1 -0
  264. package/dist/components/vegetation/index.js +14 -0
  265. package/dist/components/vegetation/produceCore.d.ts +929 -0
  266. package/dist/components/vegetation/produceCore.d.ts.map +1 -0
  267. package/dist/components/vegetation/produceCore.js +723 -0
  268. package/dist/components/vegetation/useVegetationInstance.d.ts +39 -0
  269. package/dist/components/vegetation/useVegetationInstance.d.ts.map +1 -0
  270. package/dist/components/vegetation/useVegetationInstance.js +45 -0
  271. package/dist/components/vegetation/vegetationCore.d.ts +412 -0
  272. package/dist/components/vegetation/vegetationCore.d.ts.map +1 -0
  273. package/dist/components/vegetation/vegetationCore.js +1728 -0
  274. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +5 -0
  275. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
  276. package/dist/components/volumetricClouds/VolumetricCloudsPass.js +39 -13
  277. package/dist/components/water/OceanSurface.d.ts.map +1 -1
  278. package/dist/components/water/OceanSurface.js +3 -2
  279. package/dist/components/water/WaterBody.d.ts.map +1 -1
  280. package/dist/components/water/WaterBody.js +31 -10
  281. package/dist/components/water/WaterFountain.d.ts +9 -0
  282. package/dist/components/water/WaterFountain.d.ts.map +1 -0
  283. package/dist/components/water/WaterFountain.js +24 -0
  284. package/dist/components/water/WaterStream.d.ts +9 -0
  285. package/dist/components/water/WaterStream.d.ts.map +1 -0
  286. package/dist/components/water/WaterStream.js +24 -0
  287. package/dist/components/water/WaterWaterfall.d.ts +9 -0
  288. package/dist/components/water/WaterWaterfall.d.ts.map +1 -0
  289. package/dist/components/water/WaterWaterfall.js +24 -0
  290. package/dist/components/water/core/fountain.d.ts +70 -0
  291. package/dist/components/water/core/fountain.d.ts.map +1 -0
  292. package/dist/components/water/core/fountain.js +619 -0
  293. package/dist/components/water/core/stream.d.ts +72 -0
  294. package/dist/components/water/core/stream.d.ts.map +1 -0
  295. package/dist/components/water/core/stream.js +167 -0
  296. package/dist/components/water/core/waterfall.d.ts +78 -0
  297. package/dist/components/water/core/waterfall.d.ts.map +1 -0
  298. package/dist/components/water/core/waterfall.js +325 -0
  299. package/dist/components/water/index.d.ts +8 -0
  300. package/dist/components/water/index.d.ts.map +1 -1
  301. package/dist/components/water/index.js +7 -0
  302. package/dist/components/water/types.d.ts +3 -0
  303. package/dist/components/water/types.d.ts.map +1 -1
  304. package/dist/components/water/useWaterInstance.d.ts +43 -0
  305. package/dist/components/water/useWaterInstance.d.ts.map +1 -0
  306. package/dist/components/water/useWaterInstance.js +89 -0
  307. package/dist/components/water/waterCore.d.ts +179 -0
  308. package/dist/components/water/waterCore.d.ts.map +1 -0
  309. package/dist/components/water/waterCore.js +516 -0
  310. package/dist/constants.d.ts.map +1 -1
  311. package/dist/constants.js +9 -1
  312. package/dist/hooks/index.d.ts +7 -2
  313. package/dist/hooks/index.d.ts.map +1 -1
  314. package/dist/hooks/index.js +5 -2
  315. package/dist/hooks/useActionPatch.d.ts +23 -0
  316. package/dist/hooks/useActionPatch.d.ts.map +1 -0
  317. package/dist/hooks/useActionPatch.js +38 -0
  318. package/dist/hooks/useCloudSun.d.ts.map +1 -1
  319. package/dist/hooks/useCloudSun.js +3 -2
  320. package/dist/hooks/useCommittedInstance.d.ts +6 -0
  321. package/dist/hooks/useCommittedInstance.d.ts.map +1 -0
  322. package/dist/hooks/useCommittedInstance.js +42 -0
  323. package/dist/hooks/useConfigLive.d.ts +1 -1
  324. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  325. package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
  326. package/dist/hooks/useContinuousEffects.js +36 -20
  327. package/dist/hooks/useGridLayout.d.ts +7 -0
  328. package/dist/hooks/useGridLayout.d.ts.map +1 -0
  329. package/dist/hooks/useGridLayout.js +10 -0
  330. package/dist/hooks/useInteractionEffects.d.ts.map +1 -1
  331. package/dist/hooks/useInteractionEffects.js +48 -9
  332. package/dist/hooks/useLightLive.d.ts.map +1 -1
  333. package/dist/hooks/useLightLive.js +2 -0
  334. package/dist/hooks/useLinkStatus.d.ts +7 -0
  335. package/dist/hooks/useLinkStatus.d.ts.map +1 -0
  336. package/dist/hooks/useLinkStatus.js +20 -0
  337. package/dist/hooks/useMaterialApplication.d.ts +6 -1
  338. package/dist/hooks/useMaterialApplication.d.ts.map +1 -1
  339. package/dist/hooks/useMaterialApplication.js +7 -2
  340. package/dist/hooks/useOceanMaterial.d.ts +11 -1
  341. package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
  342. package/dist/hooks/useOceanMaterial.js +185 -27
  343. package/dist/hooks/usePathAnimation.d.ts +8 -0
  344. package/dist/hooks/usePathAnimation.d.ts.map +1 -1
  345. package/dist/hooks/usePathAnimation.js +140 -59
  346. package/dist/hooks/useResolvedLayout.d.ts +10 -0
  347. package/dist/hooks/useResolvedLayout.d.ts.map +1 -0
  348. package/dist/hooks/useResolvedLayout.js +17 -0
  349. package/dist/hooks/useTimeLighting.d.ts +36 -0
  350. package/dist/hooks/useTimeLighting.d.ts.map +1 -0
  351. package/dist/hooks/useTimeLighting.js +67 -0
  352. package/dist/index.d.ts +4 -0
  353. package/dist/index.d.ts.map +1 -1
  354. package/dist/index.js +4 -0
  355. package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -1
  356. package/dist/operations/catalogue/shaderLayers.js +26 -3
  357. package/dist/render/renderLive.d.ts +11 -0
  358. package/dist/render/renderLive.d.ts.map +1 -0
  359. package/dist/render/renderLive.js +57 -0
  360. package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
  361. package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
  362. package/dist/shaders/glsl/oceanCore.glsl.js +35 -5
  363. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +12 -0
  364. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
  365. package/dist/shaders/ocean/OceanSurfaceMaterial.js +55 -7
  366. package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
  367. package/dist/shaders/terrain/TerrainMaterial.js +28 -0
  368. package/dist/triggers/kinds/change.js +1 -1
  369. package/dist/utils/composerHostedPass.d.ts +74 -0
  370. package/dist/utils/composerHostedPass.d.ts.map +1 -0
  371. package/dist/utils/composerHostedPass.js +63 -0
  372. package/dist/utils/geometryScript.d.ts +17 -0
  373. package/dist/utils/geometryScript.d.ts.map +1 -0
  374. package/dist/utils/geometryScript.js +92 -0
  375. package/dist/utils/geometryScript.worker.d.ts +2 -0
  376. package/dist/utils/geometryScript.worker.d.ts.map +1 -0
  377. package/dist/utils/geometryScript.worker.js +42 -0
  378. package/dist/utils/groundRegistry.d.ts +11 -0
  379. package/dist/utils/groundRegistry.d.ts.map +1 -0
  380. package/dist/utils/groundRegistry.js +39 -0
  381. package/dist/utils/instancingSupport.d.ts +9 -0
  382. package/dist/utils/instancingSupport.d.ts.map +1 -0
  383. package/dist/utils/instancingSupport.js +13 -0
  384. package/dist/utils/landPatch.d.ts +26 -5
  385. package/dist/utils/landPatch.d.ts.map +1 -1
  386. package/dist/utils/landPatch.js +124 -9
  387. package/dist/utils/layoutPlacement.d.ts +30 -0
  388. package/dist/utils/layoutPlacement.d.ts.map +1 -0
  389. package/dist/utils/layoutPlacement.js +113 -0
  390. package/dist/utils/linkRegistry.d.ts +15 -0
  391. package/dist/utils/linkRegistry.d.ts.map +1 -0
  392. package/dist/utils/linkRegistry.js +11 -0
  393. package/dist/utils/shapes.d.ts +28 -2
  394. package/dist/utils/shapes.d.ts.map +1 -1
  395. package/dist/utils/shapes.js +32 -3
  396. package/dist/utils/sharedParts.d.ts +61 -0
  397. package/dist/utils/sharedParts.d.ts.map +1 -0
  398. package/dist/utils/sharedParts.js +268 -0
  399. package/dist/utils/svgAsset.d.ts +6 -0
  400. package/dist/utils/svgAsset.d.ts.map +1 -0
  401. package/dist/utils/svgAsset.js +46 -0
  402. package/dist/utils/waterLight.d.ts +29 -0
  403. package/dist/utils/waterLight.d.ts.map +1 -0
  404. package/dist/utils/waterLight.js +67 -0
  405. package/dist/utils/waterReflection.d.ts +185 -0
  406. package/dist/utils/waterReflection.d.ts.map +1 -0
  407. package/dist/utils/waterReflection.js +616 -0
  408. package/package.json +4 -3
@@ -0,0 +1,310 @@
1
+ // Emitted from Claude outputs/vegetation-lab/forest.mjs by gen_family.mjs — edit the lab module and re-emit.
2
+ // Forest — vegetation object (lab module). Shared core: ./common.mjs; plants: ./tree.mjs, ./bush.mjs.
3
+ // Built for hundreds to thousands of trees:
4
+ // plants one plant per species in the mix (trees) plus the undergrowth bushes, each built ONCE by the
5
+ // tree / bush generator and never drawn itself. Each bakes its octahedral impostor
6
+ // (common.mjs "detail levels") — one bake at a time, so loading a forest is not one long hitch.
7
+ // the stand every tree of a species is one instance of that species' impostor card in ONE GPU-instanced
8
+ // draw (one more for its shadow): a thousand oaks are two draw calls and ~2,000 triangles.
9
+ // near a fixed budget of the trees nearest to the camera (nearTrees) is drawn as real plants:
10
+ // copies of the plant's meshes (shared geometry / materials) moved onto those trees every
11
+ // frame. A tree drawn in full flags its instance (aImpSlot) so its card cross-fades out with
12
+ // the dither the plant's leaves fade in with; every other tree stays the card.
13
+ // placement a jittered grid over the floor of the box, thinned by a low-frequency noise mask into groves
14
+ // and glades (clumping) — linear in the number of trees. Species drawn by the mix's weights.
15
+ // size the box: x/z is the forest floor, y the canopy height. Heights follow the box (taller species
16
+ // reach the top), crown widths follow each species' form in metres, so a stretched box never
17
+ // stretches the trees. Undergrowth is 5–12.5 % of the canopy height (1–2.5 m at
18
+ // the default 20 m box), so scaling the forest or its parents scales the whole stand.
19
+ // wind one field: gust fronts travel across the stand (gustAt reads each instance's position).
20
+ import * as THREE from 'three';
21
+ import { createCommonUniforms, applyCommonConfig, mulberry32, LOD } from '../vegetationCore.js';
22
+ import * as TREE from './tree.js';
23
+ import * as BUSH from './bush.js';
24
+ const DEFAULT_COLOR = '#4f8a3a', DEFAULT_SHADE = '#1f3d1a';
25
+ // ----------------------------------------------------------------------------- mixes
26
+ // trees: [species, weight]; under: undergrowth bush species. FORM: crown width / height and height as a
27
+ // share of the canopy, per tree species, from their silhouettes.
28
+ export const MIXES = {
29
+ temperate: { trees: [['oak', 3], ['maple', 2], ['birch', 1.5]], under: ['wildShrub', 'fern'] },
30
+ conifer: { trees: [['pine', 3], ['spruce', 3], ['birch', 0.5]], under: ['juniper', 'fern'] },
31
+ birch: { trees: [['birch', 4], ['poplar', 1]], under: ['fern', 'wildShrub'] },
32
+ autumn: { trees: [['maple', 3], ['oak', 2], ['birch', 1]], under: ['wildShrub', 'heather'] },
33
+ mediterranean: { trees: [['olive', 3], ['cypress', 2]], under: ['rosemary', 'lavender'] },
34
+ tropical: { trees: [['palm', 3], ['eucalyptus', 1], ['jacaranda', 1]], under: ['fern', 'hibiscus'] },
35
+ savanna: { trees: [['acacia', 4], ['baobab', 0.5]], under: ['agave'] },
36
+ blossom: { trees: [['cherryBlossom', 2], ['magnolia', 1], ['jacaranda', 1]], under: ['azalea', 'camellia'] },
37
+ winter: { trees: [['bare', 3], ['spruce', 1.5]], under: ['heather'] },
38
+ };
39
+ const FORM = {
40
+ oak: [0.9, 0.85], maple: [0.85, 0.8], birch: [0.55, 0.85], pine: [0.5, 0.95], spruce: [0.45, 1], poplar: [0.3, 1],
41
+ olive: [1.0, 0.5], cypress: [0.25, 1], palm: [0.7, 0.9], eucalyptus: [0.6, 1], jacaranda: [1.0, 0.7],
42
+ cherryBlossom: [0.95, 0.55], magnolia: [0.8, 0.55], acacia: [1.4, 0.55], baobab: [0.9, 0.7], willow: [1.0, 0.7], bare: [0.8, 0.85],
43
+ };
44
+ // undergrowth as fractions of the canopy height (the box height), so the whole stand scales together:
45
+ // at the default 20 m box that is a 2.2 x 1.6 m bush base, items 1.0 - 2.5 m tall
46
+ const BUSH_W = 0.11, BUSH_H = 0.08, UNDER_H = [0.05, 0.125];
47
+ export function createUniforms() { return createCommonUniforms(); }
48
+ /** The knobs each plant receives: the forest's live knobs; colours only when moved off the forest default (else each species keeps its own). */
49
+ function plantCfg(c, base) {
50
+ const p = Object.assign(Object.create(null), base); // any knob may be added below
51
+ for (const k of ['quality', 'leafSize', 'foliage', 'seasonHue', 'leafFall', 'flutter', 'sway', 'opacity', 'speed', 'windStrength', 'windDirection', 'turbulence'])
52
+ if (c[k] !== undefined)
53
+ p[k] = c[k];
54
+ if (c.color && c.color.toLowerCase() !== DEFAULT_COLOR)
55
+ p.color = c.color;
56
+ if (c.shadeColor && c.shadeColor.toLowerCase() !== DEFAULT_SHADE)
57
+ p.shadeColor = c.shadeColor;
58
+ return p;
59
+ }
60
+ function treeBase(species, seed) {
61
+ const sp = TREE.SPECIES[species] || TREE.SPECIES.oak;
62
+ return {
63
+ type: 'tree', species, trunkRatio: 1, branchiness: 1, droop: 0, twist: 0.5, density: 0.4, seed, lod: 'auto',
64
+ leafType: 'auto', flowers: sp['flowersAlways'] || 0, flowerColor: '#ffffff', fruit: 'none', fruitAmount: 0.5, ripeness: 1, fruitColor: '#ffffff',
65
+ };
66
+ }
67
+ function bushBase(species, seed) {
68
+ return { type: 'bush', species, spread: 1, twist: 0.5, density: 0.8, seed, lod: 'auto', leafType: 'auto', flowers: 0, flowerColor: '#ffffff', fruit: 'none', fruitAmount: 0.5, ripeness: 1, fruitColor: '#ffffff' };
69
+ }
70
+ export function applyConfig(u, c, plants) {
71
+ applyCommonConfig(u, c);
72
+ if (!plants)
73
+ return;
74
+ for (const p of plants)
75
+ p.inst.apply(plantCfg(c, p.base));
76
+ }
77
+ /** A smooth value-noise field on the floor (groves / glades), deterministic per seed. */
78
+ function noiseField(seed) {
79
+ const h = (x, y) => { let n = Math.imul(x, 374761393) + Math.imul(y, 668265263) + Math.imul(seed, 2147483647); n = Math.imul(n ^ (n >>> 13), 1274126177); return ((n ^ (n >>> 16)) >>> 0) / 4294967296; };
80
+ const sm = (t) => t * t * (3 - 2 * t);
81
+ const v = (x, y) => { const xi = Math.floor(x), yi = Math.floor(y), fx = sm(x - xi), fy = sm(y - yi); return (h(xi, yi) * (1 - fx) + h(xi + 1, yi) * fx) * (1 - fy) + (h(xi, yi + 1) * (1 - fx) + h(xi + 1, yi + 1) * fx) * fy; };
82
+ return (x, y) => 0.65 * v(x, y) + 0.35 * v(x * 2.3 + 7.1, y * 2.3 + 3.7);
83
+ }
84
+ export function build(u, c) {
85
+ const mix = MIXES[c.mix] || MIXES.temperate;
86
+ const seed = c.seed ?? 9;
87
+ const rnd = mulberry32(seed * 2654435761 + 313);
88
+ const object = new THREE.Group();
89
+ object.name = 'forest';
90
+ // the stand lives in metres: this group cancels the box scale (set from the world scale)
91
+ const metres = new THREE.Group();
92
+ object.add(metres);
93
+ // ---- the plants: one per species, never drawn themselves
94
+ const plants = [];
95
+ const addPlant = (M, base, kind) => {
96
+ const pu = M.createUniforms();
97
+ const cfg = plantCfg(c, base);
98
+ const inst = M.build(pu, cfg);
99
+ inst.apply(cfg);
100
+ const holder = new THREE.Group(); // the plant at its species' base size (metres)
101
+ holder.add(inst.object);
102
+ metres.add(holder);
103
+ const parts = [];
104
+ inst.object.traverse((o) => { if (o.isMesh)
105
+ parts.push(o); });
106
+ for (const p of parts)
107
+ p.layers.disableAll();
108
+ const imp = inst.lod.impostor;
109
+ const plant = { inst, base, kind, holder, u: pu, parts: parts.filter((p) => p !== imp), imp, size: [1, 1], items: [], cards: null, slots: [], slotOf: [] };
110
+ plants.push(plant);
111
+ return plant;
112
+ };
113
+ const treePlants = mix.trees.map(([sp], k) => addPlant(TREE, treeBase(sp, seed + k * 17), 'tree'));
114
+ const nTrees = Math.max(1, Math.round(c.trees ?? 800));
115
+ const nUnder = Math.round(nTrees * (c.undergrowth ?? 0.3));
116
+ const underPlants = nUnder > 0 ? mix.under.map((sp, k) => addPlant(BUSH, bushBase(sp, seed + 101 + k * 13), 'bush')) : [];
117
+ // ---- placement: a jittered grid on the unit floor, thinned by a noise mask into groves and glades
118
+ const field = noiseField(seed);
119
+ const clump = c.clumping ?? 0.4;
120
+ const scatter = (n, sp, salt) => {
121
+ const keepRate = 1 - 0.6 * clump;
122
+ const side = Math.max(1, Math.ceil(Math.sqrt(n / keepRate) * 1.15));
123
+ const out = [];
124
+ for (let j = 0; j < side; j++)
125
+ for (let i = 0; i < side; i++) {
126
+ const x = ((i + 0.15 + 0.7 * rnd()) / side - 0.5) * 0.96, z = ((j + 0.15 + 0.7 * rnd()) / side - 0.5) * 0.96;
127
+ const v = field(x * 4 + salt, z * 4 - salt);
128
+ // glades where the noise is low: clumping 0.6+ empties them, lower values only thin them
129
+ let keep = Math.max(0, 1 - clump * 1.7 * (1 - Math.min(1, Math.max(0, (v - 0.38) / 0.22))));
130
+ // a natural outline instead of the box's square edge: a rounded square (superellipse) warped by
131
+ // noise, the stand thinning across a band of varying width
132
+ const r = Math.cbrt(Math.abs(x) ** 3 + Math.abs(z) ** 3) / 0.48;
133
+ const warp = (field(x * 3 - salt, z * 3 + 11.3) - 0.5) * 0.4;
134
+ const band = 0.05 + 0.12 * field(x * 7 + 5.1, z * 7 - salt);
135
+ keep *= Math.min(1, Math.max(0, (1 - r + warp) / band));
136
+ if (rnd() < keep)
137
+ out.push({ x, z });
138
+ }
139
+ for (let i = out.length - 1; i > 0; i--) {
140
+ const k = Math.floor(rnd() * (i + 1));
141
+ const t = out[i];
142
+ out[i] = out[k];
143
+ out[k] = t;
144
+ }
145
+ return out.slice(0, n);
146
+ };
147
+ const totalW = mix.trees.reduce((s, t) => s + t[1], 0);
148
+ for (const p of scatter(nTrees, null, 0)) {
149
+ let w = rnd() * totalW, k = 0;
150
+ while (k < mix.trees.length - 1 && (w -= mix.trees[k][1]) > 0)
151
+ k++;
152
+ treePlants[k].items.push({ x: p.x, z: p.z, yaw: rnd() * 6.2832, h: 1 - (c.sizeVar ?? 0.3) * rnd() });
153
+ }
154
+ if (underPlants.length)
155
+ for (const p of scatter(nUnder, null, 3.3))
156
+ underPlants[Math.floor(rnd() * underPlants.length)].items.push({ x: p.x, z: p.z, yaw: rnd() * 6.2832, h: rnd() });
157
+ // ---- per plant: one instanced draw of its impostor card for all its items, and the near slots
158
+ const nearBudget = Math.max(0, Math.round(c.nearTrees ?? 24));
159
+ for (const pl of plants) {
160
+ const n = Math.max(1, pl.items.length);
161
+ const cards = new THREE.InstancedMesh(pl.imp.geometry, pl.imp.material, n);
162
+ cards.customDepthMaterial = pl.imp.customDepthMaterial;
163
+ cards.castShadow = true;
164
+ cards.receiveShadow = false;
165
+ cards.frustumCulled = false; // one draw for the whole stand
166
+ cards.raycast = function () { };
167
+ cards.name = 'forest:cards';
168
+ cards.count = pl.items.length;
169
+ const slotAttr = new THREE.InstancedBufferAttribute(new Float32Array(n), 1);
170
+ slotAttr.setUsage(THREE.DynamicDrawUsage);
171
+ cards.geometry = pl.imp.geometry.clone(); // its own geometry: the slot flags are per stand
172
+ cards.geometry.setAttribute('aImpSlot', slotAttr);
173
+ cards.geometry.boundingSphere = pl.imp.geometry.boundingSphere;
174
+ metres.add(cards);
175
+ pl.cards = cards;
176
+ pl.slotAttr = slotAttr;
177
+ // near slots: copies of the plant's meshes, moved onto the nearest trees each frame
178
+ const nSlots = Math.min(pl.items.length, pl.kind === 'tree' ? nearBudget : Math.round(nearBudget / 2));
179
+ for (let s = 0; s < nSlots; s++) {
180
+ const copies = pl.parts.map((src) => {
181
+ const m = new THREE.Mesh(src.geometry, src.material);
182
+ m.customDepthMaterial = src.customDepthMaterial;
183
+ m.castShadow = src.castShadow;
184
+ m.receiveShadow = src.receiveShadow;
185
+ m.frustumCulled = src.frustumCulled;
186
+ m.raycast = src.raycast;
187
+ m.matrixAutoUpdate = false;
188
+ m.visible = false;
189
+ m.name = 'forest:near';
190
+ if (src.userData.mirrorSetup)
191
+ src.userData.mirrorSetup(m);
192
+ metres.add(m);
193
+ return { m, src };
194
+ });
195
+ pl.slots.push({ copies, item: -1 });
196
+ }
197
+ }
198
+ // ---- sizes follow the box: laid out again when the world scale changes
199
+ const F = new THREE.Vector3(), lastF = new THREE.Vector3(-1, -1, -1);
200
+ const _m = new THREE.Matrix4(), _q = new THREE.Quaternion(), _p = new THREE.Vector3(), _s = new THREE.Vector3(), _y = new THREE.Vector3(0, 1, 0);
201
+ function layout() {
202
+ metres.scale.set(1 / F.x, 1 / F.y, 1 / F.z);
203
+ const maxW = Math.min(F.x, F.z) * 0.45;
204
+ for (const pl of plants) {
205
+ if (pl.kind === 'tree') {
206
+ const form = FORM[pl.base.species] || [0.8, 0.85];
207
+ const h = F.y * form[1], w = Math.min(maxW, h * form[0]);
208
+ pl.size = [w, h];
209
+ }
210
+ else
211
+ pl.size = [Math.min(maxW, F.y * BUSH_W), F.y * BUSH_H];
212
+ pl.holder.scale.set(pl.size[0], pl.size[1], pl.size[0]);
213
+ pl.items.forEach((it, i) => {
214
+ const k = pl.kind === 'tree' ? it.h : (UNDER_H[0] + (UNDER_H[1] - UNDER_H[0]) * it.h) / BUSH_H; // fractions of F.y, ratio is scale-free
215
+ it.r = 0.5 * Math.hypot(pl.size[0] * k, pl.size[1] * k, pl.size[0] * k); // bounding radius (m)
216
+ it.lx = it.x * F.x;
217
+ it.lz = it.z * F.z;
218
+ it.ly = 0.5 * pl.size[1] * k; // centre, in the stand's metres
219
+ it.mat = _m.compose(_p.set(it.lx, 0, it.lz), _q.setFromAxisAngle(_y, it.yaw), _s.set(pl.size[0] * k, pl.size[1] * k, pl.size[0] * k)).clone();
220
+ pl.cards.setMatrixAt(i, it.mat);
221
+ });
222
+ pl.cards.instanceMatrix.needsUpdate = true;
223
+ pl.cards.boundingSphere = null;
224
+ pl.cards.boundingBox = null;
225
+ for (const sl of pl.slots)
226
+ sl.item = -1;
227
+ }
228
+ lastF.copy(F);
229
+ }
230
+ // ---- per frame: which trees are near enough for full detail (by the same screen size the detail levels use)
231
+ const _inv = new THREE.Matrix4(), _cam = new THREE.Vector3();
232
+ function chooseNear() {
233
+ for (const pl of plants) {
234
+ if (!pl.slots.length)
235
+ continue;
236
+ const pu = pl.u;
237
+ const lodK = pu.uLodK.value, ortho = pu.uLodOrtho.value > 0.5;
238
+ // the camera in the stand's metres (the stand has no scale of its own: metres cancels the box)
239
+ _inv.copy(metres.matrixWorld).invert();
240
+ _cam.copy(pu.uViewPos.value).applyMatrix4(_inv);
241
+ const cand = [];
242
+ const minS = LOD.IMP * LOD.FADE_OUT;
243
+ pl.items.forEach((it, i) => {
244
+ const d = ortho ? 1 : Math.max(1e-3, Math.hypot(it.lx - _cam.x, it.ly - _cam.y, it.lz - _cam.z));
245
+ const s = it.r * lodK / d;
246
+ if (s > minS)
247
+ cand.push([s, i]);
248
+ });
249
+ cand.sort((a, b) => b[0] - a[0]);
250
+ const want = new Set(cand.slice(0, pl.slots.length).map((x) => x[1]));
251
+ const flags = pl.slotAttr.array;
252
+ // keep slots on trees that stay near; free the rest; give free slots to the newcomers
253
+ const free = [];
254
+ for (const sl of pl.slots) {
255
+ if (sl.item >= 0 && want.has(sl.item))
256
+ want.delete(sl.item);
257
+ else {
258
+ if (sl.item >= 0)
259
+ flags[sl.item] = 0;
260
+ sl.item = -1;
261
+ free.push(sl);
262
+ }
263
+ }
264
+ for (const i of want) {
265
+ const sl = free.pop();
266
+ if (!sl)
267
+ break;
268
+ sl.item = i;
269
+ flags[i] = 1;
270
+ for (const { m } of sl.copies) {
271
+ m.matrix.copy(pl.items[i].mat);
272
+ m.matrixWorldNeedsUpdate = true;
273
+ }
274
+ }
275
+ for (const sl of pl.slots)
276
+ for (const { m, src } of sl.copies)
277
+ m.visible = sl.item >= 0 && src.visible;
278
+ pl.slotAttr.needsUpdate = true;
279
+ }
280
+ }
281
+ applyConfig(u, c, plants);
282
+ return {
283
+ object,
284
+ materials: [],
285
+ apply: function (cfg) { applyConfig(u, cfg, plants); },
286
+ update: function (dt, camera, sunWorld, renderer) {
287
+ object.updateWorldMatrix(true, true);
288
+ object.getWorldScale(F);
289
+ F.set(Math.max(F.x, 1e-3), Math.max(F.y, 1e-3), Math.max(F.z, 1e-3));
290
+ if (Math.abs(F.x - lastF.x) + Math.abs(F.y - lastF.y) + Math.abs(F.z - lastF.z) > 1e-4) {
291
+ layout();
292
+ object.updateWorldMatrix(false, true);
293
+ }
294
+ // impostors: the stand needs every plant's card; bake one plant at a time
295
+ let active = plants.find((pl) => { const st = pl.inst.lod.state; return !st.ready || st.frame >= 0 || st.dirty; });
296
+ for (const pl of plants)
297
+ pl.inst.lod.state.wanted = pl === active;
298
+ for (const pl of plants)
299
+ pl.inst.update(dt, camera, sunWorld, renderer);
300
+ chooseNear();
301
+ },
302
+ stats: { trees: nTrees, undergrowth: nUnder, species: plants.length },
303
+ dispose: function () { for (const pl of plants) {
304
+ pl.cards.geometry.dispose();
305
+ pl.inst.dispose();
306
+ } },
307
+ };
308
+ }
309
+ /** Knobs whose change rebuilds the plant (dispose + build); every other knob is a live push through apply. */
310
+ export const STRUCTURAL = ['mix', 'trees', 'clumping', 'sizeVar', 'undergrowth', 'quality', 'seed', 'nearTrees'];
@@ -0,0 +1,99 @@
1
+ import * as THREE from 'three';
2
+ export declare function createUniforms(): {
3
+ uTime: {
4
+ value: number;
5
+ };
6
+ uWindPhase: {
7
+ value: number;
8
+ };
9
+ uWindDir: {
10
+ value: THREE.Vector2;
11
+ };
12
+ uWindStrength: {
13
+ value: number;
14
+ };
15
+ uTurb: {
16
+ value: number;
17
+ };
18
+ uSpeed: {
19
+ value: number;
20
+ };
21
+ uSway: {
22
+ value: number;
23
+ };
24
+ uFlutter: {
25
+ value: number;
26
+ };
27
+ uScale: {
28
+ value: THREE.Vector3;
29
+ };
30
+ uMean: {
31
+ value: number;
32
+ };
33
+ uOpacity: {
34
+ value: number;
35
+ };
36
+ uColor: {
37
+ value: THREE.Color;
38
+ };
39
+ uShadeColor: {
40
+ value: THREE.Color;
41
+ };
42
+ uSeason: {
43
+ value: number;
44
+ };
45
+ uFoliage: {
46
+ value: number;
47
+ };
48
+ uLeafType: {
49
+ value: number;
50
+ };
51
+ uLeafSize: {
52
+ value: number;
53
+ };
54
+ uGrowth: {
55
+ value: number;
56
+ };
57
+ uSunDirView: {
58
+ value: THREE.Vector3;
59
+ };
60
+ uViewPos: {
61
+ value: THREE.Vector3;
62
+ };
63
+ uLodK: {
64
+ value: number;
65
+ };
66
+ uLodOrtho: {
67
+ value: number;
68
+ };
69
+ uLodBias: {
70
+ value: number;
71
+ };
72
+ uImpReady: {
73
+ value: number;
74
+ };
75
+ uBake: {
76
+ value: number;
77
+ };
78
+ uBakeView: {
79
+ value: THREE.Matrix3;
80
+ };
81
+ uBakeDepth: {
82
+ value: THREE.Vector2;
83
+ };
84
+ };
85
+ export declare function applyConfig(u: any, c: any, mats: any): void;
86
+ export declare function build(u: any, c: any): {
87
+ object: THREE.Group<THREE.Object3DEventMap>;
88
+ materials: THREE.MeshPhysicalMaterial[];
89
+ apply: (cfg: any) => void;
90
+ update: (dt: any, camera: any, sunWorld: any) => void;
91
+ stats: {
92
+ pieces: number;
93
+ verts: number;
94
+ };
95
+ dispose: () => void;
96
+ };
97
+ /** Knobs whose change rebuilds the plant (dispose + build); every other knob is a live push through apply. */
98
+ export declare const STRUCTURAL: string[];
99
+ //# sourceMappingURL=fruit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fruit.d.ts","sourceRoot":"","sources":["../../../../src/components/vegetation/core/fruit.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC;AAEnE,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,IAAI,KAAA,QAarC;AAED,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;;EAyCzB;AAED,8GAA8G;AAC9G,eAAO,MAAM,UAAU,UAAuC,CAAC"}
@@ -0,0 +1,77 @@
1
+ // Emitted from Claude outputs/vegetation-lab/fruit.mjs by gen_family.mjs — edit the lab module and re-emit.
2
+ // Fruit — vegetation object (lab module). Engine: ./produce.mjs (shared with vegetable).
3
+ // Construction: one kind of fruit, as a single piece or a pile resting on the ground. Each kind is
4
+ // a lathe profile with per-kind lobes, dimples, bumps and lattices (apple, orange, lemon, pear,
5
+ // banana, cherry, strawberry, grapes, watermelon, pineapple), its stem and leaf / crown, and a skin
6
+ // that ripens from one colour to another with the kind's pattern, gloss and translucency. The
7
+ // cursor squeezes the flesh, ripens what it warms, or scatters a pile. Size: the unit box.
8
+ import * as THREE from 'three';
9
+ import { mulberry32, setColor, createCommonUniforms, applyCommonConfig, updateCommon, QUALITY_V, unitBounds, plantMesh } from '../vegetationCore.js';
10
+ import { PRODUCE, buildPiece, produceMaterial, instancePieces, pilePlacement, applyKind } from '../produceCore.js';
11
+ export function createUniforms() { return createCommonUniforms(); }
12
+ export function applyConfig(u, c, mats) {
13
+ // the family's `color` is the skin tint here and `shadeColor` the greens (leaves, calyx, crown)
14
+ applyCommonConfig(u, Object.assign({}, c, { color: c.shadeColor, shadeColor: undefined }));
15
+ if (!mats)
16
+ return;
17
+ const o = mats.skin.userData.uniforms;
18
+ const P = PRODUCE[c.kind] || PRODUCE.apple;
19
+ if (c.kind !== undefined)
20
+ applyKind(mats.skin, P);
21
+ if (c.ripeness !== undefined)
22
+ o.uRipeness.value = c.ripeness;
23
+ if (c.sizeVar !== undefined)
24
+ o.uSizeVar.value = c.sizeVar;
25
+ if (c.blemish !== undefined)
26
+ o.uBlemish.value = c.blemish;
27
+ if (c.gloss !== undefined)
28
+ o.uGloss.value = P.gloss * c.gloss;
29
+ if (c.color !== undefined)
30
+ setColor(o.uTint, c.color);
31
+ if (c.count !== undefined)
32
+ o.uCount.value = c.count;
33
+ }
34
+ export function build(u, c) {
35
+ const q = QUALITY_V[c.quality] || 1;
36
+ const kind = PRODUCE[c.kind] ? c.kind : 'apple';
37
+ const P = PRODUCE[kind];
38
+ const rnd = mulberry32((c.seed ?? 5) * 2654435761 + 5);
39
+ const count = Math.max(1, Math.round(c.count ?? 1));
40
+ let pair_setPieceH = 1;
41
+ const piece = buildPiece(kind, c.seed ?? 5, Math.min(1.6, 0.8 + 0.5 * q));
42
+ // fit: a single piece fills the box; a pile's footprint does
43
+ const ext = Math.max(piece.height, piece.width);
44
+ const foot = count <= 1 ? 1 : Math.min(0.5, 0.82 / Math.sqrt(count)) * (P.small ? 1.15 : 1);
45
+ const s = foot / ext;
46
+ piece.geo.scale(s, s, s);
47
+ const geo = instancePieces(piece.geo, count);
48
+ // lying kinds (carrot, banana, corn, cucumber) take their length as footprint and rest on their side
49
+ const foot2 = P.lie ? piece.height * s : piece.width * s;
50
+ const places = pilePlacement(count, foot2, rnd, count <= 1 || !!P.invert || !!P.crown || !!P.tops || !!P.mushroom || !!P.wrap, !!P.lie, piece.width * s * 0.5);
51
+ pair_setPieceH = piece.height * s;
52
+ for (let i = 0; i < count; i++) {
53
+ const p = places[i] || places[0];
54
+ geo.attributes.aXf.setXYZW(i, p.x, p.y, p.z, p.yaw);
55
+ geo.attributes.aTilt.setXYZW(i, p.tiltX, p.tiltZ, p.tilt, 1);
56
+ geo.attributes.aPiece.setXYZW(i, rnd(), i / count, rnd(), 0);
57
+ }
58
+ unitBounds(geo);
59
+ const pair = produceMaterial(u);
60
+ pair.material.userData.uniforms.uPieceH.value = pair_setPieceH;
61
+ const mesh = plantMesh(geo, pair, 'fruit');
62
+ const object = new THREE.Group();
63
+ object.name = 'fruit';
64
+ object.add(mesh);
65
+ const mats = { skin: pair.material };
66
+ applyConfig(u, c, mats);
67
+ return {
68
+ object,
69
+ materials: [pair.material],
70
+ apply: function (cfg) { applyConfig(u, cfg, mats); },
71
+ update: function (dt, camera, sunWorld) { updateCommon(u, object, camera, dt, sunWorld); },
72
+ stats: { pieces: count, verts: piece.geo.attributes.position.count },
73
+ dispose: function () { geo.dispose(); piece.geo.dispose(); pair.material.dispose(); pair.depth.dispose(); },
74
+ };
75
+ }
76
+ /** Knobs whose change rebuilds the plant (dispose + build); every other knob is a live push through apply. */
77
+ export const STRUCTURAL = ['kind', 'count', 'quality', 'seed'];
@@ -0,0 +1,103 @@
1
+ import * as THREE from 'three';
2
+ export declare function createUniforms(): {
3
+ uTime: {
4
+ value: number;
5
+ };
6
+ uWindPhase: {
7
+ value: number;
8
+ };
9
+ uWindDir: {
10
+ value: THREE.Vector2;
11
+ };
12
+ uWindStrength: {
13
+ value: number;
14
+ };
15
+ uTurb: {
16
+ value: number;
17
+ };
18
+ uSpeed: {
19
+ value: number;
20
+ };
21
+ uSway: {
22
+ value: number;
23
+ };
24
+ uFlutter: {
25
+ value: number;
26
+ };
27
+ uScale: {
28
+ value: THREE.Vector3;
29
+ };
30
+ uMean: {
31
+ value: number;
32
+ };
33
+ uOpacity: {
34
+ value: number;
35
+ };
36
+ uColor: {
37
+ value: THREE.Color;
38
+ };
39
+ uShadeColor: {
40
+ value: THREE.Color;
41
+ };
42
+ uSeason: {
43
+ value: number;
44
+ };
45
+ uFoliage: {
46
+ value: number;
47
+ };
48
+ uLeafType: {
49
+ value: number;
50
+ };
51
+ uLeafSize: {
52
+ value: number;
53
+ };
54
+ uGrowth: {
55
+ value: number;
56
+ };
57
+ uSunDirView: {
58
+ value: THREE.Vector3;
59
+ };
60
+ uViewPos: {
61
+ value: THREE.Vector3;
62
+ };
63
+ uLodK: {
64
+ value: number;
65
+ };
66
+ uLodOrtho: {
67
+ value: number;
68
+ };
69
+ uLodBias: {
70
+ value: number;
71
+ };
72
+ uImpReady: {
73
+ value: number;
74
+ };
75
+ uBake: {
76
+ value: number;
77
+ };
78
+ uBakeView: {
79
+ value: THREE.Matrix3;
80
+ };
81
+ uBakeDepth: {
82
+ value: THREE.Vector2;
83
+ };
84
+ } & {
85
+ uLeafType: {
86
+ value: number;
87
+ };
88
+ };
89
+ export declare function applyConfig(u: any, c: any, mats: any): void;
90
+ export declare function build(u: any, c: any): {
91
+ object: THREE.Group<THREE.Object3DEventMap>;
92
+ materials: THREE.MeshStandardMaterial[];
93
+ apply: (cfg: any) => void;
94
+ update: (dt: any, camera: any, sunWorld: any) => void;
95
+ stats: {
96
+ blades: number;
97
+ flowers: number;
98
+ };
99
+ dispose: () => void;
100
+ };
101
+ /** Knobs whose change rebuilds the plant (dispose + build); every other knob is a live push through apply. */
102
+ export declare const STRUCTURAL: string[];
103
+ //# sourceMappingURL=grass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grass.d.ts","sourceRoot":"","sources":["../../../../src/components/vegetation/core/grass.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2G;AAEzI,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,IAAI,KAAA,QAKrC;AAED,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;;EAgEzB;AAED,8GAA8G;AAC9G,eAAO,MAAM,UAAU,UAAgE,CAAC"}