Skip to content

PhysicsCollideShapeResult2D

Inherits: RefCounted < Object

Stores the collision points of a shape collision query.

This class contains the contact points computed by PhysicsDirectSpaceState2D.collide_shape_into().

Each collision is represented as a pair of points: one on the query shape and one on the colliding shape.

Note: For optimal performance results, it is recommended to create this object in advance, store it, and reuse it for every subsequent query.

Type Name Default
int max_collisions 32
Returns Method
int get_collision_count() const
Vector2 get_point_on_colliding_shape(collision_index: int) const
Vector2 get_point_on_queried_shape(collision_index: int) const

max_collisions

int max_collisions = 32

The maximum number of collisions this object can store.

get_collision_count

int get_collision_count() const

Returns the number of point pairs detected by the query.

get_point_on_colliding_shape

Vector2 get_point_on_colliding_shape(collision_index: int) const

Returns the collision point on the colliding shape for the collision at the given index.

get_point_on_queried_shape

Vector2 get_point_on_queried_shape(collision_index: int) const

Returns the collision point on the query shape for the collision at the given index.