Browse Source

hull 7

hull7
FatBoy-DOTC 1 year ago
parent
commit
53adbc77fb
  1. 2
      src/engine/db/handlers/dbBuildingHandler.java
  2. 24
      src/engine/gameManager/BuildingManager.java
  3. 3
      src/engine/server/world/WorldServer.java

2
src/engine/db/handlers/dbBuildingHandler.java

@ -574,7 +574,7 @@ public class dbBuildingHandler extends dbHandlerBase {
Path2D.Float prop_path = BuildingManager.hullToPath2d(HullStrings); Path2D.Float prop_path = BuildingManager.hullToPath2d(HullStrings);
ArrayList<ArrayList<Path2D>> meshList; ArrayList<Path2D.Float> meshList;
if (BuildingManager._hull_data.get(propID) == null) { if (BuildingManager._hull_data.get(propID) == null) {
meshList = new ArrayList<>(); meshList = new ArrayList<>();

24
src/engine/gameManager/BuildingManager.java

@ -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;

3
src/engine/server/world/WorldServer.java

@ -403,9 +403,6 @@ public class WorldServer {
Logger.info("Loading building slot/stuck location data."); Logger.info("Loading building slot/stuck location data.");
BuildingLocation.loadBuildingLocations(); BuildingLocation.loadBuildingLocations();
Logger.info("Populating structure to render lookup.");
DbManager.BuildingQueries.POPULATE_RENDER_LOOKUP();
Logger.info("Loading mesh hulls."); Logger.info("Loading mesh hulls.");
DbManager.BuildingQueries.LOAD_MESH_HULLS(); DbManager.BuildingQueries.LOAD_MESH_HULLS();

Loading…
Cancel
Save