@3driseai/3drise-viewer 0.1.42 → 0.1.44

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 +6 -4
@@ -0,0 +1,119 @@
1
+ import * as THREE from 'three';
2
+ import { applyConfig as applyBuilding } from './building';
3
+ export declare const PLOTS: string[];
4
+ export declare const STREETS: string[];
5
+ export declare const STRUCTURAL: string[];
6
+ /** Width of a block street with its pavements (the corridor it needs). */
7
+ export declare function blockStreetWidth(c: any): number;
8
+ /**
9
+ * The block's buildings as an instance list, its XZ extent, and where its streets run: laneX is
10
+ * the x of a street running along z (between the centre columns), laneZ the z of one along x.
11
+ * The gap at a street widens just enough for it (1 m clear each side); every building keeps the
12
+ * size and seed-drawn look it has without streets.
13
+ */
14
+ export declare function blockInstances(c: any): {
15
+ list: any[];
16
+ ext: {
17
+ w: number;
18
+ d: number;
19
+ };
20
+ laneX: number;
21
+ laneZ: number;
22
+ streetWidth: number;
23
+ };
24
+ export declare function createUniforms(): {
25
+ uSunDir: {
26
+ value: THREE.Vector3;
27
+ };
28
+ uSunColor: {
29
+ value: THREE.Color;
30
+ };
31
+ uSkyAmbient: {
32
+ value: THREE.Color;
33
+ };
34
+ uGroundAmbient: {
35
+ value: THREE.Color;
36
+ };
37
+ uNight: {
38
+ value: number;
39
+ };
40
+ } & {
41
+ uLamps: {
42
+ value: any[];
43
+ };
44
+ uLampColors: {
45
+ value: any[];
46
+ };
47
+ uLampAims: {
48
+ value: any[];
49
+ };
50
+ uLampCount: {
51
+ value: number;
52
+ };
53
+ uLampTop: {
54
+ value: number;
55
+ };
56
+ uLampField: {
57
+ value: any;
58
+ };
59
+ uLampFieldRect: {
60
+ value: THREE.Vector4;
61
+ };
62
+ uLampFieldOn: {
63
+ value: number;
64
+ };
65
+ } & {
66
+ uWallColor: {
67
+ value: THREE.Color;
68
+ };
69
+ uGlassColor: {
70
+ value: THREE.Color;
71
+ };
72
+ uGlassReflect: {
73
+ value: number;
74
+ };
75
+ uMullionColor: {
76
+ value: THREE.Color;
77
+ };
78
+ uRoofColor: {
79
+ value: THREE.Color;
80
+ };
81
+ uMullionWidth: {
82
+ value: number;
83
+ };
84
+ uLobby: {
85
+ value: number;
86
+ };
87
+ uLightColor: {
88
+ value: THREE.Color;
89
+ };
90
+ uCoolLightColor: {
91
+ value: THREE.Color;
92
+ };
93
+ uLightWarmth: {
94
+ value: number;
95
+ };
96
+ uWindowGlow: {
97
+ value: number;
98
+ };
99
+ uFlicker: {
100
+ value: number;
101
+ };
102
+ uTime: {
103
+ value: number;
104
+ };
105
+ };
106
+ export { applyBuilding as applyConfig };
107
+ export declare function build(u: any, c: any): {
108
+ object: THREE.Group<THREE.Object3DEventMap>;
109
+ readonly materials: THREE.ShaderMaterial[];
110
+ readonly uniformSets: any[];
111
+ /** Facades and plot gather the nearest lamps (their own streets' too); the merged streets use the baked field. */
112
+ lampTargets(): any[];
113
+ apply: (cfg: any) => void;
114
+ rebuild(cfg: any): void;
115
+ bounds(): any;
116
+ update(dt: any, camera: any): void;
117
+ dispose(): void;
118
+ };
119
+ //# sourceMappingURL=block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../src/components/urban/core/block.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAsI,WAAW,IAAI,aAAa,EAAoC,MAAM,YAAY,CAAC;AAEhO,eAAO,MAAM,KAAK,UAA4B,CAAC;AAC/C,eAAO,MAAM,OAAO,UAAwC,CAAC;AAE7D,eAAO,MAAM,UAAU,UACoH,CAAC;AAE5I,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,CAAC,KAAA,UAEjC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,KAAA;;;;;;;;;EAuC/B;AAiCD,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiC;AAC/D,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,CAAC;AAExC,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;IAiGlB,kHAAkH;;;;;;;EAkBzH"}
@@ -0,0 +1,266 @@
1
+ // Emitted from Claude outputs/urban-lab/block.mjs by emit_object.mjs — edit the lab module and re-emit.
2
+ // =============================================================================
3
+ // urban/block — a grid of buildings with jittered sizes, heights and facades, on a plot
4
+ // =============================================================================
5
+ // A layout preset over `building`: columns x rows cells of (width + gap) x (depth + gap);
6
+ // in each cell a building whose footprint, floors (floorsMin..floorsMax), facade kind,
7
+ // wall tint and roof are drawn from the block's seed, `facadeMix` deciding how much they
8
+ // may differ from the block's own building knobs. Every building's volumes go into ONE
9
+ // InstancedMesh with the facade material (building.mjs) — a block of 20 buildings is one
10
+ // draw call — and a plot (paving or lawn) sits under them, lit by the lamp list.
11
+ //
12
+ // Streets: the block can run its own small streets through the middle — between the two centre
13
+ // columns, the two centre rows, or both (a cross with a junction). They are the real road and
14
+ // junction cores at a smaller size (lanes, markings, kerbs, pavements, lamps), merged by
15
+ // material like a street grid and lit by a baked lamp field; the middle gap widens to fit them
16
+ // and the plot leaves their corridor out. Their lamps also light the plot and the facades.
17
+ import * as THREE from 'three';
18
+ import { mulberry32, createPavingUniforms, createPavingMaterial, applyTextureSet, loadTextureSet, mergeByMaterial, createLampField } from '../urbanCore.js';
19
+ import * as ROAD from './road.js';
20
+ import * as JUNCTION from './junction.js';
21
+ import { FOOTPRINTS, FACADES, ROOFS, pickMix, addBuilding, buildInstancedBoxes, disposeInstanced, createUniforms as buildingUniforms, applyConfig as applyBuilding, createMaterial as facadeMaterial } from './building.js';
22
+ export const PLOTS = ['paved', 'lawn', 'none'];
23
+ export const STREETS = ['none', 'cross', 'alongX', 'alongZ']; // alongX: a street running along x (between the centre rows)
24
+ export const STRUCTURAL = ['mix', 'footprint', 'width', 'depth', 'floorHeight', 'lobby', 'roof', 'seed', 'texture', 'columns', 'rows', 'gap', 'sizeJitter', 'floorsMin', 'floorsMax', 'facadeMix', 'plot', 'plotMargin', 'plotTexture', 'facade', 'windowRatio', 'bayWidth', 'windowLights',
25
+ 'streets', 'streetLanes', 'streetLaneWidth', 'streetSidewalk', 'streetTexture', 'streetLamps', 'streetLampSpacing', 'streetLampHeight'];
26
+ /** Width of a block street with its pavements (the corridor it needs). */
27
+ export function blockStreetWidth(c) {
28
+ return Math.max(1, Math.round(c.streetLanes ?? 2)) * (c.streetLaneWidth ?? 3) + 2 * Math.max(0, c.streetSidewalk ?? 2);
29
+ }
30
+ /**
31
+ * The block's buildings as an instance list, its XZ extent, and where its streets run: laneX is
32
+ * the x of a street running along z (between the centre columns), laneZ the z of one along x.
33
+ * The gap at a street widens just enough for it (1 m clear each side); every building keeps the
34
+ * size and seed-drawn look it has without streets.
35
+ */
36
+ export function blockInstances(c) {
37
+ const rng = mulberry32(c.seed * 7919 + 3);
38
+ const list = [];
39
+ const cols = Math.max(1, Math.round(c.columns)), rows = Math.max(1, Math.round(c.rows));
40
+ const cellW = c.width + c.gap, cellD = c.depth + c.gap;
41
+ const streets = c.streets || 'none', sw = blockStreetWidth(c);
42
+ const wantX = (streets === 'cross' || streets === 'alongZ') && cols >= 2, wantZ = (streets === 'cross' || streets === 'alongX') && rows >= 2;
43
+ const kx = Math.floor(cols / 2), kz = Math.floor(rows / 2);
44
+ const ex = wantX ? Math.max(0, sw + 2 - c.gap) : 0, ez = wantZ ? Math.max(0, sw + 2 - c.gap) : 0;
45
+ const x0 = -((cols - 1) * cellW + ex) / 2, z0 = -((rows - 1) * cellD + ez) / 2;
46
+ const colX = (col) => x0 + col * cellW + (wantX && col >= kx ? ex : 0);
47
+ const rowZ = (r) => z0 + r * cellD + (wantZ && r >= kz ? ez : 0);
48
+ const base = new THREE.Color(c.wallColor);
49
+ const hsl = { h: 0, s: 0, l: 0 };
50
+ base.getHSL(hsl);
51
+ const tmp = new THREE.Color();
52
+ for (let r = 0; r < rows; r++)
53
+ for (let col = 0; col < cols; col++) {
54
+ const j = c.sizeJitter;
55
+ const w = c.width * (1 - j * rng() * 0.9), d = c.depth * (1 - j * rng() * 0.9);
56
+ const mix = c.facadeMix;
57
+ const floorsOwn = Math.round(c.floorsMin + (c.floorsMax - c.floorsMin) * Math.pow(rng(), 1.4));
58
+ // A city mix picks footprint, facade, roof, floors and lobby per building; 'custom' varies the block's own knobs.
59
+ const pick = pickMix(rng, c.mix);
60
+ const footprint = pick ? pick.footprint : (rng() < mix * 0.6 ? FOOTPRINTS[Math.floor(rng() * FOOTPRINTS.length)] : c.footprint);
61
+ const facade = pick ? pick.facade : (rng() < mix * 0.8 ? FACADES[Math.floor(rng() * FACADES.length)] : c.facade);
62
+ const roof = pick ? pick.roof : (rng() < mix * 0.5 ? ROOFS[Math.floor(rng() * ROOFS.length)] : c.roof);
63
+ const windowRatio = Math.min(0.95, Math.max(0.15, c.windowRatio + (rng() - 0.5) * 0.3 * mix));
64
+ const lights = Math.min(1, Math.max(0, c.windowLights + (rng() - 0.5) * 0.4 * mix));
65
+ // Tint: a hue nudge and a lightness spread around the wall colour, as a per-channel multiplier.
66
+ tmp.setHSL((hsl.h + (rng() - 0.5) * 0.08 * mix + 1) % 1, Math.min(1, hsl.s * (1 + (rng() - 0.5) * 0.6 * mix)), Math.min(0.95, Math.max(0.08, hsl.l * (1 + (rng() - 0.5) * 0.7 * mix))));
67
+ const tint = [tmp.r / Math.max(base.r, 0.02), tmp.g / Math.max(base.g, 0.02), tmp.b / Math.max(base.b, 0.02)].map((v) => Math.min(2.2, Math.max(0.35, v)));
68
+ const floors = pick ? pick.floors : floorsOwn;
69
+ const b = Object.assign({}, c, { width: w, depth: d, floors, footprint, facade, roof, windowRatio, windowLights: lights, lobby: pick ? pick.lobby : c.lobby });
70
+ // Within the cell, slide the building off-centre a little so the rows do not read as a ruler.
71
+ const ox = (rng() - 0.5) * (cellW - w - 2) * 0.5 * j, oz = (rng() - 0.5) * (cellD - d - 2) * 0.5 * j;
72
+ addBuilding(list, b, colX(col) + ox, rowZ(r) + oz, 0, tint, Math.floor(rng() * 1e6));
73
+ }
74
+ const ext = { w: cols * cellW + ex + 2 * c.plotMargin, d: rows * cellD + ez + 2 * c.plotMargin };
75
+ const laneX = wantX ? (colX(kx - 1) + colX(kx)) / 2 : null, laneZ = wantZ ? (rowZ(kz - 1) + rowZ(kz)) / 2 : null;
76
+ return { list, ext, laneX, laneZ, streetWidth: sw };
77
+ }
78
+ /** Rectangles [x0, z0, x1, z1] covering the plot minus the street corridors. */
79
+ function plotPieces(ext, laneX, laneZ, sw) {
80
+ const xs = laneX === null ? [[-ext.w / 2, ext.w / 2]] : [[-ext.w / 2, laneX - sw / 2], [laneX + sw / 2, ext.w / 2]];
81
+ const zs = laneZ === null ? [[-ext.d / 2, ext.d / 2]] : [[-ext.d / 2, laneZ - sw / 2], [laneZ + sw / 2, ext.d / 2]];
82
+ const out = [];
83
+ for (const [a, b] of xs)
84
+ for (const [c, d] of zs)
85
+ if (b - a > 0.1 && d - c > 0.1)
86
+ out.push([a, c, b, d]);
87
+ return out;
88
+ }
89
+ // The road / junction knobs of a block street (every knob the cores read; the repo cores have no defaults table).
90
+ function streetRoadCfg(c, points) {
91
+ return {
92
+ type: 'road', enabled: true, points, curve: 0, lanes: Math.max(1, Math.round(c.streetLanes)), laneWidth: c.streetLaneWidth,
93
+ markings: 'dashed', laneLines: true, edgeLines: true, crosswalks: false, lampSide: 'alternate',
94
+ markingColor: c.streetMarkingColor, asphaltColor: c.streetAsphaltColor, wear: 0.4, texture: c.streetTexture,
95
+ sidewalk: c.streetSidewalk, kerbHeight: 0.15, sidewalkColor: c.plotColor || '#9d9892', sidewalkTexture: c.plotTexture,
96
+ lampSpacing: c.streetLamps ? c.streetLampSpacing : 0, lampHeight: c.streetLampHeight, lampPaint: '#2b2f33', lampColor: c.streetLampColor, lampRadius: c.streetLampRadius, lampIntensity: c.streetLampIntensity,
97
+ lighting: c.lighting, seed: c.seed,
98
+ };
99
+ }
100
+ function streetJunctionCfg(c) {
101
+ return {
102
+ type: 'junction', enabled: true, shape: 'cross', islandRadius: 10, signalHeight: 4.5, lanes: Math.max(1, Math.round(c.streetLanes)), laneWidth: c.streetLaneWidth, armLength: 6, cornerRadius: 3, crossings: true,
103
+ markingColor: c.streetMarkingColor, asphaltColor: c.streetAsphaltColor, wear: 0.4, texture: c.streetTexture,
104
+ sidewalk: c.streetSidewalk > 0.05, kerbHeight: 0.15, sidewalkColor: c.plotColor || '#9d9892', sidewalkTexture: c.plotTexture,
105
+ signals: false, signalCycle: 14, signalPaint: '#2b2f33',
106
+ lamps: c.streetLamps, lampHeight: c.streetLampHeight, lampPaint: '#2b2f33', lampColor: c.streetLampColor, lampRadius: c.streetLampRadius, lampIntensity: c.streetLampIntensity,
107
+ lighting: c.lighting, seed: c.seed,
108
+ };
109
+ }
110
+ export function createUniforms() { return buildingUniforms(); }
111
+ export { applyBuilding as applyConfig };
112
+ export function build(u, c) {
113
+ const group = new THREE.Group();
114
+ const mat = facadeMaterial(u);
115
+ const pavU = createPavingUniforms();
116
+ const paving = createPavingMaterial(pavU);
117
+ let mesh = null, plot = null;
118
+ const state = { tex: null, plotTex: null, ext: { w: 1, d: 1 } };
119
+ // The streets: road / junction instances (their objects stay in the group, empty, so their
120
+ // lamps follow the block's transform), drawn as merged meshes lit by one lamp field.
121
+ const uR = ROAD.createUniforms(), uJ = JUNCTION.createUniforms();
122
+ const field = createLampField();
123
+ let kids = [], merged = [];
124
+ const clearStreets = () => {
125
+ for (const m of merged) {
126
+ group.remove(m);
127
+ m.geometry.dispose();
128
+ }
129
+ merged = [];
130
+ for (const k of kids) {
131
+ group.remove(k.object);
132
+ k.dispose();
133
+ }
134
+ kids = [];
135
+ };
136
+ const rebuild = (cfg) => {
137
+ if (mesh) {
138
+ group.remove(mesh);
139
+ disposeInstanced(mesh);
140
+ mesh = null;
141
+ }
142
+ if (plot) {
143
+ group.remove(plot);
144
+ plot.geometry.dispose();
145
+ plot = null;
146
+ }
147
+ clearStreets();
148
+ const { list, ext, laneX, laneZ, streetWidth } = blockInstances(cfg);
149
+ state.ext = ext;
150
+ mesh = buildInstancedBoxes(list, mat);
151
+ group.add(mesh);
152
+ if (cfg.plot !== 'none') {
153
+ // The plot leaves the street corridors out (the streets' own pavements cover them; no overlap to flicker).
154
+ const pos = [], uv = [], idx = [];
155
+ for (const [x0, z0, x1, z1] of plotPieces(ext, laneX, laneZ, streetWidth)) {
156
+ const o = pos.length / 3;
157
+ pos.push(x0, 0, z0, x1, 0, z0, x0, 0, z1, x1, 0, z1);
158
+ uv.push(x0, z0, x1, z0, x0, z1, x1, z1);
159
+ idx.push(o, o + 2, o + 1, o + 1, o + 2, o + 3);
160
+ }
161
+ const g = new THREE.BufferGeometry();
162
+ g.setAttribute('position', new THREE.Float32BufferAttribute(pos, 3));
163
+ g.setAttribute('normal', new THREE.Float32BufferAttribute(pos.map((_, i) => (i % 3 === 1 ? 1 : 0)), 3));
164
+ g.setAttribute('aUV', new THREE.Float32BufferAttribute(uv, 2));
165
+ g.setIndex(idx);
166
+ plot = new THREE.Mesh(g, paving);
167
+ plot.position.y = 0.01;
168
+ group.add(plot);
169
+ }
170
+ pavU.uGrassMix.value = cfg.plot === 'lawn' ? 1 : 0;
171
+ // Streets from plot edge to plot edge; a junction where two cross.
172
+ if (laneX !== null || laneZ !== null) {
173
+ const halfW = ext.w / 2, halfD = ext.d / 2;
174
+ const jc = streetJunctionCfg(cfg), reach = JUNCTION.junctionReach(jc);
175
+ const roads = [];
176
+ if (laneX !== null && laneZ !== null) {
177
+ const j = JUNCTION.build(uJ, jc);
178
+ j.object.position.set(laneX, 0, laneZ);
179
+ group.add(j.object);
180
+ kids.push(j);
181
+ roads.push([[laneX, -halfD], [laneX, laneZ - reach]], [[laneX, laneZ + reach], [laneX, halfD]]);
182
+ roads.push([[-halfW, laneZ], [laneX - reach, laneZ]], [[laneX + reach, laneZ], [halfW, laneZ]]);
183
+ }
184
+ else if (laneX !== null)
185
+ roads.push([[laneX, -halfD], [laneX, halfD]]);
186
+ else
187
+ roads.push([[-halfW, laneZ], [halfW, laneZ]]);
188
+ for (const pts of roads) {
189
+ const len = Math.hypot(pts[1][0] - pts[0][0], pts[1][1] - pts[0][1]);
190
+ if (len < 2)
191
+ continue;
192
+ const r = ROAD.build(uR, streetRoadCfg(cfg, pts));
193
+ group.add(r.object);
194
+ kids.push(r);
195
+ }
196
+ merged = mergeByMaterial(group, kids.map((k) => k.object), field);
197
+ }
198
+ };
199
+ const setTextures = (cfg) => {
200
+ const maps = cfg.texture && cfg.texture.maps;
201
+ state.tex = maps && maps.color ? loadTextureSet(maps) : null;
202
+ if (state.tex)
203
+ state.tex.ready.then(() => applyBuilding(u, cfg, state.tex));
204
+ applyBuilding(u, cfg, state.tex && state.tex.color ? state.tex : null);
205
+ const pm = cfg.plotTexture && cfg.plotTexture.maps;
206
+ state.plotTex = pm && pm.color ? loadTextureSet(pm) : null;
207
+ const ap = () => applyTextureSet(pavU, 'uPav', state.plotTex && state.plotTex.color ? state.plotTex : null, cfg.plotTexture && cfg.plotTexture.tileSize, 0.7);
208
+ if (state.plotTex)
209
+ state.plotTex.ready.then(ap);
210
+ ap();
211
+ };
212
+ // A lawn plot keeps its own green: the plot colour knob is the paving's.
213
+ const apply = (cfg) => {
214
+ applyBuilding(u, cfg, undefined);
215
+ if (cfg.plotColor !== undefined || cfg.plot !== undefined)
216
+ pavU.uPavColor.value.set(cfg.plot === 'lawn' ? '#4f7a2e' : (cfg.plotColor || '#9d9892'));
217
+ // The streets' live knobs, handed on to every road / junction piece.
218
+ const live = Object.create(null);
219
+ if (cfg.streetAsphaltColor !== undefined)
220
+ live.asphaltColor = cfg.streetAsphaltColor;
221
+ if (cfg.streetMarkingColor !== undefined)
222
+ live.markingColor = cfg.streetMarkingColor;
223
+ if (cfg.plotColor !== undefined)
224
+ live.sidewalkColor = cfg.plotColor;
225
+ if (cfg.streetLampColor !== undefined)
226
+ live.lampColor = cfg.streetLampColor;
227
+ if (cfg.streetLampRadius !== undefined)
228
+ live.lampRadius = cfg.streetLampRadius;
229
+ if (cfg.streetLampIntensity !== undefined)
230
+ live.lampIntensity = cfg.streetLampIntensity;
231
+ for (const k of kids)
232
+ k.apply(live);
233
+ };
234
+ rebuild(c);
235
+ setTextures(c);
236
+ apply(c);
237
+ return {
238
+ object: group,
239
+ get materials() { const out = [mat, paving]; for (const k of kids)
240
+ out.push(...(k.materials || [])); return out; },
241
+ get uniformSets() { const out = [u, pavU, uR, uJ]; for (const k of kids)
242
+ for (const s of k.uniformSets || [])
243
+ if (!out.includes(s))
244
+ out.push(s); return out; },
245
+ /** Facades and plot gather the nearest lamps (their own streets' too); the merged streets use the baked field. */
246
+ lampTargets() {
247
+ const all = this.bounds();
248
+ const plotB = new THREE.Box3(new THREE.Vector3(-state.ext.w / 2, 0, -state.ext.d / 2), new THREE.Vector3(state.ext.w / 2, 0.2, state.ext.d / 2));
249
+ const out = [];
250
+ out.push({ u, bounds: mesh ? mesh.userData.bounds.clone() : all }, { u: pavU, bounds: plotB });
251
+ if (merged.length)
252
+ out.push({ field, bounds: plotB });
253
+ return out;
254
+ },
255
+ apply,
256
+ rebuild(cfg) { rebuild(cfg); setTextures(cfg); apply(cfg); },
257
+ bounds() {
258
+ const b = mesh ? mesh.userData.bounds.clone() : new THREE.Box3();
259
+ return b.union(new THREE.Box3(new THREE.Vector3(-state.ext.w / 2, 0, -state.ext.d / 2), new THREE.Vector3(state.ext.w / 2, 0.2, state.ext.d / 2)));
260
+ },
261
+ update(dt, camera) { u.uTime.value += dt; for (const k of kids)
262
+ k.update(dt, camera); },
263
+ dispose() { clearStreets(); field.texture.dispose(); disposeInstanced(mesh); if (plot)
264
+ plot.geometry.dispose(); mat.dispose(); paving.dispose(); },
265
+ };
266
+ }
@@ -0,0 +1,128 @@
1
+ import * as THREE from 'three';
2
+ export declare const FOOTPRINTS: string[];
3
+ export declare const FACADES: string[];
4
+ export declare const ROOFS: string[];
5
+ export declare const LIGHTING: string[];
6
+ export declare const MIXES: string[];
7
+ /** One building's picks from a mix (null for 'custom'): { footprint, facade, roof, floors, lobby }. */
8
+ export declare function pickMix(rng: any, mix: any): {
9
+ footprint: string;
10
+ facade: string;
11
+ roof: string;
12
+ floors: number;
13
+ lobby: any;
14
+ };
15
+ /** Structural knobs: the instance list is rebuilt when one changes. */
16
+ export declare const STRUCTURAL: string[];
17
+ export declare const STYLE_FACADE = 0, STYLE_SOLID = 1, STYLE_UPPER = 2, STYLE_ROOF = 3, STYLE_CROWN = 4, ROUND = 10;
18
+ export declare const MARK_NONE = 0, MARK_HELIPAD = 1, MARK_LAWN = 2;
19
+ /** Push the instances of one building described by `c` (building knobs) at (x, z) turned ry, into `list`. */
20
+ export declare function addBuilding(list: any, c: any, x: any, z: any, ry?: number, tint?: number[], seed?: any): any;
21
+ /** Turn an instance list into InstancedMeshes (one per unit geometry) with the facade attributes.
22
+ * The volume's metres go into the instance matrix SCALE (so raycasts, bounds and the
23
+ * selection gizmo see the real volumes); the shader reads the size back from the matrix.
24
+ * Returns the box mesh; the other geometries are its children. userData.bounds is the union;
25
+ * dispose with disposeInstanced(mesh). */
26
+ export declare function buildInstancedBoxes(list: any, material: any): THREE.InstancedMesh<any, any, THREE.InstancedMeshEventMap>;
27
+ /** Free every geometry of a buildInstancedBoxes result (the material is shared; dispose it separately). */
28
+ export declare function disposeInstanced(mesh: any): void;
29
+ export declare function createUniforms(): {
30
+ uSunDir: {
31
+ value: THREE.Vector3;
32
+ };
33
+ uSunColor: {
34
+ value: THREE.Color;
35
+ };
36
+ uSkyAmbient: {
37
+ value: THREE.Color;
38
+ };
39
+ uGroundAmbient: {
40
+ value: THREE.Color;
41
+ };
42
+ uNight: {
43
+ value: number;
44
+ };
45
+ } & {
46
+ uLamps: {
47
+ value: any[];
48
+ };
49
+ uLampColors: {
50
+ value: any[];
51
+ };
52
+ uLampAims: {
53
+ value: any[];
54
+ };
55
+ uLampCount: {
56
+ value: number;
57
+ };
58
+ uLampTop: {
59
+ value: number;
60
+ };
61
+ uLampField: {
62
+ value: any;
63
+ };
64
+ uLampFieldRect: {
65
+ value: THREE.Vector4;
66
+ };
67
+ uLampFieldOn: {
68
+ value: number;
69
+ };
70
+ } & {
71
+ uWallColor: {
72
+ value: THREE.Color;
73
+ };
74
+ uGlassColor: {
75
+ value: THREE.Color;
76
+ };
77
+ uGlassReflect: {
78
+ value: number;
79
+ };
80
+ uMullionColor: {
81
+ value: THREE.Color;
82
+ };
83
+ uRoofColor: {
84
+ value: THREE.Color;
85
+ };
86
+ uMullionWidth: {
87
+ value: number;
88
+ };
89
+ uLobby: {
90
+ value: number;
91
+ };
92
+ uLightColor: {
93
+ value: THREE.Color;
94
+ };
95
+ uCoolLightColor: {
96
+ value: THREE.Color;
97
+ };
98
+ uLightWarmth: {
99
+ value: number;
100
+ };
101
+ uWindowGlow: {
102
+ value: number;
103
+ };
104
+ uFlicker: {
105
+ value: number;
106
+ };
107
+ uTime: {
108
+ value: number;
109
+ };
110
+ };
111
+ /** Per-frame knobs. `tex` = the loaded texture set (or null). */
112
+ export declare function applyConfig(u: any, c: any, tex?: any): void;
113
+ export declare const VERT = "\nattribute vec4 aParams;\nattribute vec4 aFacade;\nattribute vec3 aTint;\nvarying vec3 vLocal; // metres inside the volume (x,z centred, y from the base)\nvarying vec3 vLocalN; // face normal in the volume's own frame\nvarying vec3 vSize;\nvarying vec4 vParams;\nvarying vec4 vFacade;\nvarying vec3 vTint;\nvarying vec3 vP; // world position\nvarying vec3 vN; // world normal\n#include <fog_pars_vertex>\nvoid main() {\n // The volume's size is the instance matrix scale (metres); the cube is unit.\n vec3 size = vec3(length(instanceMatrix[0].xyz), length(instanceMatrix[1].xyz), length(instanceMatrix[2].xyz));\n vLocal = position * size;\n vLocalN = normal;\n vSize = size; vParams = aParams; vFacade = aFacade; vTint = aTint;\n mat4 m = modelMatrix * instanceMatrix;\n vec4 wp = m * vec4(position, 1.0);\n vP = wp.xyz;\n vN = normalize(mat3(m) * normal);\n vec4 mvPosition = viewMatrix * wp;\n gl_Position = projectionMatrix * mvPosition;\n #include <fog_vertex>\n}";
114
+ export declare const FRAG: string;
115
+ export declare function createMaterial(u: any): THREE.ShaderMaterial;
116
+ /** Lab entry: build(u, c) -> { object, mesh, apply, rebuild, update, dispose }. */
117
+ export declare function build(u: any, c: any): {
118
+ object: THREE.Group<THREE.Object3DEventMap>;
119
+ readonly mesh: any;
120
+ materials: THREE.ShaderMaterial[];
121
+ uniformSets: any[];
122
+ apply(cfg: any): void;
123
+ rebuild(cfg: any): void;
124
+ bounds(): any;
125
+ update(dt: any): void;
126
+ dispose(): void;
127
+ };
128
+ //# sourceMappingURL=building.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"building.d.ts","sourceRoot":"","sources":["../../../../src/components/urban/core/building.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,eAAO,MAAM,UAAU,UAAuG,CAAC;AAC/H,eAAO,MAAM,OAAO,UAAyG,CAAC;AAC9H,eAAO,MAAM,KAAK,UAA8F,CAAC;AACjH,eAAO,MAAM,QAAQ,UAA2B,CAAC;AAKjD,eAAO,MAAM,KAAK,UAA2E,CAAC;AAc9F,uGAAuG;AACvG,wBAAgB,OAAO,CAAC,GAAG,KAAA,EAAE,GAAG,KAAA;;;;;;EAK/B;AAED,uEAAuE;AACvE,eAAO,MAAM,UAAU,UAAoJ,CAAC;AAQ5K,eAAO,MAAM,YAAY,IAAI,EAAE,WAAW,IAAI,EAAE,WAAW,IAAI,EAAE,UAAU,IAAI,EAAE,WAAW,IAAI,EAAE,KAAK,KAAK,CAAC;AAC7G,eAAO,MAAM,SAAS,IAAI,EAAE,YAAY,IAAI,EAAE,SAAS,IAAI,CAAC;AAI5D,6GAA6G;AAC7G,wBAAgB,WAAW,CAAC,IAAI,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,EAAE,SAAI,EAAE,IAAI,WAAY,EAAE,IAAI,MAAY,OA+JpF;AAgFD;;;;2CAI2C;AAC3C,wBAAgB,mBAAmB,CAAC,IAAI,KAAA,EAAE,QAAQ,KAAA,8DAcjD;AACD,2GAA2G;AAC3G,wBAAgB,gBAAgB,CAAC,IAAI,KAAA,QAIpC;AAGD,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB7B;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,GAAG,MAAY,QAehD;AAED,eAAO,MAAM,IAAI,ygCA0Bf,CAAC;AAEH,eAAO,MAAM,IAAI,QA2Pf,CAAC;AAEH,wBAAgB,cAAc,CAAC,CAAC,KAAA,wBAE/B;AAGD,mFAAmF;AACnF,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;;EAgCzB"}