Skip to content
ct

Class

CollisionTestSetup2D

Generated GDScript class reference for GridPlacement.CollisionTestSetup2D.

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.

CollisionTestSetup2D [codeblock] var test_setup = CollisionTestSetup2D.new(collision_object, Vector2(16, 16)) if test_setup.validate_setup(): # Use test_setup.rect_collision_test_setups for collision testing pass [/codeblock] Builds collision test parameters for a CollisionObject2D to enable placement indicators to perform accurate collision checks against object geometry. [b]Purpose:[/b] Converts CollisionObject2D shapes into testable RectCollisionTestingSetup instances for collision validation during placement operations. [b]Key Features:[/b] • Creates one RectCollisionTestingSetup per shape owner • Expands test areas using configurable shape_stretch_size • Supports CollisionShape2D and CollisionPolygon2D nodes • Full error reporting via issues array [b]Quick Start:[/b] [codeblock] var test_setup = CollisionTestSetup2D.new(collision_object, Vector2(16, 16)) if test_setup.validate_setup(): # Use test_setup.rect_collision_test_setups for collision testing pass [/codeblock] [b]Advanced Documentation:[/b] For detailed usage, API reference, and troubleshooting, see: https://gridbuilding.pages.dev/api/v5.0.0/CollisionTestSetup2D [b]Dependencies:[/b] RectCollisionTestingSetup, PlacementGeometryUtils

Source: addons/grid_placement/placement/collsion_test/collision_test_setup_2d.gd

Syntax

class CollisionTestSetup2D extends RefCounted

Members

NameKindSummary
collision_objectPropertyThe CollisionObject2D being analyzed for collision testing.
shape_stretch_sizePropertySize to stretch collision shapes for full tile coverage. Recommended: Use your tile size (e.g., Vector2(16, 16) for 16x16 tiles). See advanced documentation for detailed sizing guidance.
rect_collision_test_setupsPropertyArray of RectCollisionTestingSetup instances, one per shape owner. Use these setups to perform collision tests for placement indicators.
issuesPropertyIssues discovered during collision test setup. Check this array after initialization to identify configuration problems.
add_issueMethod
free_testing_nodesMethod
validate_setupMethod
create_test_setups_for_collision_ownersMethod
setupsProperty
tile_setProperty
collision_shape_stretch_amountProperty
create_test_setups_from_test_nodeMethod
shapes_by_ownerProperty
setups_dictProperty
resultProperty