Table of Contents

Struct Physics2DHit

Namespace
Gravitas.Queries
Assembly
Gravitas.dll

Result from a pure 2D query.

public readonly struct Physics2DHit
Inherited Members

Constructors

Physics2DHit(LSCollider2D, Vector2d, Vector2d, Fixed64)

Creates a 2D query hit from a world-space surface witness.

public Physics2DHit(LSCollider2D collider, Vector2d point, Vector2d normal, Fixed64 distance)

Parameters

collider LSCollider2D
point Vector2d
normal Vector2d
distance Fixed64

Physics2DHit(LSCollider2D, ContactAnchor2D, Vector2d, Fixed64)

Creates a 2D query hit with a rigid-frame surface witness.

public Physics2DHit(LSCollider2D collider, ContactAnchor2D anchor, Vector2d normal, Fixed64 distance)

Parameters

collider LSCollider2D
anchor ContactAnchor2D
normal Vector2d
distance Fixed64

Properties

Anchor

Gets the rigid-frame query witness.

public ContactAnchor2D Anchor { get; }

Property Value

ContactAnchor2D

Body

Gets the collider's body, or null for a bodyless collider.

public SolidBody2D? Body { get; }

Property Value

SolidBody2D

Collider

Gets the collider reported by the query.

public LSCollider2D Collider { get; }

Property Value

LSCollider2D

Distance

Gets the distance from the query origin to the hit.

public Fixed64 Distance { get; }

Property Value

Fixed64

Normal

Gets the world-space surface normal.

public Vector2d Normal { get; }

Property Value

Vector2d

Point

Gets the materialized world-space query witness.

public Vector2d Point { get; }

Property Value

Vector2d

Exceptions

InvalidOperationException

The conceptual witness lies outside the representable coordinate range.

Methods

TryGetPoint(out Vector2d)

Attempts to materialize the world-space query witness without saturation.

public bool TryGetPoint(out Vector2d point)

Parameters

point Vector2d

Returns

bool