From c2b4f926c1207e9241d15c0703228957c12f8cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20B=C3=B6klin?= Date: Tue, 8 Jun 2021 14:01:19 +0200 Subject: [PATCH] Hack custom gravity of 1G while gliding --- common/systems/src/phys.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/systems/src/phys.rs b/common/systems/src/phys.rs index df92f706d9..bf0af2b270 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -668,6 +668,11 @@ impl<'a> PhysicsData<'a> { // 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; @@ -682,7 +687,7 @@ impl<'a> PhysicsData<'a> { density, mass, &fluid, - GRAVITY, + custom_gravity.unwrap_or(GRAVITY), ); }, }