refactor(render): SweepEye returns (Eye, ViewerCellId) — surface the swept viewer cell

The camera spring-arm sweep already resolves the collided eye's cell (ResolveResult.CellId
= sp.CurCellId = retail viewer_cell = sphere_path.curr_cell, update_viewer pc:92871).
Return it from SweepEye so the render can root on the viewer cell (Phase W single-viewpoint
V1, Task 1). Pure plumbing — behavior unchanged; callers extract .Eye. 174 App tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-03 12:32:45 +02:00
parent b7375c6563
commit 832001d289
6 changed files with 28 additions and 14 deletions

View file

@ -21,10 +21,10 @@ public sealed class PhysicsCameraCollisionProbe : ICameraCollisionProbe
public PhysicsCameraCollisionProbe(PhysicsEngine physics) => _physics = physics;
public Vector3 SweepEye(Vector3 pivot, Vector3 desiredEye, uint cellId, uint selfEntityId)
public CameraSweepResult SweepEye(Vector3 pivot, Vector3 desiredEye, uint cellId, uint selfEntityId)
{
// No starting cell → nothing to sweep against; keep the desired eye.
if (cellId == 0) return desiredEye;
// No starting cell → nothing to sweep against; keep the desired eye + cell.
if (cellId == 0) return new CameraSweepResult(desiredEye, cellId);
// SpherePath.InitPath puts sphere0's center at pathPos + (0,0,radius)
// (the player foot-capsule convention). Retail's viewer_sphere center is
@ -80,7 +80,10 @@ public sealed class PhysicsCameraCollisionProbe : ICameraCollisionProbe
$"collNormValid={r.CollisionNormalValid}");
}
return eye;
// Phase W single-viewpoint V1 (2026-06-03): surface the swept cell (r.CellId =
// sp.CurCellId) as the viewer cell — retail viewer_cell = sphere_path.curr_cell
// (update_viewer pc:92871). Graph-tracked, no AABB/grace → the U.4c flap source is gone.
return new CameraSweepResult(eye, r.CellId);
}
/// <summary>Eye/pivot point → InitPath path point (subtract the sphere-center offset).</summary>