mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 23:15:24 +03:00
I somehow managed to break pedestrian rendering in 004ca95842
This commit is contained in:
parent
3b26d25fe4
commit
41712b5beb
@ -67,16 +67,17 @@ impl Circle {
|
||||
|
||||
/// Returns the ring around the circle.
|
||||
fn to_ring(&self) -> Ring {
|
||||
Ring::must_new(
|
||||
(0..=TRIANGLES_PER_CIRCLE)
|
||||
.map(|i| {
|
||||
self.center.project_away(
|
||||
self.radius,
|
||||
Angle::degrees((i as f64) / (TRIANGLES_PER_CIRCLE as f64) * 360.0),
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
)
|
||||
let mut pts: Vec<Pt2D> = (0..=TRIANGLES_PER_CIRCLE)
|
||||
.map(|i| {
|
||||
self.center.project_away(
|
||||
self.radius,
|
||||
Angle::degrees((i as f64) / (TRIANGLES_PER_CIRCLE as f64) * 360.0),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
// With some radii, we get duplicate adjacent points
|
||||
pts.dedup();
|
||||
Ring::must_new(pts)
|
||||
}
|
||||
|
||||
/// Creates an outline around the circle, strictly contained with the circle's original radius.
|
||||
|
Loading…
Reference in New Issue
Block a user