Merge branch 'lboklin/prevent-full-stop-from-drag' into 'master'

Prevent drag forces from causing something to come to a complete stop

See merge request veloren/veloren!2170
This commit is contained in:
Imbris 2021-04-21 15:06:27 +00:00
commit ae9d9d60ee

View File

@ -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;
}