@ -549,29 +549,6 @@ public class dbBuildingHandler extends dbHandlerBase {
@@ -549,29 +549,6 @@ public class dbBuildingHandler extends dbHandlerBase {
return false ;
}
public void LOAD_SUBMESH_LOOKUP ( ) {
try ( Connection connection = DbManager . getConnection ( ) ;
PreparedStatement preparedStatement = connection . prepareStatement ( "SELECT * FROM `static_render_submesh`" ) ) {
ResultSet rs = preparedStatement . executeQuery ( ) ;
while ( rs . next ( ) ) {
int structureID = rs . getInt ( "propID" ) ;
int renderID = rs . getInt ( "meshID" ) ;
if ( ! BuildingManager . _prop_subMeshes . containsKey ( structureID ) )
BuildingManager . _prop_subMeshes . put ( structureID , new ArrayList < > ( ) ) ;
BuildingManager . _prop_subMeshes . get ( structureID ) . add ( renderID ) ;
}
} catch ( SQLException e ) {
Logger . error ( e ) ;
}
}
public void LOAD_CONVEX_HULLS ( ) {
int recordsRead = 0 ;
@ -586,40 +563,39 @@ public class dbBuildingHandler extends dbHandlerBase {
@@ -586,40 +563,39 @@ public class dbBuildingHandler extends dbHandlerBase {
recordsRead + + ;
int meshID = rs . getInt ( "meshID" ) ;
String [ ] vertStrings = rs . getString ( "convexHull" ) . split ( ";" ) ;
ArrayList < Vector2f > vertArrayList = new ArrayList < > ( ) ;
String [ ] hullString = rs . getString ( "vertices" ) . split ( ";" ) ;
// Filter things that couldn't be wrapped
if ( vertStrings . length < 3 ) {
if ( hullString . length < 3 ) {
Logger . error ( "Mesh : " + meshID + " has less than 3 vertices." ) ;
continue ;
}
ArrayList < Vector2f > vectors = new ArrayList < > ( ) ;
ArrayList < Vector2f > convexHull = new ArrayList < > ( ) ;
ArrayList < Float > floats = new ArrayList < > ( ) ;
for ( String read : vertStrings ) {
for ( String read : hullString ) {
floats . add ( Float . parseFloat ( read ) ) ;
if ( floats . size ( ) = = 2 ) {
vectors . add ( new Vector2f ( floats . get ( 0 ) , floats . get ( 1 ) ) ) ;
if ( floats . size ( ) = = 2 ) {
convexHull . add ( new Vector2f ( floats . get ( 0 ) , floats . get ( 1 ) ) ) ;
floats . clear ( ) ;
}
}
ArrayList < ArrayList < Vector2f > > mes hList;
ArrayList < ArrayList < Vector2f > > hull List ;
if ( BuildingManager . _hull_data . get ( meshID ) = = null ) {
mes hList = new ArrayList < > ( ) ;
mes hList. add ( vectors ) ;
BuildingManager . _hull_data . put ( meshID , mes hList) ;
hull List = new ArrayList < > ( ) ;
hull List . add ( convexHull ) ;
BuildingManager . _hull_data . put ( meshID , hull List ) ;
} else {
mes hList = BuildingManager . _hull_data . get ( meshID ) ;
mes hList. add ( vectors ) ;
hull List = BuildingManager . _hull_data . get ( meshID ) ;
hull List . add ( convexHull ) ;
}
}