Skip to content

GBCollisionTileFilter

Helpers to normalize tile coverage and prune borderline tiles for mapper heuristics.

Keep shape-size magic numbers out of the CollisionMapper by centralizing tile-range adjustments and pruning logic here.

static func adjust_rect_tile_range( rect_size: Vector2, tile_size: Vector2, center_tile: Vector2i, start_tile: Vector2i, end_exclusive: Vector2i ) -> Dictionary

Collision Tile Filter Utilities Helpers to normalize tile coverage ranges and prune borderline tiles without embedding shape-size magic numbers in the mapper implementation.

Adjust rectangle tile iteration bounds Ensures even tile counts along any axis are expanded to the next odd count for symmetric coverage around the rectangle’s world center tile. Parameters: • rect_size: Vector2 – world-space size of the rectangle AABB. • tile_size: Vector2 – tile size. • center_tile: Vector2i – tile containing the rectangle’s world center. • start_tile, end_exclusive: Vector2i – raw iteration bounds. Returns: Dictionary – keys: start, end_exclusive.

static func circle_tile_allowed( circle_center: Vector2, radius: float, tile_center: Vector2, tile_size: Vector2 ) -> bool

Circle tile pruning Generic pruning based on the distance of the tile center from the circle center. Excludes extreme corner tiles whose centers lie beyond radius + half_tile allowance. Returns: bool – true if the tile is allowed.

addons/grid_building/utils/gb_collision_tile_filter.gd


This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.