PhysicsGetRestInfoResult2D
Inherits: RefCounted < Object
Description
Section titled “Description”Stores the nearest collision information of a shape query.
This class contains the collision data computed by PhysicsDirectSpaceState2D.get_rest_info_into().
If the shape collides with multiple objects, only the nearest collision is stored.
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 | collider_id |
0 |
| RID | collider_rid |
RID() |
| int | collider_shape |
0 |
| Vector2 | collider_velocity |
Vector2(0, 0) |
| Vector2 | normal |
Vector2(0, 0) |
| Vector2 | point |
Vector2(0, 0) |
Property descriptions
Section titled “Property descriptions”collider_id
int collider_id = 0
The colliding object’s ID.
collider_rid
RID collider_rid = RID()
The intersecting object’s RID.
collider_shape
int collider_shape = 0
The shape index of the colliding shape.
collider_velocity
Vector2 collider_velocity = Vector2(0, 0)
The colliding object’s velocity Vector2. If the object is an Area2D, the result is (0, 0).
normal
Vector2 normal = Vector2(0, 0)
The collision normal of the query shape at the intersection point, pointing away from the intersecting object.
point
Vector2 point = Vector2(0, 0)
The intersection point.
