utilize min and max Y values for meshes

This commit is contained in:
2024-01-05 23:32:32 -06:00
parent fd47c90f4f
commit 4f057ee851
+1 -16
View File
@@ -881,7 +881,7 @@ public class dbBuildingHandler extends dbHandlerBase {
public void LOAD_MESH_DATA() { public void LOAD_MESH_DATA() {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `new_static_mesh_triangles`")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `new-static_mesh_triangles`")) {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
BuildingManager.mesh_triangle_points = new HashMap<>(); BuildingManager.mesh_triangle_points = new HashMap<>();
@@ -907,21 +907,6 @@ public class dbBuildingHandler extends dbHandlerBase {
{ {
BuildingManager.mesh_triangle_points.get(rs.getInt("meshID")).add(triPoints); BuildingManager.mesh_triangle_points.get(rs.getInt("meshID")).add(triPoints);
} }
//if(BuildingManager.mesh_heights.containsKey(rs.getInt("meshID")) == false){
// BuildingManager.mesh_heights.put(rs.getInt("meshID"),rs.getFloat("maxY"));
//}
}
} catch (SQLException e) {
Logger.error(e);
}
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_mesh_triangles`")) {
ResultSet rs = preparedStatement.executeQuery();
BuildingManager.mesh_heights = new HashMap<>();
while (rs.next()) {
if(BuildingManager.mesh_heights.containsKey(rs.getInt("meshID")) == false){ if(BuildingManager.mesh_heights.containsKey(rs.getInt("meshID")) == false){
Vector2f heights = new Vector2f(rs.getFloat("maxY"),rs.getFloat("minY")); Vector2f heights = new Vector2f(rs.getFloat("maxY"),rs.getFloat("minY"));
BuildingManager.mesh_heights.put(rs.getInt("meshID"),heights); BuildingManager.mesh_heights.put(rs.getInt("meshID"),heights);