From 4568a7a38f3c90c4e4f69de76a48492ab1ff2ad4 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 c3e7216429..d848bc4c88 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -667,6 +667,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; @@ -681,7 +686,7 @@ impl<'a> PhysicsData<'a> { density, mass, &fluid, - GRAVITY, + custom_gravity.unwrap_or(GRAVITY), ); }, }