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.
Checking the stable version of the documentation...
PhysicsGetRestInfoResult2D
Inherits: RefCounted < Object
Stores the nearest collision information of a shape query.
Description
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
|
||
|
||
|
||
|
||
|
||
|
Property Descriptions
int get_collider_id()
The colliding object's ID.
RID get_collider_rid()
The intersecting object's RID.
int get_collider_shape()
The shape index of the colliding shape.
Vector2 collider_velocity = Vector2(0, 0) 🔗
Vector2 get_collider_velocity()
The colliding object's velocity Vector2. If the object is an Area2D, the result is (0, 0).
Vector2 normal = Vector2(0, 0) 🔗
Vector2 get_normal()
The collision normal of the query shape at the intersection point, pointing away from the intersecting object.
Vector2 point = Vector2(0, 0) 🔗
Vector2 get_point()
The intersection point.