mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 23:43:25 +03:00
fix center lines for two-ways
This commit is contained in:
parent
52b8570e6c
commit
592f284be3
2
TODO.md
2
TODO.md
@ -46,12 +46,12 @@
|
|||||||
|
|
||||||
- multiple lanes
|
- multiple lanes
|
||||||
- display + mouseover parking lane and sidewalk
|
- display + mouseover parking lane and sidewalk
|
||||||
- make the center lines in geom layer work (use debug mode to verify)
|
|
||||||
- something broke curved roads
|
- something broke curved roads
|
||||||
- make extra lanes for oneways work
|
- make extra lanes for oneways work
|
||||||
- have to switch from Centered to DrivingDirection somehow
|
- have to switch from Centered to DrivingDirection somehow
|
||||||
- either translate points up-front and be normal or fix geom layer (for turns and intersections)
|
- either translate points up-front and be normal or fix geom layer (for turns and intersections)
|
||||||
|
|
||||||
|
- dont allow cars on non-driving lanes :)
|
||||||
- model cars parking
|
- model cars parking
|
||||||
- maybe render numbers on the cars to distinguish them
|
- maybe render numbers on the cars to distinguish them
|
||||||
- document the FSM (on lane driving, waiting, turning, parking, etc)
|
- document the FSM (on lane driving, waiting, turning, parking, etc)
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
- and maybe to recalculate fixedish things if they change?
|
- and maybe to recalculate fixedish things if they change?
|
||||||
|
|
||||||
- more advanced road modeling, like https://wiki.openstreetmap.org/wiki/Proposed_features/Street_area
|
- more advanced road modeling, like https://wiki.openstreetmap.org/wiki/Proposed_features/Street_area
|
||||||
|
- yellow center lines eat into the width of one lane arbitrarily
|
||||||
|
|
||||||
## Conga line idea
|
## Conga line idea
|
||||||
|
|
||||||
|
@ -174,6 +174,8 @@ impl SelectionState {
|
|||||||
draw_map.get_t(turn.id).draw_full(g, render::TURN_COLOR);
|
draw_map.get_t(turn.id).draw_full(g, render::TURN_COLOR);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
// TODO tmp
|
||||||
|
draw_map.get_r(id).draw_debug(g, geom_map.get_r(id));
|
||||||
}
|
}
|
||||||
SelectionState::TooltipRoad(id) => {
|
SelectionState::TooltipRoad(id) => {
|
||||||
canvas.draw_mouse_tooltip(g, &draw_map.get_r(id).tooltip_lines(map, geom_map));
|
canvas.draw_mouse_tooltip(g, &draw_map.get_r(id).tooltip_lines(map, geom_map));
|
||||||
|
@ -25,8 +25,8 @@ const BIG_ARROW_TIP_LENGTH: f64 = 1.0;
|
|||||||
const TURN_ICON_ARROW_TIP_LENGTH: f64 = BIG_ARROW_TIP_LENGTH * 0.8;
|
const TURN_ICON_ARROW_TIP_LENGTH: f64 = BIG_ARROW_TIP_LENGTH * 0.8;
|
||||||
const TURN_ICON_ARROW_LENGTH: f64 = 2.0;
|
const TURN_ICON_ARROW_LENGTH: f64 = 2.0;
|
||||||
|
|
||||||
pub const DEBUG_COLOR: Color = canvas::PURPLE;
|
pub const DEBUG_COLOR: Color = canvas::RED;
|
||||||
pub const BRIGHT_DEBUG_COLOR: Color = [1.0, 0.1, 0.55, 1.0];
|
pub const BRIGHT_DEBUG_COLOR: Color = [0.8, 0.1, 0.1, 1.0];
|
||||||
pub const ROAD_COLOR: Color = canvas::BLACK;
|
pub const ROAD_COLOR: Color = canvas::BLACK;
|
||||||
pub const PARKING_COLOR: Color = canvas::PURPLE;
|
pub const PARKING_COLOR: Color = canvas::PURPLE;
|
||||||
pub const SIDEWALK_COLOR: Color = canvas::GREEN;
|
pub const SIDEWALK_COLOR: Color = canvas::GREEN;
|
||||||
|
@ -41,6 +41,7 @@ impl GeomRoad {
|
|||||||
pts[num_pts - 1] = Pt2D::from(new_last_pt);
|
pts[num_pts - 1] = Pt2D::from(new_last_pt);
|
||||||
|
|
||||||
// TODO handle offset
|
// TODO handle offset
|
||||||
|
let offset = road.offset as f64;
|
||||||
let lane_center_shift = if road.one_way_road {
|
let lane_center_shift = if road.one_way_road {
|
||||||
0.0
|
0.0
|
||||||
} else if road.use_yellow_center_lines {
|
} else if road.use_yellow_center_lines {
|
||||||
@ -48,9 +49,9 @@ impl GeomRoad {
|
|||||||
// shouldn't match either lane. Needs to be its own thing, or adjust the bbox.
|
// shouldn't match either lane. Needs to be its own thing, or adjust the bbox.
|
||||||
(LANE_THICKNESS / 2.0) + (BIG_ARROW_THICKNESS / 2.0)
|
(LANE_THICKNESS / 2.0) + (BIG_ARROW_THICKNESS / 2.0)
|
||||||
} else {
|
} else {
|
||||||
(LANE_THICKNESS / 2.0)
|
LANE_THICKNESS * (offset + 0.5)
|
||||||
};
|
};
|
||||||
// TODO when drawing cars along these lines, do we have the line overlap problem?
|
// TODO when drawing cars along these lines, do we have the line overlap problem? yes.
|
||||||
let lane_center_lines: Vec<(Pt2D, Pt2D)> = pts.windows(2)
|
let lane_center_lines: Vec<(Pt2D, Pt2D)> = pts.windows(2)
|
||||||
.map(|pair| {
|
.map(|pair| {
|
||||||
geometry::shift_line_perpendicularly_in_driving_direction(
|
geometry::shift_line_perpendicularly_in_driving_direction(
|
||||||
|
Loading…
Reference in New Issue
Block a user