polygon_tile_mapper_unit_test

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Unit tests for PolygonTileMapper static methods

Source File: /addons/grid_building/test/collision/detection/polygon_tile_mapper_unit_test.gd

Extends: GdUnitTestSuite

Constants

  • Constant: DEFAULT_TILE_SIZE = Vector2i(16, 16) - DRY Constants - reused 3+ times across test methods
  • Constant: DEFAULT_TEST_POSITION = Vector2(320, 320)
  • Constant: TEST_MAP_SIZE = 40

Public Methods

create_test_tile_map

1
create_test_tile_map(tile_size: Vector2i = DEFAULT_TILE_SIZE) -> TileMapLayer

DRY Helper: Create a properly configured TileMapLayer for testing


create_static_body

1
create_static_body(position: Vector2 = DEFAULT_TEST_POSITION) -> StaticBody2D

DRY Helper: Create a StaticBody2D with proper collision hierarchy setup


create_collision_polygon

1
2
3
4
create_collision_polygon(
    points: PackedVector2Array,
    parent: Node
) -> CollisionPolygon2D

DRY Helper: Create a CollisionPolygon2D with points and add to parent


test_process_polygon_with_diagnostics

1
test_process_polygon_with_diagnostics() -> void

DRY: Covered by parameterized shape/tile tests above Test diagnostic processing functionality


test_compute_tile_offsets_null_polygon

1
test_compute_tile_offsets_null_polygon() -> void

Test null polygon handling


test_compute_tile_offsets_null_map

1
test_compute_tile_offsets_null_map() -> void

Test null map handling


test_compute_tile_offsets_no_tile_set

1
test_compute_tile_offsets_no_tile_set() -> void

Test map without tile set


test_compute_tile_offsets_at_origin

1
test_compute_tile_offsets_at_origin() -> void

Test polygon at origin


test_compute_tile_offsets_large_polygon

1
test_compute_tile_offsets_large_polygon() -> void

Test large polygon covering many tiles


test_compute_tile_offsets_with_parent

1
test_compute_tile_offsets_with_parent() -> void

Test polygon with parent transform


test_process_polygon_with_diagnostics_convex

1
test_process_polygon_with_diagnostics_convex() -> void

Test diagnostic information for convex polygon


test_process_polygon_with_diagnostics_concave

1
test_process_polygon_with_diagnostics_concave() -> void

Test diagnostic information for concave polygon


test_compute_tile_offsets_different_tile_sizes

1
test_compute_tile_offsets_different_tile_sizes() -> void

Test polygon processing with different tile sizes


test_compute_tile_offsets_outside_bounds

1
test_compute_tile_offsets_outside_bounds() -> void

Test polygon completely outside tilemap bounds


test_compute_tile_offsets_complex_polygon

1
test_compute_tile_offsets_complex_polygon() -> void

Test polygon processing performance with complex polygon


test_tile_property_detection_diagnostics

1
test_tile_property_detection_diagnostics() -> void

Test to diagnose tile property detection issue


test_compute_tile_offsets_consistency

1
test_compute_tile_offsets_consistency() -> void

Test that results are consistent across multiple calls


test_filter_area_diagnostics

1
test_filter_area_diagnostics() -> void

Diagnostic: Per-offset area inspection to debug final filtering


test_polygon_tile_overlap_area_empty_polygon

1
test_polygon_tile_overlap_area_empty_polygon() -> void

Unit tests for get_polygon_tile_overlap_area function Test empty polygon


test_polygon_tile_overlap_area_outside

1
test_polygon_tile_overlap_area_outside() -> void

Test polygon completely outside rect


test_polygon_tile_overlap_area_completely_inside

1
test_polygon_tile_overlap_area_completely_inside() -> void

Test polygon completely inside rect


test_polygon_tile_overlap_area_exact_match

1
test_polygon_tile_overlap_area_exact_match() -> void

Test polygon exactly matching rect bounds


test_polygon_tile_overlap_area_contains_rect

1
test_polygon_tile_overlap_area_contains_rect() -> void

Test polygon completely containing rect


test_polygon_tile_overlap_area_partial_overlap

1
test_polygon_tile_overlap_area_partial_overlap() -> void

Test partial overlap


test_polygon_tile_overlap_area_triangle

1
test_polygon_tile_overlap_area_triangle() -> void

Test triangle overlap


test_polygon_tile_overlap_area_complex

1
test_polygon_tile_overlap_area_complex() -> void

Test complex polygon


test_concave_polygon_tile_distribution

1
test_concave_polygon_tile_distribution() -> void

Test concave polygon tile distribution - isolates issue from integration test


Private Methods

_create_collision_polygon

1
2
3
4
_create_collision_polygon(
    points: PackedVector2Array,
    parent: Node
) -> CollisionPolygon2D

Flags: private



Grid Building v5.0.8 | Generated 24/05/2026