fix bbox for bldgs to include path

This commit is contained in:
Dustin Carlino 2018-07-03 17:57:19 -07:00
parent 73455017c2
commit fb24efe1f1
3 changed files with 15 additions and 4 deletions

View File

@ -126,7 +126,8 @@ wait slow down even more -- before any of this change, lanes on adjacent roads s
- https://www.politesi.polimi.it/bitstream/10589/112826/4/2015_10_TOPTAS.pdf
- just make polygons around center lines, then intersect?
- shift turn icons and stop markings and such away from crosswalk
- depict traffic lights
- draw stop signs as rounded ellipse (hard without using rotations in GfxCtx)
- depict traffic lights (3 colored circles on a black rectangle)
- figure out what to do about yellow center lines
- yellow and white lines intersect cars and turn icons and such
- who should own drawing them?
@ -156,3 +157,9 @@ visually.
- Easy representation: draw red line / stop sign in some driving lanes. Leave the priority lanes alone.
- Harder: draw a stop sign on the side of the road by some lanes. Won't this look weird top-down and at certain angles?
Traffic signals?
- per lane would be weird.
- drawing turn icons as red/yellow/green is pretty clear...
- could draw an unaligned signal box with 3 circles in the middle of the intersection, but what does it represent? maybe just an initial indicator of what's going on; not full detail.
- similarly, draw a single stop sign in the middle of other intersections? :P

View File

@ -58,6 +58,10 @@ impl DrawBuilding {
}
pub fn get_bbox(&self) -> Rect {
geometry::get_bbox_for_polygons(&[self.polygon.clone()])
let mut polygons = vec![self.polygon.clone()];
if let Some(line) = self.front_path {
polygons.push(vec![[line[0], line[1]], [line[2], line[3]]]);
}
geometry::get_bbox_for_polygons(&polygons)
}
}

View File

@ -16,7 +16,7 @@ use std::f64;
#[derive(Debug)]
pub struct DrawIntersection {
pub id: map_model::IntersectionID,
pub point: Vec2d,
pub center: Vec2d,
pub polygon: Vec<Vec2d>,
crosswalks: Vec<Vec<(Vec2d, Vec2d)>>,
@ -52,7 +52,7 @@ impl DrawIntersection {
DrawIntersection {
id: inter.id,
point: [center.x(), center.y()],
center: [center.x(), center.y()],
polygon: pts,
crosswalks: calculate_crosswalks(inter, map),
}