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.

PhysicsIntersectShapeResult2D

Inherits: RefCounted < Object

Stores the results of a shape intersection query.

Description

This class contains the intersection information produced by PhysicsDirectSpaceState2D.intersect_shape_into().

It can store multiple intersections, up to a user-defined maximum.

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_intersections

32

Methods

Object

get_collider(intersection_index: int) const

int

get_collider_id(intersection_index: int) const

RID

get_collider_rid(intersection_index: int) const

int

get_collider_shape(intersection_index: int) const

int

get_intersection_count() const


Property Descriptions

int max_intersections = 32 🔗

  • void set_max_intersections(value: int)

  • int get_max_intersections()

The maximum number of intersections this result object can store.


Method Descriptions

Object get_collider(intersection_index: int) const 🔗

The colliding object.


int get_collider_id(intersection_index: int) const 🔗

The colliding object's ID.


RID get_collider_rid(intersection_index: int) const 🔗

The intersecting object's RID.


int get_collider_shape(intersection_index: int) const 🔗

The shape index of the colliding shape.


int get_intersection_count() const 🔗

Returns the number of shapes that intersect with the query shape.


User-contributed notes

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