Click or drag to resize

Physics2DDirectSpaceStateIntersectShape Method

Checks the intersections of a shape, given through a Physics2DShapeQueryParameters object, against the space.

Note: This method does not take into account the motion property of the object. The intersected shapes are returned in an array containing dictionaries with the following fields:

collider: The colliding object.

collider_id: The colliding object's ID.

metadata: The intersecting shape's metadata. This metadata is different from GetMeta(String), and is set with ShapeSetData(RID, Object).

rid: The intersecting object's RID.

shape: The shape index of the colliding shape.

The number of intersections can be limited with the max_results parameter, to reduce the processing time.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public Array IntersectShape(
	Physics2DShapeQueryParameters shape,
	int maxResults = 32
)

Parameters

shape
Type: GodotPhysics2DShapeQueryParameters

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

maxResults (Optional)
Type: SystemInt32

[Missing <param name="maxResults"/> documentation for "M:Godot.Physics2DDirectSpaceState.IntersectShape(Godot.Physics2DShapeQueryParameters,System.Int32)"]

Return Value

Type: Array

[Missing <returns> documentation for "M:Godot.Physics2DDirectSpaceState.IntersectShape(Godot.Physics2DShapeQueryParameters,System.Int32)"]

See Also