Struct ClusterSpatialQueryResult
Result of a cluster spatial query match. Holds the entity id, its location inside the cluster storage (chunk id and slot index), the entity's tight
bounds as read by the narrowphase, and — for Radius queries — the squared distance from the query center to the closest point on the entity's AABB.
For AABB queries, DistanceSq is 0 and should be ignored.
public readonly struct ClusterSpatialQueryResult
- Inherited Members
Fields
ClusterChunkId
Chunk id of the cluster holding the matched entity, within the archetype's cluster storage segment.
public readonly int ClusterChunkId
Field Value
DistanceSq
Squared distance from the query center to the closest point on the entity's AABB. Populated by Radius queries; always 0 for AABB
queries. Used by QueryNearest(SpatialGrid, float, float, float, int, Span<(long entityId, float distSq)>, uint) for top-k sorting. Issue #230 Phase 3.
public readonly float DistanceSq
Field Value
EntityId
Entity id of the matched entity.
public readonly long EntityId
Field Value
MaxX
Maximum X of the entity's tight AABB.
public readonly float MaxX
Field Value
MaxY
Maximum Y of the entity's tight AABB.
public readonly float MaxY
Field Value
MaxZ
Maximum Z of the entity's tight AABB. For 2D archetypes this reflects the query's Z range (typically an infinity sentinel) and should be ignored.
public readonly float MaxZ
Field Value
MinX
Minimum X of the entity's tight AABB, as read by the narrowphase. Reading these bounds off the result lets callers skip a second component-table read.
public readonly float MinX
Field Value
MinY
Minimum Y of the entity's tight AABB.
public readonly float MinY
Field Value
MinZ
Minimum Z of the entity's tight AABB. For 2D archetypes this reflects the query's Z range (typically an infinity sentinel) and should be ignored.
public readonly float MinZ
Field Value
SlotIndex
Slot index of the matched entity within its cluster.
public readonly int SlotIndex