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.

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

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

int collider_id = 0 🔗

  • int get_collider_id()

The colliding object's ID.


RID collider_rid = RID() 🔗

  • RID get_collider_rid()

The intersecting object's RID.


int collider_shape = 0 🔗

  • int get_collider_shape()

The shape index of the colliding shape.


Vector2 collider_velocity = Vector2(0, 0) 🔗

The colliding object's velocity Vector2. If the object is an Area2D, the result is (0, 0).


Vector2 normal = Vector2(0, 0) 🔗

The collision normal of the query shape at the intersection point, pointing away from the intersecting object.


Vector2 point = Vector2(0, 0) 🔗

The intersection point.