Skip to content

Class

SmoothOccupancyRegistry2D

Generated GDScript class reference for GridPlacement.SmoothOccupancyRegistry2D.

Status
Current
Version
v6.0
Source updated
Active v6.0 guide line from Grid Placement repo
Generated on
2026-09-01

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 RefCounted

Members

NameKindSummary
world_registryPropertyShared committed-placement authority. Optional for legacy standalone use.
can_occupyMethod
registerMethod
updateMethod
has_nodeMethod
unregisterMethod
snapshot_stateMethod
restore_stateMethod
clear_invalid_entriesMethod
clear_allMethod
rebuild_from_sceneMethod
debug_entriesMethod
sizeMethod