Reset rather than accumulate velocity when stuck or in unloaded chunks

This commit is contained in:
Treeco 2020-07-09 15:46:00 +01:00
parent 3239fc1f2f
commit 1f1d9c5625

View File

@ -134,6 +134,7 @@ impl<'a> System<'a> for Sys {
let dt_lerp = 0.2;
(vel.0 * dt_lerp + old_vel.0 * (1.0 - dt_lerp)) * dt.0
} else {
vel.0 = Vec3::zero();
Vec3::zero()
};
@ -319,6 +320,7 @@ impl<'a> System<'a> for Sys {
}
if attempts == MAX_ATTEMPTS {
vel.0 = Vec3::zero();
pos.0 = old_pos;
break;
}