Browse Source

load mesh data and structure meshes

server-collision
FatBoy-DOTC 10 months ago
parent
commit
a52f0941b7
  1. 2
      src/engine/CollisionEngine/CollisionManager.java

2
src/engine/CollisionEngine/CollisionManager.java

@ -10,7 +10,7 @@ import java.awt.geom.Rectangle2D; @@ -10,7 +10,7 @@ import java.awt.geom.Rectangle2D;
public class CollisionManager {
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;
for (Mesh mesh : building.buildingMeshes)

Loading…
Cancel
Save