cleanup
This commit is contained in:
parent
c56b5d6d74
commit
8a07e9cfb7
1 changed files with 9 additions and 11 deletions
20
src/actor.rs
20
src/actor.rs
|
@ -543,17 +543,15 @@ fn handle_wants_maxvelocity(
|
||||||
if total > maxv.0 {
|
if total > maxv.0 {
|
||||||
v.0 = DVec3::splat(0.0);
|
v.0 = DVec3::splat(0.0);
|
||||||
}
|
}
|
||||||
// already not moving
|
} else {
|
||||||
continue;
|
// TODO: respect engine parameters for different thrusts for different directions
|
||||||
}
|
let avg_thrust =
|
||||||
|
(engine.thrust_forward + engine.thrust_back + engine.thrust_sideways) / 3.0;
|
||||||
// TODO: respect engine parameters for different thrusts for different directions
|
let acceleration = (avg_thrust * dt) as f64 * -v.0;
|
||||||
let avg_thrust =
|
v.0 += acceleration;
|
||||||
(engine.thrust_forward + engine.thrust_back + engine.thrust_sideways) / 3.0;
|
if v.0.length() + EPSILON < acceleration.length() {
|
||||||
let acceleration = (avg_thrust * dt) as f64 * -v.0;
|
v.0 = DVec3::splat(0.0);
|
||||||
v.0 += acceleration;
|
}
|
||||||
if v.0.length() + EPSILON < acceleration.length() {
|
|
||||||
v.0 = DVec3::splat(0.0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue