This commit is contained in:
yuni 2024-03-29 03:31:15 +01:00
parent b3885aa4b6
commit 2b4fd9e5b5

View file

@ -133,7 +133,8 @@ fn run_camera_controller(
if actor.v[i].abs() < threshold {
actor.v[i] = 0.0;
}
else if (actor.v[i] < 0.0 && actor.v[i] + acceleration_total[i] > 0.0) || (actor.v[i] > 0.0 && actor.v[i] + acceleration_total[i] < 0.0) {
else if actor.v[i].signum() != (actor.v[i] + acceleration_total[i]).signum() {
// Overshoot
actor.v[i] = 0.0;
acceleration_total[i] = 0.0;
}