HardYards/web/world/js/tests
m3ultra 6971f31984 Rain stops at the cloth (SPRINT2 Lane C.3)
The garden visibly stays dry under the sail. Rain arrives along the wind, so
the dry patch sits downwind of the cloth and slides across the yard as the
wind swings — at the southerly change it walks right off the bed, free drama
and honest physics.

Cheap on purpose. Ray-testing 3k drops against 162 triangles every frame is
~486k intersections for an effect nobody inspects closely. Instead project the
sail's triangles ALONG the rain onto the ground into a coarse height grid, a
few times a second (the cloth moves slowly next to the rain); per-drop cost is
one grid read, and occluded drops get a zero-scale matrix rather than a
raycast. Measured 0.041 ms/rebuild, 10x/s = 0.41 ms/s against A's 0.63 ms
frame — negligible. Reads rig.pos/rig.tris, so nothing new needed from Lane B.

Verified in the real game with a surviving twisted rated rig: 497 grid cells
covered, 96% of the garden bed under cover, live drops culled under the cloth
and falling in the open yard either side. Screenshot for DESIGN.md.

skyfx exposes rainShadowOver(rect) — NOT the same as rig.coverageOver(bed,
sunDir). That one is the SUN shadow; this is the RAIN shadow (down the wind).
Which drives garden HP is a design call — flagged for A in THREADS.

Selftest 134/0/0 (8 new rain-shadow asserts).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:10:29 +10:00
..
a.test.js Add selftest harness with one suite per lane 2026-07-16 21:33:42 +10:00
b.test.js Align sail lane to contracts.js; free blown corners so they flog 2026-07-16 21:55:37 +10:00
c.test.js Rain stops at the cloth (SPRINT2 Lane C.3) 2026-07-17 00:10:29 +10:00
d.test.js Lane D: the small person — player, interactions, selftests 2026-07-16 21:55:16 +10:00
e.test.js Fill in Lane E selftest suite: assets verified in three.js 2026-07-16 21:50:43 +10:00
run-node.mjs Add wind field, storm timelines and weather selftest 2026-07-16 21:38:12 +10:00
weather.selftest.js Add vertical gusts, freeze debris.pieces, fix fog restore 2026-07-16 23:58:31 +10:00