@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,103 @@
1
+ import * as THREE from 'three';
2
+ /** The items: natural colours [main, grip, accent] and the main material kind. */
3
+ export declare const ITEMS: {
4
+ tennisRacquet: {
5
+ colors: string[];
6
+ kind: string;
7
+ };
8
+ badmintonRacquet: {
9
+ colors: string[];
10
+ kind: string;
11
+ };
12
+ tableTennisPaddle: {
13
+ colors: string[];
14
+ kind: string;
15
+ };
16
+ baseballBat: {
17
+ colors: string[];
18
+ kind: string;
19
+ };
20
+ cricketBat: {
21
+ colors: string[];
22
+ kind: string;
23
+ };
24
+ golfDriver: {
25
+ colors: string[];
26
+ kind: string;
27
+ };
28
+ golfIron: {
29
+ colors: string[];
30
+ kind: string;
31
+ };
32
+ golfPutter: {
33
+ colors: string[];
34
+ kind: string;
35
+ };
36
+ hockeyStick: {
37
+ colors: string[];
38
+ kind: string;
39
+ };
40
+ skateboard: {
41
+ colors: string[];
42
+ kind: string;
43
+ };
44
+ dumbbell: {
45
+ colors: string[];
46
+ kind: string;
47
+ };
48
+ kettlebell: {
49
+ colors: string[];
50
+ kind: string;
51
+ };
52
+ barbell: {
53
+ colors: string[];
54
+ kind: string;
55
+ };
56
+ frisbee: {
57
+ colors: string[];
58
+ kind: string;
59
+ };
60
+ };
61
+ export declare const ITEM_LIST: string[];
62
+ export declare const MATERIALS: string[];
63
+ export declare function createUniforms(): {
64
+ uTime: {
65
+ value: number;
66
+ };
67
+ uColor: {
68
+ value: THREE.Color;
69
+ };
70
+ uSecondaryColor: {
71
+ value: THREE.Color;
72
+ };
73
+ uAccentColor: {
74
+ value: THREE.Color;
75
+ };
76
+ uWear: {
77
+ value: number;
78
+ };
79
+ uGloss: {
80
+ value: number;
81
+ };
82
+ uOpacity: {
83
+ value: number;
84
+ };
85
+ uSeed: {
86
+ value: number;
87
+ };
88
+ };
89
+ export declare function applyConfig(u: any, c: any, mats?: any): void;
90
+ export declare function build(u: any, c: any): {
91
+ object: THREE.Group<THREE.Object3DEventMap>;
92
+ materials: any[];
93
+ apply: (cfg: any) => void;
94
+ update: (dt: any) => void;
95
+ stats: {
96
+ parts: any;
97
+ verts: number;
98
+ };
99
+ dispose: () => void;
100
+ };
101
+ /** Knobs whose change rebuilds the object (dispose + build); every other knob is a live push through apply. */
102
+ export declare const STRUCTURAL: string[];
103
+ //# sourceMappingURL=equipment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equipment.d.ts","sourceRoot":"","sources":["../../../../src/components/sports/core/equipment.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,kFAAkF;AAClF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAejB,CAAC;AACF,eAAO,MAAM,SAAS,UAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,UAA0D,CAAC;AAEjF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC;AAEnE,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,IAAI,MAAY,QAIjD;AAwOD,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;;EAqBzB;AAED,+GAA+G;AAC/G,eAAO,MAAM,UAAU,UAAoD,CAAC"}
@@ -0,0 +1,403 @@
1
+ // Emitted from Claude outputs/sports-lab/equipment.mjs by gen_family.mjs — edit the lab module and re-emit.
2
+ // sports/core/equipment — Equipment (type 'sports', config.type 'equipment'). Shared core: ../sportsCore.
3
+ // Construction: one piece of sports equipment at real size, lying or standing on the ground the way it
4
+ // would be put down: lathe-turned bats, a racquet hoop as a tube along an ellipse with its string bed
5
+ // laid string by string, extruded blades, trucks and wheels, plates on a bar, a kettlebell's cast body
6
+ // and handle. Each part is one of the family's procedural materials (ash and willow grain along the
7
+ // part's own axis, brushed steel, carbon twill, rubber grip, pebbled leather, glossy plastic) with
8
+ // wear where hands and ground touch it. Size: real metres; the transform places it.
9
+ import * as THREE from 'three';
10
+ import { createCommonUniforms, applyCommonConfig, updateCommon, QUALITY_S, propMesh, partMaterial, mergeGeos, lathe, tube, bar, box, disposePair, setColor } from '../sportsCore.js';
11
+ /** The items: natural colours [main, grip, accent] and the main material kind. */
12
+ export const ITEMS = {
13
+ tennisRacquet: { colors: ['#1f2a44', '#1a1a1a', '#e8e6df'], kind: 'carbon' },
14
+ badmintonRacquet: { colors: ['#2a2a2e', '#d13b2a', '#f2f2f2'], kind: 'carbon' },
15
+ tableTennisPaddle: { colors: ['#c89a62', '#c89a62', '#c8262a'], kind: 'wood' },
16
+ baseballBat: { colors: ['#d9b98c', '#1a1a1a', '#5a3a22'], kind: 'wood' },
17
+ cricketBat: { colors: ['#e8d6b0', '#2a4fa0', '#f2f2f2'], kind: 'wood' },
18
+ golfDriver: { colors: ['#1a1a1a', '#202020', '#c9c9c9'], kind: 'carbon' },
19
+ golfIron: { colors: ['#c9c9c9', '#202020', '#c9c9c9'], kind: 'metal' },
20
+ golfPutter: { colors: ['#9a9a9a', '#202020', '#2a2a2a'], kind: 'metal' },
21
+ hockeyStick: { colors: ['#1c1c1c', '#f2f2f2', '#d13b2a'], kind: 'carbon' },
22
+ skateboard: { colors: ['#c89a62', '#1a1a1a', '#f0efe6'], kind: 'wood' },
23
+ dumbbell: { colors: ['#1c1c1c', '#c9c9c9', '#1c1c1c'], kind: 'rubber' },
24
+ kettlebell: { colors: ['#2a2a2a', '#2a2a2a', '#d13b2a'], kind: 'paint' },
25
+ barbell: { colors: ['#c9c9c9', '#1c1c1c', '#1d4f9c'], kind: 'metal' },
26
+ frisbee: { colors: ['#e8542a', '#e8542a', '#f2f2f2'], kind: 'plastic' },
27
+ };
28
+ export const ITEM_LIST = Object.keys(ITEMS);
29
+ export const MATERIALS = ['auto', 'wood', 'metal', 'carbon', 'plastic', 'paint'];
30
+ export function createUniforms() { return createCommonUniforms(); }
31
+ export function applyConfig(u, c, mats = undefined) {
32
+ applyCommonConfig(u, c, mats);
33
+ const I = ITEMS[c.item] || ITEMS.tennisRacquet;
34
+ if (c.naturalColors !== false) {
35
+ setColor(u.uColor, I.colors[0]);
36
+ setColor(u.uSecondaryColor, I.colors[1]);
37
+ setColor(u.uAccentColor, I.colors[2]);
38
+ }
39
+ }
40
+ // ---------------------------------------------------------------------------- builders (every part: geometry + material spec)
41
+ // material spec: { kind, slot (0 main, 1 grip, 2 accent, 3 own tint), tint, roughness, metalness, axis }
42
+ const M = {
43
+ main: (kind, axis = undefined, extra = undefined) => Object.assign({ kind, slot: 0, tint: '#ffffff', roughness: kind === 'wood' ? 0.6 : 0.35, metalness: kind === 'metal' ? 1 : 0, axis: axis || [1, 0, 0] }, extra),
44
+ grip: (extra = undefined) => Object.assign({ kind: 'rubber', slot: 1, tint: '#ffffff', roughness: 0.85, axis: [1, 0, 0] }, extra),
45
+ accent: (kind, extra = undefined) => Object.assign({ kind, slot: 2, tint: '#ffffff', roughness: 0.45, metalness: kind === 'metal' ? 1 : 0, axis: [1, 0, 0] }, extra),
46
+ own: (kind, tint, extra = undefined) => Object.assign({ kind, slot: 3, tint, roughness: 0.4, metalness: kind === 'metal' ? 1 : 0, axis: [1, 0, 0] }, extra),
47
+ };
48
+ const R = (q) => Math.round(12 + 12 * q);
49
+ /** An ellipse in the XZ plane (lying flat) as a closed tube; a = half-length along x, b = half-width along z. */
50
+ function hoop(a, b, r, q) {
51
+ const pts = [];
52
+ const n = Math.round(40 + 24 * q);
53
+ for (let i = 0; i < n; i++) {
54
+ const t = (i / n) * Math.PI * 2;
55
+ pts.push([a * Math.cos(t), 0, b * Math.sin(t)]);
56
+ }
57
+ return tube(pts, r, n * 2, 8 + Math.round(4 * q), true);
58
+ }
59
+ /** A string bed inside the ellipse (a, b): `mains` strings along x, `crosses` along z, thickness t. */
60
+ function stringBed(a, b, mains, crosses, t, y) {
61
+ const parts = [];
62
+ const inner = 0.985;
63
+ for (let i = 0; i < mains; i++) {
64
+ const z = -b * 0.9 + (i + 0.5) / mains * 2 * b * 0.9;
65
+ const hx = a * inner * Math.sqrt(Math.max(0, 1 - (z / (b * inner)) ** 2));
66
+ parts.push(box(hx * 2, t, t, [0, y, z]));
67
+ }
68
+ for (let i = 0; i < crosses; i++) {
69
+ const x = -a * 0.9 + (i + 0.5) / crosses * 2 * a * 0.9;
70
+ const hz = b * inner * Math.sqrt(Math.max(0, 1 - (x / (a * inner)) ** 2));
71
+ parts.push(box(t, t, hz * 2, [x, y, 0]));
72
+ }
73
+ return mergeGeos(parts);
74
+ }
75
+ /** An octagonal grip along x from x0 to x1. */
76
+ function gripOct(x0, x1, r) { const g = new THREE.CylinderGeometry(r, r, x1 - x0, 8, 1); g.rotateZ(-Math.PI / 2); g.rotateX(Math.PI / 8); g.translate((x0 + x1) / 2, 0, 0); return g; }
77
+ const BUILDERS = {
78
+ tennisRacquet(c, q) {
79
+ // head 0.34 × 0.26 (≈ 100 sq in), 16 × 19 strings, throat bridge, 0.2 m grip; lying flat
80
+ const a = 0.17, b = 0.13, y = 0.012;
81
+ const frame = [hoop(a, b, 0.011, q)];
82
+ frame.push(tube([[-a * 0.75, 0, b * 0.62], [-a - 0.06, 0, 0.012], [-a - 0.2, 0, 0.012]], 0.009, 12, 8));
83
+ frame.push(tube([[-a * 0.75, 0, -b * 0.62], [-a - 0.06, 0, -0.012], [-a - 0.2, 0, -0.012]], 0.009, 12, 8));
84
+ frame.push(box(0.03, 0.02, 0.05, [-a - 0.08, 0, 0]));
85
+ const fr = mergeGeos(frame);
86
+ fr.translate(0, y, 0);
87
+ const grip = gripOct(-a - 0.4, -a - 0.2, 0.016);
88
+ grip.translate(0, y, 0);
89
+ const cap = box(0.012, 0.034, 0.034, [-a - 0.405, y, 0]);
90
+ return [[fr, M.main(c.material === 'auto' ? 'carbon' : c.material, [1, 0, 0])], [grip, M.grip()], [cap, M.own('plastic', '#1a1a1a')], [stringBed(a, b, 16, 19, 0.0014, y), M.accent('plastic', { roughness: 0.5 })]];
91
+ },
92
+ badmintonRacquet(c, q) {
93
+ const a = 0.125, b = 0.095, y = 0.008;
94
+ const frame = [hoop(a, b, 0.0055, q), tube([[-a + 0.005, 0, 0], [-a - 0.05, 0, 0], [-a - 0.3, 0, 0]], 0.0045, 8, 8), box(0.07, 0.012, 0.03, [-a - 0.03, 0, 0])];
95
+ const fr = mergeGeos(frame);
96
+ fr.translate(0, y, 0);
97
+ const grip = gripOct(-a - 0.47, -a - 0.3, 0.012);
98
+ grip.translate(0, y, 0);
99
+ return [[fr, M.main(c.material === 'auto' ? 'carbon' : c.material)], [grip, M.grip()], [stringBed(a, b, 22, 22, 0.0007, y), M.accent('plastic', { roughness: 0.5 })]];
100
+ },
101
+ tableTennisPaddle(c, q) {
102
+ // blade 0.15 × 0.16, 6 mm, red rubber on top, black underneath, flared handle; lying flat
103
+ const blade = new THREE.CylinderGeometry(0.078, 0.078, 0.006, R(q) * 2);
104
+ blade.scale(1, 1, 1.07);
105
+ blade.translate(0.0, 0.0065, 0);
106
+ const top = new THREE.CylinderGeometry(0.075, 0.075, 0.0025, R(q) * 2);
107
+ top.scale(1, 1, 1.07);
108
+ top.translate(0, 0.0105, 0);
109
+ const bot = new THREE.CylinderGeometry(0.075, 0.075, 0.0025, R(q) * 2);
110
+ bot.scale(1, 1, 1.07);
111
+ bot.translate(0, 0.00225, 0);
112
+ const handle = lathe([[0.012, 0], [0.013, 0.03], [0.016, 0.1]], 10);
113
+ handle.rotateZ(Math.PI / 2);
114
+ handle.scale(1, 1, 0.75);
115
+ handle.translate(-0.075, 0.0065, 0);
116
+ return [[mergeGeos([blade, handle]), M.main('wood', [1, 0, 0], { roughness: 0.55 })], [top, M.accent('rubber', { roughness: 0.7 })], [bot, M.grip({ roughness: 0.7 })]];
117
+ },
118
+ baseballBat(c, q) {
119
+ // 0.84 m, knob 52 mm, handle 26 mm, barrel 66 mm; lying along x
120
+ const g = lathe([[0.0, 0], [0.026, 0], [0.026, 0.012], [0.015, 0.02], [0.013, 0.05], [0.013, 0.28], [0.016, 0.4], [0.024, 0.52], [0.031, 0.64], [0.033, 0.72], [0.033, 0.82], [0.028, 0.835], [0.0, 0.84]], R(q) * 2);
121
+ g.rotateZ(-Math.PI / 2);
122
+ g.translate(-0.42, 0.033, 0);
123
+ const tape = new THREE.CylinderGeometry(0.0145, 0.0145, 0.24, 12);
124
+ tape.rotateZ(-Math.PI / 2);
125
+ tape.translate(-0.42 + 0.17, 0.033, 0);
126
+ return [[g, M.main(c.material === 'auto' ? 'wood' : c.material, [1, 0, 0], { roughness: 0.5 })], [tape, M.grip({ kind: 'fabric' })]];
127
+ },
128
+ cricketBat(c, q) {
129
+ // blade 0.55 × 0.108 with a spine, shoulders, 0.3 m cane handle with a rubber grip; lying face up
130
+ const sh = new THREE.Shape();
131
+ sh.moveTo(-0.054, 0);
132
+ sh.lineTo(0.054, 0);
133
+ sh.lineTo(0.054, 0.012);
134
+ sh.lineTo(0.0, 0.042);
135
+ sh.lineTo(-0.054, 0.012);
136
+ sh.closePath();
137
+ const blade = new THREE.ExtrudeGeometry(sh, { depth: 0.55, bevelEnabled: true, bevelThickness: 0.004, bevelSize: 0.004, bevelSegments: 2 });
138
+ blade.rotateY(Math.PI / 2);
139
+ blade.translate(-0.275, 0.0, 0); // along x, face (flat side) down… turn it face up:
140
+ blade.rotateX(Math.PI);
141
+ blade.translate(0, 0.042, 0);
142
+ const shoulder = lathe([[0.0, 0], [0.03, 0], [0.02, 0.04], [0.017, 0.06]], 10);
143
+ shoulder.rotateZ(Math.PI / 2);
144
+ shoulder.translate(-0.275, 0.02, 0);
145
+ const handle = new THREE.CylinderGeometry(0.017, 0.017, 0.3, 10);
146
+ handle.rotateZ(Math.PI / 2);
147
+ handle.translate(-0.275 - 0.17, 0.02, 0);
148
+ return [[mergeGeos([blade, shoulder]), M.main('wood', [1, 0, 0], { roughness: 0.55 })], [handle, M.grip()]];
149
+ },
150
+ golfDriver(c, q) { return golfClub(c, q, 'driver'); },
151
+ golfIron(c, q) { return golfClub(c, q, 'iron'); },
152
+ golfPutter(c, q) { return golfClub(c, q, 'putter'); },
153
+ hockeyStick(c, q) {
154
+ // 1.5 m shaft, blade at 135° in the plane of the ground; lying on its side
155
+ const shaft = box(1.5, 0.03, 0.02, [-0.75, 0.015, 0]);
156
+ const bl = new THREE.BoxGeometry(0.33, 0.07, 0.012);
157
+ bl.rotateY(-0.9);
158
+ bl.translate(0.13, 0.035, 0.11);
159
+ const tape = box(0.25, 0.034, 0.024, [-1.37, 0.015, 0]);
160
+ const bladeTape = new THREE.BoxGeometry(0.2, 0.072, 0.015);
161
+ bladeTape.rotateY(-0.9);
162
+ bladeTape.translate(0.17, 0.035, 0.145);
163
+ return [[mergeGeos([shaft, bl]), M.main(c.material === 'auto' ? 'carbon' : c.material)], [tape, M.grip({ kind: 'fabric' })], [bladeTape, M.accent('fabric')]];
164
+ },
165
+ skateboard(c, q) {
166
+ // A popsicle street deck, 0.81 × 0.205 m (31.9" × 8"), 0.36 m (14") wheelbase, 7-ply 11 mm, on two
167
+ // trucks and four 54 mm wheels. The deck is a dense parametric surface over its outline, bent into
168
+ // 18° kicktails (a slope that eases in over a few cm) and a 4 mm concave across, so it reads as a
169
+ // pressed deck instead of three boxes.
170
+ const L = 0.81, W = 0.205, flat = 0.3, endR = (L / 2 - flat), T = 0.011, wb = 0.18;
171
+ const halfW = (x) => { const a = Math.abs(x) - flat; return a <= 0 ? W / 2 : (W / 2) * Math.sqrt(Math.max(0, 1 - (a / endR) ** 2)); };
172
+ const kick = (x) => { const a = Math.abs(x) - 0.235; return a <= 0 ? 0 : Math.tan(18 * Math.PI / 180) * (Math.sqrt(a * a + 0.03 * 0.03) - 0.03); };
173
+ const concave = (x, z) => 0.004 * (2 * z / W) ** 2 * (kick(x) > 0 ? 0.5 : 1);
174
+ const deckY = 0.077; // deck bottom: axle height 27 mm + 50 mm truck
175
+ const nu = Math.round(48 + 48 * q), nv = Math.round(8 + 6 * q);
176
+ // u in [-1, 1] along the length (denser at the ends where it bends), v in [-1, 1] across
177
+ const xu = (u) => Math.sign(u) * Math.pow(Math.abs(u), 0.85) * (L / 2 - 0.0005);
178
+ const P = (u, v, top, inset) => { const x = xu(u) * (1 - inset), z = v * halfW(x) * (1 - inset * 3); return [x, deckY + kick(x) + concave(x, z) + (top ? T : 0), z]; };
179
+ const surface = (top, inset, lift) => {
180
+ const pos = [], idx = [], uv = [];
181
+ for (let i = 0; i <= nu; i++)
182
+ for (let j = 0; j <= nv; j++) {
183
+ const p = P(-1 + 2 * i / nu, -1 + 2 * j / nv, top, inset);
184
+ pos.push(p[0], p[1] + lift, p[2]);
185
+ uv.push(p[0], p[2]);
186
+ }
187
+ for (let i = 0; i < nu; i++)
188
+ for (let j = 0; j < nv; j++) {
189
+ const k = i * (nv + 1) + j;
190
+ if (top)
191
+ idx.push(k, k + 1, k + nv + 1, k + 1, k + nv + 2, k + nv + 1);
192
+ else
193
+ idx.push(k, k + nv + 1, k + 1, k + 1, k + nv + 1, k + nv + 2);
194
+ }
195
+ const g = new THREE.BufferGeometry();
196
+ g.setAttribute('position', new THREE.Float32BufferAttribute(pos, 3));
197
+ g.setAttribute('uv', new THREE.Float32BufferAttribute(uv, 2));
198
+ g.setIndex(idx);
199
+ g.computeVertexNormals();
200
+ return g;
201
+ };
202
+ // the edge: a strip around the outline from the bottom surface to the top one
203
+ const rim = () => {
204
+ const loop = [];
205
+ for (let i = 0; i <= nu; i++)
206
+ loop.push([-1 + 2 * i / nu, 1]);
207
+ for (let i = nu; i >= 0; i--)
208
+ loop.push([-1 + 2 * i / nu, -1]);
209
+ const pos = [], idx = [], uv = [];
210
+ loop.forEach(([u, v], k) => { const a = P(u, v, false, 0), b = P(u, v, true, 0); pos.push(...a, ...b); uv.push(k * 0.01, 0, k * 0.01, T); });
211
+ for (let k = 0; k < loop.length - 1; k++) {
212
+ const i = 2 * k;
213
+ idx.push(i, i + 2, i + 1, i + 1, i + 2, i + 3);
214
+ }
215
+ const g = new THREE.BufferGeometry();
216
+ g.setAttribute('position', new THREE.Float32BufferAttribute(pos, 3));
217
+ g.setAttribute('uv', new THREE.Float32BufferAttribute(uv, 2));
218
+ g.setIndex(idx);
219
+ g.computeVertexNormals();
220
+ return g;
221
+ };
222
+ const wood = mergeGeos([surface(false, 0, 0), rim(), surface(true, 0, 0)]);
223
+ const grip = surface(true, 0.004, 0.0006);
224
+ // trucks: baseplate under the deck, kingpin, bushings, hanger, axle, nuts
225
+ const metal = [], bush = [], wheels = [], cores = [];
226
+ const axleY = 0.027, hw = 0.067, axleL = 0.104;
227
+ const wheel = lathe([[0.0115, -0.016], [0.021, -0.016], [0.025, -0.0152], [0.0268, -0.012], [0.027, -0.006], [0.027, 0.006], [0.0268, 0.012], [0.025, 0.0152], [0.021, 0.016], [0.0115, 0.016]], R(q) * 2);
228
+ wheel.rotateX(Math.PI / 2);
229
+ for (const sx of [-1, 1]) {
230
+ const x = sx * wb;
231
+ metal.push(box(0.062, 0.007, 0.066, [x, deckY - 0.0035, 0])); // baseplate
232
+ metal.push(box(0.03, 0.016, 0.032, [x - sx * 0.012, deckY - 0.014, 0])); // pivot cup block
233
+ metal.push(bar([x + sx * 0.008, deckY - 0.006, 0], [x + sx * 0.002, axleY + 0.012, 0], 0.0045, 10)); // kingpin
234
+ const b1 = new THREE.CylinderGeometry(0.0135, 0.0135, 0.011, R(q));
235
+ b1.translate(x + sx * 0.006, axleY + 0.03, 0);
236
+ bush.push(b1);
237
+ const b2 = new THREE.CylinderGeometry(0.0125, 0.0125, 0.009, R(q));
238
+ b2.translate(x + sx * 0.004, axleY + 0.013, 0);
239
+ bush.push(b2);
240
+ // hanger: a tapered arm across, thicker in the middle, meeting the pivot
241
+ metal.push(tube([[x, axleY + 0.002, -hw], [x, axleY + 0.006, -0.03], [x, axleY + 0.012, 0], [x, axleY + 0.006, 0.03], [x, axleY + 0.002, hw]], 0.0085, 24, 10));
242
+ metal.push(box(0.022, 0.024, 0.05, [x, axleY + 0.016, 0]));
243
+ metal.push(bar([x - sx * 0.012, axleY + 0.016, 0], [x - sx * 0.014, deckY - 0.016, 0], 0.005, 8)); // pivot
244
+ metal.push(bar([x, axleY, -axleL], [x, axleY, axleL], 0.004, 10)); // axle
245
+ for (const sz of [-1, 1]) {
246
+ const nut = new THREE.CylinderGeometry(0.006, 0.006, 0.006, 6);
247
+ nut.rotateX(Math.PI / 2);
248
+ nut.translate(x, axleY, sz * (axleL - 0.003));
249
+ metal.push(nut);
250
+ const w = wheel.clone();
251
+ w.translate(x, axleY, sz * (axleL - 0.022));
252
+ wheels.push(w);
253
+ const core = new THREE.CylinderGeometry(0.0112, 0.0112, 0.03, R(q));
254
+ core.rotateX(Math.PI / 2);
255
+ core.translate(x, axleY, sz * (axleL - 0.022));
256
+ cores.push(core);
257
+ }
258
+ }
259
+ wheel.dispose();
260
+ return [
261
+ [wood, M.main(c.material === 'auto' ? 'wood' : c.material, [1, 0, 0], { roughness: 0.5 })],
262
+ [grip, M.grip({ kind: 'fabric', roughness: 1 })],
263
+ [mergeGeos(metal), M.own('metal', '#b9bcc0', { roughness: 0.35, axis: [0, 0, 1] })],
264
+ [mergeGeos(bush), M.own('rubber', '#e2b51c', { roughness: 0.6 })],
265
+ [mergeGeos(wheels), M.accent('plastic', { roughness: 0.45 })],
266
+ [mergeGeos(cores), M.own('metal', '#3a3a3a', { roughness: 0.4 })],
267
+ ];
268
+ },
269
+ dumbbell(c, q) {
270
+ // hex heads, knurled handle; the size follows `plates`
271
+ const s = 0.6 + 0.2 * (c.plates ?? 2);
272
+ const hr = 0.045 * s, hl = 0.06 * s, hand = 0.13;
273
+ const heads = [];
274
+ for (const sx of [-1, 1]) {
275
+ const h = new THREE.CylinderGeometry(hr, hr, hl, 6);
276
+ h.rotateZ(Math.PI / 2);
277
+ h.rotateX(Math.PI / 6);
278
+ h.translate(sx * (hand / 2 + hl / 2), hr * 0.866, 0);
279
+ heads.push(h);
280
+ }
281
+ const handle = new THREE.CylinderGeometry(0.016, 0.016, hand + 0.01, R(q));
282
+ handle.rotateZ(Math.PI / 2);
283
+ handle.translate(0, hr * 0.866, 0);
284
+ return [[mergeGeos(heads), M.main('rubber', [1, 0, 0], { roughness: 0.8 })], [handle, M.accent('metal', { roughness: 0.4, slot: 1 })]];
285
+ },
286
+ kettlebell(c, q) {
287
+ const s = 0.75 + 0.15 * (c.plates ?? 2);
288
+ const r = 0.085 * s;
289
+ const body = new THREE.SphereGeometry(r, R(q) * 2, R(q));
290
+ body.scale(1, 0.92, 1);
291
+ body.translate(0, r * 0.88, 0);
292
+ const base = new THREE.CylinderGeometry(r * 0.55, r * 0.6, r * 0.12, R(q));
293
+ base.translate(0, r * 0.06, 0);
294
+ const pts = [];
295
+ const n = 24;
296
+ for (let i = 0; i <= n; i++) {
297
+ const t = (i / n) * Math.PI;
298
+ pts.push([-r * 0.72 * Math.cos(t), r * 1.45 + r * 0.55 * Math.sin(t) + (i === 0 || i === n ? -r * 0.35 : 0), 0]);
299
+ }
300
+ const handle = tube(pts, 0.017 * s, 32, 10);
301
+ return [[mergeGeos([body, base]), M.main('paint', [0, 1, 0], { roughness: 0.6 })], [handle, M.own('metal', '#8a8a8a', { roughness: 0.45, axis: [0, 1, 0] })]];
302
+ },
303
+ barbell(c, q) {
304
+ // 2.2 m bar on bumper plates (`plates` per side); lying on the plates
305
+ const n = Math.max(1, Math.round(c.plates ?? 2)), pr = 0.225, pw = 0.05;
306
+ const y = pr;
307
+ const barG = new THREE.CylinderGeometry(0.014, 0.014, 2.2, R(q));
308
+ barG.rotateZ(Math.PI / 2);
309
+ barG.translate(0, y, 0);
310
+ const sleeves = [], plates = [], hubs = [];
311
+ for (const sx of [-1, 1]) {
312
+ const sl = new THREE.CylinderGeometry(0.025, 0.025, 0.42, R(q));
313
+ sl.rotateZ(Math.PI / 2);
314
+ sl.translate(sx * 0.89, y, 0);
315
+ sleeves.push(sl);
316
+ const col = new THREE.CylinderGeometry(0.035, 0.035, 0.03, R(q));
317
+ col.rotateZ(Math.PI / 2);
318
+ col.translate(sx * 0.68, y, 0);
319
+ sleeves.push(col);
320
+ for (let i = 0; i < n; i++) {
321
+ const x = sx * (0.70 + pw / 2 + i * (pw + 0.004));
322
+ const p = new THREE.CylinderGeometry(pr, pr, pw, R(q) * 2);
323
+ p.rotateZ(Math.PI / 2);
324
+ p.translate(x, y, 0);
325
+ plates.push(p);
326
+ const hb = new THREE.CylinderGeometry(0.055, 0.055, pw + 0.004, R(q));
327
+ hb.rotateZ(Math.PI / 2);
328
+ hb.translate(x, y, 0);
329
+ hubs.push(hb);
330
+ }
331
+ }
332
+ return [[mergeGeos([barG, ...sleeves]), M.main('metal', [1, 0, 0], { roughness: 0.35 })], [mergeGeos(plates), M.accent('rubber', { roughness: 0.75 })], [mergeGeos(hubs), M.own('metal', '#9a9a9a', { roughness: 0.4 })]];
333
+ },
334
+ frisbee(c, q) {
335
+ const g = lathe([[0.0, 0.028], [0.06, 0.027], [0.11, 0.022], [0.132, 0.015], [0.137, 0.008], [0.136, 0.0], [0.13, 0.0], [0.128, 0.01], [0.12, 0.016], [0.08, 0.022], [0.0, 0.025]], R(q) * 3);
336
+ return [[g, M.main('plastic', [0, 1, 0], { roughness: 0.3 })]];
337
+ },
338
+ };
339
+ function golfClub(c, q, kind) {
340
+ // lying flat: shaft along x on the ground, head at +x, grip at -x
341
+ const len = kind === 'driver' ? 1.1 : kind === 'iron' ? 0.95 : 0.86;
342
+ const y = 0.008;
343
+ const shaft = new THREE.CylinderGeometry(0.005, 0.007, len, 10);
344
+ shaft.rotateZ(Math.PI / 2);
345
+ shaft.translate(0, y, 0);
346
+ const grip = new THREE.CylinderGeometry(0.011, 0.0125, 0.26, 12);
347
+ grip.rotateZ(Math.PI / 2);
348
+ grip.translate(-len / 2 + 0.13, y, 0);
349
+ const parts = [[shaft, M.own('metal', '#c9c9c9', { roughness: 0.35 })], [grip, M.grip()]];
350
+ if (kind === 'driver') {
351
+ const head = new THREE.SphereGeometry(1, R(q) * 2, R(q));
352
+ head.scale(0.055, 0.032, 0.062);
353
+ head.translate(len / 2 + 0.03, 0.032, 0.03);
354
+ const face = box(0.012, 0.05, 0.1, [len / 2 + 0.085, 0.032, 0.03], [0, 0, 0.17]);
355
+ parts.push([head, M.main(c.material === 'auto' ? 'carbon' : c.material, [1, 0, 0], { roughness: 0.25 })], [face, M.accent('metal', { roughness: 0.4 })]);
356
+ }
357
+ else if (kind === 'iron') {
358
+ const head = new THREE.BoxGeometry(0.03, 0.055, 0.095);
359
+ head.rotateX(0.35);
360
+ head.translate(len / 2 + 0.02, 0.028, 0.03);
361
+ const hosel = new THREE.CylinderGeometry(0.008, 0.009, 0.06, 10);
362
+ hosel.rotateZ(Math.PI / 2);
363
+ hosel.translate(len / 2 + 0.01, y, 0);
364
+ parts.push([mergeGeos([head, hosel]), M.main('metal', [0, 0, 1], { roughness: 0.3 })]);
365
+ }
366
+ else {
367
+ const head = new THREE.BoxGeometry(0.03, 0.028, 0.11);
368
+ head.translate(len / 2 + 0.02, 0.014, 0.04);
369
+ const hosel = new THREE.CylinderGeometry(0.008, 0.009, 0.06, 10);
370
+ hosel.rotateZ(Math.PI / 2);
371
+ hosel.translate(len / 2 + 0.01, y, 0);
372
+ parts.push([mergeGeos([head, hosel]), M.main('metal', [0, 0, 1], { roughness: 0.4 })], [box(0.004, 0.02, 0.1, [len / 2 + 0.037, 0.014, 0.04]), M.accent('rubber', { roughness: 0.8 })]);
373
+ }
374
+ return parts;
375
+ }
376
+ export function build(u, c) {
377
+ const q = QUALITY_S[c.quality] || 1;
378
+ const item = BUILDERS[c.item] ? c.item : 'tennisRacquet';
379
+ const parts = BUILDERS[item](c, q);
380
+ const object = new THREE.Group();
381
+ object.name = item;
382
+ const geos = [], pairs = [];
383
+ for (const [geo, spec] of parts) {
384
+ const pair = partMaterial(u, spec);
385
+ geos.push(geo);
386
+ pairs.push(pair);
387
+ object.add(propMesh(geo, pair, spec.kind));
388
+ }
389
+ const mats = pairs.map((p) => p.material);
390
+ applyConfig(u, c, mats);
391
+ let verts = 0;
392
+ for (const g of geos)
393
+ verts += g.attributes.position.count;
394
+ return {
395
+ object, materials: mats,
396
+ apply: function (cfg) { applyConfig(u, cfg, mats); },
397
+ update: function (dt) { updateCommon(u, dt); },
398
+ stats: { parts: parts.length, verts },
399
+ dispose: function () { geos.forEach((g) => g.dispose()); pairs.forEach(disposePair); },
400
+ };
401
+ }
402
+ /** Knobs whose change rebuilds the object (dispose + build); every other knob is a live push through apply. */
403
+ export const STRUCTURAL = ['item', 'material', 'plates', 'quality', 'seed'];
@@ -0,0 +1,98 @@
1
+ import * as THREE from 'three';
2
+ /** Natural colours and mesh sizes: the shared table (a court's fixtures read the same one). */
3
+ export declare const GOALS: {
4
+ footballGoal: {
5
+ colors: string[];
6
+ mesh: number;
7
+ };
8
+ futsalGoal: {
9
+ colors: string[];
10
+ mesh: number;
11
+ };
12
+ handballGoal: {
13
+ colors: string[];
14
+ mesh: number;
15
+ };
16
+ hockeyNet: {
17
+ colors: string[];
18
+ mesh: number;
19
+ };
20
+ basketballHoop: {
21
+ colors: string[];
22
+ mesh: number;
23
+ };
24
+ volleyballNet: {
25
+ colors: string[];
26
+ mesh: number;
27
+ };
28
+ tennisNet: {
29
+ colors: string[];
30
+ mesh: number;
31
+ };
32
+ badmintonNet: {
33
+ colors: string[];
34
+ mesh: number;
35
+ };
36
+ pickleballNet: {
37
+ colors: string[];
38
+ mesh: number;
39
+ };
40
+ padelNet: {
41
+ colors: string[];
42
+ mesh: number;
43
+ };
44
+ tableTennisNet: {
45
+ colors: string[];
46
+ mesh: number;
47
+ };
48
+ rugbyPosts: {
49
+ colors: string[];
50
+ mesh: number;
51
+ };
52
+ americanUprights: {
53
+ colors: string[];
54
+ mesh: number;
55
+ };
56
+ };
57
+ export declare const GOAL_LIST: string[];
58
+ export declare function createUniforms(): {
59
+ uTime: {
60
+ value: number;
61
+ };
62
+ uColor: {
63
+ value: THREE.Color;
64
+ };
65
+ uSecondaryColor: {
66
+ value: THREE.Color;
67
+ };
68
+ uAccentColor: {
69
+ value: THREE.Color;
70
+ };
71
+ uWear: {
72
+ value: number;
73
+ };
74
+ uGloss: {
75
+ value: number;
76
+ };
77
+ uOpacity: {
78
+ value: number;
79
+ };
80
+ uSeed: {
81
+ value: number;
82
+ };
83
+ };
84
+ export declare function applyConfig(u: any, c: any, inst?: any): void;
85
+ export declare function build(u: any, c: any): {
86
+ object: THREE.Group<THREE.Object3DEventMap>;
87
+ materials: any[];
88
+ apply: (cfg: any) => void;
89
+ update: (dt: any) => void;
90
+ stats: {
91
+ nets: number;
92
+ parts: number;
93
+ };
94
+ dispose: () => void;
95
+ };
96
+ /** Knobs whose change rebuilds the object (dispose + build); every other knob is a live push through apply. */
97
+ export declare const STRUCTURAL: string[];
98
+ //# sourceMappingURL=goal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goal.d.ts","sourceRoot":"","sources":["../../../../src/components/sports/core/goal.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,+FAA+F;AAC/F,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAc,CAAC;AACjC,eAAO,MAAM,SAAS,UAAa,CAAC;AAEpC,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC;AAEnE,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,IAAI,MAAY,QAKjD;AAED,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;;EAezB;AAED,+GAA+G;AAC/G,eAAO,MAAM,UAAU,UAAqD,CAAC"}
@@ -0,0 +1,44 @@
1
+ // Emitted from Claude outputs/sports-lab/goal.mjs by gen_family.mjs — edit the lab module and re-emit.
2
+ // sports/core/goal — Goal (type 'sports', config.type 'goal'). Shared core: ../sportsCore (buildGoal: the same builders a court's fixtures use).
3
+ // Construction: a goal, net or hoop at regulation size standing on the ground at its goal line, facing
4
+ // +z: round posts and crossbar, back frame, net panels (back, sides, roof) drawn as anti-aliased knotted
5
+ // mesh on sagging panels (a catenary bow set by netTension — a uniform, so it animates), a basketball
6
+ // backboard with its rim, pad and cone net, nets on posts with their tape bands, rugby / American
7
+ // uprights with pads. Size: real metres; the transform places it.
8
+ import * as THREE from 'three';
9
+ import { createCommonUniforms, applyCommonConfig, updateCommon, QUALITY_S, buildGoal, GOAL_KINDS, GOAL_COLORS, setColor } from '../sportsCore.js';
10
+ /** Natural colours and mesh sizes: the shared table (a court's fixtures read the same one). */
11
+ export const GOALS = GOAL_COLORS;
12
+ export const GOAL_LIST = GOAL_KINDS;
13
+ export function createUniforms() { return createCommonUniforms(); }
14
+ export function applyConfig(u, c, inst = undefined) {
15
+ applyCommonConfig(u, c, inst && inst.mats);
16
+ const G = GOALS[c.kind] || GOALS.footballGoal;
17
+ if (c.naturalColors !== false) {
18
+ setColor(u.uColor, G.colors[0]);
19
+ setColor(u.uSecondaryColor, G.colors[1]);
20
+ setColor(u.uAccentColor, G.colors[2]);
21
+ }
22
+ if (inst)
23
+ inst.goal.apply(c);
24
+ }
25
+ export function build(u, c) {
26
+ const q = QUALITY_S[c.quality] || 1;
27
+ const kind = GOALS[c.kind] ? c.kind : 'footballGoal';
28
+ const G = GOALS[kind];
29
+ const goal = buildGoal(kind, u, { quality: q, net: c.showNet !== false, mesh: G.mesh * (c.meshSize ?? 1), sag: 1 - (c.netTension ?? 0.6) });
30
+ const object = new THREE.Group();
31
+ object.name = kind;
32
+ object.add(goal.object);
33
+ const inst = { goal, mats: goal.mats.map((p) => p.material) };
34
+ applyConfig(u, c, inst);
35
+ return {
36
+ object, materials: inst.mats,
37
+ apply: function (cfg) { applyConfig(u, cfg, inst); },
38
+ update: function (dt) { updateCommon(u, dt); },
39
+ stats: { nets: goal.nets.length, parts: goal.mats.length },
40
+ dispose: function () { goal.dispose(); },
41
+ };
42
+ }
43
+ /** Knobs whose change rebuilds the object (dispose + build); every other knob is a live push through apply. */
44
+ export const STRUCTURAL = ['kind', 'showNet', 'meshSize', 'quality', 'seed'];
@@ -0,0 +1,11 @@
1
+ export { useSportsInstance } from './useSportsInstance';
2
+ export type { SportsInstance, SportsVariantProps, SportsCore } from './useSportsInstance';
3
+ export type { SportsCourtProps } from './SportsCourt';
4
+ export { default as SportsCourt } from './SportsCourt';
5
+ export type { SportsBallProps } from './SportsBall';
6
+ export { default as SportsBall } from './SportsBall';
7
+ export type { SportsEquipmentProps } from './SportsEquipment';
8
+ export { default as SportsEquipment } from './SportsEquipment';
9
+ export type { SportsGoalProps } from './SportsGoal';
10
+ export { default as SportsGoal } from './SportsGoal';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sports/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1F,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}