|
|
@ -111,27 +111,15 @@ public class NavigationManager { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
public static boolean pointIsBlocked(Vector3fImmutable point) { |
|
|
|
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);
|
|
|
|
Building building = BuildingManager.getBuildingAtLocation(point); |
|
|
|
//if(building != null) {
|
|
|
|
if(building != null) { |
|
|
|
//for (Path2D.Float mesh : building.meshes) {
|
|
|
|
for (Path2D.Float mesh : building.meshes) { |
|
|
|
//if (mesh.contains(point.x,point.z)) {
|
|
|
|
if (mesh.contains(point.x,point.z)) { |
|
|
|
//return true;
|
|
|
|
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;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|