|
|
@ -1004,11 +1004,11 @@ public enum BuildingManager { |
|
|
|
float minX = building.loc.x + (float) boundingBox.getMinX(); |
|
|
|
float minX = building.loc.x + (float) boundingBox.getMinX(); |
|
|
|
float maxY = building.loc.z + (float) boundingBox.getMaxY(); |
|
|
|
float maxY = building.loc.z + (float) boundingBox.getMaxY(); |
|
|
|
float minY = building.loc.z + (float) boundingBox.getMinY(); |
|
|
|
float minY = building.loc.z + (float) boundingBox.getMinY(); |
|
|
|
boundingBox.setRect(buildingLoc.x + boundingBox.getCenterX(),buildingLoc.z + boundingBox.getCenterY(),boundingBox.getMaxX(), boundingBox.getMaxY()); |
|
|
|
|
|
|
|
Point2D.Float p1 = new Point2D.Float(minX, maxY); |
|
|
|
Point2D.Float p1 = new Point2D.Float(minX, maxY); |
|
|
|
Point2D.Float p2 = new Point2D.Float(maxX, maxY); |
|
|
|
Point2D.Float p2 = new Point2D.Float(maxX, maxY); |
|
|
|
Point2D.Float p3 = new Point2D.Float(maxX, minY); |
|
|
|
Point2D.Float p3 = new Point2D.Float(maxX, minY); |
|
|
|
Point2D.Float p4 = new Point2D.Float(minX, minY); |
|
|
|
Point2D.Float p4 = new Point2D.Float(minX, minY); |
|
|
|
|
|
|
|
boundingBox.setRect(p1.x,p1.y,Math.abs(maxX - minX), Math.abs(maxY - minY)); |
|
|
|
generatedMesh.BoundingLines.add(new Line2D.Float(p1, p2)); |
|
|
|
generatedMesh.BoundingLines.add(new Line2D.Float(p1, p2)); |
|
|
|
generatedMesh.BoundingLines.add(new Line2D.Float(p2, p3)); |
|
|
|
generatedMesh.BoundingLines.add(new Line2D.Float(p2, p3)); |
|
|
|
generatedMesh.BoundingLines.add(new Line2D.Float(p3, p4)); |
|
|
|
generatedMesh.BoundingLines.add(new Line2D.Float(p3, p4)); |
|
|
@ -1019,8 +1019,10 @@ public enum BuildingManager { |
|
|
|
for (ArrayList<Vector3f> pointList : triPoints) { |
|
|
|
for (ArrayList<Vector3f> pointList : triPoints) { |
|
|
|
|
|
|
|
|
|
|
|
ArrayList<Vector3f> rotatedPoints = new ArrayList<>(); |
|
|
|
ArrayList<Vector3f> rotatedPoints = new ArrayList<>(); |
|
|
|
for (Vector3f point : pointList) |
|
|
|
for (Vector3f point : pointList) { |
|
|
|
rotatedPoints.add(Vector3f.rotateAroundPoint(buildingLoc, buildingLoc.add(point), rotation)); |
|
|
|
Vector3f calculatedOffsetPoint = buildingLoc.add(point); |
|
|
|
|
|
|
|
rotatedPoints.add(Vector3f.rotateAroundPoint(buildingLoc, calculatedOffsetPoint, rotation)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Point2D.Float p1 = new Point2D.Float(rotatedPoints.get(0).x, rotatedPoints.get(0).z); |
|
|
|
Point2D.Float p1 = new Point2D.Float(rotatedPoints.get(0).x, rotatedPoints.get(0).z); |
|
|
|
Point2D.Float p2 = new Point2D.Float(rotatedPoints.get(1).x, rotatedPoints.get(1).z); |
|
|
|
Point2D.Float p2 = new Point2D.Float(rotatedPoints.get(1).x, rotatedPoints.get(1).z); |
|
|
@ -1033,9 +1035,6 @@ public enum BuildingManager { |
|
|
|
tri.sides.add(new Line2D.Float(p3, p1)); |
|
|
|
tri.sides.add(new Line2D.Float(p3, p1)); |
|
|
|
generatedMesh.triangles.add(tri); |
|
|
|
generatedMesh.triangles.add(tri); |
|
|
|
} |
|
|
|
} |
|
|
|
if (BuildingManager.mesh_bounding_boxes.containsKey(mesh)) { |
|
|
|
|
|
|
|
generatedMesh.boundsRect = BuildingManager.mesh_bounding_boxes.get(mesh); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
building.buildingMeshes.add(generatedMesh); |
|
|
|
building.buildingMeshes.add(generatedMesh); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|