Grid Placement

CollisionGeometryUtils

AUTO-GENERATED FILE — DO NOT EDIT MANUALLY

Source: shared/utils/geometry/collision_geometry_utils.gd

Version: 5.1

class_name: CollisionGeometryUtils extends: RefCounted

Summary

Pure, stateless helpers used by the placement/collision mapping pipeline. These functions are extracted from the runtime mapper to allow focused unit tests and reuse from multiple contexts without side-effects.

[b]Default Overlap Thresholds[/b]

  • Edge epsilon: [code]0.01[/code] (1% tolerance for edge detection)
  • Minimum area fraction: [code]0.05[/code] (5% of tile area required for overlap)
  • Very small polygons (< 5% of tile area) are filtered out to avoid spurious detections
  • For 16×16 tiles, minimum overlap area is 12.8 square units
  • For 32×32 tiles, minimum overlap area is 51.2 square units

[b]Testing Notes[/b]

  • Micro polygons smaller than 5% threshold return zero tiles (by design)
  • Use larger polygons (≥25% tile area) for reliable collision detection in tests
  • Production mapper may use different thresholds for specific shape types

[i]Documentation style[/i]: Comments use BBCode to render nicely in the Godot editor’s help panel.

Cross‑references

  • Center‑based tile semantics: Indicator and mapper math assume tile centers; e.g., 16×16 → center offset (+8,+8).
  • Iteration range epsilon: compute_tile_iteration_range applies symmetric epsilons to min/max to avoid fencepost tiles when world bounds align exactly to tile borders (bottom‑inclusive, top‑exclusive in practice).

Signals

(none)

Exports

(none)

Methods

(none)