This commit is contained in:
2023-11-14 21:44:17 -06:00
parent d3dd190a69
commit d7159758a1
3 changed files with 21 additions and 22 deletions
-19
View File
@@ -435,23 +435,4 @@ public enum ZoneManager {
return localAltitude < zone.sea_level;
}
public static void LinkNavNodes(){
//TODO optimize
for(Zone zone : getAllZones()){
for(PathingUtilities.Node node : zone.navNodes){
for(PathingUtilities.Node potentialNeighbor : zone.navNodes){
try {
for (Path2D.Float obstacle : zone.navObstacles) {
if (!node.equals(potentialNeighbor) && !obstacle.intersects(node.location.x, node.location.y, potentialNeighbor.location.x, potentialNeighbor.location.y) && node.location.distance(potentialNeighbor.location) < 50) {
node.neighbors.add(potentialNeighbor);
}
}
} catch(Exception e){
Logger.error("Failed To Check Neighbors Of Node In Zone: " + zone.getObjectUUID());
}
}
}
}
}
}