roamwright 0.4.0 → 0.54.0

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 (549) hide show
  1. package/.prettierrc.yaml +12 -0
  2. package/CONTRIBUTING.md +21 -14
  3. package/README.md +38 -42
  4. package/examples/animals.html +49 -0
  5. package/examples/animals.js +209 -0
  6. package/examples/crowds.html +50 -0
  7. package/examples/crowds.js +268 -0
  8. package/examples/effects.html +53 -0
  9. package/examples/effects.js +343 -0
  10. package/examples/figure-motion.html +55 -0
  11. package/examples/figure-motion.js +265 -0
  12. package/examples/figure.html +49 -0
  13. package/examples/figure.js +238 -0
  14. package/examples/fliers.html +53 -0
  15. package/examples/fliers.js +292 -0
  16. package/examples/fortification.html +54 -0
  17. package/examples/fortification.js +288 -0
  18. package/examples/house-kit.html +48 -0
  19. package/examples/house-kit.js +175 -0
  20. package/examples/index.html +26 -16
  21. package/examples/island.html +48 -0
  22. package/examples/island.js +134 -52
  23. package/examples/land.html +54 -0
  24. package/examples/land.js +392 -0
  25. package/examples/props-and-plants.html +53 -0
  26. package/examples/props-and-plants.js +275 -0
  27. package/examples/rooms.html +48 -0
  28. package/examples/rooms.js +242 -0
  29. package/examples/ships.html +51 -0
  30. package/examples/ships.js +235 -0
  31. package/examples/showcase.css +320 -0
  32. package/examples/small-world-land.js +151 -0
  33. package/examples/small-world-life.js +160 -0
  34. package/examples/small-world-town.js +127 -0
  35. package/examples/small-world.html +57 -0
  36. package/examples/small-world.js +226 -0
  37. package/examples/soundscape.html +138 -0
  38. package/examples/soundscape.js +467 -0
  39. package/examples/stage-kits.js +300 -0
  40. package/examples/stage.js +374 -0
  41. package/examples/towns.html +50 -0
  42. package/examples/towns.js +325 -0
  43. package/examples/viaduct-camera.js +8 -4
  44. package/examples/viaduct-landscape.js +28 -17
  45. package/examples/viaduct.html +45 -43
  46. package/examples/viaduct.js +68 -92
  47. package/geometry/animal-camel-body.js +410 -0
  48. package/geometry/animal-camel-head.js +118 -0
  49. package/geometry/animal-canine-body.js +361 -0
  50. package/geometry/animal-canine-breeds.js +316 -0
  51. package/geometry/animal-canine-head.js +337 -0
  52. package/geometry/animal-cattle-body.js +391 -0
  53. package/geometry/animal-cattle-coat.js +42 -0
  54. package/geometry/animal-cattle-head.js +152 -0
  55. package/geometry/animal-hen.js +248 -0
  56. package/geometry/animal-horse-body.js +446 -0
  57. package/geometry/animal-horse-bridle.js +171 -0
  58. package/geometry/animal-horse-coat.js +68 -0
  59. package/geometry/animal-horse-face.js +162 -0
  60. package/geometry/animal-horse-hair.js +304 -0
  61. package/geometry/animal-horse-head.js +133 -0
  62. package/geometry/animal-horse-tack.js +157 -0
  63. package/geometry/animal-options.js +59 -0
  64. package/geometry/animal-shapes.js +21 -0
  65. package/geometry/animal-skin.js +390 -0
  66. package/geometry/bedding.js +141 -0
  67. package/geometry/builder-cells.js +50 -0
  68. package/geometry/builder-frame.js +48 -0
  69. package/geometry/builder.js +200 -177
  70. package/geometry/card-emblem.js +437 -0
  71. package/geometry/catenary-canvas.js +396 -0
  72. package/geometry/cell-mask.js +25 -0
  73. package/geometry/cloth-folds.js +143 -0
  74. package/geometry/crawl-shapes.js +71 -0
  75. package/geometry/creased-sheet.js +40 -35
  76. package/geometry/crowd-dress.js +315 -0
  77. package/geometry/crowd-far.js +174 -0
  78. package/geometry/crowd-look.js +42 -0
  79. package/geometry/crowd-weld.js +218 -0
  80. package/geometry/ear.js +44 -39
  81. package/geometry/erosion.js +71 -45
  82. package/geometry/face-grid.js +85 -65
  83. package/geometry/field-map.js +59 -0
  84. package/geometry/figure-arms.js +339 -0
  85. package/geometry/figure-beard.js +250 -0
  86. package/geometry/figure-body.js +297 -0
  87. package/geometry/figure-bow.js +105 -0
  88. package/geometry/figure-cloak.js +189 -0
  89. package/geometry/figure-clothes.js +337 -0
  90. package/geometry/figure-face-grids.js +75 -0
  91. package/geometry/figure-gear.js +446 -0
  92. package/geometry/figure-hair-far.js +151 -0
  93. package/geometry/figure-hair-hangs.js +108 -0
  94. package/geometry/figure-hair-patch.js +66 -0
  95. package/geometry/figure-hair.js +320 -0
  96. package/geometry/figure-hands.js +321 -0
  97. package/geometry/figure-head-features.js +280 -0
  98. package/geometry/figure-head.js +375 -0
  99. package/geometry/figure-headwear.js +223 -0
  100. package/geometry/figure-legs.js +231 -0
  101. package/geometry/figure-limbs.js +39 -0
  102. package/geometry/figure-sculpt.js +82 -0
  103. package/geometry/figure-skin.js +97 -0
  104. package/geometry/figure-skirts.js +303 -0
  105. package/geometry/figure-trunk.js +411 -0
  106. package/geometry/flier-corvid-body.js +322 -0
  107. package/geometry/flier-corvid-wings.js +154 -0
  108. package/geometry/flier-long-body.js +195 -0
  109. package/geometry/flier-shapes.js +219 -0
  110. package/geometry/flier-soaring-bird.js +84 -0
  111. package/geometry/foliage.js +187 -14
  112. package/geometry/fort-city-walls.js +479 -0
  113. package/geometry/fort-gate-approach.js +233 -0
  114. package/geometry/fort-great-walls.js +280 -0
  115. package/geometry/fort-keep.js +297 -0
  116. package/geometry/fort-parts.js +261 -0
  117. package/geometry/fort-polyline.js +261 -0
  118. package/geometry/fort-portal.js +96 -0
  119. package/geometry/fort-ring-wall.js +267 -0
  120. package/geometry/fort-seawall.js +104 -0
  121. package/geometry/fort-terrace-gates.js +323 -0
  122. package/geometry/fort-terrace-plan.js +250 -0
  123. package/geometry/fort-terrace-wall.js +345 -0
  124. package/geometry/garment-tags.js +11 -3
  125. package/geometry/grid-gather.js +69 -0
  126. package/geometry/grid-sample.js +185 -0
  127. package/geometry/hair-gathers.js +57 -42
  128. package/geometry/hair-locks.js +42 -42
  129. package/geometry/hair-patch.js +24 -20
  130. package/geometry/hair-shell.js +43 -31
  131. package/geometry/head-presets.js +103 -0
  132. package/geometry/head-profile.js +26 -15
  133. package/geometry/head-shape.js +123 -95
  134. package/geometry/heightfield.js +50 -24
  135. package/geometry/horizon-angles.js +166 -0
  136. package/geometry/house-kit-body.js +195 -0
  137. package/geometry/house-kit-courtyard-parts.js +340 -0
  138. package/geometry/house-kit-courtyard-roof.js +223 -0
  139. package/geometry/house-kit-courtyard.js +409 -0
  140. package/geometry/house-kit-cut.js +29 -0
  141. package/geometry/house-kit-extras.js +192 -0
  142. package/geometry/house-kit-forms.js +298 -0
  143. package/geometry/house-kit-frame.js +74 -0
  144. package/geometry/house-kit-marks.js +93 -0
  145. package/geometry/house-kit-openings.js +193 -0
  146. package/geometry/house-kit-palette.js +54 -0
  147. package/geometry/house-kit-pool.js +71 -0
  148. package/geometry/house-kit-roofs.js +151 -0
  149. package/geometry/house-kit.js +202 -0
  150. package/geometry/index-parts.js +2 -2
  151. package/geometry/instance-visibility.js +12 -12
  152. package/geometry/instances.js +17 -17
  153. package/geometry/lamp-wash.js +65 -0
  154. package/geometry/land-clearings.js +83 -0
  155. package/geometry/land-ditches.js +290 -0
  156. package/geometry/land-dry-basin.js +327 -0
  157. package/geometry/land-dunes.js +150 -0
  158. package/geometry/land-earthworks.js +432 -0
  159. package/geometry/land-edge.js +292 -0
  160. package/geometry/land-mound-faces.js +349 -0
  161. package/geometry/land-near-relief.js +102 -0
  162. package/geometry/land-sheet.js +220 -0
  163. package/geometry/land-town-ground.js +256 -0
  164. package/geometry/land-waters.js +228 -0
  165. package/geometry/land-wildness.js +123 -0
  166. package/geometry/lathed-vessel.js +293 -0
  167. package/geometry/outline-grid.js +11 -10
  168. package/geometry/outline-segments.js +74 -0
  169. package/geometry/part-ranges.js +38 -3
  170. package/geometry/path-field.js +98 -34
  171. package/geometry/placement.js +52 -52
  172. package/geometry/planked-floor.js +149 -0
  173. package/geometry/plant-broadleaf.js +268 -0
  174. package/geometry/plant-shrub.js +198 -0
  175. package/geometry/plant-tints.js +80 -0
  176. package/geometry/plant-trees.js +453 -0
  177. package/geometry/plant-tussock.js +107 -0
  178. package/geometry/point-buckets.js +50 -0
  179. package/geometry/primitives.js +117 -59
  180. package/geometry/prop-battlefield.js +69 -0
  181. package/geometry/prop-camp.js +175 -0
  182. package/geometry/prop-door.js +26 -0
  183. package/geometry/prop-harbour.js +105 -0
  184. package/geometry/prop-haycock.js +60 -0
  185. package/geometry/prop-sacks.js +74 -0
  186. package/geometry/prop-sheaf.js +68 -0
  187. package/geometry/prop-street.js +69 -0
  188. package/geometry/prop-tents.js +396 -0
  189. package/geometry/prop-tombs.js +80 -0
  190. package/geometry/prop-trade.js +393 -0
  191. package/geometry/prop-vehicles.js +218 -0
  192. package/geometry/props.js +58 -0
  193. package/geometry/room-arcade.js +134 -0
  194. package/geometry/room-dome.js +188 -0
  195. package/geometry/room-flames.js +138 -0
  196. package/geometry/room-frame.js +106 -0
  197. package/geometry/room-furniture.js +260 -0
  198. package/geometry/room-hearth.js +98 -0
  199. package/geometry/room-kit.js +59 -0
  200. package/geometry/room-openings.js +142 -0
  201. package/geometry/room-stairs.js +180 -0
  202. package/geometry/room-surfaces.js +272 -0
  203. package/geometry/sagging-tube.js +27 -27
  204. package/geometry/sampled-surface.js +123 -77
  205. package/geometry/scatter-grid.js +49 -6
  206. package/geometry/sculpt.js +97 -93
  207. package/geometry/ship-fittings.js +350 -0
  208. package/geometry/ship-hull.js +460 -0
  209. package/geometry/ship-kit.js +208 -0
  210. package/geometry/ship-lines.js +69 -0
  211. package/geometry/ship-oars.js +150 -0
  212. package/geometry/ship-presets.js +131 -0
  213. package/geometry/ship-rig.js +374 -0
  214. package/geometry/ship-sails.js +148 -0
  215. package/geometry/shore-grid.js +81 -34
  216. package/geometry/strata-field.js +131 -98
  217. package/geometry/strata-tiles.js +108 -94
  218. package/geometry/stream.js +96 -59
  219. package/geometry/swept-tube.js +124 -0
  220. package/geometry/terrain-chunks.js +216 -123
  221. package/geometry/terrain-extension.js +29 -13
  222. package/geometry/town-courtyard-inn.js +272 -0
  223. package/geometry/town-ground.js +76 -0
  224. package/geometry/town-houses.js +343 -0
  225. package/geometry/town-lights.js +254 -0
  226. package/geometry/town-lots.js +172 -0
  227. package/geometry/town-plan.js +370 -0
  228. package/geometry/town-works.js +465 -0
  229. package/geometry/village-layout.js +181 -0
  230. package/geometry/village-yards.js +167 -0
  231. package/geometry/wall-runs.js +64 -0
  232. package/index.js +138 -2
  233. package/math/cell-edge.js +16 -16
  234. package/math/cell-key.js +6 -0
  235. package/math/circle-clearances.js +19 -0
  236. package/math/cloth-textures.js +6 -6
  237. package/math/cloud-textures.js +22 -26
  238. package/math/color.js +14 -14
  239. package/math/curve.js +26 -22
  240. package/math/lamp-texels.js +43 -0
  241. package/math/lit-share.js +22 -0
  242. package/math/mountain-ranges.js +379 -205
  243. package/math/noise.js +101 -49
  244. package/math/particle-noise.js +28 -28
  245. package/math/periodic.js +11 -5
  246. package/math/random.js +24 -15
  247. package/math/rectangles.js +58 -0
  248. package/math/rock-texture.js +22 -17
  249. package/math/scalar.js +5 -5
  250. package/math/surface-textures.js +74 -59
  251. package/math/wandering-path.js +40 -0
  252. package/math/ways.js +120 -0
  253. package/motion/action-dynamics.js +398 -0
  254. package/motion/animal-bearing.js +247 -0
  255. package/motion/animal-canine-bearing.js +178 -0
  256. package/motion/animal-canine-cast.js +131 -0
  257. package/motion/animal-cattle-cast.js +64 -0
  258. package/motion/animal-herd-cast.js +154 -0
  259. package/motion/animal-horse-still.js +161 -0
  260. package/motion/animal-troop-cast.js +43 -0
  261. package/motion/arm-reach.js +27 -26
  262. package/motion/ballistic-arc.js +191 -0
  263. package/motion/biped-cycle.js +46 -0
  264. package/motion/biped-leg.js +40 -0
  265. package/motion/biped-posture.js +459 -0
  266. package/motion/biped-stride.js +226 -140
  267. package/motion/boat-sailing.js +214 -0
  268. package/motion/contact-transition.js +32 -0
  269. package/motion/crowd-alarms.js +72 -42
  270. package/motion/crowd-attention.js +108 -0
  271. package/motion/crowd-beasts.js +203 -0
  272. package/motion/crowd-camp.js +295 -0
  273. package/motion/crowd-figure.js +100 -0
  274. package/motion/crowd-herd.js +86 -0
  275. package/motion/crowd-hold.js +130 -0
  276. package/motion/crowd-pose.js +296 -0
  277. package/motion/crowd-poses.js +481 -0
  278. package/motion/crowd-routine.js +126 -67
  279. package/motion/crowd-town.js +166 -0
  280. package/motion/crowd-water.js +143 -0
  281. package/motion/daily-clock.js +9 -9
  282. package/motion/deck-surface.js +40 -0
  283. package/motion/figure-acts.js +411 -0
  284. package/motion/figure-arms.js +437 -0
  285. package/motion/figure-blade-slide.js +149 -0
  286. package/motion/figure-body-place.js +180 -0
  287. package/motion/figure-bones.js +118 -0
  288. package/motion/figure-bow-draw.js +70 -0
  289. package/motion/figure-fingers.js +215 -0
  290. package/motion/figure-gaze.js +205 -0
  291. package/motion/figure-gestures.js +452 -0
  292. package/motion/figure-grip.js +134 -0
  293. package/motion/figure-head.js +287 -0
  294. package/motion/figure-legs.js +264 -0
  295. package/motion/figure-links.js +293 -0
  296. package/motion/figure-locomotion.js +391 -0
  297. package/motion/figure-mount-up.js +180 -0
  298. package/motion/figure-mount.js +201 -0
  299. package/motion/figure-pose-frame.js +375 -0
  300. package/motion/figure-pose-table.js +156 -0
  301. package/motion/figure-pose.js +343 -0
  302. package/motion/figure-seat.js +267 -0
  303. package/motion/figure-sway.js +125 -0
  304. package/motion/flier-corvid-pose.js +74 -0
  305. package/motion/flier-flight-air.js +122 -0
  306. package/motion/flier-flight-echelon.js +164 -0
  307. package/motion/flier-flight-roost.js +131 -0
  308. package/motion/flier-swarm-flight.js +252 -0
  309. package/motion/formation.js +193 -0
  310. package/motion/ground-lookahead.js +5 -5
  311. package/motion/instance-sight.js +15 -8
  312. package/motion/melee-contact.js +143 -0
  313. package/motion/moorings.js +48 -0
  314. package/motion/path-steering.js +358 -0
  315. package/motion/player.js +41 -32
  316. package/motion/quadruped.js +244 -168
  317. package/motion/spaces.js +90 -38
  318. package/motion/speech-cadence.js +304 -0
  319. package/motion/vessel-motion.js +57 -0
  320. package/motion/walk-grid.js +235 -0
  321. package/motion/weather.js +133 -26
  322. package/motion/wind.js +58 -13
  323. package/package.json +33 -6
  324. package/rendering/alpha-mips.js +340 -0
  325. package/rendering/animal-camel-figure.js +29 -0
  326. package/rendering/animal-canine-figure.js +59 -0
  327. package/rendering/animal-cattle-figure.js +36 -0
  328. package/rendering/animal-horse-figure.js +49 -0
  329. package/rendering/atmosphere.js +86 -0
  330. package/rendering/camera-track.js +156 -0
  331. package/rendering/cart-track.js +92 -0
  332. package/rendering/caster-motion.js +6 -5
  333. package/rendering/cell-lod-options.js +46 -0
  334. package/rendering/cell-lod.js +754 -113
  335. package/rendering/cloth-material.js +140 -0
  336. package/rendering/cloud-dome.js +30 -30
  337. package/rendering/cloud-field.js +2 -2
  338. package/rendering/compilation-schedule.js +79 -14
  339. package/rendering/contact-shadows.js +7 -4
  340. package/rendering/context.js +57 -6
  341. package/rendering/crowd-batches.js +420 -0
  342. package/rendering/crowd-herd.js +198 -0
  343. package/rendering/crowd-rig.js +132 -0
  344. package/rendering/crowd-skinning.js +62 -19
  345. package/rendering/crowd-update.js +419 -0
  346. package/rendering/crowd-visibility.js +107 -0
  347. package/rendering/crust.js +18 -12
  348. package/rendering/day-cycle-defaults.js +200 -0
  349. package/rendering/day-cycle.js +487 -0
  350. package/rendering/daylight.js +4 -6
  351. package/rendering/detail-range.js +29 -0
  352. package/rendering/dispose-meshes.js +18 -0
  353. package/rendering/dof.js +20 -13
  354. package/rendering/effects-frame.js +149 -0
  355. package/rendering/effects-water-rises.js +221 -0
  356. package/rendering/energy-stream.js +128 -0
  357. package/rendering/eye-adapt.js +14 -14
  358. package/rendering/facade-glass-material.js +105 -0
  359. package/rendering/far-shadow.js +89 -62
  360. package/rendering/field-surface.js +138 -0
  361. package/rendering/figure-shield.js +105 -0
  362. package/rendering/figure-skeleton.js +329 -0
  363. package/rendering/fire-light-watch.js +197 -0
  364. package/rendering/fire-pools.js +148 -0
  365. package/rendering/flame-sources.js +86 -0
  366. package/rendering/flier-bird-looks.js +97 -0
  367. package/rendering/flier-corvid-figure.js +67 -0
  368. package/rendering/flier-long-body-company.js +169 -0
  369. package/rendering/flier-swarm.js +186 -0
  370. package/rendering/flocks.js +82 -78
  371. package/rendering/garment-material.js +147 -51
  372. package/rendering/glow-lines.js +13 -13
  373. package/rendering/glsl-literal.js +19 -0
  374. package/rendering/ground-marks.js +316 -0
  375. package/rendering/hair-strands.js +45 -31
  376. package/rendering/height-haze.js +80 -33
  377. package/rendering/height-probe.js +164 -22
  378. package/rendering/house-kit-meshes.js +124 -0
  379. package/rendering/interior-bake.js +807 -0
  380. package/rendering/label-layout.js +56 -0
  381. package/rendering/label-range.js +41 -0
  382. package/rendering/lamp-light-map.js +159 -0
  383. package/rendering/lamp-maps.js +62 -0
  384. package/rendering/lamp-wash.js +51 -0
  385. package/rendering/light-budget.js +71 -55
  386. package/rendering/light-points.js +21 -5
  387. package/rendering/local-lights.js +39 -8
  388. package/rendering/material-lod.js +49 -50
  389. package/rendering/memory-estimate.js +84 -0
  390. package/rendering/moored-fleet.js +186 -0
  391. package/rendering/part-costs.js +104 -0
  392. package/rendering/particle-bursts.js +386 -0
  393. package/rendering/particle-emitters.js +135 -99
  394. package/rendering/particle-light-bursts.js +189 -0
  395. package/rendering/particles.js +212 -101
  396. package/rendering/pen-flocks.js +118 -0
  397. package/rendering/piece-batch.js +298 -11
  398. package/rendering/planar-reflection-options.js +159 -0
  399. package/rendering/planar-reflection.js +806 -103
  400. package/rendering/plant-cells.js +122 -0
  401. package/rendering/plant-reeds.js +113 -0
  402. package/rendering/plant-shade-trees.js +239 -0
  403. package/rendering/plant-tuft-patch.js +122 -0
  404. package/rendering/post-shaders.js +98 -31
  405. package/rendering/post.js +107 -87
  406. package/rendering/pressed-cover.js +135 -0
  407. package/rendering/prop-dig.js +136 -0
  408. package/rendering/rain-streaks.js +67 -0
  409. package/rendering/room-light.js +250 -0
  410. package/rendering/room-materials.js +78 -0
  411. package/rendering/room-space.js +111 -0
  412. package/rendering/scene-lights.js +106 -0
  413. package/rendering/sea-shaders.js +94 -37
  414. package/rendering/settlement-approach.js +226 -0
  415. package/rendering/settlement-dissolve.js +89 -0
  416. package/rendering/settlement-quarter-warm.js +55 -0
  417. package/rendering/settlement-quarter.js +477 -0
  418. package/rendering/settlement-switch.js +42 -0
  419. package/rendering/settlement-town.js +110 -0
  420. package/rendering/shader-warmup.js +101 -44
  421. package/rendering/shadow-alignment.js +4 -4
  422. package/rendering/shadow-depth.js +47 -25
  423. package/rendering/ship-meshes.js +150 -0
  424. package/rendering/shot-cuts.js +68 -0
  425. package/rendering/sky-occlusion.js +56 -29
  426. package/rendering/sky-pmrem.js +216 -0
  427. package/rendering/sky.js +126 -54
  428. package/rendering/smoke-shadows.js +201 -0
  429. package/rendering/stage-framing.js +182 -0
  430. package/rendering/stage-lights.js +46 -39
  431. package/rendering/stain-material.js +74 -0
  432. package/rendering/static-point-shadow.js +65 -26
  433. package/rendering/still-casters.js +77 -27
  434. package/rendering/strata-material.js +12 -12
  435. package/rendering/stream-flow.js +10 -10
  436. package/rendering/street-lamps.js +166 -0
  437. package/rendering/sunbeam-motes.js +670 -0
  438. package/rendering/surface-light.js +65 -6
  439. package/rendering/surface-material.js +306 -0
  440. package/rendering/surface-projection.js +32 -0
  441. package/rendering/surface-snippets.js +314 -0
  442. package/rendering/taa.js +75 -44
  443. package/rendering/talus.js +15 -15
  444. package/rendering/terrain-rock.js +7 -7
  445. package/rendering/texture-fills.js +8 -8
  446. package/rendering/textures.js +28 -28
  447. package/rendering/tree-impostor.js +929 -0
  448. package/rendering/vehicle-train.js +92 -0
  449. package/rendering/viewport.js +67 -4
  450. package/rendering/wakes.js +24 -24
  451. package/rendering/water-material.js +304 -103
  452. package/rendering/waypoint-beacons.js +191 -0
  453. package/rendering/world-matrices.js +38 -40
  454. package/ruff.toml +20 -0
  455. package/runtime/cue-cursor.js +21 -0
  456. package/runtime/device-quality.js +13 -2
  457. package/runtime/device.js +73 -0
  458. package/runtime/diagnostic-log.js +12 -4
  459. package/runtime/effect-sites.js +85 -0
  460. package/runtime/figure-orders.js +59 -0
  461. package/runtime/first-use.js +36 -28
  462. package/runtime/foley-script.js +124 -0
  463. package/runtime/foley-strides.js +333 -0
  464. package/runtime/frame-pacing.js +47 -0
  465. package/runtime/frame-yield.js +18 -0
  466. package/runtime/gpu-timing.js +15 -11
  467. package/runtime/grid-cache.js +16 -6
  468. package/runtime/grid-rows.js +44 -5
  469. package/runtime/hand-over.js +47 -24
  470. package/runtime/land-bake.js +78 -0
  471. package/runtime/lazy-sets.js +105 -0
  472. package/runtime/pool.js +73 -17
  473. package/runtime/quality-fit.js +60 -28
  474. package/runtime/region-pass-lay.js +40 -0
  475. package/runtime/region-pass.js +78 -0
  476. package/runtime/search.js +26 -22
  477. package/runtime/settlement-reach.js +42 -0
  478. package/runtime/sound-calls.js +113 -0
  479. package/runtime/sound-impacts.js +297 -0
  480. package/runtime/sound-voices.js +194 -0
  481. package/runtime/soundscape.js +282 -0
  482. package/runtime/spatial-audio.js +79 -30
  483. package/runtime/steady-frames.js +221 -0
  484. package/runtime/withdrawable-task.js +46 -0
  485. package/runtime/worker.js +7 -0
  486. package/scripts/app-parts.mjs +118 -0
  487. package/scripts/bake-revisions.mjs +81 -0
  488. package/scripts/browser-scripts.mjs +64 -0
  489. package/scripts/bundle.mjs +192 -0
  490. package/scripts/check-app.sh +26 -0
  491. package/scripts/eslint-config.mjs +119 -0
  492. package/scripts/format.sh +92 -0
  493. package/scripts/keep-builds.mjs +158 -0
  494. package/scripts/layers.mjs +112 -0
  495. package/scripts/lint.sh +49 -0
  496. package/scripts/module-graph.mjs +123 -0
  497. package/scripts/pre-commit.sh +38 -0
  498. package/scripts/serve.py +5 -3
  499. package/scripts/site.mjs +358 -0
  500. package/scripts/test-runner.sh +42 -0
  501. package/scripts/vendor.mjs +221 -0
  502. package/scripts/verify-publish.mjs +175 -0
  503. package/scripts/world.mk +59 -0
  504. package/tools/README.md +73 -0
  505. package/tools/contact-sheet.cjs +137 -0
  506. package/tools/cpu-profile.cjs +275 -0
  507. package/tools/cpu-profile.test.cjs +98 -0
  508. package/tools/first-draws.cjs +395 -0
  509. package/tools/flight-guard.cjs +482 -0
  510. package/tools/flight-guard.test.cjs +153 -0
  511. package/tools/flight-profile.cjs +145 -0
  512. package/tools/frame-bench.cjs +336 -0
  513. package/tools/frame-parts.cjs +365 -0
  514. package/tools/ios-sim.sh +145 -0
  515. package/tools/load-audit.cjs +201 -0
  516. package/tools/look-compare.cjs +304 -0
  517. package/tools/look-guard.cjs +407 -0
  518. package/tools/look-guard.test.cjs +93 -0
  519. package/tools/look-stats.cjs +185 -0
  520. package/tools/look-stats.test.cjs +71 -0
  521. package/tools/memory-audit.cjs +323 -0
  522. package/tools/page-driver.cjs +320 -0
  523. package/tools/page-driver.test.cjs +219 -0
  524. package/tools/program-census-report.cjs +191 -0
  525. package/tools/program-census.cjs +465 -0
  526. package/tools/program-census.test.cjs +332 -0
  527. package/tools/remote-runner.sh +265 -0
  528. package/tools/runners.test.cjs +59 -0
  529. package/tools/scene-audit-beat.cjs +344 -0
  530. package/tools/scene-audit-sheet.cjs +282 -0
  531. package/tools/scene-audit.cjs +471 -0
  532. package/tools/scene-audit.test.cjs +201 -0
  533. package/tools/scene-batch.cjs +219 -0
  534. package/tools/scene-bench.cjs +149 -0
  535. package/tools/scene-bench.test.cjs +33 -0
  536. package/tools/scene-run.cjs +443 -0
  537. package/tools/scene-run.test.cjs +94 -0
  538. package/tools/servers.sh +59 -0
  539. package/tools/shader-arrival.cjs +316 -0
  540. package/tools/shader-renewal.cjs +53 -0
  541. package/tools/shader-renewal.test.cjs +115 -0
  542. package/tools/speed-guard.cjs +258 -0
  543. package/tools/stills.cjs +492 -0
  544. package/tools/stills.test.cjs +49 -0
  545. package/tools/turns.sh +7 -0
  546. package/tools/yaml.cjs +158 -0
  547. package/examples/viaduct.css +0 -75
  548. package/rendering/light-shafts.js +0 -131
  549. package/rendering/road-surface.js +0 -63
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Unit meshes, transforms and colour helpers for assembling models with a geometry builder.
3
+ * @module
4
+ */
5
+
1
6
  import * as THREE from 'three';
2
7
  import { TAU } from '../math/scalar.js';
3
8
  import { createNoise } from '../math/noise.js';
@@ -7,58 +12,83 @@ import { createNoise } from '../math/noise.js';
7
12
  // between two points (stick)
8
13
  // ════════════════════════════════════════════════════════════════════════
9
14
  const _m4 = new THREE.Matrix4(),
10
- _q = new THREE.Quaternion(),
11
- _eu = new THREE.Euler(),
12
- _sc = new THREE.Vector3(),
13
- _ps = new THREE.Vector3(),
14
- _cc = new THREE.Color();
15
+ rotationScratch = new THREE.Quaternion(),
16
+ eulerScratch = new THREE.Euler(),
17
+ scaleScratch = new THREE.Vector3(),
18
+ positionScratch = new THREE.Vector3(),
19
+ colorScratch = new THREE.Color();
15
20
  function TRS(x, y, z, sx = 1, sy = 1, sz = 1, ry = 0, rx = 0, rz = 0) {
16
21
  // returns a shared matrix: use it immediately
17
- _eu.set(rx, ry, rz, 'YXZ');
18
- _q.setFromEuler(_eu);
19
- return _m4.compose(_ps.set(x, y, z), _q, _sc.set(sx, sy, sz));
22
+ eulerScratch.set(rx, ry, rz, 'YXZ');
23
+ rotationScratch.setFromEuler(eulerScratch);
24
+ return _m4.compose(positionScratch.set(x, y, z), rotationScratch, scaleScratch.set(sx, sy, sz));
20
25
  }
21
26
  // A unit triangular prism, the shape of a gable roof.
22
27
  function prismGeometry() {
23
- const a = [-0.5, 0, -0.5],
24
- b = [0.5, 0, -0.5],
25
- c = [0.5, 0, 0.5],
26
- d = [-0.5, 0, 0.5],
27
- e = [0, 1, -0.5],
28
- f = [0, 1, 0.5];
29
- const g = new THREE.BufferGeometry();
30
- g.setAttribute('position', new THREE.Float32BufferAttribute([a, d, f, a, f, e, b, e, f, b, f, c, d, c, f, b, a, e].flat(), 3));
31
- g.computeVertexNormals();
32
- return g;
28
+ const backLeft = [-0.5, 0, -0.5],
29
+ backRight = [0.5, 0, -0.5],
30
+ frontRight = [0.5, 0, 0.5],
31
+ frontLeft = [-0.5, 0, 0.5],
32
+ backRidge = [0, 1, -0.5],
33
+ frontRidge = [0, 1, 0.5];
34
+ const geometry = new THREE.BufferGeometry();
35
+ geometry.setAttribute(
36
+ 'position',
37
+ new THREE.Float32BufferAttribute(
38
+ [
39
+ backLeft,
40
+ frontLeft,
41
+ frontRidge,
42
+ backLeft,
43
+ frontRidge,
44
+ backRidge,
45
+ backRight,
46
+ backRidge,
47
+ frontRidge,
48
+ backRight,
49
+ frontRidge,
50
+ frontRight,
51
+ frontLeft,
52
+ frontRight,
53
+ frontRidge,
54
+ backRight,
55
+ backLeft,
56
+ backRidge,
57
+ ].flat(),
58
+ 3,
59
+ ),
60
+ );
61
+ geometry.computeVertexNormals();
62
+ return geometry;
33
63
  }
34
64
  // The two triangular ends of that prism alone: a gable's wall, under a roof drawn without them.
35
65
  function gableGeometry() {
36
- const g = new THREE.BufferGeometry();
37
- g.setAttribute(
66
+ const geometry = new THREE.BufferGeometry();
67
+ geometry.setAttribute(
38
68
  'position',
39
69
  new THREE.Float32BufferAttribute([-0.5, 0, 0.5, 0.5, 0, 0.5, 0, 1, 0.5, 0.5, 0, -0.5, -0.5, 0, -0.5, 0, 1, -0.5], 3),
40
70
  );
41
- g.computeVertexNormals();
42
- return g;
71
+ geometry.computeVertexNormals();
72
+ return geometry;
43
73
  }
44
74
  // The ways a face can look, as [axis, sign]
45
75
  const WAYS = { '+x': [0, 1], '-x': [0, -1], '+y': [1, 1], '-y': [1, -1], '+z': [2, 1], '-z': [2, -1] };
46
76
  // A unit shape without its flat faces that look the ways named ('+x', '-y', ...), the rest in their order: for a part whose faces
47
77
  // lie against something, where no one can see them (the back of a box fixed to a wall, the foot of a rod set in one)
48
78
  function without(shape, ...ways) {
49
- const g = shape.index ? shape.toNonIndexed() : shape,
50
- p = g.attributes.position.array,
51
- n = g.attributes.normal.array,
79
+ const sourceGeometry = shape.index ? shape.toNonIndexed() : shape,
80
+ positions = sourceGeometry.attributes.position.array,
81
+ n = sourceGeometry.attributes.normal.array,
52
82
  away = t => ways.some(w => [0, 3, 6].every(k => n[t + k + WAYS[w][0]] * WAYS[w][1] > 0.99)),
53
83
  kept = [];
54
- for (let t = 0; t < p.length; t += 9) if (!away(t)) kept.push(t);
55
- const pick = a => {
84
+ for (let t = 0; t < positions.length; t += 9) if (!away(t)) kept.push(t);
85
+ const pick = attribute => {
56
86
  const out = new Float32Array(kept.length * 9);
57
- kept.forEach((t, i) => out.set(a.subarray(t, t + 9), i * 9));
87
+ kept.forEach((t, i) => out.set(attribute.subarray(t, t + 9), i * 9));
58
88
  return new THREE.BufferAttribute(out, 3);
59
89
  },
60
90
  q = new THREE.BufferGeometry();
61
- q.setAttribute('position', pick(p));
91
+ q.setAttribute('position', pick(positions));
62
92
  q.setAttribute('normal', pick(n));
63
93
  return q;
64
94
  }
@@ -72,9 +102,9 @@ const _dir = new THREE.Vector3(),
72
102
  _a = new THREE.Vector3(),
73
103
  _b = new THREE.Vector3();
74
104
  function lump(fineness, shape) {
75
- const g = new THREE.IcosahedronGeometry(1, fineness),
76
- position = g.attributes.position.array,
77
- normal = g.attributes.normal.array,
105
+ const geometry = new THREE.IcosahedronGeometry(1, fineness),
106
+ position = geometry.attributes.position.array,
107
+ normal = geometry.attributes.normal.array,
78
108
  near = 0.03; // how far round the sphere the shape is sampled to find which way it faces
79
109
  for (let i = 0; i < position.length; i += 3) {
80
110
  _dir.set(position[i], position[i + 1], position[i + 2]).normalize();
@@ -90,32 +120,49 @@ function lump(fineness, shape) {
90
120
  position.set([_here.x, _here.y, _here.z], i);
91
121
  normal.set([_a.x, _a.y, _a.z], i);
92
122
  }
93
- return g;
123
+ return geometry;
94
124
  }
95
125
  // A stone broken from the rock, about a metre across and a little lower than it is wide: worn round by the weather, with three
96
126
  // faces where it split along its joints, and flat where it lies; shaded round where it is worn and flat on its broken faces
97
127
  // (80 triangles). Its colours are white, for the builder's colour to tint.
98
- const STONE_JOINTS = [
99
- [0.62, 0.5, 0.6, 0.37],
100
- [-0.74, 0.18, 0.64, 0.39],
101
- [0.12, 0.3, -0.95, 0.4],
102
- ].map(([x, y, z, d]) => [x / Math.hypot(x, y, z), y / Math.hypot(x, y, z), z / Math.hypot(x, y, z), d]); // [the face's normal, its distance from the middle]
128
+ const normalizeJoints = joints =>
129
+ joints.map(([x, y, z, planeDistance]) => {
130
+ const len = Math.hypot(x, y, z) || 1;
131
+ return [x / len, y / len, z / len, planeDistance];
132
+ });
133
+ /**
134
+ * Default fracture-plane definitions for the unit broken stone mesh: each entry is `[nx, ny, nz, distance]`,
135
+ * giving the unit normal of a split face and its perpendicular distance from the centre in unit-stone radii.
136
+ */
137
+ export const DEFAULT_STONE_JOINTS = Object.freeze(
138
+ normalizeJoints([
139
+ [0.62, 0.5, 0.6, 0.37],
140
+ [-0.74, 0.18, 0.64, 0.39],
141
+ [0.12, 0.3, -0.95, 0.4],
142
+ ]),
143
+ );
103
144
  const box = new THREE.BoxGeometry(1, 1, 1).translate(0, 0.5, 0),
104
145
  cyl6 = new THREE.CylinderGeometry(0.5, 0.5, 1, 6).translate(0, 0.5, 0);
105
- export function createUnitShapes(fbm = createNoise().fbm) {
146
+ /**
147
+ * Build a library of reusable unit geometries for scenery and roofs.
148
+ * @param fbm - Fractal noise sampler used to shape the rock. Pass the world’s seeded sampler to reproduce it.
149
+ * @param {{ stoneSeed?: number, stoneJoints?: Array<[number, number, number, number]> }} [options] - Optional rock noise seed and fracture-plane definitions `[nx, ny, nz, distance]`.
150
+ */
151
+ export function createUnitShapes(fbm = createNoise().fbm, { stoneSeed = 0, stoneJoints = DEFAULT_STONE_JOINTS } = {}) {
152
+ const joints = stoneJoints === DEFAULT_STONE_JOINTS ? DEFAULT_STONE_JOINTS : normalizeJoints(stoneJoints);
106
153
  function stonePoint(dir, out) {
107
- let r = 0.5 * (0.8 + 0.4 * fbm(dir.x * 1.7 + 3, dir.z * 1.7 + dir.y * 1.3, 2, 190));
108
- for (const [nx, ny, nz, d] of STONE_JOINTS) {
154
+ let r = 0.5 * (0.8 + 0.4 * fbm(dir.x * 1.7 + 3, dir.z * 1.7 + dir.y * 1.3, 2, stoneSeed));
155
+ for (const [nx, ny, nz, planeDistance] of joints) {
109
156
  const towards = dir.x * nx + dir.y * ny + dir.z * nz;
110
- if (towards > 0.05) r = Math.min(r, d / towards);
157
+ if (towards > 0.05) r = Math.min(r, planeDistance / towards);
111
158
  }
112
159
  return out.set(dir.x * r, Math.max(dir.y * r * 0.82, -0.3), dir.z * r);
113
160
  }
114
161
  function brokenStone() {
115
- const g = lump(1, stonePoint);
162
+ const geometry = lump(1, stonePoint);
116
163
  // white vertex colours: an instanced rock on a material that reads vertex colours would otherwise be drawn black
117
- g.setAttribute('color', new THREE.Float32BufferAttribute(new Float32Array(g.attributes.position.count * 3).fill(1), 3));
118
- return g;
164
+ geometry.setAttribute('color', new THREE.Float32BufferAttribute(new Float32Array(geometry.attributes.position.count * 3).fill(1), 3));
165
+ return geometry;
119
166
  }
120
167
  return {
121
168
  box,
@@ -131,28 +178,39 @@ export function createUnitShapes(fbm = createNoise().fbm) {
131
178
  prism: prismGeometry(),
132
179
  eaves: without(prismGeometry(), '+z', '-z'), // a gable roof's two slopes, its ends left open for its gables
133
180
  gable: gableGeometry(),
134
- torso: new THREE.CylinderGeometry(0.5, 0.4, 1, 12).translate(0, 0.5, 0),
135
- skirt: new THREE.CylinderGeometry(0.32, 0.5, 1, 12).translate(0, 0.5, 0),
136
- head: new THREE.IcosahedronGeometry(0.5, 2),
137
- limb: new THREE.CylinderGeometry(0.5, 0.38, 1, 8).translate(0, -0.5, 0),
138
- cloak: new THREE.CylinderGeometry(0.5, 0.64, 1, 10, 3, true, Math.PI * 0.5, Math.PI).translate(0, -0.5, 0),
139
181
  quad: new THREE.PlaneGeometry(1, 1).translate(0, 0.5, 0),
140
182
  boxF: without(box, '-z'), // a box without its back face, for parts fixed to a wall
141
183
  boxFootless: without(box, '-y'), // a box without its foot, for parts that stand on something or go into a wall at their foot
142
184
  cyl16: new THREE.CylinderGeometry(0.5, 0.5, 1, 16).translate(0, 0.5, 0),
143
- fing: new THREE.CylinderGeometry(0.5, 0.4, 1, 5).translate(0, -0.5, 0),
144
185
  cone16: new THREE.ConeGeometry(0.5, 1, 16).translate(0, 0.5, 0),
145
186
  dome16: new THREE.SphereGeometry(0.5, 20, 8, 0, TAU, 0, Math.PI / 2),
146
187
  };
147
188
  }
148
- function C(hex, jitter = 0, rng) {
189
+ let plain = null;
190
+ /**
191
+ * The unit shapes that need no noise (box, cylinders, cones, sphere), made once and shared by every caller:
192
+ * without a world's rock sampler. Each is the same geometry `createUnitShapes` makes under the same name.
193
+ * @returns {{box: THREE.BufferGeometry, cyl: THREE.BufferGeometry, cyl6: THREE.BufferGeometry, cyl16: THREE.BufferGeometry, cone6: THREE.BufferGeometry, sph: THREE.BufferGeometry}}
194
+ */
195
+ export function plainUnitShapes() {
196
+ plain ??= {
197
+ box,
198
+ cyl: new THREE.CylinderGeometry(0.5, 0.5, 1, 10).translate(0, 0.5, 0),
199
+ cyl6,
200
+ cyl16: new THREE.CylinderGeometry(0.5, 0.5, 1, 16).translate(0, 0.5, 0),
201
+ cone6: new THREE.ConeGeometry(0.5, 1, 6).translate(0, 0.5, 0),
202
+ sph: new THREE.IcosahedronGeometry(0.5, 1),
203
+ };
204
+ return plain;
205
+ }
206
+ function C(hex, jitter = 0, random) {
149
207
  // sRGB hex -> linear [r,g,b], optionally brightness-jittered
150
- _cc.setHex(hex);
151
- const k = jitter && rng ? 1 + (rng() - 0.5) * 2 * jitter : 1;
152
- return [_cc.r * k, _cc.g * k, _cc.b * k];
208
+ colorScratch.setHex(hex);
209
+ const k = jitter && random ? 1 + (random() - 0.5) * 2 * jitter : 1;
210
+ return [colorScratch.r * k, colorScratch.g * k, colorScratch.b * k];
153
211
  }
154
212
 
155
- // A rod of radius r from point a to point b ([x, y, z]), added to the builder gb.
213
+ // Append a rod of the given radius between the start and end points, both [x, y, z].
156
214
  const _rod = {
157
215
  m: new THREE.Matrix4(),
158
216
  at: new THREE.Vector3(),
@@ -161,12 +219,12 @@ const _rod = {
161
219
  way: new THREE.Vector3(),
162
220
  },
163
221
  UP = new THREE.Vector3(0, 1, 0);
164
- function stick(gb, a, b, r, col, geo = cyl6) {
222
+ function stick(builder, start, end, radius, color, geometry = cyl6) {
165
223
  const { m, at, turn, size, way } = _rod;
166
- way.set(b[0] - a[0], b[1] - a[1], b[2] - a[2]);
224
+ way.set(end[0] - start[0], end[1] - start[1], end[2] - start[2]);
167
225
  const len = way.length();
168
226
  turn.setFromUnitVectors(UP, way.divideScalar(len));
169
- gb.add(geo, col, m.compose(at.set(a[0], a[1], a[2]), turn, size.set(r, len, r)));
227
+ builder.add(geometry, color, m.compose(at.set(start[0], start[1], start[2]), turn, size.set(radius, len, radius)));
170
228
  }
171
229
 
172
230
  export { box, C, TRS, lump, stick, without };
@@ -0,0 +1,69 @@
1
+ // The dead of a battlefield: a horse on its side and a soldier on the ground, as lofted bodies rather than blocks. Worker-safe.
2
+ import * as THREE from 'three';
3
+ import { dim } from '../math/color.js';
4
+ import { C, TRS, stick } from './primitives.js';
5
+ import { createSculptor } from './sculpt.js';
6
+
7
+ /**
8
+ * The battlefield props, bound to a world's shapes, sculptor and horse.
9
+ * @param {object} o
10
+ * @param {object} o.shapes - The unit shapes (`createUnitShapes`).
11
+ * @param {Function} [o.loft] - The sculptor's loft (`createSculptor`); a plain sculptor's if not given.
12
+ * @param {Function} [o.horse] - A still horse cast into a builder, (builder, x, y, z, yaw, colour, R, graze, lying);
13
+ * `propHorse` needs it.
14
+ * @returns {object} `propHorse(builder, x, y, z, yaw, colour, R)`, a dead horse on its side, and `propFallen(builder, x, y, z,
15
+ * yaw, colour, R)`, a fallen soldier, face up or down.
16
+ */
17
+ export function createBattlefieldProps({ shapes: U, loft = createSculptor().loft, horse: stillHorse }) {
18
+ const _mA = new THREE.Matrix4();
19
+ function propHorse(into, x, y, z, yaw, col, R) {
20
+ stillHorse(into, x, y, z, yaw, col, R, false, true);
21
+ }
22
+ function propFallen(gb, x, y, z, yaw, col, R) {
23
+ const M0 = gb.M,
24
+ face = R() < 0.5,
25
+ M = new THREE.Matrix4()
26
+ .makeTranslation(x, y + 0.13, z)
27
+ .multiply(_mA.makeRotationY(yaw))
28
+ .multiply(_mA.makeRotationX(face ? Math.PI / 2 : -Math.PI / 2))
29
+ .multiply(_mA.makeTranslation(0, -0.95, 0));
30
+ const skin = C(0xb98e6e, 0.2, R),
31
+ steel = C(0x8a8d92),
32
+ dk = dim(col, 0.5),
33
+ boot = C(0x2a221c);
34
+ gb.M = M;
35
+ loft(
36
+ gb,
37
+ 0,
38
+ 0,
39
+ 0,
40
+ [
41
+ [0.86, 0.13, 0.09, 0, 0, dk, 0],
42
+ [0.98, 0.17, 0.11, 0, 0, col, 0],
43
+ [1.2, 0.165, 0.1, 0, 0, col, 0],
44
+ [1.4, 0.2, 0.105, 0, 0, col, 0],
45
+ [1.5, 0.11, 0.08, 0, 0, col, 0],
46
+ [1.56, 0.055, 0.055, 0, 0, skin, 0],
47
+ ],
48
+ 8,
49
+ );
50
+ gb.add(U.sph, skin, TRS(0, 1.66, 0.01, 0.17, 0.22, 0.19));
51
+ gb.add(U.dome, steel, TRS(0, 1.66, 0, 0.2, 0.26, 0.22));
52
+ for (const s of [-1, 1]) {
53
+ const a = (R() - 0.3) * 1.6,
54
+ el = [s * (0.24 + Math.abs(Math.sin(a)) * 0.26), 1.42 - Math.cos(a) * 0.3, 0.02],
55
+ ha = [el[0] + s * R() * 0.2, el[1] - Math.cos(a * 0.6) * 0.28, 0.05];
56
+ stick(gb, [s * 0.2, 1.42, 0], el, 0.1, col);
57
+ stick(gb, el, ha, 0.085, col);
58
+ gb.add(U.sph, skin, TRS(ha[0], ha[1], ha[2], 0.09, 0.1, 0.07));
59
+ const b = (R() - 0.5) * 0.5,
60
+ kn = [s * 0.1 + b * 0.3, 0.5, 0.03],
61
+ ft = [kn[0] + b * 0.4, 0.06, 0];
62
+ stick(gb, [s * 0.09, 0.92, 0], kn, 0.15, dk);
63
+ stick(gb, kn, ft, 0.12, boot);
64
+ gb.add(U.sph, boot, TRS(ft[0], ft[1], ft[2] + 0.07, 0.11, 0.1, 0.24));
65
+ }
66
+ gb.M = M0;
67
+ }
68
+ return { propFallen, propHorse };
69
+ }
@@ -0,0 +1,175 @@
1
+ // The furniture of an army's camp or a siege line besides its tents: fodder stacks, a weapon rack, a cookfire, a well and a
2
+ // trough, a woodpile, a watch brazier, a picketed horse and a raven. Each is built into a house kit's builders round the kit
3
+ // frame's origin, its front to +z. Worker-safe.
4
+ import * as THREE from 'three';
5
+ import { dim } from '../math/color.js';
6
+ import { TAU } from '../math/scalar.js';
7
+ import { pickR } from '../math/random.js';
8
+ import { C, TRS, stick } from './primitives.js';
9
+ import { HOUSE_PALETTE } from './house-kit-palette.js';
10
+
11
+ /**
12
+ * The camp props, bound to a world's shapes, palette, haycock and horse.
13
+ * @param {object} o
14
+ * @param {object} o.shapes - The unit shapes (`createUnitShapes`).
15
+ * @param {object} [o.palette] - The house palette (`hemp` for rope, `cloths` and `awnings`, sRGB hex choices); a house kit's
16
+ * `palette`, or the kit's default (`HOUSE_PALETTE`).
17
+ * @param {Function} o.haycock - The haycock (`createHaycock`), the fodder stacks' hay.
18
+ * @param {Function} [o.horse] - A still horse cast into a builder, (builder, x, y, z, yaw, colour, R, graze); `propHorseUp`
19
+ * needs it.
20
+ * @returns {object} Builders, each (B, R, ...) into a kit's builders: `fodderStack(B, R, far)`, `propRack`, `propCookfire`,
21
+ * `propDesertWell`, `propPlankTrough`, `propWoodpile(B, R, n)`, `propBrazier`; and, into one builder at a point and bearing,
22
+ * `propHorseUp(builder, x, y, z, yaw, colour, R, graze)` and `propRaven(builder, x, y, z, yaw, scale)`.
23
+ */
24
+ export function createCampProps({ shapes: U, palette = HOUSE_PALETTE, haycock, horse: stillHorse }) {
25
+ const { hemp: HEMP } = palette;
26
+ const _mA = new THREE.Matrix4();
27
+
28
+ // The main rick and the loose forkful pulled from its foot share the same hay as the mown fields.
29
+ function fodderStack(B, R, far = false) {
30
+ const straw = C(0xb49e65, 0.07, R),
31
+ gb = B.cloth,
32
+ frame = gb.M;
33
+ gb.M = _mA.multiplyMatrices(frame, TRS(0, -0.02, 0, 1.56, 1 + R() * 0.24, 1.37, R() * TAU));
34
+ haycock(gb, far, straw);
35
+ gb.M = _mA.multiplyMatrices(frame, TRS(1.28, -0.025, 0.76, 0.95, 0.31, 0.76, R() * TAU));
36
+ haycock(gb, far, dim(straw, 0.89));
37
+ gb.M = frame;
38
+ }
39
+ function propRack(B, R) {
40
+ // spears stacked on a rack, shields leaning at its foot
41
+ const w = C(0x4a3a2a),
42
+ st = [0.5, 0.52, 0.56];
43
+ for (const sx of [-1, 1]) {
44
+ stick(B.wood, [sx * 0.9, 0, -0.35], [sx * 0.9, 1.5, 0], 0.035, w);
45
+ stick(B.wood, [sx * 0.9, 0, 0.35], [sx * 0.9, 1.5, 0], 0.035, w);
46
+ }
47
+ B.wood.box(0, 1.45, 0, 2.0, 0.06, 0.06, w);
48
+ for (let q = 0; q < 6; q++) {
49
+ const x = -0.75 + q * 0.3;
50
+ stick(B.wood, [x, 0, 0.5], [x, 2.3, -0.12], 0.02, C(0x6a5540, 0.15, R));
51
+ B.cloth.add(U.cone6, st, TRS(x, 2.3, -0.12, 0.06, 0.24, 0.06, 0, -0.26));
52
+ }
53
+ for (let q = 0; q < 2; q++)
54
+ B.cloth.add(U.cyl16, C(q ? 0x6a2a26 : 0x4a4640), TRS(-0.4 + q * 0.9, 0.42, -0.5, 0.8, 0.06, 0.8, 0, Math.PI / 2 - 0.35));
55
+ }
56
+ function propCookfire(B, R) {
57
+ // an iron pot hung from a tripod, logs to sit on
58
+ const w = C(0x3a2e22);
59
+ for (let k = 0; k < 3; k++) stick(B.wood, [Math.cos(k * 2.094) * 0.95, 0, Math.sin(k * 2.094) * 0.95], [0, 1.9, 0], 0.03, w);
60
+ stick(B.cloth, [0, 1.85, 0], [0, 0.95, 0], 0.012, [0.02, 0.02, 0.02]);
61
+ B.cloth.add(U.sph, [0.025, 0.024, 0.023], TRS(0, 0.75, 0, 0.5, 0.42, 0.5));
62
+ for (let k = 0; k < 3; k++) {
63
+ const a = k * 2.1 + 0.6;
64
+ B.wood.add(U.cyl, C(0x5a4632, 0.15, R), TRS(Math.cos(a) * 1.9, 0.2, Math.sin(a) * 1.9, 0.38, 1.3, 0.38, -a, 0, Math.PI / 2));
65
+ }
66
+ }
67
+
68
+ function propDesertWell(B, R) {
69
+ // a camp's well: a curb of rough fieldstones laid dry in two courses round a dark shaft, two forked posts carrying a beam with a
70
+ // wooden pulley, the rope down it, a leather bucket left on the curb, and the trodden, splashed ground round it
71
+ const st = C(0x9a8a70, 0.06, R),
72
+ tim = C(0x4a3826, 0.1, R);
73
+ for (let course = 0; course < 2; course++)
74
+ for (let k = 0; k < 13; k++) {
75
+ const a = ((k + course * 0.5) / 13) * Math.PI * 2 + (R() - 0.5) * 0.08,
76
+ r = 1.05 + (R() - 0.5) * 0.06;
77
+ B.stone.add(
78
+ U.box,
79
+ dim(st, 0.85 + R() * 0.3),
80
+ TRS(Math.cos(a) * r, course * 0.34, Math.sin(a) * r, 0.5 + R() * 0.12, 0.36, 0.42, -a, (R() - 0.5) * 0.1),
81
+ );
82
+ }
83
+ B.cloth.add(U.cyl16, [0.008, 0.009, 0.01], TRS(0, 0.3, 0, 1.7, 0.06, 1.7)); // the shaft, dark
84
+ B.stone.add(U.cyl16, [0.11, 0.1, 0.085], TRS(0, -0.02, 0, 4.6, 0.04, 4.2)); // the wet, trodden ground round the curb
85
+ for (const sx of [-1, 1]) {
86
+ stick(B.wood, [sx * 1.45, -0.3, 0], [sx * 1.4, 2.25, 0], 0.075, tim); // a forked post
87
+ stick(B.wood, [sx * 1.4, 2.0, 0], [sx * 1.6, 2.4, 0.04], 0.035, tim);
88
+ }
89
+ stick(B.wood, [-1.6, 2.28, 0], [1.6, 2.28, 0], 0.06, tim); // the beam
90
+ B.wood.add(U.cyl, dim(tim, 0.8), TRS(0.2, 2.18, -0.09, 0.32, 0.06, 0.32, 0, Math.PI / 2)); // the pulley wheel
91
+ stick(B.cloth, [0.2, 2.06, 0], [0.2, 0.3, 0], 0.012, HEMP); // the rope into the shaft
92
+ stick(B.cloth, [0.2, 2.06, 0], [1.5, 0.4, 0.7], 0.012, HEMP); // and its end to the bucket
93
+ B.cloth.add(U.taper, C(0x5a3a24, 0.1, R), TRS(1.5, 0.38, 0.7, 0.42, 0.38, 0.42, 0, Math.PI)); // the bucket, wide mouth up
94
+ B.cloth.add(U.cyl16, [0.03, 0.035, 0.04], TRS(1.5, 0.34, 0.7, 0.36, 0.01, 0.36));
95
+ }
96
+ function propPlankTrough(B, R) {
97
+ // a plank trough on two stones, its water dark in it, and the wet ground before it where the beasts stand; front is +z
98
+ const wood = C(0x6a5034, 0.1, R);
99
+ B.wood.box(0, 0.12, 0, 2.4, 0.06, 0.56, dim(wood, 0.85));
100
+ for (const sz of [-1, 1]) B.wood.box(0, 0.12, sz * 0.26, 2.4, 0.34, 0.05, wood, 0, sz * 0.08);
101
+ for (const sx of [-1, 1]) B.wood.box(sx * 1.18, 0.12, 0, 0.05, 0.34, 0.5, dim(wood, 0.9));
102
+ B.cloth.box(0, 0.38, 0, 2.3, 0.02, 0.44, [0.04, 0.05, 0.055]); // the water, nearly to the brim
103
+ for (const sx of [-1, 1]) B.stone.add(U.rock, C(0x8a7a62, 0.1, R), TRS(sx * 0.95, -0.08, 0, 0.45, 0.28, 0.6, R() * 3));
104
+ B.stone.add(U.cyl16, [0.1, 0.09, 0.075], TRS(0, -0.02, 0.7, 3.2, 0.03, 1.2));
105
+ }
106
+
107
+ function propWoodpile(B, R, n = 9) {
108
+ // split cordwood stacked between stakes, a chopping block and its axe
109
+ const wd = [0x6a5540, 0x5a4632, 0x77614a];
110
+ for (let j = 0; j < 5; j++)
111
+ for (let i = 0; i < n - (j > 2 ? j - 2 : 0); i++) {
112
+ const c = C(pickR(R, wd), 0.18, R);
113
+ B.wood.add(
114
+ U.cyl6,
115
+ c,
116
+ TRS(
117
+ (i - n / 2 + 0.5 + (j % 2) * 0.5) * 0.3,
118
+ 0.14 + j * 0.25,
119
+ -0.55 + (R() - 0.5) * 0.08,
120
+ 0.27 + R() * 0.05,
121
+ 1.1,
122
+ 0.26,
123
+ 0,
124
+ Math.PI / 2,
125
+ ),
126
+ );
127
+ }
128
+ for (const sx of [-1, 1]) B.wood.box(sx * (n * 0.15 + 0.12), -0.2, 0, 0.08, 1.6, 0.08, C(0x4a3a2a));
129
+ B.wood.add(U.cyl, C(0x5a4632), TRS(n * 0.15 + 1.2, -0.1, 0.5, 0.6, 0.6, 0.6));
130
+ stick(B.wood, [n * 0.15 + 1.2, 0.5, 0.5], [n * 0.15 + 1.75, 0.95, 0.42], 0.035, C(0x6a5540), U.box);
131
+ B.cloth.box(n * 0.15 + 1.2, 0.5, 0.5, 0.06, 0.2, 0.26, [0.3, 0.31, 0.33], 0.2);
132
+ for (let q = 0; q < 5; q++)
133
+ B.wood.add(
134
+ U.cyl6,
135
+ C(pickR(R, wd), 0.2, R),
136
+ TRS(n * 0.15 + 0.6 + R() * 1.4, 0.02, 0.9 + R() * 0.8, 0.22, 0.5, 0.2, R() * 6, Math.PI / 2),
137
+ );
138
+ }
139
+ function propBrazier(B, R) {
140
+ // a watch brazier: an iron basket on three legs, dung coals banked in it
141
+ const iron = [0.03, 0.03, 0.032];
142
+ for (let k = 0; k < 3; k++)
143
+ stick(
144
+ B.cloth,
145
+ [Math.cos(k * 2.094) * 0.42, 0, Math.sin(k * 2.094) * 0.42],
146
+ [Math.cos(k * 2.094) * 0.22, 0.8, Math.sin(k * 2.094) * 0.22],
147
+ 0.035,
148
+ iron,
149
+ U.box,
150
+ );
151
+ B.cloth.add(U.cyl6, iron, TRS(0, 0.74, 0, 0.62, 0.3, 0.62));
152
+ B.cloth.add(U.cyl6, iron, TRS(0, 0.62, 0, 0.4, 0.14, 0.4));
153
+ B.cloth.add(U.sph, [0.2, 0.05, 0.02], TRS(0, 0.96, 0, 0.5, 0.22, 0.5));
154
+ B.cloth.add(U.sph, [0.05, 0.04, 0.035], TRS(0.08, 1.0, 0.05, 0.3, 0.16, 0.34));
155
+ }
156
+ // A horse standing at a picket line, head up or down at its fodder: the horse a rider sits, cast where it stands.
157
+ function propHorseUp(into, x, y, z, yaw, col, R, graze) {
158
+ stillHorse(into, x, y, z, yaw, col, R, graze);
159
+ }
160
+ function propRaven(gb, x, y, z, yaw, s) {
161
+ // a raven on the ground or a perch
162
+ const k = [0.016, 0.016, 0.02],
163
+ sn = Math.sin(yaw),
164
+ cs = Math.cos(yaw);
165
+ gb.add(U.sph, k, TRS(x, y + 0.08 * s, z, 0.3 * s, 0.32 * s, 0.6 * s, yaw, -0.5));
166
+ gb.add(U.sph, k, TRS(x + sn * 0.25 * s, y + 0.4 * s, z + cs * 0.25 * s, 0.2 * s, 0.2 * s, 0.22 * s));
167
+ gb.add(
168
+ U.cone6,
169
+ [0.05, 0.05, 0.05],
170
+ TRS(x + sn * 0.33 * s, y + 0.49 * s, z + cs * 0.33 * s, 0.07 * s, 0.24 * s, 0.07 * s, yaw, Math.PI / 2 + 0.25),
171
+ );
172
+ gb.box(x - sn * 0.36 * s, y + 0.02 * s, z - cs * 0.36 * s, 0.17 * s, 0.03 * s, 0.4 * s, k, yaw, 0.5);
173
+ }
174
+ return { fodderStack, propBrazier, propCookfire, propDesertWell, propHorseUp, propPlankTrough, propRack, propRaven, propWoodpile };
175
+ }
@@ -0,0 +1,26 @@
1
+ // A door's leaf of planks bound with black iron, hung in a doorway a world builds. Worker-safe.
2
+ import { dim } from '../math/color.js';
3
+ import { C, TRS } from './primitives.js';
4
+
5
+ /**
6
+ * The door props, bound to a world's shapes and hash.
7
+ * @param {object} o
8
+ * @param {object} o.shapes - The unit shapes (`createUnitShapes`).
9
+ * @param {Function} o.hash - The world's hash (`createHash`), which shades each plank.
10
+ * @returns {{strappedDoor: Function}} `strappedDoor(builder, R, x, z, width, height)`: the leaf into one builder, its hinge at
11
+ * (x, z) of the builder's frame (the west jamb), metres.
12
+ */
13
+ export function createDoorProps({ shapes: U, hash: hash2 }) {
14
+ // The door's leaf into builder b, its hinge at (x, z) of b's frame (the west jamb): planks bound with black iron.
15
+ function strappedDoor(b, rng, x, z, w, h) {
16
+ const oak = C(0x2e241c, 0.06, rng),
17
+ iron = [0.03, 0.03, 0.034];
18
+ for (let p = 0; p < 5; p++) b.box(x + (p + 0.5) * (w / 5), 0, z, w / 5 - 0.012, h, 0.12, dim(oak, 0.8 + 0.3 * hash2(p, 5, 974)));
19
+ for (const y of [0.35, h / 2, h - 0.35]) b.box(x + w / 2, y, z + 0.07, w - 0.06, 0.12, 0.03, iron);
20
+ const latchX = x + w - 0.22,
21
+ wornIron = [0.16, 0.15, 0.13];
22
+ b.add(U.cyl6, iron, TRS(latchX, 1.15, z + 0.1, 0.16, 0.05, 0.16, 0, Math.PI / 2));
23
+ b.box(latchX - 0.07, 1.15, z + 0.15, 0.21, 0.035, 0.055, wornIron);
24
+ }
25
+ return { strappedDoor };
26
+ }
@@ -0,0 +1,105 @@
1
+ // The furniture of a quay: sheer-legs with their windlass, and nets hung to dry on a rack. Each is built into a house kit's
2
+ // builders round the kit frame's origin, the water to +z. Worker-safe.
3
+ import { dim } from '../math/color.js';
4
+ import { pickR } from '../math/random.js';
5
+ import { C, TRS, stick } from './primitives.js';
6
+ import { HOUSE_PALETTE } from './house-kit-palette.js';
7
+ import { sackLying } from './prop-sacks.js';
8
+ import { sampleSurface as surf } from './sampled-surface.js';
9
+
10
+ /**
11
+ * The harbour props, bound to a world's shapes and palette.
12
+ * @param {object} o
13
+ * @param {object} o.shapes - The unit shapes (`createUnitShapes`).
14
+ * @param {object} [o.palette] - The house palette (`hemp` for rope, `cloths` and `awnings`, sRGB hex choices); a house kit's
15
+ * `palette`, or the kit's default (`HOUSE_PALETTE`).
16
+ * @returns {object} `propCrane(B, R, quarry)` (a quarry's lifts stone, not sacks) and `propNetRack(B, R)`.
17
+ */
18
+ export function createHarbourProps({ shapes: U, palette = HOUSE_PALETTE }) {
19
+ const { hemp: HEMP } = palette;
20
+ // Sheer-legs on the quay, +z the water: two tapering poles of weathered timber standing in stone shoes, leaning out over the
21
+ // edge and lashed where they cross; two guys back to rings in the paving; a block hung from the lashing, its fall down to the
22
+ // hook and a sling of sacks, and the hauling part back to a windlass on its trestles, worked by handspikes.
23
+ const CRANE = { head: [0, 6.9, 2.5], feet: 1.5, guyBack: 6.2, guySpread: 2.4, load: 2.1 }; // metres
24
+ function propCrane(B, R, quarry = false) {
25
+ const tim = C(0x7a6a56, 0.1, R),
26
+ iron = [0.05, 0.05, 0.055],
27
+ [hx, hy, hz] = CRANE.head;
28
+ for (const sx of [-1, 1]) {
29
+ stick(B.wood, [sx * CRANE.feet, 0.1, 0], [sx * 0.12, hy + 0.35, hz + 0.05], 0.32, dim(tim, 0.95 + sx * 0.05), U.taper);
30
+ B.stone.box(sx * CRANE.feet, -0.1, 0, 0.7, 0.34, 0.7, C(0x6a645a, 0.05, R)); // its shoe
31
+ B.trim.add(U.cyl6, iron, TRS(sx * CRANE.feet, 0.18, 0, 0.36, 0.08, 0.36)); // the iron band at its foot
32
+ const ring = [sx * CRANE.guySpread, 0.02, -CRANE.guyBack];
33
+ stick(B.trim, [hx, hy + 0.15, hz - 0.1], ring, 0.03, HEMP, U.box); // a guy
34
+ B.trim.add(U.cyl6, iron, TRS(ring[0], -0.02, ring[2], 0.24, 0.06, 0.24));
35
+ }
36
+ for (let k = 0; k < 5; k++) B.trim.add(U.cyl6, HEMP, TRS(hx, hy - 0.05 + k * 0.07, hz, 0.42, 0.06, 0.42, 0, 0.35, 0)); // the lashing
37
+ // the block: its wooden shell in an iron strop, the sheave showing at its sides
38
+ B.trim.box(hx, hy - 0.55, hz, 0.05, 0.5, 0.05, iron);
39
+ B.wood.box(hx, hy - 1.05, hz, 0.2, 0.5, 0.32, dim(tim, 0.8));
40
+ B.trim.add(U.cyl16, dim(tim, 0.6), TRS(hx - 0.11, hy - 0.8, hz, 0.26, 0.02, 0.26, 0, 0, Math.PI / 2));
41
+ // the fall to the hook, the sling and its two sacks
42
+ const hook = [hx, CRANE.load + 1.0, hz];
43
+ stick(B.trim, [hx, hy - 1.05, hz + 0.08], hook, 0.03, HEMP, U.box);
44
+ B.trim.add(U.cone6, iron, TRS(hook[0], hook[1] - 0.22, hook[2], 0.12, 0.22, 0.12, 0, Math.PI, 0));
45
+ B.trim.add(U.cyl6, iron, TRS(hook[0], hook[1] - 0.3, hook[2], 0.14, 0.04, 0.14, 0, Math.PI / 2, 0));
46
+ for (const sx of [-0.32, 0.32]) {
47
+ stick(B.trim, [hook[0], hook[1] - 0.28, hook[2]], [sx, CRANE.load + (quarry ? 0.5 : 0.3), hz + 0.05], 0.025, HEMP, U.box);
48
+ stick(B.trim, [sx, CRANE.load + (quarry ? 0.5 : 0.3), hz + 0.05], [sx, CRANE.load - 0.02, hz + 0.05], 0.025, HEMP, U.box);
49
+ }
50
+ if (quarry) B.stone.box(hx, CRANE.load - 0.02, hz, 0.76, 0.52, 0.68, C(0xa49a84, 0.07, R));
51
+ else
52
+ for (let k = 0; k < 2; k++)
53
+ sackLying(
54
+ B.cloth,
55
+ C(0x8a7a5a, 0.12, R),
56
+ 0,
57
+ CRANE.load + k * 0.3,
58
+ hz + (k - 0.5) * 0.08,
59
+ Math.PI / 2 + (k - 0.5) * 0.2,
60
+ 0.85,
61
+ 0.48,
62
+ 0.32,
63
+ );
64
+ // the hauling part from the block back to the windlass: a drum on two trestles, the rope wound on it, handspikes in its head
65
+ const wz = -1.6,
66
+ wy = 1.0;
67
+ stick(B.trim, [hx, hy - 0.85, hz - 0.1], [-0.2, wy + 0.18, wz], 0.03, HEMP, U.box);
68
+ for (const sx of [-0.75, 0.75]) {
69
+ stick(B.wood, [sx, 0, wz - 0.45], [sx, wy + 0.05, wz], 0.12, tim, U.box);
70
+ stick(B.wood, [sx, 0, wz + 0.45], [sx, wy + 0.05, wz], 0.12, tim, U.box);
71
+ B.wood.box(sx, 0, wz, 0.12, 0.1, 1.0, dim(tim, 0.85));
72
+ }
73
+ B.wood.add(U.cyl, dim(tim, 1.1), TRS(-0.85, wy, wz, 0.32, 1.7, 0.32, 0, 0, -Math.PI / 2));
74
+ const coil = dim(HEMP, 0.72); // rope wound on, darkened by handling and tar
75
+ B.cloth.add(U.cyl16, coil, TRS(-0.45, wy, wz, 0.4, 0.75, 0.4, 0, 0, -Math.PI / 2));
76
+ for (let k = 0; k < 6; k++)
77
+ B.cloth.add(U.cyl16, dim(coil, 0.85 + (k % 2) * 0.2), TRS(-0.42 + k * 0.13, wy, wz, 0.43, 0.06, 0.43, 0, 0, -Math.PI / 2)); // its turns
78
+ for (const x of [-0.51, 0.3]) B.wood.add(U.cyl16, dim(tim, 0.9), TRS(x, wy, wz, 0.56, 0.06, 0.56, 0, 0, -Math.PI / 2)); // the drum's flanges
79
+ for (let k = 0; k < 4; k++) {
80
+ const a = k * (Math.PI / 2) + 0.3;
81
+ stick(B.wood, [0.82, wy, wz], [0.82, wy + Math.sin(a) * 0.75, wz + Math.cos(a) * 0.75], 0.05, dim(tim, 1.15));
82
+ }
83
+ }
84
+ function propNetRack(B, R) {
85
+ // nets hung to dry over a pole between two posts, cork floats along their head-ropes
86
+ const tim = C(0x4a3a2a, 0.15, R),
87
+ net = C(pickR(R, [0x4a4436, 0x3e3a30, 0x55503e]), 0.1, R);
88
+ for (const sx of [-1.6, 1.6]) B.wood.box(sx, -0.2, 0, 0.14, 2.2, 0.14, tim);
89
+ B.wood.add(U.cyl6, tim, TRS(-1.75, 1.95, 0, 0.1, 3.5, 0.1, 0, 0, -Math.PI / 2));
90
+ for (const sg of [-1, 1])
91
+ surf(
92
+ B.cloth,
93
+ 6,
94
+ 3,
95
+ (u, v) => [(u - 0.5) * 3.1, 1.95 - v * (1.6 + 0.2 * Math.sin(u * 9)), sg * (0.04 + v * 0.35) + Math.sin(u * 7 + v * 3) * 0.06],
96
+ net,
97
+ { flip: sg > 0, back: dim(net, 0.7) },
98
+ );
99
+ for (let k = 0; k < 7; k++) B.cloth.add(U.sph, C(0xb09a6a, 0.1, R), TRS(-1.35 + k * 0.45, 1.92, 0.08, 0.12, 0.09, 0.12));
100
+ B.cloth.add(U.cyl16, net, TRS(1.2, 0, 1.0, 1.4, 0.35, 1.2, R() * 3));
101
+ }
102
+
103
+ // A boat of the harbours and shores from the ship kit, `len` metres long, of the kind a harbour has at that length (boatSpec);
104
+ return { propCrane, propNetRack };
105
+ }