DrawnPoseTests: coasting probe reads world-axis swing; SimClockTests rides the field at the drawn time
The co-moving probe projected a world-fixed offset onto the rotating motion direction; it now compares the planet and ship in world x and z. SimClockTests' zero-lead sibling at a lead read the step-time ride height; with moving wells the drawn ride is the field at T. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b57207045d
commit
63124add6b
2 changed files with 10 additions and 11 deletions
|
|
@ -150,8 +150,8 @@ public sealed class DrawnPoseTests : IDisposable
|
|||
|
||||
// The operator's report, from the production clock: a ship coasting at its planet's step velocity, 60 u beside it, seen
|
||||
// across display frames. Frames are 1/144 s (the report), and 75, 165 and 240 Hz, where a clamp or a fraction of the
|
||||
// lead would also show; at 60 Hz Lead is always 0 and could not tell. The planet minus the ship must not swing along the
|
||||
// motion (0.306 u when the planet is drawn at the step's orbit).
|
||||
// lead would also show; at 60 Hz Lead is always 0 and could not tell. The planet minus the ship must not swing in either
|
||||
// world axis (0.306 u along the motion when the planet is drawn at the step's orbit).
|
||||
[Theory]
|
||||
[InlineData(144)]
|
||||
[InlineData(75)]
|
||||
|
|
@ -162,8 +162,8 @@ public sealed class DrawnPoseTests : IDisposable
|
|||
var w = Build();
|
||||
var ship = new Ship(w.Items, w.Zone, w.Hull, new EntitySettings());
|
||||
var clock = new SimClock(1f / 60f);
|
||||
var along = new List<float>();
|
||||
var across = new List<float>();
|
||||
var xs = new List<float>();
|
||||
var ys = new List<float>();
|
||||
var leads = new List<float>();
|
||||
|
||||
for (var frame = 0; frame < displayHz * 2; frame++)
|
||||
|
|
@ -177,17 +177,16 @@ public sealed class DrawnPoseTests : IDisposable
|
|||
});
|
||||
if (clock.Steps == 0) continue;
|
||||
var lead = clock.Lead;
|
||||
var direction = normalize(w.Zone.Orbits[w.PlanetOrbit].Velocity);
|
||||
var relative = DrawAhead.Orbit(w.Zone, w.PlanetOrbit, lead) - DrawAhead.Position(ship, lead).xz;
|
||||
along.Add(dot(relative, direction));
|
||||
across.Add(dot(relative, float2(-direction.y, direction.x)));
|
||||
xs.Add(relative.x);
|
||||
ys.Add(relative.y);
|
||||
leads.Add(lead);
|
||||
}
|
||||
|
||||
Assert.True(along.Count > displayHz, "the run covered its frames");
|
||||
Assert.True(xs.Count > displayHz, "the run covered its frames");
|
||||
Assert.True(leads.Max() > .005f, $"{displayHz} Hz: the frames fall far enough past a step to tell a lead from none");
|
||||
Assert.True(along.Max() - along.Min() < .005f, $"{displayHz} Hz: the planet swings {along.Max() - along.Min():F4} u along the ship's motion");
|
||||
Assert.True(across.Max() - across.Min() < .005f, $"{displayHz} Hz: the planet swings {across.Max() - across.Min():F4} u across it");
|
||||
Assert.True(xs.Max() - xs.Min() < .005f, $"{displayHz} Hz: the planet swings {xs.Max() - xs.Min():F4} u in x against the ship");
|
||||
Assert.True(ys.Max() - ys.Min() < .005f, $"{displayHz} Hz: the planet swings {ys.Max() - ys.Min():F4} u in z against the ship");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ public sealed partial class RunStartTests
|
|||
const float lead = .007f;
|
||||
var ahead = DrawAhead.Position(player, lead);
|
||||
Assert.Equal(player.Position.x + player.Velocity.x * lead, ahead.x, 6);
|
||||
Assert.Equal(player.RideHeight(float2(ahead.x, ahead.z)), ahead.y, 4);
|
||||
Assert.Equal(player.RideHeight(float2(ahead.x, ahead.z), player.Zone.ExactTime + lead), ahead.y, 4);
|
||||
Assert.Equal(player.Position.z + player.Velocity.y * lead, ahead.z, 6);
|
||||
Assert.Equal(before, Snapshot(arena, new List<string>()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue