This commit is contained in:
2023-11-14 20:54:29 -06:00
parent 25e9f28746
commit b4720a2db5
7 changed files with 120 additions and 140 deletions
+4 -14
View File
@@ -17,10 +17,12 @@ import engine.gameManager.ZoneManager;
import engine.math.Bounds;
import engine.math.Vector2f;
import engine.math.Vector3fImmutable;
import engine.mobileAI.utilities.PathingUtilities;
import engine.net.ByteBufferWriter;
import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger;
import java.awt.*;
import java.awt.geom.Path2D;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
@@ -65,8 +67,8 @@ public class Zone extends AbstractWorldObject {
public float sea_level;
public Terrain terrain = null;
public Area navMesh;
public ArrayList<Path2D.Float> navObstacles = new ArrayList<>();
public ArrayList<PathingUtilities.Node> navNodes = new ArrayList<>();
/**
* ResultSet Constructor
@@ -183,18 +185,6 @@ public class Zone extends AbstractWorldObject {
}
ZoneManager.populateZoneCollections(this);
//this.createNavMesh();
}
public void createNavMesh(){
int xPoint = (int)(this.absX - this.bounds.getHalfExtents().x);
int zPoint = (int) (this.absZ - this.bounds.getHalfExtents().y);
int extentsX = (int) (this.bounds.getHalfExtents().x * 2);
int extentsZ = (int) (this.bounds.getHalfExtents().y * 2);
this.navMesh = new Area(new Rectangle(xPoint, zPoint, extentsX, extentsZ));
}
/* Method sets a default value for player cities
* otherwise using values derived from the loadnum