diff --git a/docs/TODO_quality.md b/docs/TODO_quality.md index 8de53abdf7..a8ea84b1a3 100644 --- a/docs/TODO_quality.md +++ b/docs/TODO_quality.md @@ -5,7 +5,6 @@ - try fixed pt again, for determinism purposes mostly - go through and use less f64's... like LANE_THICKNESS, make_polygons, Circle::new, project_away - audit inner_foo()'s - - rerun import, all tests, screenshots - change internal pt2d representation to int. JUST get that working first. - clamp distances first, not points? diff --git a/sim/src/driving.rs b/sim/src/driving.rs index 2e7676091d..f35047ff0e 100644 --- a/sim/src/driving.rs +++ b/sim/src/driving.rs @@ -851,7 +851,7 @@ impl DrivingSimState { }; let body = if let Some(ref parking) = c.parking { - let progress: f64 = (time - parking.started_at).as_time() / TIME_TO_PARK_OR_DEPART; + let progress = (time - parking.started_at).as_time() / TIME_TO_PARK_OR_DEPART; assert!(progress >= 0.0 && progress <= 1.0); let project_away_ratio = if parking.is_parking { progress diff --git a/sim/src/kinematics.rs b/sim/src/kinematics.rs index d88e0946ae..4f265ba1b3 100644 --- a/sim/src/kinematics.rs +++ b/sim/src/kinematics.rs @@ -166,7 +166,8 @@ impl Vehicle { / (2.0 * dist.inner_meters()), ); // TODO might validlyish be NaN, so just f64 here - let required_time: f64 = (speed / normal_case * -1.0).inner_seconds(); + let required_time = + -1.0 * speed.inner_meters_per_second() / normal_case.inner_meters_per_second_squared(); if self.debug { debug!( diff --git a/sim/src/walking.rs b/sim/src/walking.rs index 445dc09558..fcc077504a 100644 --- a/sim/src/walking.rs +++ b/sim/src/walking.rs @@ -312,7 +312,7 @@ impl Pedestrian { ); let line = Line::new(sidewalk_pos.pt(map), street_pos.pt(map)); - let progress: f64 = (now - bp.started_at).as_time() / TIME_TO_PREPARE_BIKE; + let progress = (now - bp.started_at).as_time() / TIME_TO_PREPARE_BIKE; assert!(progress >= 0.0 && progress <= 1.0); let ratio = if bp.is_parking { 1.0 - progress