PolygonTileMapper
Summary
Section titled “Summary”Handles polygon-to-tile-offset conversion with testable, separated concerns.
This class extracts the complex polygon processing logic from CollisionMapper to enable better testing and separation of responsibilities.
Pipeline stages:
- Transform polygon to world space and compute initial tile coverage
- Apply trapezoid expansion heuristics for convex polygons when beneficial
- Prune concave polygon fringes to remove unwanted overhangs
- Align narrow parented polygons to match local positioning
- Filter tiles by minimum area overlap to remove slivers
Methods
Section titled “Methods”compute_tile_offsets( polygon_node: CollisionPolygon2D, map: TileMapLayer ) -> Array[Vector2i]
Primary entry point for polygon-to-tile conversion
process_polygon_with_diagnostics( polygon_node: CollisionPolygon2D, map: TileMapLayer ) -> ProcessingResult
Full processing with diagnostic information for testing and debugging
Source
Section titled “Source”addons/grid_building/placement/manager/components/mapper/polygon_tile_mapper.gd
This page was auto-generated from GDScript source. Edit the source file to improve documentation.
Generated on 2025-09-07