Restore tutorial return placement and source terrain collision eligibility

This commit is contained in:
UnixNight committed 2026-10-25 01:30:09 -04:00
1 parent ca08c468ba
commit 8d60a68511
36 files changed
+991 -69

No files matched your search

+18
View File
@@ -21,6 +21,7 @@ var tests = new (string Name, Action Check)[]
("powered steering remains independent of presentation rate", JetpackReplayRates),
("landing clears residual air turn before ground steering", LandingTurn),
("reset restores spawn, camera and counters", Reset),
("RETURN restores exact root with authored start yaw", ReturnRoot),
("ten-minute simulation remains finite and supported", LongRun),
("original lab placement, floor, walking and jump checkpoint", () => OriginalLab(project, originals)),
};
@@ -274,6 +275,23 @@ static void LandingTurn()
}
}
static void ReturnRoot()
{
var simulation = FlatSimulation();
var destination = simulation.ActorRoot + new Vector3(450, 100, -250);
var yaw = simulation.Yaw;
simulation.RestoreReturnRoot(destination);
NearVector(simulation.ActorRoot, destination, .0001f, "restore stored XYZ without floor snapping");
Near(simulation.Yaw, yaw, 0, "RETURN has no stored rotation; retain STRT yaw");
Check(simulation.Velocity == Vector3.Zero && simulation.Steps == 0, "fresh destination keeps initial motion state");
Check(Vector3.Distance(simulation.CameraEye, simulation.ActorRoot) < 500, "camera follows restored root");
Throws<ArgumentOutOfRangeException>(() => simulation.RestoreReturnRoot(new(float.NaN, 0, 0)));
simulation.Step(default);
Check(simulation.ActorRoot.Y < destination.Y && !simulation.Grounded, "restored unsupported root settles through physics");
simulation.Reset();
Check(Vector3.Distance(simulation.ActorRoot, destination) > 100, "ordinary reset still uses the source start");
}
static void JumpRepress()
{
var simulation = FlatSimulation();