Skip to content

Add snapshot_entities() to SpatialIndex #72

@rebelmachina

Description

@rebelmachina

Epic: #64 (AffinityEngine)
No dependencies — can be done independently

What

Add a public method to SpatialIndex in crates/arcane-spatial/src/index.rs that exposes entity data for building WorldStateView.players:

pub fn snapshot_entities(&self) -> Vec<(Uuid, Uuid, Vec3)> {
    self.entities
        .iter()
        .map(|(entity_id, (cluster_id, position))| (*entity_id, *cluster_id, *position))
        .collect()
}

Returns (entity_id, cluster_id, position) triples for all tracked entities.

Why

SpatialIndex.entities is private. ClusterManager currently can only get cluster-level geometry via snapshot_for_view(), not individual entity data. To populate WorldStateView.players (required for AffinityEngine), ClusterManager needs entity-level access.

Acceptance criteria

  • Method added to SpatialIndex
  • Returns correct data for tracked entities
  • cargo test -p arcane-spatial passes

Spec

See arcane-engine repo: in_08_00_integration_report.md §2.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions