|
|
@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
package engine.db.handlers; |
|
|
|
package engine.db.handlers; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import engine.CollisionEngine.MeshData; |
|
|
|
import engine.Enum; |
|
|
|
import engine.Enum; |
|
|
|
import engine.Enum.DbObjectType; |
|
|
|
import engine.Enum.DbObjectType; |
|
|
|
import engine.Enum.ProtectionState; |
|
|
|
import engine.Enum.ProtectionState; |
|
|
@ -853,6 +854,29 @@ public class dbBuildingHandler extends dbHandlerBase { |
|
|
|
return false; |
|
|
|
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> 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() { |
|
|
|
public void LOAD_PROP_MESHES() { |
|
|
|
|
|
|
|
|
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
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(); |
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_mesh_triangles`")) { |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_mesh_triangles`")) { |
|
|
|