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,40 @@
using System.Numerics;
using AcDream.App.UI.Layout;
namespace AcDream.App.Tests.UI.Layout;
public sealed class VividTargetIndicatorLayoutTests
{
private static readonly (float Width, float Height)[] RetailCorners =
[(12f, 12f), (12f, 12f), (12f, 12f), (12f, 12f)];
[Fact]
public void CornersSitOutsideSelectionSphereRectangle()
{
VividTargetLayout layout = VividTargetIndicatorController.ComputeLayout(
new Vector2(100f, 80f),
new Vector2(180f, 200f),
new Vector2(800f, 600f),
RetailCorners);
Assert.Equal(new Vector2(88f, 68f), layout.RootPosition);
Assert.Equal(new Vector2(104f, 144f), layout.RootSize);
Assert.Equal(Vector2.Zero, layout.CornerPositions[0]);
Assert.Equal(new Vector2(92f, 0f), layout.CornerPositions[1]);
Assert.Equal(new Vector2(92f, 132f), layout.CornerPositions[2]);
Assert.Equal(new Vector2(0f, 132f), layout.CornerPositions[3]);
}
[Fact]
public void WholeIndicatorClampsToRetailEightPixelViewportMargin()
{
VividTargetLayout layout = VividTargetIndicatorController.ComputeLayout(
new Vector2(2f, 3f),
new Vector2(62f, 83f),
new Vector2(200f, 150f),
RetailCorners);
Assert.Equal(new Vector2(8f, 8f), layout.RootPosition);
Assert.Equal(new Vector2(66f, 87f), layout.RootSize);
}
}