Physics2DDirectSpaceState.getRestInfo

Checks the intersections of a shape, given through a Physics2DShapeQueryParameters object, against the space. If it collides with more than one shape, the nearest one is selected. If the shape did not intersect anything, then an empty dictionary is returned instead. Note: This method does not take into account the motion property of the object. The returned object is a dictionary containing the following fields: collider_id: The colliding object's ID. linear_velocity: The colliding object's velocity Vector2. If the object is an Area2D, the result is (0, 0). metadata: The intersecting shape's metadata. This metadata is different from GodotObject.getMeta, and is set with Physics2DServer.shapeSetData. normal: The object's surface normal at the intersection point. point: The intersection point. rid: The intersecting object's RID. shape: The shape index of the colliding shape.

struct Physics2DDirectSpaceState
@nogc nothrow
Dictionary
getRestInfo

Meta