Function saft::sphere_tracing::trace

source ·
pub fn trace(
    sd: impl FnMut(Vec3) -> f32,
    ray: Ray3,
    t_range: RangeInclusive<f32>,
    opt: &Options
) -> ClosestHit
Expand description

Marches a ray from t_range.start() until t_range.end(), returning the first hit or (in case of no hit) the point that were closest to the surface.

sd is a signed distance field that should never underestimate the distance to the surface. The surface is where the signed distance is zero.