Skip to content
ct

Class

CollisionShapeProcessor

Generated GDScript class reference for GridPlacement.CollisionShapeProcessor.

Status
Draft
Version
v6.0
Updated
Development docs generated from GDScript source

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

Processes collision shapes to determine tile offsets for grid-based placement. The 2D leaf is this class; the 3D leaf is [CollisionShapeProcessor3D]. Both extend this base; see addons/grid_placement/guides/naming-convention.md for the 2D/3D naming rule.

Source: addons/grid_placement/placement/manager/components/mapper/collision_shape_processor_2d.gd

Syntax

class CollisionShapeProcessor extends RefCounted

Members

NameKindSummary
GeometryCacheManagerFieldThis component handles the geometric calculations needed to map arbitrary 2D collision shapes onto discrete tile grids. It supports both square and isometric tile layouts, providing accurate tile coverage determination for placement validation. [b]Core Responsibilities:[/b][br] - Convert collision shapes to tile offset arrays relative to a center tile[br] - Handle shape-to-tile overlap calculations with configurable precision[br] - Support different tile geometries (square, isometric) automatically[br] - Apply shape-specific optimizations (symmetry enforcement, area thresholds)[br] - Cache geometric calculations for performance[br][br] [b]Tile Shape Support:[/b][br] The processor automatically detects tile shape from the TileMapLayer's TileSet and applies appropriate geometric calculations. Single source of truth principle ensures tile shape information is read directly from the map configuration.[br][br] [b]Usage:[/b] [codeblock] var processor = CollisionShapeProcessor.new(cache_manager) var tile_offsets = processor.get_tile_offsets_for_collision_object(test_data, map, positioner) [/codeblock]
get_tile_offsets_for_collision_objectMethod