PolygonTileMapper
AUTO-GENERATED FILE — DO NOT EDIT MANUALLY
Source: systems/placement/processors/polygon_tile_mapper.gd
Version: 5.1
class_name: PolygonTileMapper
extends: RefCounted
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.
Coordinate semantics
- Tile addressing is center-based. For 16×16 tiles, the center is at +8,+8 from the tile origin.
- Tests and runtime share “bottom-inclusive, top-exclusive” behavior on axis-aligned boundaries to avoid fencepost rows when a polygon edge lies exactly on a tile boundary.
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
- Filter tiles by minimum area overlap to remove slivers (with concave center-point check)
Signals
(none)
Exports
(none)
Methods
(none)