A ray cast callback implementation that keeps only the closest hit data. This is reusable, but make sure to clear the old result by calling RayCastClosest.clear if used once or more before.

Constructor

new()

Default constructor.

Variables

fraction:Float

The ratio of the position the ray hit from the start point to the end point.

hit:Bool

Whether the ray hit any shape in the world.

normal:Vec3

The normal vector of the surface the ray hit.

position:Vec3

The position the ray hit at.

shape:Shape

The shape the ray hit.

Methods

inlineclear():Void

Clears the result data.

Inherited Variables

Inherited Methods