fix overshoot calculation when matching velocity
This commit is contained in:
parent
704c249091
commit
e44ecaabcd
|
@ -227,7 +227,7 @@ pub fn apply_input_to_player(
|
||||||
let threshold = 1e-5;
|
let threshold = 1e-5;
|
||||||
if key_input.pressed(settings.key_stop) {
|
if key_input.pressed(settings.key_stop) {
|
||||||
// Decelerate
|
// Decelerate
|
||||||
let dv = target_v - v.0;
|
let dv = v.0 - target_v;
|
||||||
for i in 0..3 {
|
for i in 0..3 {
|
||||||
if dv[i].abs() < threshold {
|
if dv[i].abs() < threshold {
|
||||||
v[i] = target_v[i];
|
v[i] = target_v[i];
|
||||||
|
|
Loading…
Reference in a new issue