Comment fixes

This commit is contained in:
IsseW 2022-05-31 17:09:28 +02:00
parent 9104a07530
commit 121cf3becc
2 changed files with 5 additions and 2 deletions

View File

@ -78,7 +78,8 @@ pub struct WeatherGrid {
weather: Grid<Weather>,
}
/// Returns the center of the weather cell at the given position
/// Transforms a world position to cell coordinates. Where (0.0, 0.0) in cell
/// coordinates is the center of the weather cell located at (0, 0) in the grid.
fn to_cell_pos(wpos: Vec2<f32>) -> Vec2<f32> { wpos / CELL_SIZE as f32 - 0.5 }
// TODO: Move consts from world to common to avoid duplication

View File

@ -21,8 +21,10 @@ pub fn init(state: &mut State, world: &world::World) {
state.ecs_mut().insert(sim);
/// How often the weather is updated, in seconds
pub const WEATHER_DT: f32 = 5.0;
const WEATHER_DT: f32 = 5.0;
// NOTE: If weather computations get too heavy, this should not block the main
// thread.
state
.ecs_mut()
.insert(SysScheduler::<tick::Sys>::every(Duration::from_secs_f32(