Update to bake logic
This commit is contained in:
@@ -986,12 +986,23 @@ public enum BuildingManager {
|
||||
|
||||
Path2D.Float stencilPath = new Path2D.Float();
|
||||
|
||||
// Add building offset to vertices
|
||||
|
||||
for (Vector2f vertex : meshEntry)
|
||||
stencilPath.moveTo(vertex.x, vertex.y);
|
||||
vertex.addLocal(building.getLoc().x, building.getLoc().y);
|
||||
|
||||
// Move to start of path
|
||||
|
||||
stencilPath.moveTo(meshEntry.get(0).x, meshEntry.get(0).y);
|
||||
|
||||
// Draw path
|
||||
|
||||
for (int i = 1; i < meshEntry.size(); i++)
|
||||
stencilPath.lineTo(meshEntry.get(i).x, meshEntry.get(i).y);
|
||||
|
||||
// enclose the path
|
||||
|
||||
stencilPath.moveTo(meshEntry.get(0).x, meshEntry.get(0).y);
|
||||
stencilPath.closePath();
|
||||
|
||||
// subtract stencil from zone navmesh
|
||||
|
||||
@@ -1000,6 +1011,7 @@ public enum BuildingManager {
|
||||
}
|
||||
|
||||
//add in all the regions to the navMesh
|
||||
|
||||
for (Regions region : building.getBounds().getRegions())
|
||||
building.parentZone.navMesh.add(region.getArea());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user