From 1c582886874f0c7657302e1e51c8b154292c0cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20B=C3=B6klin?= Date: Wed, 9 Jun 2021 14:33:28 +0200 Subject: [PATCH] Undo gravity hack and set gravity to 1G again --- common/src/comp/body.rs | 4 ++-- common/src/consts.rs | 2 +- common/systems/src/phys.rs | 8 +------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 5f6d234716..6648507ae5 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -764,8 +764,8 @@ impl Drag for Body { fn parasite_drag_coefficient(&self) -> f32 { // Scale modifier to reduce or increase drag as needed to give bodies reasonable // terminal velocities for the gravitational acceleration of this world - // const SCALE_MODIFIER: f32 = 0.6; // if we can eventually have 1G - const SCALE_MODIFIER: f32 = 1.1; // for 2.5G + const SCALE_MODIFIER: f32 = 0.6; // if we can eventually have 1G + // const SCALE_MODIFIER: f32 = 1.1; // for 2.5G // Reference area and drag coefficient assumes best-case scenario of the // orientation producing least amount of drag diff --git a/common/src/consts.rs b/common/src/consts.rs index 4cbaa9598e..e55fee68bc 100644 --- a/common/src/consts.rs +++ b/common/src/consts.rs @@ -2,7 +2,7 @@ pub const MAX_PICKUP_RANGE: f32 = 8.0; pub const MAX_MOUNT_RANGE: f32 = 14.0; -pub const GRAVITY: f32 = 25.0; +pub const GRAVITY: f32 = 9.81; pub const FRIC_GROUND: f32 = 0.15; // Values for air taken from http://www-mdp.eng.cam.ac.uk/web/library/enginfo/aerothermal_dvd_only/aero/atmos/atmos.html diff --git a/common/systems/src/phys.rs b/common/systems/src/phys.rs index bf0af2b270..7fb2c45a94 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -667,12 +667,6 @@ impl<'a> PhysicsData<'a> { // players into the floor when stationary if other systems cause the server // to lag (as observed in the 0.9 release party). let dt = DeltaTime(read.dt.0.min(0.1)); - - // Hack. FIXME: Implement gravity magic proper and/or set GRAVITY to 9.81. - let custom_gravity = character_state.and_then(|cs| match cs { - CharacterState::Glide(_) => Some(9.81), - _ => None, - }); match physics_state.in_fluid { None => { vel.0.z -= dt.0 * GRAVITY; @@ -687,7 +681,7 @@ impl<'a> PhysicsData<'a> { density, mass, &fluid, - custom_gravity.unwrap_or(GRAVITY), + GRAVITY, ); }, }