Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

PhysicsCollideShapeResult2D

Inherits: RefCounted < Object

Stores the collision points of a shape collision query.

Description

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.

Properties

int

max_collisions

32

Methods

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


Property Descriptions

int max_collisions = 32 🔗

  • void set_max_collisions(value: int)

  • int get_max_collisions()

The maximum number of collisions this object can store.


Method Descriptions

int get_collision_count() const 🔗

Returns the number of point pairs detected by the query.


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.


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.


User-contributed notes

Please read the User-contributed notes policy before submitting a comment.