Browse Source

load mesh data and structure meshes

server-collision
FatBoy-DOTC 11 months ago
parent
commit
e8a39e596e
  1. 13
      src/engine/gameManager/BuildingManager.java

13
src/engine/gameManager/BuildingManager.java

@ -985,14 +985,14 @@ public enum BuildingManager { @@ -985,14 +985,14 @@ public enum BuildingManager {
building.buildingMeshes = new ArrayList<>();
float rotation = building.getRot().getRotation();
Vector3f buildingLoc = new Vector3f(building.loc.x, building.loc.y, building.loc.z);
int buildingMeshUUID = building.meshUUID;
int blueprintMeshUUID = building.getBlueprint().getMeshForRank(building.rank);
if(prop_meshes.containsKey(building.meshUUID) == false)
return;//no meshes to load for this prop
//ArrayList<Integer> meshes = prop_meshes.get(building.meshUUID);
int buildingMeshUUID = building.meshUUID;
int blueprintMeshUUID = building.getBlueprint().getMeshForRank(building.rank);
ArrayList<Integer> meshes = prop_meshes.get(building.getBlueprint().getMeshForRank(building.rank));
for (int mesh : meshes) {
if (!mesh_heights.containsKey(mesh) || !mesh_triangle_points.containsKey(mesh))
@ -1001,7 +1001,7 @@ public enum BuildingManager { @@ -1001,7 +1001,7 @@ public enum BuildingManager {
Mesh generatedMesh = new Mesh();
generatedMesh.maxY = building.loc.y + mesh_heights.get(mesh).x;
generatedMesh.minY = building.loc.y + mesh_heights.get(mesh).y;
ArrayList<ArrayList<Vector3f>> triPoints = mesh_triangle_points.get(building.meshUUID);
ArrayList<ArrayList<Vector3f>> triPoints = mesh_triangle_points.get(mesh);
if (mesh_bounding_boxes.containsKey(mesh)) {
Rectangle2D boundingBox = mesh_bounding_boxes.get(mesh);
@ -1012,11 +1012,6 @@ public enum BuildingManager { @@ -1012,11 +1012,6 @@ public enum BuildingManager {
Vector3f topRight = new Vector3f(building.loc.x + halfX, building.loc.y, building.loc.z - halfZ);
Vector3f bottomLeft = new Vector3f(building.loc.x - halfX, building.loc.y, building.loc.z + halfZ);
topLeft.x *= -1;
bottomLeft.x *= -1;
topRight.x *= -1;
bottomRight.x *= -1;
generatedMesh.BoundingLines = new ArrayList<>();
Point2D.Float p1 = new Point2D.Float(topLeft.x, topLeft.z);
Point2D.Float p2 = new Point2D.Float(topRight.x, topRight.z);

Loading…
Cancel
Save