mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 12:12:00 +03:00
undo an epsilon fix that broke stuff. all tests pass right now!
This commit is contained in:
parent
d8e26eb703
commit
e7dab9f65e
@ -55,8 +55,9 @@ impl Vehicle {
|
|||||||
// TODO this needs unit tests and some careful checking
|
// TODO this needs unit tests and some careful checking
|
||||||
pub fn accel_to_stop_in_dist(&self, speed: Speed, dist: Distance) -> Acceleration {
|
pub fn accel_to_stop_in_dist(&self, speed: Speed, dist: Distance) -> Acceleration {
|
||||||
assert_ge!(dist, -EPSILON_DIST);
|
assert_ge!(dist, -EPSILON_DIST);
|
||||||
// Don't NaN out
|
// Don't NaN out. Don't check for <= EPSILON_DIST here -- it makes cars slightly overshoot
|
||||||
if dist <= EPSILON_DIST {
|
// sometimes.
|
||||||
|
if dist <= 0.0 * si::M {
|
||||||
return 0.0 * si::MPS2;
|
return 0.0 * si::MPS2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user