mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 17:37:22 +03:00
sidewalks for two-ways
This commit is contained in:
parent
854eee4fd0
commit
52b8570e6c
12
TODO.md
12
TODO.md
@ -46,19 +46,27 @@
|
|||||||
|
|
||||||
- multiple lanes
|
- multiple lanes
|
||||||
- display + mouseover parking lane and sidewalk
|
- 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)
|
- 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)
|
- model bikes in driving lanes (as slow cars)
|
||||||
- add random bike lanes, figure out how turns would work
|
- add random bike lanes, figure out how turns would work
|
||||||
- be able to convert between parking and bike lanes, recompute the turns
|
- 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
|
- when rendering sidewalks, have an option for a grass buffer
|
||||||
|
|
||||||
- regression testing
|
- regression testing
|
||||||
- goldenfile approach for map_model, geom, and render layer from a small OSM chunk
|
- 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
|
- 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
|
## Code cleanup
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ use std::f64;
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct DrawRoad {
|
pub struct DrawRoad {
|
||||||
pub id: RoadID,
|
pub id: RoadID,
|
||||||
pub polygons: Vec<Vec<Vec2d>>, // TODO pub for DrawIntersection
|
polygons: Vec<Vec<Vec2d>>,
|
||||||
// Empty for one-ways and one side of two-ways.
|
// Empty for one-ways and one side of two-ways.
|
||||||
// TODO ideally this could be done in the shader or something
|
// TODO ideally this could be done in the shader or something
|
||||||
yellow_center_lines: Vec<Pt2D>,
|
yellow_center_lines: Vec<Pt2D>,
|
||||||
@ -27,7 +27,6 @@ impl DrawRoad {
|
|||||||
pub fn new(road: &map_model::Road, geom_map: &geom::GeomMap) -> DrawRoad {
|
pub fn new(road: &map_model::Road, geom_map: &geom::GeomMap) -> DrawRoad {
|
||||||
let geom_r = geom_map.get_r(road.id);
|
let geom_r = geom_map.get_r(road.id);
|
||||||
|
|
||||||
// TODO handle offset for Centered
|
|
||||||
let thick_line = if road.one_way_road {
|
let thick_line = if road.one_way_road {
|
||||||
geometry::ThickLine::Centered(geom::LANE_THICKNESS)
|
geometry::ThickLine::Centered(geom::LANE_THICKNESS)
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,7 +55,6 @@ impl ThickLine {
|
|||||||
(-1.0 * w * offset, -1.0 * w * (offset + 1.0))
|
(-1.0 * w * offset, -1.0 * w * (offset + 1.0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO this case
|
|
||||||
ThickLine::Centered(w) => (w / -2.0, w / 2.0),
|
ThickLine::Centered(w) => (w / -2.0, w / 2.0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,18 +279,20 @@ impl Map {
|
|||||||
LaneType::Driving,
|
LaneType::Driving,
|
||||||
0,
|
0,
|
||||||
orig_direction,
|
orig_direction,
|
||||||
if oneway { None } else { Some(2) },
|
if oneway { None } else { Some(3) },
|
||||||
),
|
),
|
||||||
(LaneType::Parking, 1, orig_direction, None),
|
(LaneType::Parking, 1, orig_direction, None),
|
||||||
//(LaneType::Sidewalk, 2, orig_direction, None),
|
(LaneType::Sidewalk, 2, orig_direction, None),
|
||||||
];
|
];
|
||||||
if oneway {
|
if oneway {
|
||||||
//lanes.push((LaneType::Sidewalk, 0, reverse_direction, None));
|
lanes.pop();
|
||||||
|
lanes.pop();
|
||||||
|
//lanes.push((LaneType::Sidewalk, 0, reverse_direction, None));
|
||||||
} else {
|
} else {
|
||||||
lanes.extend(vec![
|
lanes.extend(vec![
|
||||||
(LaneType::Driving, 0, reverse_direction, Some(-2)),
|
(LaneType::Driving, 0, reverse_direction, Some(-3)),
|
||||||
(LaneType::Parking, 1, reverse_direction, None),
|
(LaneType::Parking, 1, reverse_direction, None),
|
||||||
//(LaneType::Sidewalk, 2, reverse_direction, None),
|
(LaneType::Sidewalk, 2, reverse_direction, None),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user