Fix lab cutscene control, landing steering, clipping and objective timeout

This commit is contained in:
UnixNight committed 2026-10-25 01:18:08 -04:00
1 parent 976e677019
commit ca08c468ba
33 files changed
+871 -64

No files matched your search

+20
View File
@@ -19,6 +19,7 @@ var tests = new (string Name, Action Check)[]
("ordinary jump responds to airborne arrows", AirControl),
("powered jetpack starts moving and turns from stationary takeoff", JetpackControl),
("powered steering remains independent of presentation rate", JetpackReplayRates),
("landing clears residual air turn before ground steering", LandingTurn),
("reset restores spawn, camera and counters", Reset),
("ten-minute simulation remains finite and supported", LongRun),
("original lab placement, floor, walking and jump checkpoint", () => OriginalLab(project, originals)),
@@ -254,6 +255,25 @@ static void JetpackReplayRates()
}
}
static void LandingTurn()
{
foreach (var initialLeft in new[] { false, true })
{
var simulation = FlatSimulation();
simulation.Step(new(true, false, false, false, true));
for (var i = 0; i < 120 && !simulation.Grounded; i++)
simulation.Step(new(true, false, initialLeft, !initialLeft, false));
Check(simulation.Grounded && MathF.Abs(simulation.TurnRate) > 20,
"Landing fixture retains an opposing air turn before outer grounded reset");
var before = simulation.Yaw;
simulation.Step(new(true, false, !initialLeft, initialLeft, false));
Near(simulation.TurnRate, 0, 0, "grounded released-jump reset clears shared air-turn field");
var yawChange = MathF.IEEERemainder(simulation.Yaw - before, 360);
Near(yawChange, initialLeft ? -10 * FixedStepClock.Step * 3.7f : 10 * FixedStepClock.Step * 3.7f,
.0001f, "prior jump turn must not cancel or clamp opposing ground turn");
}
}
static void JumpRepress()
{
var simulation = FlatSimulation();