Browse Source

utilize min and max Y values for meshes

server-collision
FatBoy-DOTC 10 months ago
parent
commit
4f057ee851
  1. 17
      src/engine/db/handlers/dbBuildingHandler.java

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

@ -881,7 +881,7 @@ public class dbBuildingHandler extends dbHandlerBase { @@ -881,7 +881,7 @@ public class dbBuildingHandler extends dbHandlerBase {
public void LOAD_MESH_DATA() {
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();
BuildingManager.mesh_triangle_points = new HashMap<>();
@ -907,21 +907,6 @@ public class dbBuildingHandler extends dbHandlerBase { @@ -907,21 +907,6 @@ public class dbBuildingHandler extends dbHandlerBase {
{
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){
Vector2f heights = new Vector2f(rs.getFloat("maxY"),rs.getFloat("minY"));
BuildingManager.mesh_heights.put(rs.getInt("meshID"),heights);

Loading…
Cancel
Save