Function veloren_world::layer::scatter::density_factor_by_altitude

source ยท
pub fn density_factor_by_altitude(
    lower_limit: f32,
    altitude: f32,
    upper_limit: f32,
) -> f32
Expand description

Returns a decimal value between 0 and 1. The density is maximum at the middle of the highest and the lowest allowed altitudes, and zero otherwise. Quadratic curve.

The formula used is:

\max\left(-\frac{4\left(x-u\right)\left(x-l\right)}{\left(u-l\right)^{2}},\ 0\right)