Click or drag to resize

Physics2DDirectSpaceStateGetRestInfo Method

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 GetMeta(String), and is set with ShapeSetData(RID, Object).

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.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public Dictionary GetRestInfo(
	Physics2DShapeQueryParameters shape
)

Parameters

shape
Type: GodotPhysics2DShapeQueryParameters

[Missing <param name="shape"/> documentation for "M:Godot.Physics2DDirectSpaceState.GetRestInfo(Godot.Physics2DShapeQueryParameters)"]

Return Value

Type: Dictionary

[Missing <returns> documentation for "M:Godot.Physics2DDirectSpaceState.GetRestInfo(Godot.Physics2DShapeQueryParameters)"]

See Also