Chris' Tutorials
Docs/Grid Placement

Class

CollisionGeometryUtils

Generated GDScript class reference for GridPlacement.CollisionGeometryUtils.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.

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).

Source: addons/grid_placement/utils/collision_geometry_utils.gd

Syntax

class CollisionGeometryUtils extends RefCounted

Members

NameKindSummary
build_shape_transformMethod
shape_transformProperty
shape_local_offsetProperty
to_world_polygonMethod
world_pointsProperty
global_xformProperty
compute_tile_iteration_rangeMethod
resultProperty
epsilonProperty
adjusted_min_cornerProperty
start_tileProperty
adjusted_max_cornerProperty
end_tile_inclusiveProperty
end_exclusiveProperty
center_tile_for_polygon_positionerMethod
center_tile_for_shape_objectMethod
compute_polygon_tile_offsetsMethod
offsetsProperty
overlapped_tilesProperty
is_polygon_convexMethod
nProperty
signProperty
aProperty
bProperty
cProperty
crossProperty
curr_signProperty

Source

addons/grid_placement/utils/collision_geometry_utils.gd

Plugin docs root:gdscript/plugins/grid_placement_dev/docs