Endless Stairs: Infinite Streamed Staircase and Themed Areas Kit
README.md
endlessStairs.bodyTest
The body test for the course's guards. BodyTest.run(opts) builds its own course far from the origin (the tumbling preset unless courseOpts says otherwise) and fires small capsules (radius 0.05 m, 3 kg, CCD off, the size of a ragdoll forearm or shin) outward at 15, 20 and 25 m/s, straight out and 30 degrees forward and back, from 0.5 to 6 m above the treads, on both sides. It aims along every curved, zigzag, broken and rampsteps chunk and across every chunk join. Bodies fly in batches of 200 under Physics.advance. Each one then counts as outside if it ended past the wall, the guard and a 0.25 m margin from the nearest point of the centre line, or more than 6 m below the treads there. Pass = 0 outside.
Run it in play mode, since bodies only move while play runs:
local r = require("endlessStairs.bodyTest").run({ seed = 7, length = 600 })
print(r.fired, r.outside, r.byShape, r.collidersMax)
It answers fired, outside, byShape ({shape = {fired, outside}}, joins under join), fails (the first 40), chunks, joins, guardBoxesMax, collidersMax, buildMs and the course's final stats. Pass courseOpts = { guardShape = "mesh", guardHeight = 4.2, outerGuardHeight = 5.0, airGuard = false } to measure the 1.2.1 guards the same way. The endlessStairs_guards test suite runs it in play and checks the box layout in edit mode.