Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
The shooter’s recipes are pinned: src/client/models.ts gets the test it never had #90
Check · Review · Land · Live done — Landed and live in production.
`src/client/models.test.ts` pins all four recipes — `levelMesh`, `playerMesh`, `bombMesh`, `viewModelMesh` — through one `wellFormed` helper that asserts what the renderer and the atlas actually require: position, normal, uv and layer lengths agreeing per vertex, an index of whole triangles with every value inside the vertex count, no NaN anywhere, and every layer an integer inside `0..LAYERS - 1`…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
src/client/models.test.tspins all four recipes —levelMesh,playerMesh,bombMesh,viewModelMesh— through onewellFormedhelper that asserts what the renderer and the atlas actually require: position, normal, uv and layer lengths agreeing per vertex, an index of whole triangles with every value inside the vertex count, no NaN anywhere, and every layer an integer inside0..LAYERS - 1. Geometry is asserted only where it carries meaning: one box is 24 vertices and 36 indices with exactly the box's bounds, the empty level is an empty mesh rather than a throw, everykindin the weapons table answers a distinct model that sits down-and-right of the eye and runs down -Z, an unknown kind falls back to a single gun shape instead of throwing, and each recipe called twice returns equal data in fresh buffers. No vertex order and no fifteen-digit float is pinned, so rebuilding a box a different way does not break this.One recipe surprised the test, which is the point of the issue:
playerMeshstood 73.5 units tall againstHULL.standof 72, because the head was placed at a literal 67.scene.tsscales a ducking player byhullHeight(p) / HULL.standabout their feet, so that head poked above the hull standing and above the duck hull ducking. The fix inmodels.tsis two lines — importHULL, and crown the head atHULL.stand - HEAD / 2— so the model is the hull by construction and the duck squash lands on 54 exactly. The model is 1.5 units (about 3 cm) shorter than it was; nothing else in the picture moved.static/app.*.jsis rebuilt because the client source changed, whichsrc/server.test.tsrequires.bun testis green at 498 passing, and the layer assertion was mutation-checked: setting the bomb's light to layer 9 fails the suite. To look at it in the preview: a standing player's head now tops out level with the ceiling of anything 72 units high, and a ducking one no longer clips through what it ducks under.🤖 Generated with Claude Code
Closes #57