From 52e314ce1c550551b1c72ea93834563b510617b6 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 22 Sep 2021 08:36:38 -0500 Subject: [PATCH] Draw visibility collider lines through coordinate centers to hopefully address seeing through walls. --- src/visibility.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/visibility.rs b/src/visibility.rs index b5eef90..768c834 100644 --- a/src/visibility.rs +++ b/src/visibility.rs @@ -170,7 +170,10 @@ fn viewshed_changed( let translation = position.position.translation; let mut points = vec![]; for p in &viewshed.visible_points { - points.push(point!(p.x() - translation.x, p.y() - translation.y)); + points.push(point!( + p.x() - translation.x + 0.5, + p.y() - translation.y + 0.5 + )); } if let Some(shape) = ColliderShape::convex_hull(&points) { if let (Some(mut collider_shape), Some(mut collider_position)) =