using System.Numerics;
namespace AcDream.Core.Selection;
///
/// 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.
///
public sealed record RetailSelectionMesh(
Vector3 SphereCenter,
float SphereRadius,
IReadOnlyList Polygons);
/// One visual polygon. Vertex order and one/two-sidedness are DAT-authored.
public sealed record RetailSelectionPolygon(
IReadOnlyList Vertices,
bool SingleSided);
/// One part which survived the normal world-render visibility traversal.
public readonly record struct RetailSelectionPart(
uint ServerGuid,
uint LocalEntityId,
int PartIndex,
Matrix4x4 LocalToWorld,
RetailSelectionMesh Mesh);
/// Retail picker result, including which physics part supplied the hit.
public readonly record struct RetailSelectionHit(
uint ServerGuid,
uint LocalEntityId,
int PartIndex,
double Distance,
bool PolygonHit);