wallhammer-web 0.0.0-stage → 0.4.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 (408) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -2
  3. package/dist/base/data.d.ts +67 -0
  4. package/dist/base/data.js +10 -0
  5. package/dist/base/destructible.d.ts +167 -0
  6. package/dist/base/destructible.js +47 -0
  7. package/dist/base/env-slot.d.ts +101 -0
  8. package/dist/base/env-slot.js +8 -0
  9. package/dist/base/frames.d.ts +138 -0
  10. package/dist/base/frames.js +459 -0
  11. package/dist/base/index.d.ts +21 -0
  12. package/dist/base/index.js +11 -0
  13. package/dist/base/mat34.d.ts +46 -0
  14. package/dist/base/mat34.js +173 -0
  15. package/dist/base/material.d.ts +87 -0
  16. package/dist/base/material.js +6 -0
  17. package/dist/base/math.d.ts +27 -0
  18. package/dist/base/math.js +60 -0
  19. package/dist/base/progress.d.ts +38 -0
  20. package/dist/base/progress.js +81 -0
  21. package/dist/base/rig.d.ts +177 -0
  22. package/dist/base/rig.js +97 -0
  23. package/dist/base/trig.d.ts +29 -0
  24. package/dist/base/trig.js +169 -0
  25. package/dist/base/up.d.ts +26 -0
  26. package/dist/base/up.js +40 -0
  27. package/dist/base/view.d.ts +128 -0
  28. package/dist/base/view.js +136 -0
  29. package/dist/camera/camera.d.ts +99 -0
  30. package/dist/camera/camera.js +228 -0
  31. package/dist/camera/follow.d.ts +120 -0
  32. package/dist/camera/follow.js +320 -0
  33. package/dist/camera/free.d.ts +153 -0
  34. package/dist/camera/free.js +359 -0
  35. package/dist/camera/index.d.ts +10 -0
  36. package/dist/camera/index.js +6 -0
  37. package/dist/camera/orbit.d.ts +93 -0
  38. package/dist/camera/orbit.js +261 -0
  39. package/dist/camera/path.d.ts +48 -0
  40. package/dist/camera/path.js +179 -0
  41. package/dist/core/ballistic.d.ts +66 -0
  42. package/dist/core/ballistic.js +104 -0
  43. package/dist/core/bodies.d.ts +77 -0
  44. package/dist/core/bodies.js +125 -0
  45. package/dist/core/clock.d.ts +37 -0
  46. package/dist/core/clock.js +87 -0
  47. package/dist/core/cover-fade.d.ts +14 -0
  48. package/dist/core/cover-fade.js +38 -0
  49. package/dist/core/index.d.ts +13 -0
  50. package/dist/core/index.js +8 -0
  51. package/dist/core/kepler.d.ts +74 -0
  52. package/dist/core/kepler.js +108 -0
  53. package/dist/core/level-fade.d.ts +66 -0
  54. package/dist/core/level-fade.js +123 -0
  55. package/dist/core/palette.d.ts +15 -0
  56. package/dist/core/palette.js +47 -0
  57. package/dist/env/atmosphere.d.ts +129 -0
  58. package/dist/env/atmosphere.js +707 -0
  59. package/dist/env/cloud-field.d.ts +44 -0
  60. package/dist/env/cloud-field.js +111 -0
  61. package/dist/env/environment.d.ts +217 -0
  62. package/dist/env/environment.js +441 -0
  63. package/dist/env/frame-block.d.ts +29 -0
  64. package/dist/env/frame-block.js +152 -0
  65. package/dist/env/glsl.d.ts +35 -0
  66. package/dist/env/glsl.js +246 -0
  67. package/dist/env/index.d.ts +13 -0
  68. package/dist/env/index.js +9 -0
  69. package/dist/env/sky.d.ts +48 -0
  70. package/dist/env/sky.js +227 -0
  71. package/dist/env/sun.d.ts +31 -0
  72. package/dist/env/sun.js +42 -0
  73. package/dist/gen-arch/build.d.ts +17 -0
  74. package/dist/gen-arch/build.js +414 -0
  75. package/dist/gen-arch/damage/damaged.d.ts +44 -0
  76. package/dist/gen-arch/damage/damaged.js +1119 -0
  77. package/dist/gen-arch/damage/fall-material.d.ts +10 -0
  78. package/dist/gen-arch/damage/fall-material.js +47 -0
  79. package/dist/gen-arch/damage/fall.d.ts +78 -0
  80. package/dist/gen-arch/damage/fall.js +797 -0
  81. package/dist/gen-arch/damage/rubble.d.ts +22 -0
  82. package/dist/gen-arch/damage/rubble.js +188 -0
  83. package/dist/gen-arch/index.d.ts +25 -0
  84. package/dist/gen-arch/index.js +16 -0
  85. package/dist/gen-arch/interior/interior-plan.d.ts +114 -0
  86. package/dist/gen-arch/interior/interior-plan.js +615 -0
  87. package/dist/gen-arch/interior/interior.d.ts +97 -0
  88. package/dist/gen-arch/interior/interior.js +966 -0
  89. package/dist/gen-arch/structure/building-shader.d.ts +25 -0
  90. package/dist/gen-arch/structure/building-shader.js +946 -0
  91. package/dist/gen-arch/structure/buildings.d.ts +248 -0
  92. package/dist/gen-arch/structure/buildings.js +294 -0
  93. package/dist/gen-arch/structure/dims.d.ts +77 -0
  94. package/dist/gen-arch/structure/dims.js +39 -0
  95. package/dist/gen-arch/structure/distant.d.ts +62 -0
  96. package/dist/gen-arch/structure/distant.js +316 -0
  97. package/dist/gen-arch/structure/env-slots.d.ts +18 -0
  98. package/dist/gen-arch/structure/env-slots.js +47 -0
  99. package/dist/gen-arch/structure/facade.d.ts +193 -0
  100. package/dist/gen-arch/structure/facade.js +159 -0
  101. package/dist/gen-arch/structure/parts.d.ts +31 -0
  102. package/dist/gen-arch/structure/parts.js +69 -0
  103. package/dist/gen-arch/structure/roof.d.ts +76 -0
  104. package/dist/gen-arch/structure/roof.js +568 -0
  105. package/dist/gen-arch/structure/structure-material.d.ts +23 -0
  106. package/dist/gen-arch/structure/structure-material.js +55 -0
  107. package/dist/gen-arch/structure/writer.d.ts +94 -0
  108. package/dist/gen-arch/structure/writer.js +195 -0
  109. package/dist/gen-core/cell.d.ts +138 -0
  110. package/dist/gen-core/cell.js +150 -0
  111. package/dist/gen-core/cube-sphere.d.ts +57 -0
  112. package/dist/gen-core/cube-sphere.js +159 -0
  113. package/dist/gen-core/field.d.ts +55 -0
  114. package/dist/gen-core/field.js +154 -0
  115. package/dist/gen-core/geometry.d.ts +31 -0
  116. package/dist/gen-core/geometry.js +231 -0
  117. package/dist/gen-core/hash.d.ts +18 -0
  118. package/dist/gen-core/hash.js +58 -0
  119. package/dist/gen-core/height-field.d.ts +33 -0
  120. package/dist/gen-core/height-field.js +137 -0
  121. package/dist/gen-core/index.d.ts +22 -0
  122. package/dist/gen-core/index.js +17 -0
  123. package/dist/gen-core/instance-cells.d.ts +37 -0
  124. package/dist/gen-core/instance-cells.js +72 -0
  125. package/dist/gen-core/near-scatter.d.ts +56 -0
  126. package/dist/gen-core/near-scatter.js +120 -0
  127. package/dist/gen-core/noise.d.ts +23 -0
  128. package/dist/gen-core/noise.js +72 -0
  129. package/dist/gen-core/occupancy.d.ts +21 -0
  130. package/dist/gen-core/occupancy.js +104 -0
  131. package/dist/gen-core/sphere-patch.d.ts +138 -0
  132. package/dist/gen-core/sphere-patch.js +544 -0
  133. package/dist/gen-core/strip-surface.d.ts +34 -0
  134. package/dist/gen-core/strip-surface.js +246 -0
  135. package/dist/gen-core/strip.d.ts +102 -0
  136. package/dist/gen-core/strip.js +817 -0
  137. package/dist/gen-ground/env-slots.d.ts +48 -0
  138. package/dist/gen-ground/env-slots.js +78 -0
  139. package/dist/gen-ground/ground.d.ts +78 -0
  140. package/dist/gen-ground/ground.js +208 -0
  141. package/dist/gen-ground/index.d.ts +9 -0
  142. package/dist/gen-ground/index.js +7 -0
  143. package/dist/gen-ground/markings.d.ts +46 -0
  144. package/dist/gen-ground/markings.js +124 -0
  145. package/dist/gen-ground/materials.d.ts +18 -0
  146. package/dist/gen-ground/materials.js +22 -0
  147. package/dist/gen-ground/terrain-shader.d.ts +5 -0
  148. package/dist/gen-ground/terrain-shader.js +151 -0
  149. package/dist/gen-mesh/bare-shapes.d.ts +194 -0
  150. package/dist/gen-mesh/bare-shapes.js +596 -0
  151. package/dist/gen-mesh/bisect-surface.d.ts +47 -0
  152. package/dist/gen-mesh/bisect-surface.js +261 -0
  153. package/dist/gen-mesh/box.d.ts +18 -0
  154. package/dist/gen-mesh/box.js +2 -0
  155. package/dist/gen-mesh/cell-morph-mesh.d.ts +52 -0
  156. package/dist/gen-mesh/cell-morph-mesh.js +258 -0
  157. package/dist/gen-mesh/cell-surface-mesh.d.ts +32 -0
  158. package/dist/gen-mesh/cell-surface-mesh.js +140 -0
  159. package/dist/gen-mesh/chunk-mesh.d.ts +25 -0
  160. package/dist/gen-mesh/chunk-mesh.js +112 -0
  161. package/dist/gen-mesh/drape-mesh.d.ts +36 -0
  162. package/dist/gen-mesh/drape-mesh.js +98 -0
  163. package/dist/gen-mesh/height-field-mesh.d.ts +14 -0
  164. package/dist/gen-mesh/height-field-mesh.js +98 -0
  165. package/dist/gen-mesh/index.d.ts +26 -0
  166. package/dist/gen-mesh/index.js +15 -0
  167. package/dist/gen-mesh/line-mesh.d.ts +25 -0
  168. package/dist/gen-mesh/line-mesh.js +62 -0
  169. package/dist/gen-mesh/mesh-builder.d.ts +115 -0
  170. package/dist/gen-mesh/mesh-builder.js +315 -0
  171. package/dist/gen-mesh/packed-mesh.d.ts +53 -0
  172. package/dist/gen-mesh/packed-mesh.js +205 -0
  173. package/dist/gen-mesh/prism-mesh.d.ts +33 -0
  174. package/dist/gen-mesh/prism-mesh.js +176 -0
  175. package/dist/gen-mesh/rig-mesh.d.ts +9 -0
  176. package/dist/gen-mesh/rig-mesh.js +135 -0
  177. package/dist/gen-mesh/strip-mesh.d.ts +45 -0
  178. package/dist/gen-mesh/strip-mesh.js +258 -0
  179. package/dist/gen-plan/drain.d.ts +58 -0
  180. package/dist/gen-plan/drain.js +270 -0
  181. package/dist/gen-plan/grid.d.ts +37 -0
  182. package/dist/gen-plan/grid.js +182 -0
  183. package/dist/gen-plan/horizon.d.ts +50 -0
  184. package/dist/gen-plan/horizon.js +185 -0
  185. package/dist/gen-plan/index.d.ts +15 -0
  186. package/dist/gen-plan/index.js +13 -0
  187. package/dist/gen-plan/line-tiles.d.ts +35 -0
  188. package/dist/gen-plan/line-tiles.js +190 -0
  189. package/dist/gen-plan/lines.d.ts +31 -0
  190. package/dist/gen-plan/lines.js +183 -0
  191. package/dist/gen-plan/plots.d.ts +40 -0
  192. package/dist/gen-plan/plots.js +282 -0
  193. package/dist/gen-plan/route.d.ts +55 -0
  194. package/dist/gen-plan/route.js +297 -0
  195. package/dist/gen-plan/sites.d.ts +32 -0
  196. package/dist/gen-plan/sites.js +209 -0
  197. package/dist/gen-tex/code-stamp.d.ts +31 -0
  198. package/dist/gen-tex/code-stamp.js +137 -0
  199. package/dist/gen-tex/index.d.ts +7 -0
  200. package/dist/gen-tex/index.js +5 -0
  201. package/dist/gen-tex/light-horizon.d.ts +47 -0
  202. package/dist/gen-tex/light-horizon.js +180 -0
  203. package/dist/gen-tex/textures.d.ts +8 -0
  204. package/dist/gen-tex/textures.js +49 -0
  205. package/dist/gen-tex/value-textures.d.ts +46 -0
  206. package/dist/gen-tex/value-textures.js +102 -0
  207. package/dist/gen-vegetation/env-slots.d.ts +20 -0
  208. package/dist/gen-vegetation/env-slots.js +29 -0
  209. package/dist/gen-vegetation/index.d.ts +8 -0
  210. package/dist/gen-vegetation/index.js +7 -0
  211. package/dist/gen-vegetation/materials.d.ts +7 -0
  212. package/dist/gen-vegetation/materials.js +17 -0
  213. package/dist/gen-vegetation/planting.d.ts +170 -0
  214. package/dist/gen-vegetation/planting.js +363 -0
  215. package/dist/gen-vegetation/tree-shader.d.ts +23 -0
  216. package/dist/gen-vegetation/tree-shader.js +229 -0
  217. package/dist/gen-vegetation/trees.d.ts +59 -0
  218. package/dist/gen-vegetation/trees.js +329 -0
  219. package/dist/gpu/device.d.ts +286 -0
  220. package/dist/gpu/device.js +1157 -0
  221. package/dist/gpu/gl.d.ts +134 -0
  222. package/dist/gpu/gl.js +276 -0
  223. package/dist/gpu/index.d.ts +4 -0
  224. package/dist/gpu/index.js +3 -0
  225. package/dist/index.d.ts +11 -0
  226. package/dist/index.js +13 -0
  227. package/dist/motion/graph.d.ts +244 -0
  228. package/dist/motion/graph.js +739 -0
  229. package/dist/motion/index.d.ts +8 -0
  230. package/dist/motion/index.js +8 -0
  231. package/dist/motion/pose-ops.d.ts +30 -0
  232. package/dist/motion/pose-ops.js +232 -0
  233. package/dist/motion/reach.d.ts +45 -0
  234. package/dist/motion/reach.js +264 -0
  235. package/dist/motion/skeleton.d.ts +49 -0
  236. package/dist/motion/skeleton.js +99 -0
  237. package/dist/platform/byte-store.d.ts +21 -0
  238. package/dist/platform/byte-store.js +137 -0
  239. package/dist/platform/canvas.d.ts +29 -0
  240. package/dist/platform/canvas.js +76 -0
  241. package/dist/platform/context-loss.d.ts +8 -0
  242. package/dist/platform/context-loss.js +17 -0
  243. package/dist/platform/free-input.d.ts +51 -0
  244. package/dist/platform/free-input.js +100 -0
  245. package/dist/platform/index.d.ts +18 -0
  246. package/dist/platform/index.js +10 -0
  247. package/dist/platform/input.d.ts +48 -0
  248. package/dist/platform/input.js +117 -0
  249. package/dist/platform/keys.d.ts +12 -0
  250. package/dist/platform/keys.js +29 -0
  251. package/dist/platform/loop.d.ts +41 -0
  252. package/dist/platform/loop.js +84 -0
  253. package/dist/platform/walk-input.d.ts +74 -0
  254. package/dist/platform/walk-input.js +226 -0
  255. package/dist/platform/worker.d.ts +51 -0
  256. package/dist/platform/worker.js +170 -0
  257. package/dist/render/bone-instances.d.ts +24 -0
  258. package/dist/render/bone-instances.js +74 -0
  259. package/dist/render/cells.d.ts +70 -0
  260. package/dist/render/cells.js +144 -0
  261. package/dist/render/glsl.d.ts +66 -0
  262. package/dist/render/glsl.js +173 -0
  263. package/dist/render/index.d.ts +26 -0
  264. package/dist/render/index.js +16 -0
  265. package/dist/render/instance-sets.d.ts +97 -0
  266. package/dist/render/instance-sets.js +241 -0
  267. package/dist/render/near-instances.d.ts +75 -0
  268. package/dist/render/near-instances.js +219 -0
  269. package/dist/render/particles.d.ts +63 -0
  270. package/dist/render/particles.js +215 -0
  271. package/dist/render/pieces.d.ts +57 -0
  272. package/dist/render/pieces.js +151 -0
  273. package/dist/render/point-lights.d.ts +97 -0
  274. package/dist/render/point-lights.js +243 -0
  275. package/dist/render/renderer.d.ts +447 -0
  276. package/dist/render/renderer.js +1100 -0
  277. package/dist/render/rig.d.ts +74 -0
  278. package/dist/render/rig.js +576 -0
  279. package/dist/render/shadow-areas.d.ts +49 -0
  280. package/dist/render/shadow-areas.js +125 -0
  281. package/dist/render/shadow-glsl.d.ts +12 -0
  282. package/dist/render/shadow-glsl.js +146 -0
  283. package/dist/render/transient.d.ts +61 -0
  284. package/dist/render/transient.js +213 -0
  285. package/dist/render/value-glsl.d.ts +17 -0
  286. package/dist/render/value-glsl.js +208 -0
  287. package/dist/render/value-layers.d.ts +180 -0
  288. package/dist/render/value-layers.js +333 -0
  289. package/dist/runtime/atmosphere.d.ts +37 -0
  290. package/dist/runtime/atmosphere.js +304 -0
  291. package/dist/runtime/cloud-shell.d.ts +29 -0
  292. package/dist/runtime/cloud-shell.js +158 -0
  293. package/dist/runtime/engine.d.ts +155 -0
  294. package/dist/runtime/engine.js +305 -0
  295. package/dist/runtime/environment-link.d.ts +22 -0
  296. package/dist/runtime/environment-link.js +49 -0
  297. package/dist/runtime/index.d.ts +13 -0
  298. package/dist/runtime/index.js +12 -0
  299. package/dist/runtime/precipitation-glsl.d.ts +2 -0
  300. package/dist/runtime/precipitation-glsl.js +70 -0
  301. package/dist/runtime/precipitation.d.ts +11 -0
  302. package/dist/runtime/precipitation.js +78 -0
  303. package/dist/runtime/sky.d.ts +30 -0
  304. package/dist/runtime/sky.js +114 -0
  305. package/dist/runtime/streaming.d.ts +245 -0
  306. package/dist/runtime/streaming.js +602 -0
  307. package/dist/sim/agenda.d.ts +167 -0
  308. package/dist/sim/agenda.js +425 -0
  309. package/dist/sim/bytes.d.ts +34 -0
  310. package/dist/sim/bytes.js +125 -0
  311. package/dist/sim/destruction/apply.d.ts +59 -0
  312. package/dist/sim/destruction/apply.js +243 -0
  313. package/dist/sim/destruction/cell-states.d.ts +54 -0
  314. package/dist/sim/destruction/cell-states.js +198 -0
  315. package/dist/sim/destruction/index.d.ts +11 -0
  316. package/dist/sim/destruction/index.js +10 -0
  317. package/dist/sim/destruction/int-geometry.d.ts +17 -0
  318. package/dist/sim/destruction/int-geometry.js +131 -0
  319. package/dist/sim/destruction/pick.d.ts +13 -0
  320. package/dist/sim/destruction/pick.js +59 -0
  321. package/dist/sim/destruction/rubble.d.ts +8 -0
  322. package/dist/sim/destruction/rubble.js +159 -0
  323. package/dist/sim/destruction/state.d.ts +15 -0
  324. package/dist/sim/destruction/state.js +83 -0
  325. package/dist/sim/destruction/structure.d.ts +30 -0
  326. package/dist/sim/destruction/structure.js +139 -0
  327. package/dist/sim/events.d.ts +37 -0
  328. package/dist/sim/events.js +106 -0
  329. package/dist/sim/fixed.d.ts +21 -0
  330. package/dist/sim/fixed.js +64 -0
  331. package/dist/sim/flow-probe.d.ts +58 -0
  332. package/dist/sim/flow-probe.js +158 -0
  333. package/dist/sim/flow.d.ts +257 -0
  334. package/dist/sim/flow.js +967 -0
  335. package/dist/sim/index.d.ts +28 -0
  336. package/dist/sim/index.js +20 -0
  337. package/dist/sim/interlock.d.ts +47 -0
  338. package/dist/sim/interlock.js +252 -0
  339. package/dist/sim/movers.d.ts +228 -0
  340. package/dist/sim/movers.js +1083 -0
  341. package/dist/sim/nav.d.ts +72 -0
  342. package/dist/sim/nav.js +292 -0
  343. package/dist/sim/paths.d.ts +80 -0
  344. package/dist/sim/paths.js +197 -0
  345. package/dist/sim/regions.d.ts +87 -0
  346. package/dist/sim/regions.js +517 -0
  347. package/dist/sim/simulation.d.ts +114 -0
  348. package/dist/sim/simulation.js +291 -0
  349. package/dist/sim/states.d.ts +23 -0
  350. package/dist/sim/states.js +54 -0
  351. package/dist/sim/table.d.ts +49 -0
  352. package/dist/sim/table.js +126 -0
  353. package/dist/sim/zones.d.ts +11 -0
  354. package/dist/sim/zones.js +196 -0
  355. package/dist/tools/collision-lines.d.ts +12 -0
  356. package/dist/tools/collision-lines.js +50 -0
  357. package/dist/tools/data-view-glsl.d.ts +3 -0
  358. package/dist/tools/data-view-glsl.js +63 -0
  359. package/dist/tools/data-view-layers.d.ts +20 -0
  360. package/dist/tools/data-view-layers.js +60 -0
  361. package/dist/tools/debug-view.d.ts +30 -0
  362. package/dist/tools/debug-view.js +4 -0
  363. package/dist/tools/index.d.ts +10 -0
  364. package/dist/tools/index.js +7 -0
  365. package/dist/tools/mesh-checks.d.ts +67 -0
  366. package/dist/tools/mesh-checks.js +188 -0
  367. package/dist/tools/profile.d.ts +85 -0
  368. package/dist/tools/profile.js +173 -0
  369. package/dist/world/cell-cache.d.ts +32 -0
  370. package/dist/world/cell-cache.js +60 -0
  371. package/dist/world/cell-format.d.ts +25 -0
  372. package/dist/world/cell-format.js +232 -0
  373. package/dist/world/collide.d.ts +192 -0
  374. package/dist/world/collide.js +822 -0
  375. package/dist/world/index.d.ts +16 -0
  376. package/dist/world/index.js +12 -0
  377. package/dist/world/mesh-solids.d.ts +48 -0
  378. package/dist/world/mesh-solids.js +169 -0
  379. package/dist/world/pick.d.ts +34 -0
  380. package/dist/world/pick.js +177 -0
  381. package/dist/world/providers.d.ts +66 -0
  382. package/dist/world/providers.js +83 -0
  383. package/dist/world/sphere.d.ts +69 -0
  384. package/dist/world/sphere.js +271 -0
  385. package/dist/world/streaming.d.ts +288 -0
  386. package/dist/world/streaming.js +801 -0
  387. package/dist/world/walker.d.ts +145 -0
  388. package/dist/world/walker.js +502 -0
  389. package/docs/architecture.md +111 -0
  390. package/docs/cameras.md +302 -0
  391. package/docs/concepts.md +123 -0
  392. package/docs/destruction.md +127 -0
  393. package/docs/frames.md +199 -0
  394. package/docs/generators.md +575 -0
  395. package/docs/getting-started.md +123 -0
  396. package/docs/headless.md +50 -0
  397. package/docs/motion.md +160 -0
  398. package/docs/planet.md +152 -0
  399. package/docs/recipes.md +521 -0
  400. package/docs/reference.md +364 -0
  401. package/docs/rendering.md +823 -0
  402. package/docs/rigs.md +203 -0
  403. package/docs/simulation.md +235 -0
  404. package/docs/streaming.md +590 -0
  405. package/docs/system.md +166 -0
  406. package/docs/tools.md +175 -0
  407. package/docs/walking.md +262 -0
  408. package/package.json +131 -3
@@ -0,0 +1,364 @@
1
+ # Reference
2
+
3
+ Every entry of the package, with its main names, checked against each `src/<module>/index.ts`. Rows starting with "types" list type-only exports. For full signatures, read the doc comments in the source.
4
+
5
+ ## `wallhammer-web` (root)
6
+
7
+ Re-exports `base`, `platform`, `core`, `gen-core`, `gen-mesh`, `gen-tex`, `gpu`, `camera`, `env`, `world` and `tools`. Not `render`, `sim`, `sim/destruction`, `runtime`, `gen-arch`, `gen-ground`, `gen-vegetation`.
8
+
9
+ ## `wallhammer-web/base` (layer 0)
10
+
11
+ | Name | One line |
12
+ | --- | --- |
13
+ | `DEG`, `add`, `clamp`, `cross`, `dot`, `lerp`, `normalize`, `orthoMatrix`, `scale`, `smoothstep` | Small vector and scalar math. |
14
+ | `primitiveCount`, `texelBytes` | Sizes derived from mesh and texture data. |
15
+ | `DAMAGE`, `PART_FLAG`, `PART_ROLE`, `RUBBLE`, `packEntry`, `entryRung`, `entryDir`, `entryVariant` | Destructible structure constants and the packed damage entry. |
16
+ | types `Vec3`, `RGB`, `OrthoFrame` | Math types. |
17
+ | `MAT34_FLOATS`, `mat34Identity`, `mat34Copy`, `mat34Translation`, `mat34Scaling`, `mat34RotationX`, `mat34RotationY`, `mat34RotationZ`, `mat34RotationAxis`, `mat34FromQuat`, `mat34Multiply`, `mat34Determinant`, `mat34Invert`, `mat34Point`, `mat34Direction`, `mat34Normal`; types `Mat34`, `Vec3Out` | Affine 3 × 4 matrices, 12 numbers column by column (the instance record layout); `out` last, may alias. See [3 × 4 matrices](concepts.md#3--4-matrices). |
18
+ | `boxInVolume`, `distanceToBox` | Box tests shared by culling layers: does an axis-aligned box reach into a cull volume; distance from a point to a box. |
19
+ | types `View`, `CullVolume`, `CullBox`, `CullFrustum`, `Ray`, `Box3` | The view contract the renderer reads. |
20
+ | `View.axes(out?)`, `View.cornerRays(out?)`, `View.viewProj(…, out?)`; `newOrthoFrame`, `newCornerRays`, `crossInto`, `orthoMatrix(…, out?)`, `depthViewProj(…, out?)` | Optional `out` arguments: a rig may write into the given frame, rays or matrix instead of allocating (always use the returned value). The renderer passes its own scratch, so a still frame allocates nothing there. See [Allocation-free frames](rendering.md#allocation-free-frames). |
21
+ | `depthViewProj`, types `DepthMode`, `DepthProjection` | The depth mode of the main passes (`'standard'`, `'reversed'`, `'logarithmic'`) and the world → clip matrix of a view in a mode, with the logarithmic scale. See [Depth modes](rendering.md#depth-modes). |
22
+ | `snapRenderOrigin`, `toRenderSpace`, type `OriginAxes` | The render origin for a focus point: the grid point at or below it on the horizontal axes or on all three; a world position relative to an origin, subtracted in doubles. |
23
+ | types `MeshData`, `InstanceData`, `InstanceBounds`, `TextureData`, `VertexLayout`, `VertexAttrib`, `ScalarType`, `Primitive`, `TextureFormat`, `TextureSampling` | Plain data between generators and the GPU. |
24
+ | type `CullMode`; `DrawState.cull` | Face culling `'none'`, `'back'`, `'front'`; wins over `cullBack` in the same state. See [Materials](rendering.md#materials). |
25
+ | types `MaterialDesc`, `PassName`, `ShaderSource`, `DrawState`, `BlendSpec`, `BlendFactor`, `UniformValue`, `Uniforms`, `BakeDesc`, `BakeTarget` | Materials, draw state, uniforms, bakes as data. |
26
+ | types `EnvSlot`, `FrameField`, `FrameRegion`, `FrameEnvironment`, `FogLayer`, `LightMode` | The environment slot contract. |
27
+ | `RIG_INSTANCE_FLOATS`, `RIG_INSTANCE_LAYOUT`, `RIG_VERTEX_LAYOUT`, `RIG_VERTEX_FLOATS`, `RIG_ATTRIBS`, `RIG_MOTION`, `RIG_BEND_AXIS`, `RIG_FINISH`, `packRgb`, `writeRigInstance`, `rigExtended`; types `RigDesc`, `RigPart`, `RigShape`, `RigMotion`, `RigFinish`, `RigSegment`, `RigInstance` | Rigs as plain data and their instance record. `rigExtended` tells whether a description uses the free gait or chains of links (`bend`). See [Rigs](rigs.md#free-gait-and-chains). |
28
+ | `Progress`; types `ProgressStage`, `ProgressReport` | Progress of long work in named, weighted stages (loading a map): workers, uploads and shader compiles advance it, a loading screen subscribes. No DOM, no clock. See [Recipes](recipes.md#report-loading-progress). |
29
+ | types `StructureDesc`, `StructurePart`, `StructureBond`, `StructureState`, `ConvexPiece`, `DestructibleMaterial`, `DestructionEvent`, `DamageEntry`, `DamageRung`, `PartRole`, `RubbleFootprint`, `RubbleArchetype` | Destructible descriptions and states. |
30
+ | `detSinCosTurns`, `detSinTurns`, `detCosTurns`, `detSinCos`, `detSin`, `detCos`, `detAtan`, `detAtan2`, `detAsin`, `detAcos`, `RAD_PER_TURN` | Reproducible trigonometry: the same bits on every machine, built from `+ − × ÷` and `Math.sqrt` only. Angles in turns or radians. See [Bodies on rails and nested frames](frames.md#reproducible-trigonometry). |
31
+ | `FrameSet`, `FRAME_NONE`; types `FramePose`, `FrameState`, `FrameBearing` | A hierarchy of reference frames with 64-bit poses: conversion of points, directions, orientations and velocities between frames, `reparent`, `directionTo`, `fingerprint`. See [Nested frames](frames.md#nested-frames). |
32
+ | `relativeMatrix`, `relativePoints` | 64-bit poses and points to 32-bit numbers relative to the eye, for the GPU. |
33
+ | `tangentPose`, `directionFromDeg`, `directionToDeg` | A frame that touches a sphere (x east, y up, z south); unit direction from latitude and longitude and back. |
34
+ | `quatIdentity`, `quatAxisTurns`, `quatMul`, `quatConj`, `quatNormalize`, `quatRotate`, `quatFromAxes`; type `Quat` | Rotations as unit quaternions `[x, y, z, w]`. |
35
+ | `radialUpAt`, `radialHeight`, `upFrame`, `toFramePlane`; types `RadialUp`, `UpFrame` | Up that points away from a centre: the unit up and the height of a point above a base radius; the frame of an upright object for an up (the shortest rotation from +y, the CPU twin of the shader's `localFrame`) and a direction as the (x, z) pair of that frame. See [Local up](rendering.md#local-up). |
36
+
37
+ ## `wallhammer-web/platform` (layer 1)
38
+
39
+ | Name | One line |
40
+ | --- | --- |
41
+ | `observeCanvasSize`, `resizeCanvas`, `syncCanvasSize` | Keep a canvas and a view sized to the element. |
42
+ | `canvasPixelRatio(max?)`; `observeCanvasSize(…, maxPixelRatio?)`, `syncCanvasSize(…, maxPixelRatio?)`, `resizeCanvas(…, pixelRatio?)` | A cap on the canvas's pixels per CSS pixel (default none): fewer pixels drawn, the browser scales the canvas up; the view's `dpr` is the ratio in effect. See [Resolution and antialiasing](rendering.md#resolution-and-antialiasing). |
43
+ | `bindCameraInput` | Pan, zoom, rotation steps and home key for a stepped view. |
44
+ | `bindOrbitInput` | Drag orbit and wheel zoom for an orbit view. |
45
+ | `bindFreeInput`, `DEFAULT_FREE_KEYS` | Held keys move, drag or locked pointer turns, wheel changes the speed of a free view (`FreeControl`); returns a `FreeInput` to step every frame. |
46
+ | `trackHeldKeys` | A live set of held keys (`HeldKeys`). |
47
+ | `bindWalkInput`, `DEFAULT_WALK_KEYS`; types `WalkInput`, `WalkInputOptions`, `WalkInputState`, `WalkKeys`, `WalkView` | Walk controls: keys, drag or locked pointer and a standard gamepad give the wanted movement in the view's frame (`read(state)` once per frame), turns and wheel zoom go to the view; `enabled = false` hands the view over (releases keys, drag and pointer lock). See [Walk controls](cameras.md#walk-controls). |
48
+ | `HeldKeys.clear()` | Forgets every held key (a hand-over of the controls). |
49
+ | `FrameLoop` | The on-demand frame loop with real time. |
50
+ | `WorkerPool`, `serveWorker`, `workersAvailable`, `hardwareThreads` | Workers: a pool on the page side, a message handler on the worker side. `WorkerPool.broadcast(message)` sends one copy to every worker ahead of the queued jobs and resolves when all have answered. |
51
+ | `fetchBytes` | Fetch a URL as bytes (a `BytesFetcher` for `FileCellProvider`). |
52
+ | `openByteStore`; type `ByteStore` | Byte arrays by key in the browser's storage (IndexedDB) that outlive the page: `get`, `put`, `keepOnly(prefix)`, `clear`, `usage`, `close`. Resolves to `null` where the browser gives no storage; reads and writes never reject. See [A cache in the browser's storage](streaming.md#a-cache-in-the-browsers-storage). |
53
+ | `watchContextLoss`; type `ContextLossHandlers` | Calls `lost` and `restored` when a canvas loses its graphics context and gets a fresh one (and tells the browser that a restore is wanted). Returns a function that stops. See [Loss of the graphics context](rendering.md#loss-of-the-graphics-context). |
54
+ | types `Canvas`, `CanvasSizeTarget`, `CameraInputOptions`, `OrbitInputOptions`, `OrbitControl`, `ViewControl`, `ViewChangeKind`, `FrameLoopOptions`, `LoopClock`, `WorkerJob`, `WorkerAnswer`, `HeldKeys`, `FreeControl`, `FreeInput`, `FreeInputOptions`, `FreeKeys` | |
55
+
56
+ ## `wallhammer-web/core` (layer 2)
57
+
58
+ | Name | One line |
59
+ | --- | --- |
60
+ | `Clock` | A playable, steppable time value with a rate and change listeners. |
61
+ | `definePalette`, `PALETTE_CAPACITY` | Named colours to a 64-row uniform table with typed keys. |
62
+ | `trackPose`, `trackFlightTime`, `trackLifetime`, `writeTrack`, `trackAttribs`, `TRACK_GLSL`, `TRACK_FLOATS`, `TRACK_GRAVITY`, `TRACK_CRUMBLE_S`, `TRACK_MAX_FLIGHT_S` | Closed-form ballistic tracks of falling pieces, on the CPU and in GLSL. |
63
+ | `prepareOrbit`, `orbitPosition`, `orbitVelocity`, `solveKepler`, `ORBIT_SOLVER_STEPS`, `ORBIT_MAX_ECCENTRICITY` | A Kepler ellipse as a pure function of time, solved with a fixed number of steps. See [Orbits and spin from time](frames.md#orbits-and-spin-from-time). |
64
+ | `prepareSpin`, `spinRotation`, `spinRate` | Turning about a fixed, tilted axis as a pure function of time. |
65
+ | `BodySystem`, `BODY_INFLUENCE_RADII` | Bodies on rails placed in a `FrameSet`: `setTime`, `setTick`, `dominantBody`, `subPoint`, `fingerprint`. See [A system of bodies](frames.md#a-system-of-bodies). |
66
+ | types `ClockOptions`, `Palette`, `BallisticTrack`, `DustPuff`, `TrackPose` | |
67
+ | types `OrbitElements`, `Orbit`, `SpinElements`, `Spin`, `BodyDef`, `Body`, `SubPoint` | |
68
+ | `LevelFade`; type `LevelFadeOptions` | A level of detail chosen from one scalar with a dead band around every threshold and a timed transition: `update`, `position`, `moving`, `limit`, `shown`, `fade`, `uniforms`, `snap`. No clock inside. See [Levels of detail with a fade](rendering.md#levels-of-detail-with-a-fade). |
69
+ | `FADE_GLSL`, `fadeFragment`, `withFade` | The screen-door fade that draws a transition: the GLSL (`u_fade`, `fadeHidden`), a fragment shader with it added, a `MaterialDesc` with it in every pass that has its own program. |
70
+ | `COVER_FADE_GLSL`, `coverFade`, `coverKeep` | Content drawn as objects near the viewer and carried by the surface colour farther away: the share of the far look for a cell (`coverFade(objectLevel, cellLevel, morph)`) and the size of one object at that share (`coverKeep(fade, order)`), as functions and as GLSL of the same names. See [Content beyond its levels](streaming.md#content-beyond-its-levels). |
71
+
72
+ ## `wallhammer-web/gen-core` (layer 2)
73
+
74
+ | Name | One line |
75
+ | --- | --- |
76
+ | `hashInt`, `hashInts`, `hashString`, `mix32`, `unit`, `rand`, `randRange`, `pickWeighted`, `streamSeed` | Stateless randomness with named streams. |
77
+ | `valueNoise2` | 2D value noise. |
78
+ | `distToSegment`, `insetRing`, `lineRing`, `orientedBox`, `pointInRings`, `ringSignedArea`, `ringsArea` | Planar polygon geometry; `lineRing` is the ring round a polyline at a half-width (null when a segment is shorter than the half-width or a mitre exceeds 3×). |
79
+ | `HeightField`, `SegmentField`, `OutlineField`, `Occupancy` | Spatial fields that generators query. |
80
+ | `splitInstanceCells`, `DEFAULT_INSTANCE_TIERS` | Instances sorted into square ground cells, with thinned tiers for distance. |
81
+ | `FACE_FLAT`, `FLAT_ROOT_EDGE_M`, `FlatWorld`, `LEVEL`, `cellId`, `cellKey`, `parseCellKey`, `cellBits`, `cellFromBits`, `compareCells`, `sameCell`, `cellContentBytes` | Cell ids and the flat world shape for streaming. |
82
+ | `shapeHash` | A world shape's `hashKey` as a 32-bit number for cell files and their paths. |
83
+ | types `Ring`, `OrientedBox`, `InstanceCell`, `InstanceCellOptions`, `InstanceTier`, `CellId`, `CellContent`, `CellMesh`, `CellInstances`, `LocalBounds`, `WorldPos`, `WorldShape` | |
84
+ | `valueNoise3`, `fractalNoise3`; type `FractalNoise3` | Value noise in space and a sum of its octaves, 0..1: no seam and no pole on a curved surface. |
85
+ | `CUBE_FACE_AXES`, `cubeGrid`, `cubeWarp`, `cubeUnwarp`, `cubeDirection`, `cubeDirectionWarped`, `cubeFaceOf`, `cubeFaceCoords`, `cubeNeighbour`, `directionTangents` | A cube blown up to a sphere: the six faces and their axes, grid index to face coordinate, the even-angle spacing, direction of a grid point and back, the neighbouring cell across an edge of the cube, two directions across a direction that depend on it alone. |
86
+ | `spherePatchMesh`, `spherePatchRadius`, `SPHERE_PATCH_LAYOUT`, `SPHERE_PATCH_ATTRIBS`, `SPHERE_PATCH_GLSL`; types `SpherePatch`, `SpherePatchOptions` | The surface mesh of one cell of a sphere of six quadtrees, with blend attributes toward the coarser level and a skirt; where a direction meets its triangles; the vertex layout and the GLSL of the blend factor (`spherePatchMorph`). See [A sphere world](streaming.md#a-sphere-world). |
87
+ | `stripNet`, `stripLength`, `stripNearest`, `stripCarve`, `stripTouches`, `stripUp`, `STRIP_STATION_FLOATS`; types `StripProfile`, `StripNode`, `StripLine`, `StripInput`, `StripNet`, `StripNetLine`, `StripHit` | Strips along broken lines on a plane or a sphere: the net (measured, mitred, node corners), the nearest line at a point, the ground height cut and filled under the lines, a cheap test whether a line reaches a cell. See [Strips along a surface](generators.md#strips-along-a-surface). |
88
+ | `flatStripSurface`, `sphereStripSurface`; type `StripSurface` | What the strip mesher needs from the surface the cells draw: the cell of a level at a point, its origin, the vertex spacing, where a straight way meets the edges of the cell's triangles, the height of the drawn triangles. |
89
+ | `SpherePatchOptions.coverAt`, `SPHERE_PATCH_COVER_LAYOUT`, `SPHERE_PATCH_COVER_ATTRIBS` | The baked cover of a sphere patch (off by default): `coverAt(x, y, z, height)` returns RGBA bytes, rgb what the content on the surface looks like from afar and a the share of the surface it hides. The mesh then uses the cover layout: the plain one plus `a_cover` and `a_coarseCover` (locations 6 and 7). Without `coverAt` the bytes are unchanged. |
90
+ | `SpherePatchOptions.extraAt`, `SPHERE_PATCH_EXTRA_LAYOUT`, `SPHERE_PATCH_EXTRA_ATTRIBS`, `SPHERE_PATCH_COVER_EXTRA_LAYOUT`, `SPHERE_PATCH_COVER_EXTRA_ATTRIBS` | Four more bytes per vertex of a sphere patch (off by default) that the content gives a meaning, `extraAt(x, y, z, height)`: `a_extra` and `a_coarseExtra` (the level one coarser), after the plain attributes (locations 6 and 7, stride 48) or after the cover (8 and 9, stride 56). Without `extraAt` the bytes are unchanged. |
91
+ | `nearScatter`, `nearKeep`, `nearLeaveM`, `nearCount`, `NEAR_FLOATS`, `NEAR_LAYOUT`, `NEAR_FADE_GLSL`; types `NearScatterOptions`, `NearRecords`, `NearFade` | Small instances per square of a fixed fine grid: records hashed from the seed, the square's key, the kind and the candidate alone, a density callback that keeps a share, sorted by an order so the fade by distance removes the lowest first and what can be seen is a prefix (`nearCount`); the fade in TypeScript and GLSL. See [Instances near the viewer](generators.md#instances-near-the-viewer). |
92
+
93
+ ## `wallhammer-web/motion` (layer 2)
94
+
95
+ Not re-exported from the root entry. See [Motion](motion.md).
96
+
97
+ | Name | One line |
98
+ | --- | --- |
99
+ | `Skeleton`, `Pose`, `boneMask`; types `BoneSpec`, `BoneMask`, `BoneMaskOptions` | Bones with a parent and a joint offset; per bone a rotation (quaternion x, y, z, w) and an offset; a weight per bone (named bones with their descendants by default). |
100
+ | `blendPose`, `addPose`, `subtractPose`, `nlerpInto` | Blend two poses (shortest arc, optional mask), add a pose in the bones' frames by a weight, the difference that `addPose` turns back, quaternion blend into an array. |
101
+ | `setBoneRotation`, `setBoneAxisAngle`, `setBoneEuler`; type `EulerOrder` | Writing a bone's rotation in a source. |
102
+ | `solvePose`, `solvePoseBelow` | World matrices, 3 × 4 column by column, 12 floats per bone, from a root matrix; again for one bone and its descendants. |
103
+ | `MotionGraph`, `MotionGraphDef`, `compileMotionGraph`; types `MotionSource`, `MotionGraphDesc`, `MotionLayerDesc`, `MotionStateDesc`, `MotionTransitionDesc`, `MotionCondition`, `MotionEase`, `MotionEventKind` | States, transitions (conditions, triggers, after a pass; fades without a jump), override and additive layers with masks and weights, phase from time, a rate or a driving parameter, sync groups, events at marks and on entering and leaving, `setState` (straight into a state part-way, no fade), `save`/`restore`. One compiled description shared by every figure. |
104
+ | `speedWeights` | Weights of motions by their speed ranges [min, ideal, max] at a value: continuous, summing to 1. |
105
+ | `reachTwoBone`, `fitToGround`; types `TwoBoneChain`, `GroundFitOptions` | Post steps on a solved pose: two bones put the end on a target (bend axis, pole, weight); chain ends moved to the ground height of a function of the game. |
106
+
107
+ ## `wallhammer-web/gen-mesh` (layer 3)
108
+
109
+ | Name | One line |
110
+ | --- | --- |
111
+ | `heightFieldMesh`, `HEIGHT_FIELD_LAYOUT`, `HEIGHT_FIELD_ATTRIBS` | A height field as a mesh with a skirt. |
112
+ | `lineMesh`, `LINE_LAYOUT` | Lines draped over a height function. |
113
+ | `spaceLineMesh`; type `SpaceLinePath` | Polylines through given 3D points (open or closed) as `LINE_LAYOUT` lines. |
114
+ | `cellSurfaceMesh`, `CELL_SURFACE_LAYOUT`, `CELL_SURFACE_ATTRIBS` | One streamed cell's surface with vertex colours and a skirt. |
115
+ | `cellMorphMesh`, `CELL_MORPH_LAYOUT`, `CELL_MORPH_ATTRIBS`, `CELL_MORPH_GLSL`; types `CellMorphOptions`, `CellMorphSurface` | The cell surface with, per vertex, the shape of the level one coarser, and the GLSL that blends the two by distance. See [Blending between levels](streaming.md#blending-between-levels). |
116
+ | `rigMesh`, `rigShadowMesh` | The part mesh of a rig (near or far level) and its contact shadow. |
117
+ | `drapeTiles`, `drapeEvery`, `DRAPE_LAYOUT`, `DRAPE_ATTRIBS`; types `DrapeOptions`, `DrapeTile` | A sheet laid on a height field, in tiles with their boxes (positions only); `drapeEvery` picks the thinning that keeps it under a vertex count. See [Value layers](rendering.md#value-layers). |
118
+ | `packMesh`, `packFrame`, `packUniform`, `packedLayout`, `packedMaterial`, `PACKED_POSITION`, `PACK_STEPS_PER_EDGE`; types `PackFrame`, `PackOptions`, `PackedMesh` | Compact meshes for streamed cells: positions as 16-bit steps from the cell's corner, loose triangles indexed (per span, so one span can be rewritten alone), and the material that reads them. See [Packed meshes](streaming.md#packed-meshes). |
119
+ | `bisectSurface`, `BISECT_SURFACE_LAYOUT`, `BISECT_SURFACE_ATTRIBS`; types `BisectSurfaceOptions`, `BisectSurface` | A square height grid as a packed mesh with as few triangles as an error tolerance allows (right-triangle bisection), with a skirt, cut sides and a clip rectangle. See [A surface within a tolerance](streaming.md#a-surface-within-a-tolerance). |
120
+ | `prismMesh`, `triangulateRing`, `PRISM_LAYOUT`, `PRISM_ATTRIBS`; types `PrismShape`, `PrismMeshOptions` | Upright prisms over outlines, each vertex carrying the table row of its prism (`a_ref`); ear clipping of a simple polygon. |
121
+ | `stripMesh`, `stripGrow`, `STRIP_LAYOUT`, `STRIP_ATTRIBS`, `STRIP_GLSL`; types `StripMesh`, `StripMeshOptions` | The mesh of the strips in one streamed cell at its level, with the shift to the level one coarser, and the vertex shader rule (`stripWiden`) that keeps a strip a least number of pixels wide; `stripGrow` is the same rule in TypeScript. See [Strips along a surface](generators.md#strips-along-a-surface). |
122
+ | `chunkMeshes`; types `ChunkOptions`, `MeshChunk` | Static meshes cut into spatial chunks by triangle centroid and merged per cell, each with its box, for `PieceLayer`. See [Generators](generators.md#gen-mesh-meshes). |
123
+ | `MeshBuilder`, `faceNormal`; types `VertexFormat`, `VertexEdit`, `MeshBounds`, `MeshBuildOptions` | Building meshes by hand in a vertex format the caller supplies (payload `V` per vertex, never read by the engine): transform stack with mirroring, `vertex`/`tri`/`quad`/`append`/`bounds`, `positions`/`normals`/`indices` for collisions and checks (`positionData`/`normalData`/`indexData` without a copy, `setTriangle`), `edit` and `setPayload` for data that depends on the finished mesh. See [Building meshes in your own vertex format](generators.md#building-meshes-in-your-own-vertex-format). |
124
+ | `revolve`, `sweep`, `extrude`, `polygon`, `gridSurface`, `box`, `cylinder`, `pathFrames`, `smoothPath`; types `ShapeVertex`, `ShapePayload`, `ShapePart`, `ShapeWarp`, `GridSmooth`, `RevolveOptions`, `SweepOptions`, `ExtrudeOptions`, `PolygonOptions`, `GridOptions`, `CylinderOptions`, `PathFrame` | Bare shapes for `MeshBuilder<V>` without any look: each asks the caller for every vertex payload with its geometric facts (`ShapeVertex`); smooth, flat or `'along'` normals; a `warp` hook for the caller's own irregularity. See [Bare shapes](generators.md#bare-shapes). |
125
+ | types `LinePath`, `PropBox`, `CellSurface`, `CellSurfaceOptions` | |
126
+
127
+ ## `wallhammer-web/gen-tex` (layer 3)
128
+
129
+ | Name | One line |
130
+ | --- | --- |
131
+ | `codeTexture` | Byte codes as an `r8ui` texture. |
132
+ | `colorTable` | A 256-entry colour lookup by code. |
133
+ | `boxBlur` | Blur a float raster on the CPU. |
134
+ | `quantizeValues`, `wordValue`, `NO_VALUE`, `VALUE_WORD_MAX` | Numbers as 16-bit words: `min` → 1, `max` → 65535, not finite → 0 (`NO_VALUE`); and back. |
135
+ | `wordTexture`, `valueTableSize`, `VALUE_TABLE_WIDTH` | Words as a two-byte `rg8` texture; the size of the table texture that holds a number of rows (wraps at 1024). |
136
+ | `colorRamp`, `rampColor`, `VALUE_RAMPS`; types `RampStop`, `ValueRampName` | A colour ramp as a 256 × 1 texture (smooth or in flat bands), its colour at a position, and five ready-made ramps (`viridis`, `heat`, `blues`, `diverging`, `grey`). |
137
+ | `SurfaceRaster`, `lightHorizon`, `horizonTexture`; type `HorizonTexture` | The light horizon of a surface: a raster of surface heights (`raisePolygon`, `raiseDisc` raise it under outlines and discs), per cell the height below which a point is hidden from a directional light (one sweep, `-Infinity` where nothing hides), and that packed as an `rg8` texture with `baseY` and `rangeM` for `Renderer.shadowHorizon`. |
138
+ | `CodeStamp`; type `CodeRegion` | Stamps outlines (`polygon`, with holes) and discs (`disc`) into a rectangle of a byte raster of class codes. A cell takes the code with a probability equal to its covered share, so shapes smaller than a cell keep their total area; rectangles stamped one by one equal the raster stamped at once. |
139
+
140
+ ## `wallhammer-web/gen-arch` (layer 3, content)
141
+
142
+ | Name | One line |
143
+ | --- | --- |
144
+ | `buildBuildingMesh`, `BUILDING_LAYOUT`, `BUILDING_ATTRIBS`, `WINDOW_STYLE` | Structures from recipes as one mesh; optional descriptions, states, interiors. |
145
+ | `WALL_FINISH`, `ROOF_COVER` | Codes of `BuildingSpec.wallFinish` and `BuildingSpec.roofCover`, drawn by the `finishes` shader variant. See [Finishes and frames](generators.md#finishes-and-frames). |
146
+ | `FACADE_DIM`, `DOOR_KIND`, `GROUND_FLOOR` | Façade proportions and enumerations (door kind `arch`, `FACADE_DIM.archHeightPerWidth`). |
147
+ | `ROOF_PROFILE`; type `RoofProfile` | Height profiles of the `dome` and `mansard` roofs; a spec may give its own (`BuildingSpec.roofProfile`). See [Compositions](generators.md#compositions). |
148
+ | `BUILDING_VS`, `buildingVs`, `buildingFs`; type `StructureShaderOptions` | Shader sources of the structure material; `buildingVs(o)` and `buildingFs(dims, damage, o)` with `o.framed` (the mesh in its own frame, uniform `u_frame`) and `o.finishes`. Without options the text of `BUILDING_VS` and of the plain fragment program. |
149
+ | `structureMaterial`, `structureUniforms`, `fallingMaterial` | Materials for structures and falling pieces; `structureMaterial(dims, { damage, framed, finishes })` and `fallingMaterial(dims, { framed, finishes })`, each variant with its own name. |
150
+ | `windowLightSlot`, `windowShare`, `DEFAULT_WINDOWS` | Environment slot for lit windows. |
151
+ | `DESTRUCT_DIM`, `PART_RULE`, `STRUCTURE_MATERIAL`, `STRUCTURE_MATERIALS`, `bayKey`, `canopyKey`, `chimneyKey`, `foundationKey`, `partitionKey`, `roofKey`, `roofTopKey`, `slabKey`, `stairKey`, `describeKey` | Destructible description: part keys, materials, sizes. |
152
+ | `INTERIOR_DIM`, `ROOM_TYPE`, `cellAt`, `roomAt` | Interior plans. |
153
+ | `buildRubbleMesh`, `rubbleColours` | Rubble meshes. |
154
+ | `fallPieces`, `retimeFall`, `FALL_LAYOUT`, `FALL_ATTRIBS` | Falling pieces of one event; `retimeFall` moves a prepared batch later on the clock. |
155
+ | `buildMassingMesh`, `massingMaterial`, `MASSING_LAYOUT`, `MASSING_ATTRIBS`; types `MassingMesh`, `MassingOptions` | The middle distant level: every structure as a prism with a flat top, all in one small indexed mesh (per tile, optionally relative to a tile origin), and the material that shades it with the means of the full one. See [Distant levels](generators.md#distant-levels-of-structures). |
156
+ | `stampFootprints`, `roofTones` | The far distant level: footprints stamped into a ground class raster (`CodeStamp`) with a class per structure, and the three tones of a roof covering for such a class. |
157
+ | types `BuildingSpec`, `BuildingMeshStats`, `PropBox`, `RoofKind`, `StructureOptions`, `FacadeRecipe`, `WindowRecipe`, `EntranceSpec`, `BalconyRecipe`, `CorniceRecipe`, `RoofBoxSpec`, `DoorKind`, `GroundFloorKind`, `ArchDims`, `ArchMeshDims`, `ArchShadeDims`, `StructureRows`, `WindowLight`, `WindowLightState`, `InteriorPlan`, `InteriorCell`, `InteriorRoom`, `InteriorPartition`, `PartitionSeg`, `StairCore`, `FallInput`, `FallOutput`, `FallChange`, `FallEvent` | |
158
+
159
+ ## `wallhammer-web/gen-ground` (layer 3, content)
160
+
161
+ | Name | One line |
162
+ | --- | --- |
163
+ | `groundBake`, `buildOcclusionMask` | Ground colour and kind bake from a class raster. |
164
+ | `buildGroundMarkings`, `MARKING_LAYOUT`, `MARKING_ATTRIBS` | Painted strips on the terrain. |
165
+ | `TERRAIN_MATERIAL`, `MARKING_MATERIAL`, `GROUND_SAMPLERS`, `groundUniforms` | Materials and uniforms. |
166
+ | `TERRAIN_VS`, `TERRAIN_FS`, `MARKING_VS`, `MARKING_FS` | Shader sources. |
167
+ | `seasonSlot`, `snowSlot`, `seasonAt`, `DEFAULT_PHENOLOGY` | Environment slots: season, snow. |
168
+ | types `GroundInput`, `GroundMaterial`, `GroundSurface`, `OcclusionInput`, `OcclusionMask`, `GroundMarking`, `MarkingPattern`, `GroundShading`, `PhenologyConfig`, `SeasonState` | |
169
+
170
+ ## `wallhammer-web/gen-vegetation` (layer 3, content)
171
+
172
+ | Name | One line |
173
+ | --- | --- |
174
+ | `plantTrees`, `plantTreesSteps`, `TREE_KINDS`, `TREE_SPECIES`, `TREE_MAX_FLEX` | Deterministic vegetation placement; `plantTreesSteps` is the same as a generator that pauses between pieces, for slicing over tasks. |
175
+ | `buildTreeBatches`, `buildTreeBatch`, `packTreeInstances`, `treeBatchUniforms`, `TREE_ATTRIBS`, `TREE_VERTEX_LAYOUT`, `TREE_INSTANCE_LAYOUT`, `TREE_INSTANCE_BOUNDS`, `TREE_INSTANCE_FLOATS`, `TREE_LOD_COUNT` | Instanced vegetation with levels of detail. |
176
+ | `VEGETATION_MATERIAL`, `vegetationUniforms`, `vegetationSieve` | Material and uniforms. |
177
+ | `TREE_VS`, `TREE_FS`, `DEPTH_TREE_VS`, `DEPTH_TREE_FS` | Shader sources. |
178
+ | `swaySlot`, `swayAt`, `maxSway`, `DEFAULT_SWAY` | Environment slot: sway. |
179
+ | types `CanopyRaster`, `PlantedTree`, `CrownRule`, `PlantingInput`, `PlantingRules`, `PlantingStats`, `StreetLine`, `TreeKind`, `TreeSpecies`, `TreeBatch`, `TreeMaterial`, `SwayConfig`, `SwayState` | |
180
+
181
+ ## `wallhammer-web/gen-plan` (layer 3)
182
+
183
+ See [The plan of a sphere](generators.md#gen-plan-the-plan-of-a-sphere).
184
+
185
+ | Name | One line |
186
+ | --- | --- |
187
+ | `sphereGrid` | The grid of nodes at the middles of the cells of one cube-sphere level (`SphereGrid`: `radiusM`, `level`, `n`, `count`). |
188
+ | `gridNodeAt`, `gridDirection`, `gridNeighbours`, `gridNodeArea`, `gridSample`, `gridWeights` | The node of a direction, the direction of a node, up to eight neighbours across face seams, the area of a node in m², a bilinear read of a field of one value per node, and the nodes and weights of that read (3 at a corner of the cube, else 4; their sum in order is `gridSample` bit for bit). |
189
+ | `drainGrid` | Fills the hollows to their sills from the base nodes and returns the drainage (`Drainage`): filled height, the node each drains to, an upstream-first order, gathered flow, pools. |
190
+ | `traceChannels` | Chains of nodes with at least a given flow along the drainage (`Channels`), each ending in a base node, a pool or another chain. |
191
+ | `smoothLine`, `fallingGrade` | Smooths a line of unit directions keeping its ends; a profile that never rises. |
192
+ | `lineTiles`, `tileLinesAt`, `tileLinesOfCell` | An index from the cells of one level to the lines within reach of them (`LineTiles`); the lines of the tile at a direction, the lines of any cell. |
193
+ | `gridSteps`, `gridSlopeAt` | Per node the steps over the grid to the nearest marked node (capped); the steepest slope at a node from a field of heights. |
194
+ | `pickSites` | Best-first pick of nodes by a score with a least straight distance between them, nodes already taken and a test of the caller (`accept`). |
195
+ | `plotsAlong` | Rectangles along both sides of lines in a plane, squared to the line, never overlapping each other or the lines (`Plot`). |
196
+ | `routeGrid`, `routeScratch` | The nodes of the least-cost chain of neighbour steps between two nodes under a cost of the caller (null when unreachable or over `maxNodes`); reusable per-node arrays for it. |
197
+ | `routeRegions`, `regionLinks` | One search from many sources: per node its cheapest source, the cost and the node it came from (`RouteRegions`); per pair of touching regions the cheapest step between them (`RegionLinks`). |
198
+ | `lineLengths`, `lineAt`, `limitGrade` | Metres along great arcs to each point of a line; the direction and heading at a distance along it; a profile changed so that no step is steeper than a limit, ends kept. |
199
+ | `HORIZON_AXES`, `gridHorizon`, `horizonCode`, `horizonField`, `horizonCodeAt`, `horizonLit`, `HORIZON_GLSL` | The skyline of a height field: four tetrahedron directions, the sine of the skyline toward each at a point, its byte (`round(255 · sqrt)`), a field of node codes made on demand and blended to any point with the weights of `gridSample`, and how lit a point is by a far light (JS and GLSL, the same formula). |
200
+ | types `SphereGrid`, `Drainage`, `DrainOptions`, `Channels`, `LineTiles`, `LineTilesOptions` | |
201
+ | types `PickOptions`, `Plot`, `PlotOptions`, `StepCost`, `RouteScratch`, `RouteRegions`, `RegionLinks`, `HorizonField`, `HorizonOptions` | |
202
+
203
+ ## `wallhammer-web/gpu` (layer 4)
204
+
205
+ | Name | One line |
206
+ | --- | --- |
207
+ | `Device` | The WebGL2 device: cached state, uniform blocks, depth targets, draws, uploads, bakes. `memory()` totals what it allocated; `shareMesh` draws another mesh's buffers; `flush`; `compiling()` counts programs the driver still compiles in parallel. `setDepthMode(mode)` chooses the depth convention of the main target (returns the mode in effect, `depthMode` reads it); `present()` copies the offscreen main target of the reversed and logarithmic modes to the canvas. `depthTarget(size, repeat?)` makes a depth target (with `repeat` its texture wraps around its edges); `clearDepthRect(x, y, w, h)` clears a rectangle of the bound depth target; `fixSampler(name, unit)` binds a sampler name to one texture unit in every program used from then on. `colorTarget(width, height, count, format)` makes a target of `count` colour textures (`'rgba8'` or `'rgba16f'`, `null` where the format cannot be drawn into) and `fill(target, program, uniforms?)` draws one triangle over all of it, between passes (`Layer.prepare`). |
208
+ | `Program` | A program with typed uniform setters (`int`, `float`, `vec3`, …; arrays with `vec3v` and `vec4v`, e.g. a list of point lights as `uniform vec4 u_lights[64]`). Compile and link start at creation; the status is checked on first use (`settle()`), and `isComplete()` asks the driver without blocking (`KHR_parallel_shader_compile`). |
209
+ | `Device.retainUploads`, `Device.lost`, `Device.onRestored(fn)`, `Device.contextRestored()`, `Device.loseContext()`, `Device.restoreContext()`; `Program.restore()` | Recovery from a lost graphics context (off by default). With `retainUploads` set before the first upload the device keeps what every mesh, instance buffer, texture and bake was made from; `contextRestored()` makes programs, uniform blocks, depth targets and all of those again in place and then calls the `onRestored` listeners. `lost` is true while there is no context. `loseContext` and `restoreContext` trigger a loss and a restore through `WEBGL_lose_context`, for tests. See [Loss of the graphics context](rendering.md#loss-of-the-graphics-context). |
210
+ | `Device.mainSamples()` | Samples per pixel of the main target (the offscreen target's, or the canvas's in the standard depth mode; 0 without antialiasing). For statistics. |
211
+ | `createContext`, `rendererName` | Create the WebGL2 context (`createContext(canvas, depthMode)`: for reversed and logarithmic depth the canvas gets no depth buffer of its own); name the GPU. |
212
+ | `Device.setMainSamples(samples)`, `createContext(canvas, depthMode, samples?)`, type `MainSamples` | Samples per pixel of the main target, 0, 2 or 4 (default unchanged). In the standard depth mode 0 and 4 keep the canvas (without or with antialiasing), 2 draws offscreen and copies in `present`. See [Resolution and antialiasing](rendering.md#resolution-and-antialiasing). |
213
+ | `Device.copyDepth(from, to, size)` | Copies the lower left `size × size` square of one depth target into another of the same size (`blitFramebuffer`); the static shadow map of dynamic casters. |
214
+ | `createBuffer`, `createTexture`, `bindAttribs`, `drawMesh`, `UBO_BINDING` | Low-level helpers. `UBO_BINDING` holds the fixed binding points of the shared uniform blocks (`Frame` 0, `Palette` 1, `PointLights` 2), bound in every program that declares them. |
215
+ | types `GL`, `Mesh`, `MeshSource`, `Texture`, `TextureOptions`, `GpuBuffer`, `AttribSpec`, `ContextSource`, `InstanceBuffer`, `UniformBlock`, `DepthTarget`, `ColorTarget`, `ColorTargetFormat`, `BakeInput`, `GpuMemory` | |
216
+
217
+ ## `wallhammer-web/render` (layer 5)
218
+
219
+ | Name | One line |
220
+ | --- | --- |
221
+ | `Renderer` | Passes, shadow map, layers, materials, the upload path. Options `depth` and `depthNearM` choose the depth mode of the main passes; `depthMode` tells the one in effect; `resolve(src, into)` resolves includes (and adds logarithmic depth to fragment shaders of the main target). |
222
+ | `Material` | A compiled `MaterialDesc`. |
223
+ | `MeshLayer`, `InstancedLayer`, `cullInstances` | Ready-made layers and instance culling. |
224
+ | `PieceLayer`; type `PieceLayerOptions` | Many meshes of one material, each culled by its box against the view and the light, without allocation. Options `order: 'front-to-back'` (sorted when culled) and `lights` (each piece's draw names the point lights that reach its box). |
225
+ | `PointLightSet`, `pointLightsGlsl`, `POINT_LIGHTS_BINDING`, `POINT_LIGHTS_PER_DRAW`; types `PointLight`, `PointLightSetOptions` | Point lights as plain records with gain groups; per frame `update(x, y, z)` selects up to `max` for the eye into the `PointLights` uniform block; the include `<point-lights>` gives `pointLights(world, normal, wrap)`; per-draw lists of at most 8 lights (`bindFor`, `bindAll`, `bindNone`; a box more lights reach gets the whole selection, counted in `crowdedDraws`). See [Point lights](rendering.md#point-lights). |
226
+ | `ParticleLayer`; types `ParticleSource`, `ParticleCounts`, `ParticleLayerOptions` | Looping particle sources computed in the vertex shader from the clock: fixed budget, two draws (blended, added), shapes `'soft'` and `'core'`, gain groups. See [Particles](rendering.md#particles). |
227
+ | `InstanceSetLayer`, `instanceSet`, `writeInstance`, `pushInstance`, `instanceSetAttribs`, `INSTANCE_SET_GLSL`, `INSTANCE_SET_LAYOUT`, `INSTANCE_SET_FLOATS`; types `InstanceSet`, `InstanceSetLayerOptions` | One mesh per set, a 3 × 4 matrix and four free numbers per instance, one instanced draw per set; casts shadows as a dynamic caster (`shadowCasters: 'dynamic'`, `shadowDirty()`). See [Instance sets](rendering.md#instance-sets). |
228
+ | `InstanceSetLayer.cull()`; shared sets | Returns the records of the visible sets (counted in `instancesVisible`). One set in several layers of a renderer shares one GPU instance buffer, uploaded once per change; `shadowDirty()` is never true for a layer without a shadow pass. See [Instance sets](rendering.md#instance-sets). |
229
+ | `PIXEL_SIZE_GLSL` | `detailVisible`, `metresPerPixelAt`, `detailVisibleAt`, now part of the header (guard `WH_PIXEL_SIZE`); `<noise>` no longer needed for them. See [Shader includes](rendering.md#shader-includes). |
230
+ | `InstanceCellLayer`, `cellDetail` | Instances in cells: per-cell culling, level of detail and thinning tier by distance. |
231
+ | `TransientLayer`, `DUST_LIFE_S` | Pieces on closed-form tracks and dust puffs. |
232
+ | `RigLayer` | Instanced rigs posed in the vertex shader; near, far and hidden by size on screen; `lamps`. Kinds with a free gait or chains get a second program (`rig-ext`), made when the first such kind is added. See [Rigs](rigs.md). |
233
+ | `RIG_POSE_GLSL`; type `RigLayerOptions` | The rig posing as a vertex include (`<rig-pose>`: `rigPose`, `rigColor`). `new RigLayer(renderer, { material, castShadow, contactShadows })`: the game's material for the bodies, the posed bodies in the shadow map (default off), the contact shadows (default on). Without options the layer draws as before. See [Rigs](rigs.md#a-material-of-the-game-shadows-into-the-map). |
234
+ | `BoneInstances`; type `BonePart` | Bone matrices (`solvePose`) into instance set records: a table bone → set, record and part matrix; `write(world, first)`, `hide()`; no allocation. See [Motion](motion.md#writing-to-instances). |
235
+ | `RasterValueLayer`, `PointValueLayer`, `ShapeValueLayer`, `ValueSteps` | Numbers over a scene through a colour ramp: a grid on a sheet over the ground (or cells that name table rows), discs per point, prisms tinted by a table row. Two time steps blended. See [Value layers](rendering.md#value-layers). |
236
+ | `RASTER_VALUE_MATERIAL`, `POINT_VALUE_MATERIAL`, `SHAPE_VALUE_MATERIAL`, `POINT_VALUE_ATTRIBS`, `POINT_VALUE_LAYOUT`, `VALUE_GLSL` | The value layers' materials, the disc instance layout (x, y, z, radius) and the GLSL helpers that read value words. |
237
+ | `NearInstanceLayer`, `NEAR_INSTANCE_GLSL`; types `NearInstanceLayerOptions`, `NearKindDraw`, `NearPart`, `NearWind` | Records of `nearScatter` round the eye: one instance buffer per kind with a hard ceiling, refilled nearest set first when the eye has moved `stepM`, the exact fade per instance in the vertex shader, a bend in the wind along two waves fixed to the world. The vertex include gives `nearBase`, `nearScale`, `nearAxes`, `nearPoint`; the app's material lights it. See [Instances near the viewer](rendering.md#instances-near-the-viewer). |
238
+ | `NOISE`, `shaderHeader`, `frameBlockFloats` | Built-in GLSL and the Frame block size. `shaderHeader(slots, depthMode)` also defines `WH_DEPTH_REVERSED` or `WH_DEPTH_LOGARITHMIC`. |
239
+ | `DEPTH_VS`, `DEPTH_FS`, `SHADOW_MAP_UNIT` | Shared shadow programs; texture unit 0. |
240
+ | types `ShadowMode`, `ShadowOptions` | `RendererOptions.shadows`: the layout of the shadow map, `'single'` (default, as without the option), `'snapped'` (one map fixed to the world's texel grid, kept between frames, a pan draws only the uncovered border) or `'cascades'` (2–4 maps around the eye); `reachM`, `cascades`, `firstReachM`. `Renderer.shadowMode` tells the mode; `FrameStats.shadowUpdates` counts the parts of the map drawn in a frame (0: kept). See [Shadow modes](rendering.md#shadow-modes). |
241
+ | type `ShadowHorizon`; `SHADOW_HORIZON_UNIT` | `Renderer.shadowHorizon` (default null): the scene's light horizon texture with its extent and height range, the far term of the modes `'snapped'` and `'cascades'`; the fixed texture unit (15) it is sampled on. |
242
+ | `SHADOW_AREAS_MAX`; type `HeaderExtra` | The largest number of shadow areas (4). `shaderHeader(slots, depthMode, extra)`: `extra.defines` are added after the depth define, `extra.frameTail` members at the end of the Frame block. |
243
+ | types `Layer`, `DrawContext`, `PassName`, `FrameStats`, `SceneBounds`, `RendererOptions`, `MeshLayerOptions`, `InstancedLayerOptions`, `InstanceBatch`, `InstanceBounds`, `MeshPiece`, `CellDetail`, `InstanceCellGroup`, `InstanceCellLayerOptions`, `TransientBatch`, `TransientStats`, `RigCounts`, `FrameSlotSizes`, `FrameSlotsGlsl`, `ValueGrid`, `ValueStyle`, `ValueSheetTile`, `RasterValueOptions`, `PointValueOptions`, `ShapeValueOptions` | |
244
+ | `Layer.name`, `MeshLayerOptions.name`, `InstancedLayerOptions.name` | Optional layer name for profiles and statistics; nothing else reads it. |
245
+ | `Layer.shadowCasters`, `Layer.shadowDirty()`; `FrameStats.dynamicShadowTriangles`, `FrameStats.dynamicShadowDrawCalls` | Moving shadow casters: a layer with `shadowCasters: 'dynamic'` is redrawn over a kept map of the static casters in a frame where its `shadowDirty()` is true (mode `'single'`; the other modes redraw the whole map). The counts of that part. See [Moving casters](rendering.md#moving-casters). |
246
+ | `RendererOptions.samples` | Samples per pixel of the main target, 0, 2 or 4 (`Device.setMainSamples`); default unchanged. |
247
+ | `Renderer.probe`, type `RenderProbe`; `Renderer.shadowMapEdgePx` | Measuring hooks, null in normal use: `draws(layer, pass)` may leave a layer out of a pass (or out of `prepare`), `drawn(layer, pass, triangles, calls)` reports what it counted. The edge of the shadow map texture. Used by `profileFrame`. |
248
+ | `RendererOptions.radialUp`, `Renderer.radialUp`, `Renderer.upCenter()`, `InstancedLayerOptions.upCenter`, `cullInstances(…, upCenter)` | Local up (off by default): up points away from a centre. The header then defines `WH_LOCAL_UP`, the Frame block ends with `u_upCenter`, and the header functions `localUp`, `localHeight`, `localFrame` (always present) follow it. `upCenter()` is the centre in render space; instance culling takes it to extend boxes along the local up. See [Local up](rendering.md#local-up). |
249
+
250
+ ## `wallhammer-web/camera` (layer 5)
251
+
252
+ | Name | One line |
253
+ | --- | --- |
254
+ | `SteppedOrthoRig` | Orthographic view, four rotations, fixed zoom levels. |
255
+ | `PerspectiveOrbitRig`, `DEFAULT_ORBIT` | Perspective view orbiting a target. |
256
+ | `OrbitSetup.groundAt`, `OrbitSetup.minEyeHeight`, `PerspectiveOrbitRig.keepAboveGround()` | The eye kept at least `minEyeHeight` over `groundAt` by raising the pitch, on `setState`, `orbitPixels`, `zoomBy`. See [Keeping the eye above the ground](cameras.md#keeping-the-eye-above-the-ground). |
257
+ | `OrbitPath`, `writeOrbitState`, `blendOrbitState`; types `OrbitKey`, `OrbitPathOptions` | Keyframed orbit states sampled as a smooth curve (Catmull-Rom tangents, yaw the shorter way, distance in log space, open or looping), written into a caller's state or a rig without allocating; a state written into a rig in place; a blend of two states. See [Orbit paths](cameras.md#orbit-paths). |
258
+ | `FreeRig`, `DEFAULT_FREE` | Perspective view that moves freely: world position in doubles, up from a world shape, clearance and speed from a height callback. |
259
+ | `FollowRig`, `DEFAULT_FOLLOW`; types `FollowSetup`, `FollowOptions`, `BoomClearance` | Perspective view that follows a moving point: a lagging pivot, a boom turned by yaw and pitch, cut at once by a clearance callback and growing back smoothly; distance 0 is first person; `forward(out)` for turning input into world movement. See [`FollowRig`](cameras.md#followrig). |
260
+ | types `CameraSetup`, `ViewState`, `OrbitSetup`, `OrbitState`, `FreeSetup`, `FreeState`, `FreeOptions`, `UpSource`, `HeightAbove` | |
261
+
262
+ ## `wallhammer-web/env` (layer 5)
263
+
264
+ | Name | One line |
265
+ | --- | --- |
266
+ | `Environment` | Clocks, sun, light, weather, wind, clouds, fog; `frame(view)`. |
267
+ | `Environment.setFixedLight(toLight, light?)`, `Environment.fixed`, `EnvironmentConfig.fixed`, `DEFAULT_FIXED`; type `FixedLight`; `LightMode` `'fixed'` | A light in a fixed world direction with colours and strengths given directly, changeable at any time. See [A fixed light](rendering.md#a-fixed-light). |
268
+ | `SHADOW_QUERY`, `shadowGlsl(options?)` | The `<shadow>` include (registered by `EnvironmentLink`): sun visibility only, with `sunVisibilitySharp` and `sunVisibilityBakedSharp`; guarded, so it combines with `<lighting>`. See [Shader includes](rendering.md#shader-includes). |
269
+ | `DEFAULT_STUDIO`, `DEFAULT_SITE`, `DEFAULT_DAY`, `DEFAULT_WIND`, `DEFAULT_CLOUDS`, `DEFAULT_WEATHER`, `DEFAULT_SNOW_ALBEDO`, `studioLightDirection` | Defaults. |
270
+ | `LIGHTING`, `CLOUD_NOISE`, `CLOUD_OCTAVES` | The `lighting` GLSL and the cloud field. |
271
+ | `skySlot`, `computeSky`, `SKY_GLSL`, `SKY_FALLBACK`, `DEFAULT_SKY` | The sky slot and its stand-ins. |
272
+ | `assembleFrameBlock`, `ENV_CORE_SLOT` | Build the Frame block from slots. |
273
+ | `sunPosition`, `skyDirection`, `dayOfYear` | Sun position for a site and time. |
274
+ | types `EnvironmentConfig`, `StudioLight`, `DayLight`, `WeatherState`, `WindConfig`, `CloudConfig`, `SkyParams`, `SkyValues`, `EnvFrameBlock`, `FrameBlockValues`, `FrameRegions`, `SunPosition`, `SunSite` | |
275
+ | `CLOUD_NOISE_RADIAL` | The cloud field in space, used by `LIGHTING` when the renderer has `radialUp`. `LIGHTING` also provides `lightOnAt(worldPos, n, sun, ao)`: `lightOn` with the up of a named point. |
276
+ | `atmosphereSlot`, `atmosphereTables`, `atmosphereFor`, `computeAtmosphere`, `atmosphereGlsl`, `ATMOSPHERE_FALLBACK`, `DEFAULT_ATMOSPHERE`, `DEFAULT_ATMOSPHERE_MEDIUM`, `ATMOSPHERE_TABLE_LAYOUT`, `ATMOSPHERE_TABLE_UNIT` | Air as a shell round a sphere: the slot (Frame members `u_atm…`, include `<atmosphere>`), its lookup tables computed at creation (one 160 × 32 RGBA8 texture, no files), the default air and the same air fitted to another sphere, the stand-in include, and the texture unit (14) the tables are bound to. The include gives `atmosphereAir` (the air to a vertex) and `atmosphereApply` (applied to a fragment, or integrated there). See [The atmosphere](rendering.md#the-atmosphere). |
277
+ | types `AtmosphereMedium`, `AtmosphereParams`, `AtmosphereSlot`, `AtmosphereTables`, `AtmosphereValues` | The air itself (read once), the params that may change every frame (`reference` among them: every pixel integrates its own ray, to compare against), the slot with its `medium` and `tables`, the tables, the packed values. |
278
+ | `Environment.observer`; type `SunObserver`; `sphereSunDirection` | The sun for a world whose up depends on the place (default `null`: unchanged). `observer = { up, sunDir }` puts the sun in a world direction and computes everything that follows its height for the place with that up. `sphereSunDirection(dayOfYear, utcHour)` is the direction to the sun in the axes of a sphere turning about +y. |
279
+ | `cloudFieldSlot`, `CLOUD_FIELD_SLOT`, `cloudFieldCover`, `cloudFieldSun`, `lightingGlsl`, `cloudCoverTerms`; types `CloudCoverField`, `CloudFieldValues` | A cloud cover by place under radial up (opt-in slot, Frame members `u_cloudField…`): a profile by the angle to an axis plus drifting patches. With the slot the link registers `lightingGlsl({ cloudField: true })` as `lighting` (`lightingGlsl()` is `LIGHTING`). `cloudFieldCover` and `cloudFieldSun` are the same cover and share of the sun on the CPU; `cloudCoverTerms(cover, darkness)` the terms `frame()` derives from one cover. See [Cloud cover by place](rendering.md#cloud-cover-by-place). |
280
+
281
+ ## `wallhammer-web/world` (layer 5)
282
+
283
+ | Name | One line |
284
+ | --- | --- |
285
+ | `raycastHeightField`, `raycastPrisms` | Picking against a height field and prisms. |
286
+ | `CollisionWorld`, `newRayHit`, `newSlideResult`; types `CollisionWorldOptions`, `SolidOptions`, `SolidInfo`, `RayHit`, `SlideResult` | A base height function plus upright solids (prisms, cylinders, turned boxes) in a grid of cells: `groundAt`, `ceilingAt`, `slide` (a circle sliding along sides, never ending inside), `raycast`, `clearance` (a sphere along a boom), `remove` that keeps ids. No allocation per query, plain Node. See [Collision world](walking.md#collision-world). |
287
+ | `Walker`, `DEFAULT_WALKER`, `newWalkIntent`; types `WalkerSetup`, `WalkIntent` | A kinematic upright body over a `CollisionWorld` in fixed steps (60 Hz): walk and run with acceleration, sliding along sides, steps up to `maxStepUp`, falling, no climbing of base slopes over `maxSlopeDeg` (it slides down them), jumps with limited air control stopped by undersides, a smoothly turning `yaw`; `advance(dt, intent)`, `step`, `renderPosition`, `teleport`. Deterministic, plain Node. See [Walker](walking.md#walker). |
288
+ | `Walker.saveState(out?, offset?)`, `loadState(bytes, offset?)`, `simState(name)`, `renderPosition(out, alpha?)`, `renderYaw(alpha?)`, `renderTravelled(alpha?)`, `lastStepDistance`, `WALKER_STATE_BYTES`; types `ByteSink`, `ByteSource`, `WalkerSimState` | The walker's state as 160 bytes, as a part of a simulation's state, drawn with an external alpha (position, heading and the distance travelled, for a stride); the distance of the last step. See [Saving and restoring](walking.md#saving-and-restoring). |
289
+ | `meshPrismFootprint`, `meshCylinderFootprint`, `addMeshSolid`, `convexHullXZ`; types `MeshFootprintOptions`, `MeshPrismFootprint`, `MeshCylinderFootprint` | Collision solids from a mesh: an upright prism over the hull of its vertices or a cylinder round it. See [Solids from a mesh](walking.md#solids-from-a-mesh). |
290
+ | `CollisionWorld.baseHeightAt`, `baseSlopeAt`; option `baseExtent` | The base height and its gradient at a point; the rectangle where the base exists, which ends the base search of a ray. See [Collision world](walking.md#collision-world). |
291
+ | `StreamingManager`, `DEFAULT_STREAMING`, `CELL_STATES` | Which cells are wanted, without I/O. |
292
+ | `pixelsPerRadian`; type `ScreenErrorConfig` | Selection of levels by screen-space error with a budget of cells (`StreamingConfig.screenError`, off by default). See [Selection by screen-space error](streaming.md#selection-by-screen-space-error). |
293
+ | `GeneratorCellProvider`, `FileCellProvider` | Cell providers without workers. |
294
+ | `StreamingManager.refresh(cells)`, `swapped(cell, gpuBytes)`, `refreshes()`; `GeneratorCellProvider(seed, gen, edits?)`; types `EditableCellGenerator`, `CellEdits` | Content that went out of date: a refreshed RESIDENT cell stays drawn until its new content is swapped in, a MESHED one is forgotten, a job in flight restarts; `refreshes()` counts pending and touched cells. Generators that take edits text per cell. See [Edits and refresh](streaming.md#edits-and-refresh). |
295
+ | `CachedCellProvider`; types `CellStore`, `CellCacheStats` | A provider in front of another that keeps finished cells in a byte store under a caller-given version (`prefix`, `key(cell)`, `stats`). See [A cache in the browser's storage](streaming.md#a-cache-in-the-browsers-storage). |
296
+ | `StreamingConfig.gpuBudgetBytes`, `StreamingManager.gpuReserveBytes`, `gpuPressure()`, `dropResident()` | A ceiling of GPU bytes (off by default): over it cells leave the GPU, least recently wanted first, and uploads wait; the coarsest level is exempt. `gpuReserveBytes` is what everything else holds, `gpuPressure()` the cells released and uploads held back in the last step. `dropResident()` marks every cell on the GPU as not uploaded (after a context loss without retained uploads). See [A ceiling of GPU memory](streaming.md#a-ceiling-of-gpu-memory). |
297
+ | `encodeCell`, `decodeCell`, `cellFilePath`, `CELL_MAGIC`, `CELL_FORMAT_VERSION`, `CELL_FORMAT_VERSION_SHAPED`, `CELL_FILE_EXT` | The WHC1 cell file format: version 1, and version 2 for cells that state their shape hash or error. |
298
+ | types `Prism`, `CellProvider`, `CellGenerator`, `CellResult`, `CellOrigin`, `BytesFetcher`, `StreamingConfig`, `StreamingActions`, `StreamingCounters`, `CellRequest`, `CellState`, `Ticket`, `TicketKind` | |
299
+ | `SphereWorld`, `horizonHidden`, `boxMaxRadius` | The sphere world shape: six quadtrees on a cube, neighbours across its edges, radial up; fields `radiusM`, `centerM`, `radial`, methods `directionOf`, `altitude`, `atHeight`, `facetDropM` besides the `WorldShape` port. The horizon test of a hiding sphere and the largest distance of a box from a centre. See [A sphere world](streaming.md#a-sphere-world). |
300
+
301
+ ## `wallhammer-web/sim` (layer 5)
302
+
303
+ | Name | One line |
304
+ | --- | --- |
305
+ | `Simulation` | Fixed-step deterministic simulation with commands, checkpoints, hashes. |
306
+ | `EventQueue` | Per-tick events. |
307
+ | `EntityTable` | Dense typed columns with stable ids. |
308
+ | `NavGraph`, `PathSet` | A* navigation and paths. |
309
+ | `Movers`, `MOVER_STATE`, `TRANSFORM_STRIDE`, `POSE_STRIDE`, `capsuleDist2` | Entities moving along paths with collision modes (`follow`, `static`, `lanes`, `agents`); extraction strides. |
310
+ | `buildZoneIntervals` | Conflict zones between lanes (`Movers.buildZones` uses it). |
311
+ | `Interlock` | Shared areas where two mover sets cross, with a priority side. |
312
+ | `Agendas` | Entities that follow activities (place, time, stay) through a graph, with app states. |
313
+ | `StateMachine` | Named states with `enter` and `update`; the state lives in the owner's table. |
314
+ | `RegionNav` | Route search on two levels: regions with gates, tables between gates built ahead or on demand, a route cache. |
315
+ | `FlowNetwork`, `FLOW_STATE` | Coarse movement over a whole graph: every edge a queue of trips; individual movers only inside a focus circle. |
316
+ | `createFlowProbe`, `flowProbeLine` | Reference run of the flow model with a state hash, and its one-line report. |
317
+ | `mm`, `mmPerTick`, `mmPerTick2`, `isqrt`, `approachSpeed`, `brakeSpeed`, `stoppingDistance` | Fixed-point helpers. |
318
+ | `ByteWriter`, `ByteReader`, `hashBytes` | Snapshot streams and the state hash. |
319
+ | types `SimulationOptions`, `System`, `Command`, `CommandHandler`, `SimState`, `SimEvent`, `SimData`, `SimValue`, `ColumnSpec`, `ColumnType`, `Columns`, `Path`, `PathDef`, `PathStop`, `NavEdgeInput`, `NavGraphInput`, `RouteOptions`, `CollisionMode`, `SpawnOptions`, `MoversOptions`, `Capsule`, `KnownObstacles`, `ZoneIntervals`, `InterlockOptions`, `SharedArea`, `StateDef`, `AgendaActivity`, `AgendaEntity`, `AgendaOptions`, `AgendaPlace`, `RegionNavOptions`, `FlowOptions`, `FlowTrip`, `FlowMoverOptions`, `FlowCensus`, `FlowProbe`, `FlowProbeOptions`, `FlowProbeResult` | |
320
+
321
+ ## `wallhammer-web/sim/destruction` (part of `sim`)
322
+
323
+ | Name | One line |
324
+ | --- | --- |
325
+ | `destructionEvent`, `applyEvent`, `applyEventToAll`, `fallTimeline`, `TIMELINE`, `TIMELINE_TICK_S` | Apply an event; staged collapse timing. |
326
+ | `compileStructure`, `solveSupport`, `UNSUPPORTED` | Precompiled structures and the support solver. |
327
+ | `rubbleFootprints`, `partRubble`, `ruinRubble` | Where rubble lies. |
328
+ | `intactState`, `isIntact`, `sortedEntries`, `stateHash`, `encodeStates`, `decodeStates` | State helpers, hashing, text encoding. |
329
+ | `raycastParts` | Pick a part with a ray. |
330
+ | `CellStates`, `decodeCellStates`, `DEFAULT_MAX_UNITS`, `CELL_STATES_CHARS_PER_UNIT`; type `CommitResult` | Changed structure states of a streamed world by home cell: `commit`, `of`, `cells`, `under`, `clear`, `hash`, `text`, `units`, `structures`, a ceiling in units (`maxUnits`) with one fixed rule. See [State in streamed cells](destruction.md#state-in-streamed-cells). |
331
+ | `octant`, `pieceDistSq` | Integer geometry helpers. |
332
+ | types `DestructionResult`, `DestructionOptions`, `PartChange`, `ChangeCause`, `CompiledStructure`, `PartHit` | |
333
+
334
+ ## `wallhammer-web/runtime` (layer 6)
335
+
336
+ | Name | One line |
337
+ | --- | --- |
338
+ | `createEngine`, `Engine` | The mediator: init order, frame order, dispose. |
339
+ | `createHeadlessEngine`, `HeadlessEngine` | The same without canvas and GPU. |
340
+ | `Engine.setView(view)`, `Engine.animateWhile(fn)`, `HeadlessEngine.frameSeconds` | Draw through another view from the next frame (it takes the canvas size; `orbitControls` act only while their own view is current); keep the loop drawing while a condition holds (returns a remover); the real seconds of the frame being made, for the input and extraction hooks. See [Walk controls](cameras.md#walk-controls). |
341
+ | `EnvironmentLink` | Computes the environment and slots each frame and fills the Frame block. |
342
+ | `SkyLayer`, `SKY_VS`, `SKY_FS` | The sky behind a perspective view. |
343
+ | `SkyLayer.behindScene`, `Engine.moveSkyBefore(layer)` | The sky drawn after the opaque layers, only where nothing was drawn (depth-tested at the far end), instead of over the whole screen first; the same image when every layer before it is opaque. Off by default. See [The sky](rendering.md#the-sky). |
344
+ | `EngineOptions.maxPixelRatio`, `Engine.maxPixelRatio` | Cap of the canvas's pixels per CSS pixel (default none). See [Resolution and antialiasing](rendering.md#resolution-and-antialiasing). |
345
+ | `AtmosphereLayer`, `ATMOSPHERE_FS`, `ATMOSPHERE_TABLE_FS`, `ATMOSPHERE_SKY_TABLE`; `EngineOptions.atmosphere`, `Engine.atmosphere` | The air behind a perspective view, from the ground to orbit, and the binding of its tables for the layers after it. The sky is read from the sky table (64 × 128 texels), which the layer fills in `prepare` when the environment or the eye has changed; `usesSkyTable` tells whether it does in this frame. `createEngine({ atmosphere })` (off by default; `true` or the params) adds the slot and the layer. |
346
+ | `PrecipitationLayer`, `PRECIP_VS`, `PRECIP_FS` | Screen-space rain and snow; under radial up they fall along the up under the eye. |
347
+ | `CloudShellLayer`, `CLOUD_SHELL_VS`, `CLOUD_SHELL_FS` | The clouds of the cloud cover by place as a shell over a sphere, over their own shadows; needs `cloudFieldSlot`. |
348
+ | `StreamedWorld`, `WorkerCellProvider`, `serveCellGenerator`, `viewTickets`, `viewerTickets`, `boxInVolume` | Streaming on the GPU side. `viewerTickets` takes world directions and the viewer's pixels per radian. `StreamedWorldOptions.originAxes: 'all'` makes the render origin follow the height of the focus too. |
349
+ | types `EngineOptions`, `EngineView`, `HeadlessEngineOptions`, `EnvironmentLinkOptions`, `StreamedWorldOptions`, `StreamedWorldStats`, `StreamArchetype` | |
350
+ | `StreamedWorldOptions.textures`, `materialUniforms`, `gpuCeilingBytes`, `onResident`, `onReleased`; `StreamedWorld.reupload()` | Per-material textures and uniforms of streamed cells (also fields of the layer, changeable at any time); the GPU ceiling measured on the device (`Device.memory().total`), off by default; callbacks when a cell reaches or leaves the GPU (its meshes in the order of `content.meshes`); `reupload()` uploads every cell again from its CPU data. |
351
+ | `EngineOptions.contextRecovery` | Recovery from a lost graphics context (off by default): the device keeps its uploads, the engine watches the canvas and, when the browser hands a fresh context back, has the device make everything again and draws a frame. |
352
+ | `StreamedWorldOptions.horizon`, `StreamedWorldStats.horizonCulled` | Horizon culling of streamed cells (off by default): `{ center, radiusM }` of a sphere that hides what lies behind it; the number of cells it skipped in the last frame. |
353
+ | `StreamedWorld.refresh(cells)`; `WorkerCellProvider(url, seed, size?, edits?)`, `serveCellGenerator(gen)` with an `EditableCellGenerator` | Rebuilds cells whose content went out of date and swaps them in on the GPU without a gap; edits text per cell through workers. See [Edits and refresh](streaming.md#edits-and-refresh). |
354
+
355
+ ## `wallhammer-web/tools` (layer 7)
356
+
357
+ | Name | One line |
358
+ | --- | --- |
359
+ | `DataView` | The data view: ground in class colours and lines on top. The name shadows the global `DataView` of JavaScript. |
360
+ | `DATA_TERRAIN_FS`, `LINE_VS`, `LINE_FS` | Its shaders. |
361
+ | types `DataViewSetup`, `DataViewMask`, `DataViewOptions` | |
362
+ | `collisionLines(world, options?)`; type `CollisionLinesOptions` | The solids of a collision world as a wireframe (`LINE_LAYOUT` lines), filtered by `select`. See [Walking](walking.md#seeing-the-solids). |
363
+ | `profileFrame(renderer, view, options?)`, `formatProfile(profile)`; types `FrameProfile`, `FrameTiming`, `LayerProfile`, `PassCost`, `ProfileOptions` | Frame profile on the graphics card at hand: target size, samples, shadow map size, GPU name; median frame time empty, with the shadow map kept, redrawn every frame and (with `step`) animated; per layer its passes, triangles, calls and cost in ms in the colour and the shadow pass. `formatProfile` makes a text table. See [Tools](tools.md#frame-profile). |
364
+ | `meshParts`, `floatingParts`, `routeClearance`; types `MeshPart`, `MeshPartsOptions`, `FloatingOptions`, `RouteClearance`, `RouteClearanceOptions` | Checks of built geometry without a browser: connected parts of a mesh and those hanging in the air; the least distance of a route from the solids of a collision world. See [Mesh checks](tools.md#mesh-checks). |