diff --git a/src/engine/CollisionEngine/Mesh.java b/src/engine/CollisionEngine/Mesh.java index 5f7e68b0..1e8be05a 100644 --- a/src/engine/CollisionEngine/Mesh.java +++ b/src/engine/CollisionEngine/Mesh.java @@ -35,7 +35,8 @@ public class Mesh { //check to see if character is under or over the mesh - if((charY + charHeight) < this.minY || charY > this.maxY) + float head = charY + charHeight; + if(head < this.minY || charY > this.maxY) return false; //check if any triangles intersect the movement path diff --git a/src/engine/devcmd/cmds/RegionCmd.java b/src/engine/devcmd/cmds/RegionCmd.java index 7edbc215..0749b145 100644 --- a/src/engine/devcmd/cmds/RegionCmd.java +++ b/src/engine/devcmd/cmds/RegionCmd.java @@ -49,6 +49,7 @@ public class RegionCmd extends AbstractDevCmd { } if(building != null){ for (Mesh mesh : building.buildingMeshes){ + this.throwbackInfo(pc, "Mesh Rect: " + mesh.boundsRect); if(mesh.boundsRect.contains(pc.loc.x,pc.loc.z)) { this.throwbackInfo(pc, "Inside A Mesh's Bounds"); return; diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 441b2b38..940fcee8 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -1017,12 +1017,13 @@ public enum BuildingManager { Point2D.Float p4 = new Point2D.Float(bottomLeft.x, bottomLeft.z); float rectWidth = topLeft.distance(topRight); float rectHeight = topLeft.distance(bottomLeft); - boundingBox.setRect(p1.x, p1.y, rectWidth, rectHeight); + generatedMesh.boundsRect = new Rectangle2D.Float(); + generatedMesh.boundsRect.setRect(p1.x, p1.y, rectWidth, rectHeight); generatedMesh.BoundingLines.add(new Line2D.Float(p1, p2)); generatedMesh.BoundingLines.add(new Line2D.Float(p2, p3)); generatedMesh.BoundingLines.add(new Line2D.Float(p3, p4)); generatedMesh.BoundingLines.add(new Line2D.Float(p4, p1)); - generatedMesh.boundsRect = boundingBox; + //generatedMesh.boundsRect = boundingBox; } else{ Logger.error("No Bounding Box Data For Mesh: " + mesh); } @@ -1049,13 +1050,14 @@ public enum BuildingManager { } building.buildingMeshes.add(generatedMesh); } - Rectangle2D.Float buildingBound = new Rectangle2D.Float(); + //Rectangle2D.Float buildingBound = new Rectangle2D.Float(); float xLoc = building.loc.x - building.getBounds().getHalfExtents().x; float zLoc = building.loc.z - building.getBounds().getHalfExtents().y; float width = building.getBounds().getHalfExtents().x * 2; float height = building.getBounds().getHalfExtents().y * 2; - buildingBound.setRect(xLoc,zLoc,width,height); - building.buildingRect = buildingBound; + building.buildingRect = new Rectangle2D.Float(); + building.buildingRect.setRect(xLoc,zLoc,width,height); + //building.buildingRect = buildingBound; } catch(Exception e){ Logger.info("Failed To Bake Building Mesh Data For Structure: " + building.meshUUID); diff --git a/src/engine/net/client/handlers/MoveToPointHandler.java b/src/engine/net/client/handlers/MoveToPointHandler.java index 4c3e33bc..c94aeb76 100644 --- a/src/engine/net/client/handlers/MoveToPointHandler.java +++ b/src/engine/net/client/handlers/MoveToPointHandler.java @@ -43,8 +43,7 @@ public class MoveToPointHandler extends AbstractClientMsgHandler { Line2D travelLine = new Line2D.Float(); Vector3fImmutable endLoc = new Vector3fImmutable(msg.getEndLat(),msg.getEndAlt(),msg.getEndLon()); travelLine.setLine(pc.loc.x,pc.loc.z,endLoc.x,endLoc.z); - float movementDistance = 185 + pc.loc.distance(endLoc); - HashSet awoList = WorldGrid.getObjectsInRangePartial(pc.loc, movementDistance, MBServerStatics.MASK_BUILDING); + HashSet awoList = WorldGrid.getObjectsInRangePartial(pc.loc, 1000, MBServerStatics.MASK_BUILDING); for(AbstractWorldObject awo : awoList){ Building building = (Building)awo; if(CollisionManager.CollisionDetected(building, travelLine,pc.getCharacterHeight(),pc.loc.y)){ @@ -54,7 +53,7 @@ public class MoveToPointHandler extends AbstractClientMsgHandler { return true; } } - ChatManager.chatSystemInfo(pc, "No Collision Detected"); + //ChatManager.chatSystemInfo(pc, "No Collision Detected"); MovementManager.movement(msg, pc); return true; }