Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.
Processes collision shapes to determine tile offsets for grid-based placement. The 2D leaf is this class; the 3D leaf is [CollisionShapeProcessor3D]. Both extend this base; see docs/v6-0/guides/naming-convention.md for the 2D/3D naming rule.
Source: addons/grid_placement/placement/manager/components/mapper/collision_shape_processor_2d.gd
Syntax
class CollisionShapeProcessor extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
GeometryCacheManager | Field | This component handles the geometric calculations needed to map arbitrary 2D collision shapes onto discrete tile grids. It supports both square and isometric tile layouts, providing accurate tile coverage determination for placement validation. [b]Core Responsibilities:[/b][br] - Convert collision shapes to tile offset arrays relative to a center tile[br] - Handle shape-to-tile overlap calculations with configurable precision[br] - Support different tile geometries (square, isometric) automatically[br] - Apply shape-specific optimizations (symmetry enforcement, area thresholds)[br] - Cache geometric calculations for performance[br][br] [b]Tile Shape Support:[/b][br] The processor automatically detects tile shape from the TileMapLayer's TileSet and applies appropriate geometric calculations. Single source of truth principle ensures tile shape information is read directly from the map configuration.[br][br] [b]Usage:[/b] [codeblock] var processor = CollisionShapeProcessor.new(cache_manager) var tile_offsets = processor.get_tile_offsets_for_collision_object(test_data, map, positioner) [/codeblock] |
set_logger | Method | |
get_tile_offsets_for_collision_object | Method | |
collision_positions | Property | |
col_obj | Property | |
center_tile | Property | |
tile_size | Property | |
shape_epsilon | Property | |
tile_shape | Property | |
shape_positions | Property | |
shape_positions | Property | |
shape_owner | Property | |
shape_transform | Property | |
shape_polygon | Property | |
bounds | Property | |
start_tile | Property | |
end_exclusive | Property | |
shape_offsets | Property | |
min_local | Property | |
max_local | Property | |
min_world | Property | |
max_world | Property | |
min_local | Property | |
max_local | Property | |
shape_center_tile | Property | |
left_span | Property | |
right_span | Property | |
desired_right_exclusive | Property | |
eff_size | Property | |
shape_center_tile | Property | |
adjusted | Property | |
tile_shape | Property | |
shape_offsets | Property | |
tile_pos | Property | |
tile_center_local | Property | |
tile_center_world | Property | |
tile_top_left_world | Property | |
has_overlap | Property | |
cshape | Property | |
circle_center | Property | |
circle_tile_center | Property | |
tile_area | Property | |
area_epsilon | Property | |
min_area | Property | |
tile_rect | Property | |
overlap_area | Property | |
shape_bounds | Property | |
tile_bounds | Property | |
at_min_x | Property | |
at_max_x | Property | |
at_min_y | Property | |
at_max_y | Property | |
is_corner_tile | Property | |
required_area | Property | |
shape_bounds | Property | |
tile_bounds | Property | |
by_row | Property | |
additions | Property | |
xs | Property | |
collision_objects | Property |
Source
addons/grid_placement/placement/manager/components/mapper/collision_shape_processor_2d.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs