Responsibilities:
- Translate CollisionShape2D / CollisionPolygon2D geometry into tile offsets used by placement rules and indicators.
- Apply filtering, normalization, and heuristics to remove slivers and normalize pivots for consistent indicators.
- Provide caching and utility helpers consumed by IndicatorManager and the placement pipeline. See: Collision Mapping guide
Source: addons/grid_placement/placement/manager/components/mapper/collision_mapper_2d.gd
Syntax
class CollisionMapper2D extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
test_indicator | Property | |
test_setups | Property | Maps each CollisionObject2D to its CollisionTestSetup2D for collision testing. |
get_targeting_state | Method | |
get_runtime_issues | Method | |
resolve_placement_dependencies | Method | |
setup | Method | |
map_collision_positions_to_rules | Method | |
map | Property | |
dbg_msg | Property | |
co | Property | |
default_mask | Property | |
positions_only | Property | |
pos_tile | Property | |
abs_tile | Property | |
rule_info | Property | |
found_positions | Property | |
found_count | Property | |
pos_tile | Property | |
abs_tile | Property | |
get_collision_tile_positions_with_mask | Method | |
colliding_tile_positions | Property | |
diag_lines | Property | |
col_obj | Property | |
resolution | Property | |
matches | Property | |
obj_layer | Property | |
mask_layers | Property | |
obj_layers | Property | |
collision_tile_offsets | Property | |
offsets_count | Property | |
shown | Property | |
i | Property | |
msg | Property | |
get_tile_offsets_for_collision_polygon | Method | |
get_tile_offsets_for_test_collisions | Method |
Guides that use this class
Tutorials built on Grid Placement
- Godot multiplayer grid placement: one host, four sessions
- Godot 2D grid building system: paint, place, save
- Godot 3D grid building system: the runtime loop
- Godot 4 grid-building plugins: build mode vs editor tools
- 3D room placement in Godot: build rooms and stack storeys
- 3D grid placement in Godot 4: full setup tutorial
- Snap to a TileMap in Godot: 2D grid placement
- How to make a farming system in Godot
- How to snap objects to a 3D grid in Godot