diff --git a/TODO.md b/TODO.md index 5d666b1f8a..99e00a9779 100644 --- a/TODO.md +++ b/TODO.md @@ -46,19 +46,27 @@ - multiple lanes - display + mouseover parking lane and sidewalk - - make parking lanes on one-ways work - - add in sidewalks (update the ID offset!) - make the center lines in geom layer work (use debug mode to verify) + - something broke curved roads + - make extra lanes for oneways work + - have to switch from Centered to DrivingDirection somehow + - either translate points up-front and be normal or fix geom layer (for turns and intersections) + - model cars parking + - maybe render numbers on the cars to distinguish them + - document the FSM (on lane driving, waiting, turning, parking, etc) - model bikes in driving lanes (as slow cars) - add random bike lanes, figure out how turns would work - be able to convert between parking and bike lanes, recompute the turns + - model pdestrians + - maybe draw crosswalks? - when rendering sidewalks, have an option for a grass buffer - regression testing - goldenfile approach for map_model, geom, and render layer from a small OSM chunk - or maybe a visual demo approach with a list of things to manually check + - unit test that Centered thick line yields same geometry with points reversed ## Code cleanup diff --git a/editor/src/render/road.rs b/editor/src/render/road.rs index cb9b23e487..982af19ef3 100644 --- a/editor/src/render/road.rs +++ b/editor/src/render/road.rs @@ -17,7 +17,7 @@ use std::f64; #[derive(Debug)] pub struct DrawRoad { pub id: RoadID, - pub polygons: Vec>, // TODO pub for DrawIntersection + polygons: Vec>, // Empty for one-ways and one side of two-ways. // TODO ideally this could be done in the shader or something yellow_center_lines: Vec, @@ -27,7 +27,6 @@ impl DrawRoad { pub fn new(road: &map_model::Road, geom_map: &geom::GeomMap) -> DrawRoad { let geom_r = geom_map.get_r(road.id); - // TODO handle offset for Centered let thick_line = if road.one_way_road { geometry::ThickLine::Centered(geom::LANE_THICKNESS) } else { diff --git a/geom/src/geometry.rs b/geom/src/geometry.rs index 935ad3a5ef..db889477da 100644 --- a/geom/src/geometry.rs +++ b/geom/src/geometry.rs @@ -55,7 +55,6 @@ impl ThickLine { (-1.0 * w * offset, -1.0 * w * (offset + 1.0)) } } - // TODO this case ThickLine::Centered(w) => (w / -2.0, w / 2.0), } } diff --git a/map_model/src/lib.rs b/map_model/src/lib.rs index c23646b394..665503a9c4 100644 --- a/map_model/src/lib.rs +++ b/map_model/src/lib.rs @@ -279,18 +279,20 @@ impl Map { LaneType::Driving, 0, orig_direction, - if oneway { None } else { Some(2) }, + if oneway { None } else { Some(3) }, ), (LaneType::Parking, 1, orig_direction, None), - //(LaneType::Sidewalk, 2, orig_direction, None), + (LaneType::Sidewalk, 2, orig_direction, None), ]; if oneway { - //lanes.push((LaneType::Sidewalk, 0, reverse_direction, None)); + lanes.pop(); + lanes.pop(); + //lanes.push((LaneType::Sidewalk, 0, reverse_direction, None)); } else { lanes.extend(vec![ - (LaneType::Driving, 0, reverse_direction, Some(-2)), + (LaneType::Driving, 0, reverse_direction, Some(-3)), (LaneType::Parking, 1, reverse_direction, None), - //(LaneType::Sidewalk, 2, reverse_direction, None), + (LaneType::Sidewalk, 2, reverse_direction, None), ]); }