From 36095e5336f6d7f0dae4cfe147a019cda112dca4 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 3 Dec 2023 10:10:41 -0600 Subject: [PATCH] hull 7 --- src/engine/gameManager/NavigationManager.java | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/engine/gameManager/NavigationManager.java b/src/engine/gameManager/NavigationManager.java index 74a4681d..f72aece3 100644 --- a/src/engine/gameManager/NavigationManager.java +++ b/src/engine/gameManager/NavigationManager.java @@ -111,27 +111,15 @@ public class NavigationManager { return false; } public static boolean pointIsBlocked(Vector3fImmutable point) { - Zone zone = ZoneManager.findSmallestZone(point); - if(zone != null){ - for(Path2D.Float obstacle : zone.navObstacles) - if (obstacle.contains(point.x,point.z)) { - return true; - } - } - //Building building = BuildingManager.getBuildingAtLocation(point); - //if(building != null) { - //for (Path2D.Float mesh : building.meshes) { - //if (mesh.contains(point.x,point.z)) { - //return true; - //} - //} - //for (Regions region : building.getBounds().getRegions()) { - //if (region.isPointInPolygon(point)) - //if (Math.abs(region.lerpY(point) - point.y) > stepHeight) // get the height distance between current height and target location height - //return true; - //} - //} + Building building = BuildingManager.getBuildingAtLocation(point); + if(building != null) { + for (Path2D.Float mesh : building.meshes) { + if (mesh.contains(point.x,point.z)) { + return true; + } + } + } return false; } }