acdream/src/AcDream.Core/Selection/RetailSelectionMesh.cs
Erik 047a4c83b5 fix(interaction): bind selection to live incarnations
Carry local WorldEntity identity through render hits, lighting pulses, and deferred movement actions so GUID reuse cannot target a replacement. Reset all session-owned selection and ItemHolder state and prevent combat auto-target during teardown.
2026-07-21 07:07:58 +02:00

34 lines
1.1 KiB
C#

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,
uint LocalEntityId,
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,
uint LocalEntityId,
int PartIndex,
double Distance,
bool PolygonHit);