Skip to main content

map_clamped

Function map_clamped 

Source
pub fn map_clamped<T>(
    value: T,
    from_min: T,
    from_max: T,
    to_min: T,
    to_max: T,
) -> T
where T: Add<Output = T> + Copy + Div<Output = T> + From<f32> + Mul<Output = T> + PartialOrd + Sub<Output = T>,
Expand description

Map a value from one range to another with clamped lerp.

Used for Y-clamped gradients in density functions.