feat(selection): port retail polygon picking and vivid marker

Replace the projected Setup-sphere rectangle and independent physics-wall ray with retail's render-coupled picker: only visible server-object parts participate, each exact drawing sphere broad-phases the camera-eye ray, and first-in-DAT-order visual polygon hits globally outrank sphere fallbacks.

Replace the devtools-only procedural triangles with the retained gameplay VividTargetIndicator using retail client-enum surfaces 1..4, radar-blip colorization, Setup selection-sphere framing, and the exact eight-pixel viewport clamp.

Release build succeeds with zero warnings and all 5,886 tests pass with five intentional skips.

Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-17 21:32:51 +02:00
parent 0f82a08f0a
commit 146a963aeb
26 changed files with 1302 additions and 1340 deletions

View file

@ -0,0 +1,32 @@
using System.Numerics;
namespace AcDream.Core.Selection;
/// <summary>
/// Immutable CPU geometry used by retail's world-selection pass. One instance
/// represents one GfxObj part: its exact drawing-BSP root sphere and its visual
/// polygons in DAT order.
/// </summary>
public sealed record RetailSelectionMesh(
Vector3 SphereCenter,
float SphereRadius,
IReadOnlyList<RetailSelectionPolygon> Polygons);
/// <summary>One visual polygon. Vertex order and one/two-sidedness are DAT-authored.</summary>
public sealed record RetailSelectionPolygon(
IReadOnlyList<Vector3> Vertices,
bool SingleSided);
/// <summary>One part which survived the normal world-render visibility traversal.</summary>
public readonly record struct RetailSelectionPart(
uint ServerGuid,
int PartIndex,
Matrix4x4 LocalToWorld,
RetailSelectionMesh Mesh);
/// <summary>Retail picker result, including which physics part supplied the hit.</summary>
public readonly record struct RetailSelectionHit(
uint ServerGuid,
int PartIndex,
double Distance,
bool PolygonHit);