Skip to content
ct

Class

SmoothOccupancyRegistry2D

Generated GDScript class reference for GridPlacement.SmoothOccupancyRegistry2D.

Status
Draft
Version
v6.0
Updated
Development docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

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