Struct QueryRaycastHit
A raw 2D raycast hit returned by PhysicsQueries2D. Engine-agnostic: contains only Box2D identifiers and value types; see RaycastHit for the entity-resolved variant.
public readonly record struct QueryRaycastHit : IEquatable<QueryRaycastHit>
- Implements
- Inherited Members
Constructors
QueryRaycastHit(B2BodyId, B2ShapeId, Vector2, Vector2, float)
A raw 2D raycast hit returned by PhysicsQueries2D. Engine-agnostic: contains only Box2D identifiers and value types; see RaycastHit for the entity-resolved variant.
public QueryRaycastHit(B2BodyId BodyId, B2ShapeId ShapeId, Vector2 Point, Vector2 Normal, float Fraction)
Parameters
BodyIdB2BodyIdThe body hit by the ray.
ShapeIdB2ShapeIdThe specific shape on the body that was hit.
PointVector2World-space intersection point.
NormalVector2World-space surface normal at the hit.
FractionfloatNormalized fraction along the ray in range [0,1].
Properties
BodyId
The body hit by the ray.
public B2BodyId BodyId { get; init; }
Property Value
- B2BodyId
Fraction
Normalized fraction along the ray in range [0,1].
public float Fraction { get; init; }
Property Value
Normal
World-space surface normal at the hit.
public Vector2 Normal { get; init; }
Property Value
Point
World-space intersection point.
public Vector2 Point { get; init; }
Property Value
ShapeId
The specific shape on the body that was hit.
public B2ShapeId ShapeId { get; init; }
Property Value
- B2ShapeId