feat(physics): port retail projectile integration

Add a pure Core projectile driver for retail clock quanta, final-state acceleration, 50-unit velocity clamping, world-space angular integration, full-3D AlignPath, and oriented Setup-local sphere sweeps. Preserve exact success versus set_frame-only failure semantics, independent Contact/OnWalkable state, and full-cell identity across all landblock directions.

Port OBJECTINFO::missile_ignore with explicit weenie/creature metadata, remove the invented transition-step cap, retain PathClipped without arming PerfectClip, and keep authoritative target identity optional. Add malformed-shape/clock, thin-wall, terrain, target-exclusion, frame-spike, failure-state, and boundary conformance coverage.

Retire TS-2 and synchronize the architecture, milestones, roadmap, research oracle, and durable physics memory.

Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
Erik 2026-07-14 11:43:11 +02:00
parent 542dcfc384
commit f02b995e4f
21 changed files with 1669 additions and 263 deletions

View file

@ -217,8 +217,7 @@ public class TransitionTests
// Arrange: flat terrain at Z=10. The sphere starts in contact with the
// surface and moves horizontally. Because the terrain stays flat the
// Contact flag should persist and no step-down is needed.
// Movement distance is kept < MaxTransitionSteps * radius to avoid the
// retail 30-step safety cap. With radius=1.0 and 15 units: 15 steps < 30.
// A 15-unit move at radius 1.0 requires 15 continuous-sweep steps.
const float groundZ = 10f;
var terrain = FlatTerrain(groundZ);
var engine = MakeEngine(terrain);
@ -284,31 +283,28 @@ public class TransitionTests
}
[Fact]
public void FindTransitionalPosition_LongSweep_ViewerBypassesStepCap()
public void FindTransitionalPosition_LongSweep_HasNoInventedStepCap()
{
// A8.F: the 30-step safety cap bailed long sweeps. Retail's
// find_transitional_position has no cap and handles viewers specially
// (calc_num_steps `state & 4` branch, acclient :272181). The camera
// spring arm (IsViewer) must not bail. radius 0.3, dist 12 → 40 steps > 30.
// Retail find_transitional_position 0x0050BDF0 iterates every step
// returned by calc_num_steps. radius 0.3, dist 12 => 40 steps.
const float groundZ = 10f;
var engine = MakeEngine(FlatTerrain(groundZ));
Vector3 from = new(50f, 50f, groundZ);
Vector3 to = new(62f, 50f, groundZ); // 12 units → 40 steps at r=0.3 (>30 cap)
// Normal mover: hits the 30-step cap, bails without moving.
var normal = MakeTransition(from, to, sphereRadius: 0.3f);
bool normalOk = normal.FindTransitionalPosition(engine);
Assert.False(normalOk);
Assert.True(normalOk);
Assert.True(normal.SpherePath.CurPos.X > from.X);
// Viewer: cap bypassed → sweep proceeds the full distance over flat ground.
// Viewer uses calc_num_steps' dedicated path and likewise completes.
var viewer = MakeTransition(from, to, sphereRadius: 0.3f);
viewer.ObjectInfo.State |= ObjectInfoState.IsViewer;
bool viewerOk = viewer.FindTransitionalPosition(engine);
Assert.True(viewerOk);
// Position must have advanced toward `to` (key invariant: viewer proceeds).
Assert.True(viewer.SpherePath.CurPos.X > from.X,
"Viewer sphere should have advanced in +X past the step cap");
"Viewer sphere should have advanced in +X through the full sweep");
}
[Fact]