Browse Source

shape

hull4
FatBoy-DOTC 1 year ago
parent
commit
72dea668f9
  1. 7
      src/engine/devcmd/cmds/RegionCmd.java
  2. 4
      src/engine/gameManager/BuildingManager.java

7
src/engine/devcmd/cmds/RegionCmd.java

@ -18,10 +18,15 @@ import engine.math.Vector3fImmutable; @@ -18,10 +18,15 @@ import engine.math.Vector3fImmutable;
import engine.objects.*;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
import java.lang.reflect.Field;
import static java.awt.geom.Path2D.WIND_EVEN_ODD;
import static java.awt.geom.Path2D.WIND_NON_ZERO;
public class RegionCmd extends AbstractDevCmd {
public RegionCmd() {
@ -67,7 +72,7 @@ public class RegionCmd extends AbstractDevCmd { @@ -67,7 +72,7 @@ public class RegionCmd extends AbstractDevCmd {
boolean pointBlocked = false;
for(Path2D.Float area : building.meshes){
Vector3fImmutable pos = ((AbstractCharacter)target).loc;
if(area.contains(pos.x, pos.z)){
if(area.contains(new Point((int) pos.x, (int) pos.z))){
pointBlocked = true;
}
}

4
src/engine/gameManager/BuildingManager.java

@ -984,6 +984,10 @@ public enum BuildingManager { @@ -984,6 +984,10 @@ public enum BuildingManager {
return;
}
if(building.meshUUID == 24000){
int i = 0;
}
for (ArrayList<Vector2f> meshEntry : convexHullList) {
Path2D.Float meshBound = new Path2D.Float();
Vector3fImmutable start = Vector3fImmutable.rotateAroundPoint(new Vector3fImmutable(meshEntry.get(0).x,building.loc.y,meshEntry.get(0).y),building.loc,building.getRot().getRotation());

Loading…
Cancel
Save