2D smooth occupancy registry. Authoritative spatial tracking for smooth/free placement mode. This is the primary validation layer: physics queries are available separately as an optional [PhysicsOccupancyValidator] that users configure. Key design decisions:
- Occupancy is registered only after a successful commit.
- Failed placements create no registry record.
- Move operations exclude the object being moved (update in place).
- Demolish unregisters occupancy.
- Projection rebuilds consume only committed [PlacementWorldRegistry] records; save/load itself uses [PlacementWorldRestoreCoordinator2D].
- Shared world: all entries are checked regardless of session. Split-screen players in the same world see each other's objects. Separate registries are for separate placement worlds only. Usage: var registry := SmoothOccupancyRegistry2D.new() if registry.can_occupy(position, footprint, rotation): registry.register(node, position, footprint, rotation)
Source: addons/grid_placement/services/smooth_occupancy_registry_2d.gd
Syntax
class SmoothOccupancyRegistry2D extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
world_registry | Property | Shared committed-placement authority. Optional for legacy standalone use. |
can_occupy | Method | |
register | Method | |
update | Method | |
has_node | Method | |
unregister | Method | |
snapshot_state | Method | |
restore_state | Method | |
clear_invalid_entries | Method | |
clear_all | Method | |
rebuild_from_scene | Method | |
debug_entries | Method | |
size | Method |