mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 17:34:58 +03:00
fix location of stop signs / signals, based on bad center
This commit is contained in:
parent
841944f84c
commit
01b230b47f
@ -20,8 +20,13 @@ pub struct DrawIntersection {
|
||||
|
||||
impl DrawIntersection {
|
||||
pub fn new(inter: &Intersection, map: &Map) -> DrawIntersection {
|
||||
// Don't skew the center towards the repeated point
|
||||
let mut pts = inter.polygon.clone();
|
||||
pts.pop();
|
||||
let center = Pt2D::center(&pts);
|
||||
|
||||
DrawIntersection {
|
||||
center: Pt2D::center(&inter.polygon),
|
||||
center,
|
||||
id: inter.id,
|
||||
polygon: Polygon::new(&inter.polygon),
|
||||
crosswalks: calculate_crosswalks(inter, map),
|
||||
|
@ -54,7 +54,8 @@ pub fn intersection_polygon(
|
||||
let angle_diff = (pl1.last_line().angle().opposite().normalized_degrees()
|
||||
- pl2.last_line().angle().normalized_degrees()).abs();
|
||||
|
||||
if angle_diff > 5.0 {
|
||||
// TODO A tuning challenge. :)
|
||||
if angle_diff > 15.0 {
|
||||
// The easy case!
|
||||
if let Some(hit) = pl1.intersection(&pl2) {
|
||||
endpoints.push(hit);
|
||||
|
Loading…
Reference in New Issue
Block a user