PhysicsIntersectShapeResult2D
Inherits: RefCounted < Object
Description
Section titled “Description”Stores the results of a shape intersection query.
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
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| int | max_intersections |
32 |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| 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
Section titled “Property descriptions”max_intersections
int max_intersections = 32
The maximum number of intersections this result object can store.
Method descriptions
Section titled “Method descriptions”get_collider
Object get_collider(intersection_index: int) const
The colliding object.
get_collider_id
int get_collider_id(intersection_index: int) const
The colliding object’s ID.
get_collider_rid
RID get_collider_rid(intersection_index: int) const
The intersecting object’s RID.
get_collider_shape
int get_collider_shape(intersection_index: int) const
The shape index of the colliding shape.
get_intersection_count
int get_intersection_count() const
Returns the number of shapes that intersect with the query shape.
