|
|
@ -10,7 +10,7 @@ import java.awt.geom.Rectangle2D; |
|
|
|
public class CollisionManager { |
|
|
|
public class CollisionManager { |
|
|
|
public static boolean CollisionDetected(Building building, Line2D travelLine, float charHeight, float charY){ |
|
|
|
public static boolean CollisionDetected(Building building, Line2D travelLine, float charHeight, float charY){ |
|
|
|
|
|
|
|
|
|
|
|
if(!travelLine.intersects(building.buildingRect) && !building.buildingRect.contains(travelLine.getP1()) && !building.buildingRect.contains(travelLine.getP2())) |
|
|
|
if(building.buildingRect != null && !travelLine.intersects(building.buildingRect) && !building.buildingRect.contains(travelLine.getP1()) && !building.buildingRect.contains(travelLine.getP2())) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
for (Mesh mesh : building.buildingMeshes) |
|
|
|
for (Mesh mesh : building.buildingMeshes) |
|
|
|