Chris' Tutorials
Docs/Grid Placement

Class

CollisionShapeProcessor

Generated GDScript class reference for GridPlacement.CollisionShapeProcessor.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

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

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 RefCounted

Members

NameKindSummary
GeometryCacheManagerFieldThis 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_loggerMethod
get_tile_offsets_for_collision_objectMethod
collision_positionsProperty
col_objProperty
center_tileProperty
tile_sizeProperty
shape_epsilonProperty
tile_shapeProperty
shape_positionsProperty
shape_positionsProperty
shape_ownerProperty
shape_transformProperty
shape_polygonProperty
boundsProperty
start_tileProperty
end_exclusiveProperty
shape_offsetsProperty
min_localProperty
max_localProperty
min_worldProperty
max_worldProperty
min_localProperty
max_localProperty
shape_center_tileProperty
left_spanProperty
right_spanProperty
desired_right_exclusiveProperty
eff_sizeProperty
shape_center_tileProperty
adjustedProperty
tile_shapeProperty
shape_offsetsProperty
tile_posProperty
tile_center_localProperty
tile_center_worldProperty
tile_top_left_worldProperty
has_overlapProperty
cshapeProperty
circle_centerProperty
circle_tile_centerProperty
tile_areaProperty
area_epsilonProperty
min_areaProperty
tile_rectProperty
overlap_areaProperty
shape_boundsProperty
tile_boundsProperty
at_min_xProperty
at_max_xProperty
at_min_yProperty
at_max_yProperty
is_corner_tileProperty
required_areaProperty
shape_boundsProperty
tile_boundsProperty
by_rowProperty
additionsProperty
xsProperty
collision_objectsProperty

Source

addons/grid_placement/placement/manager/components/mapper/collision_shape_processor_2d.gd

Plugin docs root:gdscript/plugins/grid_placement_dev/docs