|
|
@ -16,7 +16,6 @@ import engine.db.archive.DataWarehouse; |
|
|
|
import engine.gameManager.ZoneManager; |
|
|
|
import engine.gameManager.ZoneManager; |
|
|
|
import engine.math.Bounds; |
|
|
|
import engine.math.Bounds; |
|
|
|
import engine.math.Vector2f; |
|
|
|
import engine.math.Vector2f; |
|
|
|
import engine.math.Vector3f; |
|
|
|
|
|
|
|
import engine.math.Vector3fImmutable; |
|
|
|
import engine.math.Vector3fImmutable; |
|
|
|
import engine.net.ByteBufferWriter; |
|
|
|
import engine.net.ByteBufferWriter; |
|
|
|
import engine.server.MBServerStatics; |
|
|
|
import engine.server.MBServerStatics; |
|
|
@ -185,26 +184,18 @@ public class Zone extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
ZoneManager.populateZoneCollections(this); |
|
|
|
ZoneManager.populateZoneCollections(this); |
|
|
|
|
|
|
|
|
|
|
|
this.bakeNavMesh(); |
|
|
|
this.createNavMesh(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void bakeNavMesh(){ |
|
|
|
public void createNavMesh(){ |
|
|
|
int xPoint = (int)(this.loc.x - this.bounds.getHalfExtents().x); |
|
|
|
Vector3fImmutable location = this.loc; |
|
|
|
int zPoint = (int) (this.loc.z - this.bounds.getHalfExtents().y); |
|
|
|
int xPoint = (int)(location.x - this.bounds.getHalfExtents().x); |
|
|
|
|
|
|
|
int zPoint = (int) (location.z - this.bounds.getHalfExtents().y); |
|
|
|
int extentsX = (int) (this.bounds.getHalfExtents().x * 2); |
|
|
|
int extentsX = (int) (this.bounds.getHalfExtents().x * 2); |
|
|
|
int extentsZ = (int) (this.bounds.getHalfExtents().y * 2); |
|
|
|
int extentsZ = (int) (this.bounds.getHalfExtents().y * 2); |
|
|
|
|
|
|
|
|
|
|
|
this.navMesh = new Area(new Rectangle(xPoint, zPoint, extentsX, extentsZ)); |
|
|
|
this.navMesh = new Area(new Rectangle(xPoint, zPoint, extentsX, extentsZ)); |
|
|
|
|
|
|
|
|
|
|
|
for(Building building : this.zoneBuildingSet){ |
|
|
|
|
|
|
|
for(Regions region : building.getBounds().getRegions()) |
|
|
|
|
|
|
|
this.navMesh.add(region.getArea()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MeshBounds meshBounds = Bounds.meshBoundsCache.get(building.getMeshUUID()); |
|
|
|
|
|
|
|
if(meshBounds != null) |
|
|
|
|
|
|
|
this.navMesh.subtract(meshBounds.getArea()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
/* Method sets a default value for player cities |
|
|
|
/* Method sets a default value for player cities |
|
|
|
* otherwise using values derived from the loadnum |
|
|
|
* otherwise using values derived from the loadnum |
|
|
|