Minor cleanup.
This commit is contained in:
parent
dee62d2dca
commit
9798988141
|
@ -44,6 +44,7 @@ impl Viewshed {
|
||||||
pub fn is_point_visible(&self, point: &dyn PointLike) -> bool {
|
pub fn is_point_visible(&self, point: &dyn PointLike) -> bool {
|
||||||
self.visible_points.contains(&point.into())
|
self.visible_points.contains(&point.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(
|
fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
viewer_entity: &Entity,
|
viewer_entity: &Entity,
|
||||||
|
@ -79,7 +80,7 @@ impl Viewshed {
|
||||||
let mut entities = HashSet::new();
|
let mut entities = HashSet::new();
|
||||||
let shape_pos = (Vec2::new(coord.x as f32 + 0.5, coord.y as f32 + 0.5), 0.);
|
let shape_pos = (Vec2::new(coord.x as f32 + 0.5, coord.y as f32 + 0.5), 0.);
|
||||||
let dest = point!(coord.x as f32 + 0.5, coord.y as f32 + 0.5);
|
let dest = point!(coord.x as f32 + 0.5, coord.y as f32 + 0.5);
|
||||||
if na::distance(&origin, &dest) >= self.range as f32 {
|
if na::distance(&origin, &dest) > self.range as f32 {
|
||||||
return u8::MAX;
|
return u8::MAX;
|
||||||
}
|
}
|
||||||
let mut opacity = 0;
|
let mut opacity = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user