Function veloren_world::sim::sample_wpos
source ยท pub fn sample_wpos(
config: &MapConfig<'_>,
sampler: &WorldSim,
wpos: Vec2<i32>,
) -> f32
Expand description
A sample function that grabs the connections at a chunk.
Currently this just supports rivers, but ideally it can be extended past that.
A sample function that grabs surface altitude at a column. (correctly reflecting settings like is_basement and is_water).
The altitude produced by this function at a column corresponding to a particular chunk should be identical to the altitude produced by sample_pos at that chunk.
You should generally pass a closure over this function into generate when constructing a map for the first time. However, if repeated construction is needed, or alternate base colors are to be used for some reason, one should pass a custom function to generate instead (e.g. one that just looks up the height in a cached array).