oops, bug where parking spots were too close to the start

This commit is contained in:
Dustin Carlino 2018-08-16 12:48:17 -07:00
parent e7dab9f65e
commit 0edd4c6eff
3 changed files with 3 additions and 3 deletions

View File

@ -291,7 +291,7 @@ How to represent departing/parking states?
---> or, own it in the driving state, since thats the major place where we need to block other cars and make sure we dont hit things.
- should we tell parking state about the transitional cars or not? driving should render them. might make statistics and looking for free spots weird, but let's not tell parking about them yet!
How do we tell a driving car to aim for a particular parking spot? Seems like we need to pick it first...
Time to implement roaming if there are no spots free!
## Representing map edits

View File

@ -185,7 +185,7 @@ impl ParkingLane {
spots: iter::repeat(None).take(l.number_parking_spots()).collect(),
spot_fronts: (0..l.number_parking_spots())
.map(|idx| {
let spot_start = map_model::PARKING_SPOT_LENGTH * (1.0 + idx as f64);
let spot_start = map_model::PARKING_SPOT_LENGTH * (2.0 + idx as f64);
let dist_along =
spot_start - (map_model::PARKING_SPOT_LENGTH - draw_car::CAR_LENGTH) / 2.0;
let (pos, angle) = l.dist_along(dist_along);

View File

@ -502,7 +502,7 @@ fn pick_goal_and_find_path<R: Rng + ?Sized>(
}
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ParkingSpot {
pub parking_lane: LaneID,
pub spot_idx: usize,