mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Prevent drag forces from causing something to come to a complete stop
This commit is contained in:
parent
b10718c568
commit
6e364665cb
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user