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:
parent
b7375c6563
commit
832001d289
6 changed files with 28 additions and 14 deletions
|
|
@ -2,9 +2,17 @@ using System.Numerics;
|
|||
|
||||
namespace AcDream.App.Rendering;
|
||||
|
||||
/// <summary>
|
||||
/// Result of a camera spring-arm sweep: the collided eye position AND the cell the swept
|
||||
/// viewer-sphere ended in (retail <c>viewer_cell = sphere_path.curr_cell</c>, update_viewer
|
||||
/// pc:92871). The cell is graph-tracked by the transition — no AABB, no grace frames — so it
|
||||
/// is the robust per-frame "which cell is the camera in?" answer that roots the render.
|
||||
/// </summary>
|
||||
public readonly record struct CameraSweepResult(Vector3 Eye, uint ViewerCellId);
|
||||
|
||||
/// <summary>
|
||||
/// Sweeps a small sphere from the camera pivot (player head) toward the
|
||||
/// desired eye and returns the stopped (non-penetrating) eye. The seam that
|
||||
/// desired eye and returns the stopped (non-penetrating) eye + its cell. The seam that
|
||||
/// lets <see cref="RetailChaseCamera"/> collide its eye without depending on
|
||||
/// the physics engine directly (and stay unit-testable with a fake).
|
||||
/// </summary>
|
||||
|
|
@ -13,8 +21,9 @@ public interface ICameraCollisionProbe
|
|||
/// <summary>
|
||||
/// Roll a collision sphere from <paramref name="pivot"/> to
|
||||
/// <paramref name="desiredEye"/>; return the position it reaches without
|
||||
/// penetrating geometry. Returns <paramref name="desiredEye"/> unchanged
|
||||
/// penetrating geometry AND the cell it ended in. Returns
|
||||
/// <paramref name="desiredEye"/> + <paramref name="cellId"/> unchanged
|
||||
/// when nothing blocks the path or when <paramref name="cellId"/> is 0.
|
||||
/// </summary>
|
||||
Vector3 SweepEye(Vector3 pivot, Vector3 desiredEye, uint cellId, uint selfEntityId);
|
||||
CameraSweepResult SweepEye(Vector3 pivot, Vector3 desiredEye, uint cellId, uint selfEntityId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue