reckfellENGINE

PhysicsShapeQueryParameters2D

Provides parameters for PhysicsDirectSpaceState2D's methods.

On this page
class PhysicsShapeQueryParameters2DReckfellSharpInherits RefCounted

Provides parameters for PhysicsDirectSpaceState2D's methods.

By changing various properties of this object, such as the shape, you can configure the parameters for PhysicsDirectSpaceState2D's methods.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

PhysicsShapeQueryParameters2DConstructor
# PhysicsShapeQueryParameters2D
C#
public PhysicsShapeQueryParameters2D();

Properties9

CollideWithAreasProperty
# CollideWithAreas
C#
public bool CollideWithAreas { get; set; }

If true, the query will take Area2Ds into account.

CollideWithBodiesProperty
# CollideWithBodies
C#
public bool CollideWithBodies { get; set; }

If true, the query will take PhysicsBody2Ds into account.

CollisionMaskProperty
# CollisionMask
C#
public uint CollisionMask { get; set; }

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.

ExcludeProperty
# Exclude
C#
public Reckfell.Collections.Array<Rid> Exclude { get; set; }

The list of object Rids that will be excluded from collisions. Use CollisionObject2D.GetRid to get the Rid associated with a CollisionObject2D-derived node. Note: The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again.

MarginProperty
# Margin
C#
public float Margin { get; set; }

The collision margin for the shape.

MotionProperty
# Motion
C#
public Vector2 Motion { get; set; }

The motion of the shape being queried for.

ShapeProperty
# Shape
C#
public Resource Shape { get; set; }

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 PhysicsShapeQueryParameters2D.ShapeRid.

ShapeRidProperty
# ShapeRid
C#
public Rid ShapeRid { get; set; }

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

C#
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);
TransformProperty
# Transform
C#
public Transform2D Transform { get; set; }

The queried shape's transform matrix.

Methods18

GetCollisionMaskuint
# GetCollisionMask
C#
public uint GetCollisionMask();
Returns uint
GetExcludeReckfell.Collections.Array<Rid>
# GetExclude
C#
public Reckfell.Collections.Array<Rid> GetExclude();
Returns Reckfell.Collections.Array<Rid>
GetMarginfloat
# GetMargin
C#
public float GetMargin();
Returns float
GetMotionVector2
# GetMotion
C#
public Vector2 GetMotion();
Returns Vector2
GetShapeResource
# GetShape
C#
public Resource GetShape();
Returns Resource
GetShapeRidRid
# GetShapeRid
C#
public Rid GetShapeRid();
Returns Rid
GetTransformTransform2D
# GetTransform
C#
public Transform2D GetTransform();
Returns Transform2D
IsCollideWithAreasEnabledbool
# IsCollideWithAreasEnabled
C#
public bool IsCollideWithAreasEnabled();
Returns bool
IsCollideWithBodiesEnabledbool
# IsCollideWithBodiesEnabled
C#
public bool IsCollideWithBodiesEnabled();
Returns bool
SetCollideWithAreasvoid
# SetCollideWithAreas
C#
public void SetCollideWithAreas(bool enable);
Parameters
NameTypeDefault
enablebool—
SetCollideWithBodiesvoid
# SetCollideWithBodies
C#
public void SetCollideWithBodies(bool enable);
Parameters
NameTypeDefault
enablebool—
SetCollisionMaskvoid
# SetCollisionMask
C#
public void SetCollisionMask(uint collisionMask);
Parameters
NameTypeDefault
collisionMaskuint—
SetExcludevoid
# SetExclude
C#
public void SetExclude(Reckfell.Collections.Array<Rid> exclude);
Parameters
NameTypeDefault
excludeReckfell.Collections.Array<Rid>—
SetMarginvoid
# SetMargin
C#
public void SetMargin(float margin);
Parameters
NameTypeDefault
marginfloat—
SetMotionvoid
# SetMotion
C#
public void SetMotion(Vector2 motion);
Parameters
NameTypeDefault
motionVector2—
SetShapevoid
# SetShape
C#
public void SetShape(Resource shape);
Parameters
NameTypeDefault
shapeResource—
SetShapeRidvoid
# SetShapeRid
C#
public void SetShapeRid(Rid shape);
Parameters
NameTypeDefault
shapeRid—
SetTransformvoid
# SetTransform
C#
public void SetTransform(Transform2D transform);
Parameters
NameTypeDefault
transformTransform2D—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.