RayResult

constructor(hit: Boolean, shape: Shape?, point: Vec2, normal: Vec2, fraction: Float)

Parameters

hit

Whether the ray hit anything

shape

The shape that was hit (null if no hit)

point

The point of intersection in world coordinates

normal

The surface normal at the intersection point

fraction

The fraction along the ray (0 to 1) where the hit occurred. If there is initial overlap, the fraction and normal will be zero while the point is an arbitrary point in the overlap region.