Table of Contents

Class PhysicsShapeQueryParameters2D

Namespace
Godot
Assembly
GodotSharp.dll

By changing various properties of this object, such as the shape, you can configure the parameters for IntersectShape(PhysicsShapeQueryParameters2D, int).

public class PhysicsShapeQueryParameters2D : RefCounted, IDisposable
Inheritance
PhysicsShapeQueryParameters2D
Implements
Inherited Members

Constructors

PhysicsShapeQueryParameters2D()

public PhysicsShapeQueryParameters2D()

Properties

CollideWithAreas

If true, the query will take Area2Ds into account.

public bool CollideWithAreas { get; set; }

Property Value

bool

CollideWithBodies

If true, the query will take PhysicsBody2Ds into account.

public bool CollideWithBodies { get; set; }

Property Value

bool

CollisionMask

The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See Collision layers and masks in the documentation for more information.

public uint CollisionMask { get; set; }

Property Value

uint

Exclude

The list of object Rids that will be excluded from collisions. Use GetRid() to get the Rid associated with a CollisionObject2D-derived node.

public Array<Rid> Exclude { get; set; }

Property Value

Array<Rid>

Margin

The collision margin for the shape.

public float Margin { get; set; }

Property Value

float

Motion

The motion of the shape being queried for.

public Vector2 Motion { get; set; }

Property Value

Vector2

Shape

The Shape2D that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over ShapeRid.

public Resource Shape { get; set; }

Property Value

Resource

ShapeRid

The queried shape's Rid that will be used for collision/intersection queries. Use this over Shape if you want to optimize for performance using the Servers API:

RID shapeRid = PhysicsServer2D.CircleShapeCreate();
  int radius = 64;
  PhysicsServer2D.ShapeSetData(shapeRid, radius);

var params = new PhysicsShapeQueryParameters2D(); params.ShapeRid = shapeRid;

// Execute physics queries here...

// Release the shape when done with physics queries. PhysicsServer2D.FreeRid(shapeRid);

public Rid ShapeRid { get; set; }

Property Value

Rid

Transform

The queried shape's transform matrix.

public Transform2D Transform { get; set; }

Property Value

Transform2D

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool