Function veloren_world::util::math::close
source ยท pub fn close(x: f32, range: Range<f32>) -> f32
Expand description
Return a value between 0 and 1 corresponding to how close to the centre of
range
x
is. The exact function used is left unspecified, but it shall
have the shape of a bell-like curve. This function is required to return 0
(or a value extremely close to 0
) when x
is outside of range
.