reckfellENGINE

PhysicsRayQueryParameters2D

Parameters for a one-shot 2D ray query.

On this page
class PhysicsRayQueryParameters2DReckfellSharpInherits RefCounted

From and To are world endpoints of one segment. CollisionMask filters candidate Layers; CollideWithBodies/CollideWithAreas choose categories. Exclude holds physics-object RIDs, not instance IDs.

Parameters are not automatically inherited from a camera/weapon. Validate finite coordinates, a positive distance when computing endpoints and the intended world. Account for HitFromInside and geometry limitations separately; backface detection does not fill a concave surface.

Guide and example.

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

Constructors1

PhysicsRayQueryParameters2DConstructor
# PhysicsRayQueryParameters2D
C#
public PhysicsRayQueryParameters2D();

Properties7

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; }

Physics-object RIDs excluded from the query. Obtain them with CollisionObject.GetRid; GetInstanceId and visual mesh references are not those RIDs.

FromProperty
# From
C#
public Vector2 From { get; set; }

The starting point of the ray being queried for, in global coordinates.

HitFromInsideProperty
# HitFromInside
C#
public bool HitFromInside { get; set; }

If true, the query will detect a hit when starting inside shapes. In this case the collision normal will be Vector2(0, 0). Does not affect concave polygon shapes.

ToProperty
# To
C#
public Vector2 To { get; set; }

The ending point of the ray being queried for, in global coordinates.

Methods15

CreatePhysicsRayQueryParameters2D
# Create
C#
public static PhysicsRayQueryParameters2D Create(Vector2 from, Vector2 to, uint collisionMask = 4294967295, Reckfell.Collections.Array<Rid> exclude = null);

Returns a new, pre-configured PhysicsRayQueryParameters2D object. Use it to quickly create query parameters using the most common options.

Parameters
NameTypeDefault
fromVector2—
toVector2—
collisionMaskuint4294967295
excludeReckfell.Collections.Array<Rid>null
Returns PhysicsRayQueryParameters2D
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>
GetFromVector2
# GetFrom
C#
public Vector2 GetFrom();
Returns Vector2
GetToVector2
# GetTo
C#
public Vector2 GetTo();
Returns Vector2
IsCollideWithAreasEnabledbool
# IsCollideWithAreasEnabled
C#
public bool IsCollideWithAreasEnabled();
Returns bool
IsCollideWithBodiesEnabledbool
# IsCollideWithBodiesEnabled
C#
public bool IsCollideWithBodiesEnabled();
Returns bool
IsHitFromInsideEnabledbool
# IsHitFromInsideEnabled
C#
public bool IsHitFromInsideEnabled();
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>—
SetFromvoid
# SetFrom
C#
public void SetFrom(Vector2 from);
Parameters
NameTypeDefault
fromVector2—
SetHitFromInsidevoid
# SetHitFromInside
C#
public void SetHitFromInside(bool enable);
Parameters
NameTypeDefault
enablebool—
SetTovoid
# SetTo
C#
public void SetTo(Vector2 to);
Parameters
NameTypeDefault
toVector2—
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.