|
|
@ -41,7 +41,7 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
BUILDINGMANAGER; |
|
|
|
BUILDINGMANAGER; |
|
|
|
|
|
|
|
|
|
|
|
public static HashMap<Integer, ArrayList<ArrayList<Path2D>>> _hull_data = new HashMap<>(); |
|
|
|
public static HashMap<Integer, ArrayList<Path2D.Float>> _hull_data = new HashMap<>(); |
|
|
|
public static HashMap<Integer, ArrayList<BuildingLocation>> _stuckLocations = new HashMap<>(); |
|
|
|
public static HashMap<Integer, ArrayList<BuildingLocation>> _stuckLocations = new HashMap<>(); |
|
|
|
public static HashMap<Integer, ArrayList<BuildingLocation>> _slotLocations = new HashMap<>(); |
|
|
|
public static HashMap<Integer, ArrayList<BuildingLocation>> _slotLocations = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
@ -974,7 +974,7 @@ public enum BuildingManager { |
|
|
|
// Build up navmesh by stencil of the
|
|
|
|
// Build up navmesh by stencil of the
|
|
|
|
// convex hull meshes that comprise the prop.
|
|
|
|
// convex hull meshes that comprise the prop.
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<ArrayList<Vector2f>> convexHullList; |
|
|
|
ArrayList<Path2D.Float> convexHullList; |
|
|
|
convexHullList = _hull_data.get(building.meshUUID); |
|
|
|
convexHullList = _hull_data.get(building.meshUUID); |
|
|
|
|
|
|
|
|
|
|
|
if (convexHullList == null) { |
|
|
|
if (convexHullList == null) { |
|
|
@ -982,23 +982,9 @@ public enum BuildingManager { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (ArrayList<Vector2f> meshEntry : convexHullList) { |
|
|
|
for (Path2D.Float meshEntry : convexHullList) { |
|
|
|
Path2D.Float meshBound = new Path2D.Float(); |
|
|
|
building.meshes.add(meshEntry); |
|
|
|
Vector3fImmutable offsetVect = new Vector3fImmutable(meshEntry.get(0).x + building.loc.x, building.loc.y,meshEntry.get(0).y + building.loc.z); |
|
|
|
building.parentZone.navObstacles.add(meshEntry); |
|
|
|
Vector3fImmutable rotatedStart = Vector3fImmutable.rotateAroundPoint(building.loc,offsetVect,building.getRot().y); |
|
|
|
|
|
|
|
meshBound.moveTo(rotatedStart.x,rotatedStart.z); |
|
|
|
|
|
|
|
for (Vector2f vect : meshEntry) { |
|
|
|
|
|
|
|
if(meshEntry.indexOf(vect) == 0){ |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Vector3fImmutable pos = new Vector3fImmutable(vect.x + building.loc.x, building.loc.y,vect.y + building.loc.z); |
|
|
|
|
|
|
|
Vector3fImmutable rotatedPos = Vector3fImmutable.rotateAroundPoint(building.loc,pos,building.getRot().getRotation()); |
|
|
|
|
|
|
|
meshBound.lineTo(rotatedPos.x,rotatedPos.z); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
meshBound.lineTo(rotatedStart.x,rotatedStart.z); |
|
|
|
|
|
|
|
meshBound.closePath(); |
|
|
|
|
|
|
|
building.meshes.add(meshBound); |
|
|
|
|
|
|
|
building.parentZone.navObstacles.add(meshBound); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//add navNodes to parent zone list
|
|
|
|
//add navNodes to parent zone list
|
|
|
|
float X = building.getBounds().getHalfExtents().x; |
|
|
|
float X = building.getBounds().getHalfExtents().x; |
|
|
|