diff --git a/src/engine/CollisionEngine/MeshData.java b/src/engine/CollisionEngine/MeshData.java new file mode 100644 index 00000000..beaf405e --- /dev/null +++ b/src/engine/CollisionEngine/MeshData.java @@ -0,0 +1,14 @@ +package engine.CollisionEngine; + +import engine.math.Vector3f; + +public class MeshData { + public int propID; + public int meshID; + public Vector3f loc; + public Vector3f scale; + public Vector3f refPoint; + public Vector3f endPoint; + public float maxY; + public float minY; +} diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index 75b8f7fe..7043204e 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -9,6 +9,7 @@ package engine.db.handlers; +import engine.CollisionEngine.MeshData; import engine.Enum; import engine.Enum.DbObjectType; import engine.Enum.ProtectionState; @@ -853,6 +854,29 @@ public class dbBuildingHandler extends dbHandlerBase { return false; } + public void LOAD_MESH_DATA(){ + try (Connection connection = DbManager.getConnection(); + PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `final_structure_meshes`")) { + + ResultSet rs = preparedStatement.executeQuery(); + ArrayList meshData = new ArrayList<>(); + while (rs.next()) { + MeshData md = new MeshData(); + md.propID = rs.getInt("propID"); + md.meshID = rs.getInt("meshID"); + md.loc = new Vector3f(rs.getFloat("locX"), rs.getFloat("locY"),rs.getFloat("locz")); + md.scale = new Vector3f(rs.getFloat("scaleX"), rs.getFloat("scaleY"),rs.getFloat("scaleZ")); + md.refPoint = new Vector3f(rs.getFloat("refX"), rs.getFloat("refY"),rs.getFloat("refZ")); + md.endPoint = new Vector3f(rs.getFloat("endX"), rs.getFloat("endY"),rs.getFloat("endZ")); + md.minY = rs.getFloat("minY"); + md.maxY = rs.getFloat("maxY"); + meshData.add(md); + } + int i = 0; //finished; + } catch (SQLException e) { + Logger.error(e); + } + } public void LOAD_PROP_MESHES() { try (Connection connection = DbManager.getConnection(); @@ -880,7 +904,7 @@ public class dbBuildingHandler extends dbHandlerBase { } - public void LOAD_MESH_DATA() { + public void LOAD_MESH_DATA_OLD() { try (Connection connection = DbManager.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_mesh_triangles`")) {