diff --git a/src/actor.rs b/src/actor.rs index f213544..3297b10 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -58,12 +58,20 @@ impl Plugin for ActorPlugin { app.add_systems( PostUpdate, - handle_gforce - .run_if(game_running) - .run_if(alive) - .after(PhysicsSet::Sync) - .after(sync::position_to_transform) - .after(handle_wants_acceleration), + ( + handle_gforce + .run_if(game_running) + .run_if(alive) + .after(PhysicsSet::Sync) + .after(sync::position_to_transform) + .after(handle_wants_acceleration), + handle_atmosphere + .run_if(game_running) + .run_if(alive) + .after(PhysicsSet::Sync) + .after(sync::position_to_transform) + .before(handle_gforce), + ), ); app.add_systems( Update, @@ -205,6 +213,13 @@ pub struct WantsMatchVelocityWith(pub String); pub struct Identifier(pub String); #[derive(Component)] pub struct OrbitsJupiter; +#[derive(Component)] +pub struct ExperiencesAtmosphere; +#[derive(Component, Debug)] +pub struct HasAtmosphere { + pub r_inner: f64, + pub r_outer: f64, +} #[derive(Component)] pub struct LifeForm { @@ -1109,3 +1124,44 @@ fn handle_gravity( v.0 += accel; } } + +fn handle_atmosphere( + time: Res