Draw visibility collider lines through coordinate centers to hopefully address seeing through walls.
This commit is contained in:
parent
a59f8a22a1
commit
52e314ce1c
|
@ -170,7 +170,10 @@ fn viewshed_changed(
|
||||||
let translation = position.position.translation;
|
let translation = position.position.translation;
|
||||||
let mut points = vec![];
|
let mut points = vec![];
|
||||||
for p in &viewshed.visible_points {
|
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(shape) = ColliderShape::convex_hull(&points) {
|
||||||
if let (Some(mut collider_shape), Some(mut collider_position)) =
|
if let (Some(mut collider_shape), Some(mut collider_position)) =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user