Struct Physics2DHit
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
colliderLSCollider2DpointVector2dnormalVector2ddistanceFixed64
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
colliderLSCollider2DanchorContactAnchor2DnormalVector2ddistanceFixed64
Properties
Anchor
Gets the rigid-frame query witness.
public ContactAnchor2D Anchor { get; }
Property Value
Body
Gets the collider's body, or null for a bodyless collider.
public SolidBody2D? Body { get; }
Property Value
Collider
Gets the collider reported by the query.
public LSCollider2D Collider { get; }
Property Value
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
pointVector2d