From 6e364665cb939df89afb21a8ffaa0ff99a63d8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20B=C3=B6klin?= Date: Wed, 21 Apr 2021 16:07:24 +0200 Subject: [PATCH] Prevent drag forces from causing something to come to a complete stop --- common/systems/src/phys.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/systems/src/phys.rs b/common/systems/src/phys.rs index da058af3a5..71e05f5390 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -86,7 +86,9 @@ fn integrate_forces( // This way we can only ever lose velocity and will never experience a reverse // in direction from events such as falling into water at high velocities. if new_v.dot(vel.0) < 0.0 { - vel.0 -= vel.0.projected(&impulse); + // Multiply by a factor to prevent full stop, as this can cause things to get + // stuck in high-density medium + vel.0 -= vel.0.projected(&impulse) * 0.7; } else { vel.0 = new_v; }