RaycastHit#
The closest object hit by a ray. Point, Normal and Direction use Space's coordinates; Distance is metres along the full path, including any scene tunnel crossings.
public readonly record struct RaycastHit(RuntimeEntity Entity, Vector3 Point, Vector3 Normal, float Distance)Record properties#
| Property | Type | Access | Constructor default |
|---|---|---|---|
Entity | RuntimeEntity | get; init; | required |
Point | Vector3 | get; init; | required |
Normal | Vector3 | get; init; | required |
Distance | float | get; init; | required |
Direction#
public Vector3 Direction { get; init; }The incoming unit direction at the hit, after any scene tunnel rotations.
Space#
public SceneSpace Space { get; init; }Initial value: Entity.Space
The coordinate context at the time of the hit, retained if the object later travels.
Related types#
Source#
- Contact.cs