diff --git a/src/engine/CollisionEngine/Mesh.java b/src/engine/CollisionEngine/Mesh.java index c4d9727f..0870bfb8 100644 --- a/src/engine/CollisionEngine/Mesh.java +++ b/src/engine/CollisionEngine/Mesh.java @@ -26,8 +26,10 @@ public class Mesh { if(!this.BoundsCollides(line)) return false; + boolean feetcollides = (charY + charHeight) < this.minY; + boolean headcollides = charY > this.maxY; //check to see if the mesh collides between the characters feet and head locations - if((charY + charHeight) < this.minY && charY > this.maxY){ + if(feetcollides && headcollides){ return false; } diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index 935c7387..4f336f8a 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -19,9 +19,9 @@ import engine.math.Vector2f; import engine.math.Vector3f; import engine.math.Vector3fImmutable; import engine.objects.*; +import javafx.geometry.Bounds; import org.joda.time.DateTime; import org.pmw.tinylog.Logger; - import java.awt.geom.Rectangle2D; import java.sql.Connection; import java.sql.PreparedStatement; @@ -30,7 +30,6 @@ import java.sql.SQLException; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.concurrent.ConcurrentHashMap; @@ -881,7 +880,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 `static_mesh_triangles`")) { ResultSet rs = preparedStatement.executeQuery(); BuildingManager.mesh_triangle_points = new HashMap<>(); @@ -934,8 +933,10 @@ public class dbBuildingHandler extends dbHandlerBase { float refX = Float.parseFloat(rs.getString("ref").split(";")[0]); float refZ = Float.parseFloat(rs.getString("ref").split(";")[1]); + //Bounds bound = new Bounds(endX,0,endZ,0,0,0); + - Vector2f topLeft = new Vector2f(centerX - refX,centerZ + refZ); + Vector2f topLeft = new Vector2f(centerX + refX,centerZ + refZ); float width = Math.abs(endX-refX); float height = Math.abs(endZ-refZ); Rectangle2D boundRect = new Rectangle2D.Float();