@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,67 @@
1
+ import * as THREE from 'three';
2
+ export declare const LIGHTING: string[];
3
+ export declare const STRUCTURAL: string[];
4
+ export declare function createUniforms(): {
5
+ uSunDir: {
6
+ value: THREE.Vector3;
7
+ };
8
+ uSunColor: {
9
+ value: THREE.Color;
10
+ };
11
+ uSkyAmbient: {
12
+ value: THREE.Color;
13
+ };
14
+ uGroundAmbient: {
15
+ value: THREE.Color;
16
+ };
17
+ uNight: {
18
+ value: number;
19
+ };
20
+ } & {
21
+ uLamps: {
22
+ value: any[];
23
+ };
24
+ uLampColors: {
25
+ value: any[];
26
+ };
27
+ uLampAims: {
28
+ value: any[];
29
+ };
30
+ uLampCount: {
31
+ value: number;
32
+ };
33
+ uLampTop: {
34
+ value: number;
35
+ };
36
+ uLampField: {
37
+ value: any;
38
+ };
39
+ uLampFieldRect: {
40
+ value: THREE.Vector4;
41
+ };
42
+ uLampFieldOn: {
43
+ value: number;
44
+ };
45
+ } & {
46
+ uPavColor: {
47
+ value: THREE.Color;
48
+ };
49
+ uPavRoughness: {
50
+ value: number;
51
+ };
52
+ uGrassMix: {
53
+ value: number;
54
+ };
55
+ };
56
+ export declare function applyConfig(u: any, c: any): void;
57
+ export declare function build(u: any, c: any): {
58
+ object: THREE.Group<THREE.Object3DEventMap>;
59
+ materials: THREE.ShaderMaterial[];
60
+ uniformSets: any[];
61
+ apply: (cfg: any) => void;
62
+ rebuild(cfg: any): void;
63
+ bounds(): THREE.Box3;
64
+ update(): void;
65
+ dispose(): void;
66
+ };
67
+ //# sourceMappingURL=park.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"park.d.ts","sourceRoot":"","sources":["../../../../src/components/urban/core/park.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,eAAO,MAAM,QAAQ,UAA2B,CAAC;AAEjD,eAAO,MAAM,UAAU,UAA+H,CAAC;AAIvJ,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC;AACnE,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAE/B;AAQD,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;EA0GzB"}
@@ -0,0 +1,176 @@
1
+ // Emitted from Claude outputs/urban-lab/park.mjs by emit_object.mjs — edit the lab module and re-emit.
2
+ // =============================================================================
3
+ // urban/park — a lawn inside a polygon with a looping path, a kerb and park lamps
4
+ // =============================================================================
5
+ // Construction. The outline (points, curve — the plaza's polygon) is one lawn slab in the
6
+ // paving material's lawn mode (two greens broken by cells, no texture), with the plaza's
7
+ // kerb around it. A PATH loops inside it: the outline shrunk toward its centre by
8
+ // `pathInset`, sampled closed and drawn as a ribbon `pathWidth` wide in a library paving
9
+ // set, with an optional cross path through the middle. Short park lamps stand along the
10
+ // loop every lampSpacing and register in the lamp list, so the lawn and the path light up
11
+ // at night with no real light. Trees, bushes and flowers are the vegetation family's
12
+ // (scatter them with a layout over the park's outline); benches are street furniture.
13
+ import * as THREE from 'three';
14
+ import { createPavingUniforms, createPavingMaterial, applyTextureSet, loadTextureSet, buildLampGeometry, createFixtureUniforms, createFixtureMaterial, registerLamp, unregisterLamp, touchLamps, setLamps, placeLamps, samplePath, ribbon, mergeGeometries, } from '../urbanCore.js';
15
+ import { slabGeometry, signedArea } from './plaza.js';
16
+ export const LIGHTING = ['auto', 'day', 'night'];
17
+ export const STRUCTURAL = ['points', 'curve', 'kerb', 'kerbHeight', 'pathInset', 'pathWidth', 'crossPath', 'pathTexture', 'lampSpacing', 'lampHeight'];
18
+ // The lawn and the path are both the family's paving material (lawn mode / a paving set), so
19
+ // the park has no shader of its own: createUniforms returns the lawn's uniforms.
20
+ export function createUniforms() { return createPavingUniforms(); }
21
+ export function applyConfig(u, c) {
22
+ if (c.lawnColor !== undefined)
23
+ u.uPavColor.value.set(c.lawnColor);
24
+ }
25
+ /** The outline shrunk toward its centroid by `inset` (0..0.9). */
26
+ function insetPolygon(pts, inset) {
27
+ let cx = 0, cz = 0;
28
+ for (const [x, z] of pts) {
29
+ cx += x;
30
+ cz += z;
31
+ }
32
+ cx /= pts.length;
33
+ cz /= pts.length;
34
+ return pts.map(([x, z]) => [cx + (x - cx) * (1 - inset), cz + (z - cz) * (1 - inset)]);
35
+ }
36
+ export function build(u, c) {
37
+ const group = new THREE.Group();
38
+ const lawn = createPavingMaterial(u);
39
+ u.uGrassMix.value = 1;
40
+ const pathU = createPavingUniforms();
41
+ const pathMat = createPavingMaterial(pathU);
42
+ // The path lies on the lawn (two of the family's surfaces a few cm apart): a stronger depth
43
+ // offset than the lawn's, so it wins the depth test and never flickers as the camera moves.
44
+ pathMat.polygonOffsetFactor = -4;
45
+ pathMat.polygonOffsetUnits = -8;
46
+ const kerbU = createPavingUniforms();
47
+ const kerbMat = createPavingMaterial(kerbU);
48
+ const fixU = createFixtureUniforms();
49
+ const fixture = createFixtureMaterial(fixU);
50
+ const meshes = [];
51
+ let lamps = [], lampLocal = [];
52
+ const state = { pathTex: null };
53
+ const clear = () => {
54
+ for (const m of meshes) {
55
+ group.remove(m);
56
+ m.geometry.dispose();
57
+ }
58
+ meshes.length = 0;
59
+ for (const L of lamps)
60
+ unregisterLamp(L);
61
+ lamps = [];
62
+ lampLocal = [];
63
+ };
64
+ const add = (mesh) => { mesh.frustumCulled = false; group.add(mesh); meshes.push(mesh); };
65
+ const rebuild = (cfg) => {
66
+ clear();
67
+ let pts = (cfg.points || []).filter((p) => Array.isArray(p) && p.length >= 2);
68
+ if (pts.length < 3)
69
+ return;
70
+ if (signedArea(pts) > 0)
71
+ pts = [...pts].reverse();
72
+ const outline = samplePath(pts, cfg.curve, true);
73
+ if (outline.length < 3)
74
+ return;
75
+ const kh = cfg.kerb ? Math.max(0.02, cfg.kerbHeight) : 0.02;
76
+ add(new THREE.Mesh(slabGeometry(outline, kh), lawn));
77
+ if (cfg.kerb) {
78
+ add(new THREE.Mesh(mergeGeometries([ribbon(outline, -0.3, 0, kh, kh, false), ribbon(outline, 0, 0, kh, 0.0, true, 1)], [['aUV', 2]]), kerbMat));
79
+ }
80
+ // The path loop (and the cross path), 2 cm above the lawn.
81
+ const loop = samplePath(insetPolygon(pts, Math.min(0.9, Math.max(0.05, cfg.pathInset))), cfg.curve, true);
82
+ const pw = cfg.pathWidth;
83
+ const parts = [ribbon(loop, -pw / 2, pw / 2, kh + 0.04, kh + 0.04, false)];
84
+ if (cfg.crossPath) {
85
+ // Across the loop: the two loop points farthest apart, joined by a straight path.
86
+ let a = 0, b = 0, best = 0;
87
+ for (let i = 0; i < loop.length; i += 3)
88
+ for (let j = i + 3; j < loop.length; j += 3) {
89
+ const d = loop[i].p.distanceToSquared(loop[j].p);
90
+ if (d > best) {
91
+ best = d;
92
+ a = i;
93
+ b = j;
94
+ }
95
+ }
96
+ const cross = samplePath([[loop[a].p.x, loop[a].p.z], [loop[b].p.x, loop[b].p.z]], 0, false);
97
+ if (cross.length >= 2)
98
+ parts.push(ribbon(cross, -pw / 2, pw / 2, kh + 0.04, kh + 0.04, false));
99
+ }
100
+ add(new THREE.Mesh(mergeGeometries(parts, [['aUV', 2]]), pathMat));
101
+ // Lamps along the loop, on its outer edge, every lampSpacing metres.
102
+ const L = loop[loop.length - 1].s;
103
+ const n = Math.max(1, Math.round(L / cfg.lampSpacing));
104
+ const geo = buildLampGeometry({ height: cfg.lampHeight, armReach: 0.5, headWidth: 0.5, headDepth: 0.5 });
105
+ const lm = new THREE.InstancedMesh(geo, fixture, n);
106
+ const m = new THREE.Matrix4(), q = new THREE.Quaternion(), p = new THREE.Vector3(), sc = new THREE.Vector3(1, 1, 1), up = new THREE.Vector3(0, 1, 0);
107
+ for (let i = 0; i < n; i++) {
108
+ const s = (i + 0.5) * L / n;
109
+ let k = 0;
110
+ while (k < loop.length - 1 && loop[k + 1].s < s)
111
+ k++;
112
+ const S = loop[k];
113
+ p.copy(S.p).addScaledVector(S.n, pw / 2 + 0.6);
114
+ q.setFromAxisAngle(up, Math.atan2(S.n.x, S.n.z) + Math.PI);
115
+ m.compose(p, q, sc);
116
+ lm.setMatrixAt(i, m);
117
+ const head = geo.userData.head.clone().applyMatrix4(m);
118
+ lampLocal.push(head);
119
+ lamps.push(registerLamp({ id: 'park-' + i, position: head.clone(), color: new THREE.Color(cfg.lampColor), radius: cfg.lampRadius, intensity: cfg.lampIntensity, on: true }));
120
+ }
121
+ lm.instanceMatrix.needsUpdate = true;
122
+ add(lm);
123
+ };
124
+ const setTextures = (cfg) => {
125
+ const pm = cfg.pathTexture && cfg.pathTexture.maps;
126
+ state.pathTex = pm && pm.color ? loadTextureSet(pm) : null;
127
+ const ap = () => {
128
+ const t = state.pathTex && state.pathTex.color ? state.pathTex : null;
129
+ applyTextureSet(pathU, 'uPav', t, cfg.pathTexture && cfg.pathTexture.tileSize, 0.7);
130
+ applyTextureSet(kerbU, 'uPav', t, cfg.pathTexture && cfg.pathTexture.tileSize, 0.7);
131
+ };
132
+ if (state.pathTex)
133
+ state.pathTex.ready.then(ap);
134
+ ap();
135
+ };
136
+ const apply = (cfg) => {
137
+ applyConfig(u, cfg);
138
+ if (cfg.pathColor !== undefined)
139
+ pathU.uPavColor.value.set(cfg.pathColor);
140
+ if (cfg.kerbColor !== undefined)
141
+ kerbU.uPavColor.value.set(cfg.kerbColor);
142
+ if (cfg.lampPaint !== undefined)
143
+ fixU.uPaint.value.set(cfg.lampPaint);
144
+ if (cfg.lampColor !== undefined)
145
+ fixU.uLampColor.value.set(cfg.lampColor);
146
+ if (cfg.lampIntensity !== undefined)
147
+ fixU.uLampGlow.value = cfg.lampIntensity / 2.6;
148
+ setLamps(lamps, cfg.lampColor, cfg.lampIntensity, cfg.lampRadius); // bumps the lamp list only on a real change
149
+ };
150
+ rebuild(c);
151
+ setTextures(c);
152
+ apply(c);
153
+ const lastWorld = new THREE.Matrix4();
154
+ return {
155
+ object: group,
156
+ materials: [lawn, pathMat, kerbMat, fixture],
157
+ uniformSets: [u, pathU, kerbU, fixU],
158
+ apply,
159
+ rebuild(cfg) { rebuild(cfg); setTextures(cfg); apply(cfg); },
160
+ bounds() { const b = new THREE.Box3(); for (const m of meshes) {
161
+ if (!m.geometry.boundingBox)
162
+ m.geometry.computeBoundingBox();
163
+ b.union(m.geometry.boundingBox);
164
+ } return b; },
165
+ update() {
166
+ group.updateMatrixWorld();
167
+ if (!lastWorld.equals(group.matrixWorld)) {
168
+ lastWorld.copy(group.matrixWorld);
169
+ placeLamps(lamps, lampLocal, group.matrixWorld); // positions, reach and falloff follow the object's scale
170
+ if (lamps.length)
171
+ touchLamps();
172
+ }
173
+ },
174
+ dispose() { clear(); lawn.dispose(); pathMat.dispose(); kerbMat.dispose(); fixture.dispose(); },
175
+ };
176
+ }
@@ -0,0 +1,82 @@
1
+ import * as THREE from 'three';
2
+ export declare const LIGHTING: string[];
3
+ export declare const STRUCTURAL: string[];
4
+ export declare function createUniforms(): {
5
+ uSunDir: {
6
+ value: THREE.Vector3;
7
+ };
8
+ uSunColor: {
9
+ value: THREE.Color;
10
+ };
11
+ uSkyAmbient: {
12
+ value: THREE.Color;
13
+ };
14
+ uGroundAmbient: {
15
+ value: THREE.Color;
16
+ };
17
+ uNight: {
18
+ value: number;
19
+ };
20
+ } & {
21
+ uLamps: {
22
+ value: any[];
23
+ };
24
+ uLampColors: {
25
+ value: any[];
26
+ };
27
+ uLampAims: {
28
+ value: any[];
29
+ };
30
+ uLampCount: {
31
+ value: number;
32
+ };
33
+ uLampTop: {
34
+ value: number;
35
+ };
36
+ uLampField: {
37
+ value: any;
38
+ };
39
+ uLampFieldRect: {
40
+ value: THREE.Vector4;
41
+ };
42
+ uLampFieldOn: {
43
+ value: number;
44
+ };
45
+ } & {
46
+ uAsphaltColor: {
47
+ value: THREE.Color;
48
+ };
49
+ uMarkingColor: {
50
+ value: THREE.Color;
51
+ };
52
+ uSize: {
53
+ value: THREE.Vector2;
54
+ };
55
+ uBay: {
56
+ value: THREE.Vector2;
57
+ };
58
+ uAisle: {
59
+ value: number;
60
+ };
61
+ uWear: {
62
+ value: number;
63
+ };
64
+ uSeed: {
65
+ value: number;
66
+ };
67
+ };
68
+ export declare function applyConfig(u: any, c: any, tex?: any): void;
69
+ export declare const VERT = "\nattribute vec2 aUV;\nvarying vec3 vN; varying vec3 vP; varying vec2 vQ;\n#include <fog_pars_vertex>\nvoid main() {\n vec4 wp = modelMatrix * vec4(position, 1.0);\n vP = wp.xyz;\n vN = normalize(mat3(modelMatrix) * normal);\n vQ = aUV;\n vec4 mvPosition = viewMatrix * wp;\n gl_Position = projectionMatrix * mvPosition;\n #include <fog_vertex>\n}";
70
+ export declare const FRAG: string;
71
+ export declare function createMaterial(u: any): THREE.ShaderMaterial;
72
+ export declare function build(u: any, c: any): {
73
+ object: THREE.Group<THREE.Object3DEventMap>;
74
+ materials: THREE.ShaderMaterial[];
75
+ uniformSets: any[];
76
+ apply: (cfg: any) => void;
77
+ rebuild(cfg: any): void;
78
+ bounds(): THREE.Box3;
79
+ update(): void;
80
+ dispose(): void;
81
+ };
82
+ //# sourceMappingURL=parkingLot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parkingLot.d.ts","sourceRoot":"","sources":["../../../../src/components/urban/core/parkingLot.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,eAAO,MAAM,QAAQ,UAA2B,CAAC;AAEjD,eAAO,MAAM,UAAU,UAA+J,CAAC;AAGvL,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU7B;AAED,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,GAAG,MAAY,QAShD;AAED,eAAO,MAAM,IAAI,qXAYf,CAAC;AAEH,eAAO,MAAM,IAAI,QAkDf,CAAC;AAEH,wBAAgB,cAAc,CAAC,CAAC,KAAA,wBAE/B;AAKD,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;EAoIzB"}
@@ -0,0 +1,284 @@
1
+ // Emitted from Claude outputs/urban-lab/parkingLot.mjs by emit_object.mjs — edit the lab module and re-emit.
2
+ // =============================================================================
3
+ // urban/parkingLot — a surface car park: marked bays, aisles, tall lamps, parked cars
4
+ // =============================================================================
5
+ // Construction. ONE asphalt slab (width x depth, UVs in metres) whose fragment shader draws
6
+ // the bays: modules along z of two bay rows (bayDepth each) around an aisle, bay lines every
7
+ // bayWidth along x, a kerb line around, with the road family's wear and tone variation; a
8
+ // kerb ribbon around the slab in the paving material. Lamps (one tall fixture geometry,
9
+ // instanced) stand in the aisle centre lines every lampSpacing and register in the lamp
10
+ // list, so the asphalt and the cars light up at night with no real light. Cars are ONE
11
+ // InstancedMesh of a low-poly car (body + cabin + wheels, ~80 triangles) in the fixture
12
+ // material with per-instance paint (instanceColor) from a palette; `cars` is the occupancy.
13
+ // A low-poly car MODEL from the library is still the better hero car; these are the crowd.
14
+ import * as THREE from 'three';
15
+ import { mulberry32, createSunUniforms, createLampUniforms, createTextureUniforms, applyTextureSet, glslTextureBlock, GLSL_COMMON, GLSL_FOG_PARS, GLSL_FOG_VERT_PARS, GLSL_OUT, loadTextureSet, createPavingUniforms, createPavingMaterial, buildLampGeometry, createFixtureUniforms, createFixtureMaterial, registerLamp, unregisterLamp, touchLamps, setLamps, placeLamps, mergeGeometries, ribbon, SURFACE_DEPTH, buildCarGeometry, CAR_PALETTE, } from '../urbanCore.js';
16
+ export const LIGHTING = ['auto', 'day', 'night'];
17
+ export const STRUCTURAL = ['width', 'depth', 'bayWidth', 'bayDepth', 'aisle', 'texture', 'kerb', 'kerbHeight', 'kerbTexture', 'lampSpacing', 'lampHeight', 'cars', 'carScale', 'seed'];
18
+ // ---------------------------------------------------------------------------- asphalt material
19
+ export function createUniforms() {
20
+ return Object.assign(createSunUniforms(), createLampUniforms(), createTextureUniforms('uAsp'), {
21
+ uAsphaltColor: { value: new THREE.Color() },
22
+ uMarkingColor: { value: new THREE.Color() },
23
+ uSize: { value: new THREE.Vector2(60, 44) },
24
+ uBay: { value: new THREE.Vector2(2.5, 5) },
25
+ uAisle: { value: 6.5 },
26
+ uWear: { value: 0.5 },
27
+ uSeed: { value: 0 },
28
+ });
29
+ }
30
+ export function applyConfig(u, c, tex = undefined) {
31
+ if (c.asphaltColor !== undefined)
32
+ u.uAsphaltColor.value.set(c.asphaltColor);
33
+ if (c.markingColor !== undefined)
34
+ u.uMarkingColor.value.set(c.markingColor);
35
+ if (c.width !== undefined && c.depth !== undefined)
36
+ u.uSize.value.set(c.width, c.depth);
37
+ if (c.bayWidth !== undefined && c.bayDepth !== undefined)
38
+ u.uBay.value.set(c.bayWidth, c.bayDepth);
39
+ if (c.aisle !== undefined)
40
+ u.uAisle.value = c.aisle;
41
+ if (c.wear !== undefined)
42
+ u.uWear.value = c.wear;
43
+ if (c.seed !== undefined)
44
+ u.uSeed.value = c.seed;
45
+ if (tex !== undefined)
46
+ applyTextureSet(u, 'uAsp', tex, c.texture && c.texture.tileSize, 0.6);
47
+ }
48
+ export const VERT = /* glsl */ `
49
+ attribute vec2 aUV;
50
+ varying vec3 vN; varying vec3 vP; varying vec2 vQ;
51
+ ${GLSL_FOG_VERT_PARS}
52
+ void main() {
53
+ vec4 wp = modelMatrix * vec4(position, 1.0);
54
+ vP = wp.xyz;
55
+ vN = normalize(mat3(modelMatrix) * normal);
56
+ vQ = aUV;
57
+ vec4 mvPosition = viewMatrix * wp;
58
+ gl_Position = projectionMatrix * mvPosition;
59
+ #include <fog_vertex>
60
+ }`;
61
+ export const FRAG = /* glsl */ `
62
+ precision highp float;
63
+ ${GLSL_COMMON}
64
+ ${glslTextureBlock('uAsp')}
65
+ uniform vec3 uAsphaltColor; uniform vec3 uMarkingColor;
66
+ uniform vec2 uSize; uniform vec2 uBay; uniform float uAisle; uniform float uWear; uniform float uSeed;
67
+ varying vec3 vN; varying vec3 vP; varying vec2 vQ;
68
+ ${GLSL_FOG_PARS}
69
+
70
+ float lineAA(float x, float w) { return 1.0 - bandAA(abs(x), w * 0.5, 1e9); }
71
+
72
+ void main() {
73
+ vec3 N = normalize(vN);
74
+ vec3 V = normalize(cameraPosition - vP);
75
+ vec3 T = vec3(1.0, 0.0, 0.0), B = vec3(0.0, 0.0, 1.0);
76
+ float rough;
77
+ vec3 Nb = N;
78
+ vec3 mul = uAspSample(vQ, Nb, T, B, rough);
79
+ float x = vQ.x, z = vQ.y;
80
+ vec2 hs = uSize * 0.5;
81
+ // Modules along z: [bay row][aisle][bay row], starting at the -z edge after a 1 m margin.
82
+ float modH = uBay.y * 2.0 + uAisle;
83
+ float zz = z + hs.y - 1.0;
84
+ float mi = floor(zz / modH), mz = zz - mi * modH;
85
+ float nMods = floor((uSize.y - 2.0) / modH);
86
+ bool inMod = zz >= 0.0 && mi < nMods;
87
+ float lw = 0.12;
88
+ float mark = 0.0;
89
+ if (inMod) {
90
+ // In a bay row (not the aisle): bay lines every bayWidth, and the row's inner edge line.
91
+ float inRowA = step(mz, uBay.y), inRowB = step(uBay.y + uAisle, mz);
92
+ float inRow = max(inRowA, inRowB);
93
+ float xx = x + hs.x - 1.0;
94
+ float nBays = floor((uSize.x - 2.0) / uBay.x);
95
+ float bx = mod(xx, uBay.x);
96
+ float bayLine = max(lineAA(bx, lw), lineAA(bx - uBay.x, lw)) * step(0.0, xx) * step(xx, nBays * uBay.x);
97
+ float edgeLine = max(lineAA(mz - uBay.y, lw), lineAA(mz - uBay.y - uAisle, lw)) * step(0.0, xx) * step(xx, nBays * uBay.x);
98
+ mark = max(bayLine * inRow, edgeLine);
99
+ }
100
+ // Perimeter line 0.6 m in from the kerb.
101
+ mark = max(mark, max(lineAA(abs(x) - (hs.x - 0.6), lw), lineAA(abs(z) - (hs.y - 0.6), lw)));
102
+ float macro = 0.92 + 0.16 * vnoise21(vQ / 9.0 + uSeed);
103
+ vec3 albedo = uAsphaltColor * mul * macro;
104
+ rough = mix(rough, 0.95, 0.4);
105
+ float chip = hash21(floor(vec2(x * 2.0, z * 4.0)) + uSeed);
106
+ mark *= 1.0 - clamp(uWear * 0.5 * step(chip, 0.3 * uWear), 0.0, 0.85);
107
+ albedo = mix(albedo, uMarkingColor * mix(1.0, 0.75, chip * uWear), mark);
108
+ rough = mix(rough, 0.6, mark);
109
+ vec3 col = shadeSurface(albedo, Nb, vP, V, rough, 1.0);
110
+ ${GLSL_OUT}
111
+ }`;
112
+ export function createMaterial(u) {
113
+ return new THREE.ShaderMaterial({ uniforms: Object.assign(THREE.UniformsUtils.clone(THREE.UniformsLib.fog), u), vertexShader: VERT, fragmentShader: FRAG, fog: true, ...SURFACE_DEPTH });
114
+ }
115
+ // The car (buildCarGeometry, CAR_PALETTE) is the family's shared crowd car: common.mjs.
116
+ // ---------------------------------------------------------------------------- lab build
117
+ export function build(u, c) {
118
+ const group = new THREE.Group();
119
+ const asphalt = createMaterial(u);
120
+ const pavU = createPavingUniforms();
121
+ const paving = createPavingMaterial(pavU);
122
+ const fixU = createFixtureUniforms();
123
+ const fixture = createFixtureMaterial(fixU);
124
+ const carU = createFixtureUniforms();
125
+ const carMat = createFixtureMaterial(carU);
126
+ carU.uPaint.value.set('#ffffff');
127
+ carU.uAccent.value.set('#15171a');
128
+ carU.uRough.value = 0.35;
129
+ const meshes = [];
130
+ let lamps = [], lampLocal = [];
131
+ const state = { tex: null, kerbTex: null };
132
+ const clear = () => {
133
+ for (const m of meshes) {
134
+ group.remove(m);
135
+ m.geometry.dispose();
136
+ }
137
+ meshes.length = 0;
138
+ for (const L of lamps)
139
+ unregisterLamp(L);
140
+ lamps = [];
141
+ lampLocal = [];
142
+ };
143
+ const rebuild = (cfg) => {
144
+ clear();
145
+ const rng = mulberry32(cfg.seed * 331 + 7);
146
+ const W = cfg.width, D = cfg.depth, hw = W / 2, hd = D / 2;
147
+ // Slab with UVs in metres.
148
+ const g = new THREE.PlaneGeometry(W, D, 1, 1);
149
+ g.rotateX(-Math.PI / 2);
150
+ g.setAttribute('aUV', new THREE.BufferAttribute(new Float32Array([-hw, -hd, hw, -hd, -hw, hd, hw, hd]), 2));
151
+ const slab = new THREE.Mesh(g, asphalt);
152
+ slab.position.y = 0.02;
153
+ slab.frustumCulled = false;
154
+ group.add(slab);
155
+ meshes.push(slab);
156
+ // Kerb: a ribbon around the rectangle, in the paving material.
157
+ if (cfg.kerb) {
158
+ const kh = Math.max(0.02, cfg.kerbHeight);
159
+ const corners = [[-hw, -hd], [hw, -hd], [hw, hd], [-hw, hd], [-hw, -hd]];
160
+ const samples = corners.map(([x, z], i) => {
161
+ const q = corners[Math.min(i + 1, 4)], p0 = corners[Math.max(i - 1, 0)];
162
+ const t = new THREE.Vector3(q[0] - p0[0], 0, q[1] - p0[1]).normalize();
163
+ return { p: new THREE.Vector3(x, 0, z), t, n: new THREE.Vector3(t.z, 0, -t.x), s: i * 10 };
164
+ });
165
+ const parts = [ribbon(samples, 0, 0.4, kh, kh, false), ribbon(samples, 0, 0, kh, 0.0, true, -1), ribbon(samples, 0.4, 0.4, 0.0, kh, true, 1)];
166
+ const kerb = new THREE.Mesh(mergeGeometries(parts, [['aUV', 2]]), paving);
167
+ kerb.frustumCulled = false;
168
+ group.add(kerb);
169
+ meshes.push(kerb);
170
+ }
171
+ // Bay centres: modules along z, bays along x (the same layout the shader draws).
172
+ const modH = cfg.bayDepth * 2 + cfg.aisle;
173
+ const nMods = Math.floor((D - 2) / modH), nBays = Math.floor((W - 2) / cfg.bayWidth);
174
+ const bays = [], aisles = [];
175
+ for (let m = 0; m < nMods; m++) {
176
+ const z0 = -hd + 1 + m * modH;
177
+ aisles.push(z0 + cfg.bayDepth + cfg.aisle / 2);
178
+ for (let b = 0; b < nBays; b++) {
179
+ const x = -hw + 1 + (b + 0.5) * cfg.bayWidth;
180
+ bays.push({ x, z: z0 + cfg.bayDepth / 2, face: 1 }); // row A, nose toward -z
181
+ bays.push({ x, z: z0 + cfg.bayDepth + cfg.aisle + cfg.bayDepth / 2, face: -1 }); // row B
182
+ }
183
+ }
184
+ // Lamps along the aisle centre lines.
185
+ const where = [];
186
+ for (const za of aisles) {
187
+ const n = Math.max(1, Math.round((W - 4) / cfg.lampSpacing));
188
+ for (let i = 0; i < n; i++)
189
+ where.push({ x: -hw + 2 + (i + 0.5) * (W - 4) / n, z: za });
190
+ }
191
+ if (where.length) {
192
+ const geo = buildLampGeometry({ height: cfg.lampHeight, armReach: 0.9, headWidth: 1.2, headDepth: 0.5 });
193
+ const lm = new THREE.InstancedMesh(geo, fixture, where.length);
194
+ const m = new THREE.Matrix4(), q = new THREE.Quaternion(), p = new THREE.Vector3(), sc = new THREE.Vector3(1, 1, 1), up = new THREE.Vector3(0, 1, 0);
195
+ where.forEach((w, i) => {
196
+ p.set(w.x, 0, w.z);
197
+ q.setFromAxisAngle(up, Math.PI / 2);
198
+ m.compose(p, q, sc);
199
+ lm.setMatrixAt(i, m);
200
+ const head = geo.userData.head.clone().applyMatrix4(m);
201
+ lampLocal.push(head);
202
+ lamps.push(registerLamp({ id: 'lot-' + i, position: head.clone(), color: new THREE.Color(cfg.lampColor), radius: cfg.lampRadius, intensity: cfg.lampIntensity, on: true }));
203
+ });
204
+ lm.instanceMatrix.needsUpdate = true;
205
+ lm.frustumCulled = false;
206
+ group.add(lm);
207
+ meshes.push(lm);
208
+ }
209
+ // Cars: a share of the bays, palette paint, a little slop in the bay.
210
+ const occupied = bays.filter(() => rng() < cfg.cars);
211
+ if (occupied.length) {
212
+ const geo = buildCarGeometry();
213
+ const cm = new THREE.InstancedMesh(geo, carMat, occupied.length);
214
+ const m = new THREE.Matrix4(), q = new THREE.Quaternion(), p = new THREE.Vector3(), sc = new THREE.Vector3(), up = new THREE.Vector3(0, 1, 0), col = new THREE.Color();
215
+ occupied.forEach((b, i) => {
216
+ const s = cfg.carScale * (0.92 + rng() * 0.16);
217
+ p.set(b.x + (rng() - 0.5) * 0.3, 0, b.z + (rng() - 0.5) * 0.4);
218
+ q.setFromAxisAngle(up, b.face * Math.PI / 2 + (rng() - 0.5) * 0.08);
219
+ sc.set(s, s, s);
220
+ m.compose(p, q, sc);
221
+ cm.setMatrixAt(i, m);
222
+ col.set(CAR_PALETTE[Math.floor(rng() * CAR_PALETTE.length)]);
223
+ cm.setColorAt(i, col);
224
+ });
225
+ cm.instanceMatrix.needsUpdate = true;
226
+ cm.instanceColor.needsUpdate = true;
227
+ cm.frustumCulled = false;
228
+ cm.castShadow = true;
229
+ group.add(cm);
230
+ meshes.push(cm);
231
+ }
232
+ };
233
+ const setTextures = (cfg) => {
234
+ const maps = cfg.texture && cfg.texture.maps;
235
+ state.tex = maps && maps.color ? loadTextureSet(maps) : null;
236
+ if (state.tex)
237
+ state.tex.ready.then(() => applyConfig(u, cfg, state.tex));
238
+ applyConfig(u, cfg, state.tex && state.tex.color ? state.tex : null);
239
+ const km = cfg.kerbTexture && cfg.kerbTexture.maps;
240
+ state.kerbTex = km && km.color ? loadTextureSet(km) : null;
241
+ const ap = () => applyTextureSet(pavU, 'uPav', state.kerbTex && state.kerbTex.color ? state.kerbTex : null, cfg.kerbTexture && cfg.kerbTexture.tileSize, 0.7);
242
+ if (state.kerbTex)
243
+ state.kerbTex.ready.then(ap);
244
+ ap();
245
+ };
246
+ const apply = (cfg) => {
247
+ applyConfig(u, cfg, undefined);
248
+ if (cfg.kerbColor !== undefined)
249
+ pavU.uPavColor.value.set(cfg.kerbColor);
250
+ if (cfg.lampPaint !== undefined)
251
+ fixU.uPaint.value.set(cfg.lampPaint);
252
+ if (cfg.lampColor !== undefined)
253
+ fixU.uLampColor.value.set(cfg.lampColor);
254
+ if (cfg.lampIntensity !== undefined)
255
+ fixU.uLampGlow.value = cfg.lampIntensity / 2.6;
256
+ setLamps(lamps, cfg.lampColor, cfg.lampIntensity, cfg.lampRadius); // bumps the lamp list only on a real change
257
+ };
258
+ rebuild(c);
259
+ setTextures(c);
260
+ apply(c);
261
+ const lastWorld = new THREE.Matrix4();
262
+ return {
263
+ object: group,
264
+ materials: [asphalt, paving, fixture, carMat],
265
+ uniformSets: [u, pavU, fixU, carU],
266
+ apply,
267
+ rebuild(cfg) { rebuild(cfg); setTextures(cfg); apply(cfg); },
268
+ bounds() { const b = new THREE.Box3(); for (const m of meshes) {
269
+ if (!m.geometry.boundingBox)
270
+ m.geometry.computeBoundingBox();
271
+ b.union(m.geometry.boundingBox);
272
+ } return b; },
273
+ update() {
274
+ group.updateMatrixWorld();
275
+ if (!lastWorld.equals(group.matrixWorld)) {
276
+ lastWorld.copy(group.matrixWorld);
277
+ placeLamps(lamps, lampLocal, group.matrixWorld); // positions, reach and falloff follow the object's scale
278
+ if (lamps.length)
279
+ touchLamps();
280
+ }
281
+ },
282
+ dispose() { clear(); asphalt.dispose(); paving.dispose(); fixture.dispose(); carMat.dispose(); },
283
+ };
284
+ }
@@ -0,0 +1,24 @@
1
+ import * as THREE from 'three';
2
+ export declare const PATTERNS: string[];
3
+ export declare const LIGHTING: string[];
4
+ export declare const STRUCTURAL: string[];
5
+ export declare function createUniforms(): any;
6
+ export declare function applyConfig(u: any, c: any, tex?: any, bandTex?: any): void;
7
+ export declare const VERT = "\nattribute vec2 aUV;\nvarying vec3 vN; varying vec3 vP; varying vec2 vUVm;\n#include <fog_pars_vertex>\nvoid main() {\n vec4 wp = modelMatrix * vec4(position, 1.0);\n vP = wp.xyz;\n vN = normalize(mat3(modelMatrix) * normal);\n vUVm = aUV;\n vec4 mvPosition = viewMatrix * wp;\n gl_Position = projectionMatrix * mvPosition;\n #include <fog_vertex>\n}";
8
+ export declare const FRAG: string;
9
+ export declare function createMaterial(u: any): THREE.ShaderMaterial;
10
+ /** Signed area of an [x, z] polygon (positive = counter-clockwise seen from above, +y). */
11
+ export declare function signedArea(pts: any): number;
12
+ /** The slab: the sampled outline as a Shape, triangulated, UVs in metres, laid flat at height y. */
13
+ export declare function slabGeometry(samples: any, y: any): THREE.ShapeGeometry;
14
+ export declare function build(u: any, c: any): {
15
+ object: THREE.Group<THREE.Object3DEventMap>;
16
+ materials: THREE.ShaderMaterial[];
17
+ uniformSets: any[];
18
+ apply: (cfg: any) => void;
19
+ rebuild(cfg: any): void;
20
+ bounds(): THREE.Box3;
21
+ update(): void;
22
+ dispose(): void;
23
+ };
24
+ //# sourceMappingURL=plaza.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plaza.d.ts","sourceRoot":"","sources":["../../../../src/components/urban/core/plaza.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,eAAO,MAAM,QAAQ,UAAkD,CAAC;AACxE,eAAO,MAAM,QAAQ,UAA2B,CAAC;AAEjD,eAAO,MAAM,UAAU,UAA8E,CAAC;AAGtG,wBAAgB,cAAc,QAU7B;AAED,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,GAAG,MAAY,EAAE,OAAO,MAAY,QAUrE;AAED,eAAO,MAAM,IAAI,yXAYf,CAAC;AAEH,eAAO,MAAM,IAAI,QAiDf,CAAC;AAEH,wBAAgB,cAAc,CAAC,CAAC,KAAA,wBAE/B;AAGD,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,GAAG,KAAA,UAI7B;AAED,oGAAoG;AACpG,wBAAgB,YAAY,CAAC,OAAO,KAAA,EAAE,CAAC,KAAA,uBAqBtC;AAGD,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;EA8DzB"}