Browse Source

cleanup

hull4
FatBoy-DOTC 1 year ago
parent
commit
d57e5df356
  1. 5
      src/engine/devcmd/cmds/RegionCmd.java
  2. 9
      src/engine/mobileAI/utilities/MovementUtilities.java
  3. 6
      src/engine/objects/Building.java

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

@ -13,6 +13,7 @@ import engine.Enum;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3f;
import engine.objects.*; import engine.objects.*;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@ -36,6 +37,8 @@ public class RegionCmd extends AbstractDevCmd {
this.throwbackInfo(pc, "No Building At This Location.") ; this.throwbackInfo(pc, "No Building At This Location.") ;
} }
Regions region = ((AbstractCharacter)target).region; Regions region = ((AbstractCharacter)target).region;
output += "In Floor: " + ((AbstractCharacter) target).getInFloorID() + newline;
output += "In Building: " + ((AbstractCharacter) target).getInBuilding() + newline;
if (region == null) { if (region == null) {
output += "No Region Found." + newline; output += "No Region Found." + newline;
}else{ }else{
@ -44,6 +47,8 @@ public class RegionCmd extends AbstractDevCmd {
output += "Region Height: " + region.lerpY((AbstractCharacter)target) + newline; output += "Region Height: " + region.lerpY((AbstractCharacter)target) + newline;
output += "is Stairs: " + region.isStairs() + newline; output += "is Stairs: " + region.isStairs() + newline;
output += "is Outside: " + region.isOutside() + newline; output += "is Outside: " + region.isOutside() + newline;
for(Vector3f point : region.regionPoints)
output += point + newline;
output += "NavMesh Data" + newline; output += "NavMesh Data" + newline;
this.throwbackInfo(pc, output); this.throwbackInfo(pc, output);
} }

9
src/engine/mobileAI/utilities/MovementUtilities.java

@ -408,10 +408,6 @@ private static final int cellGap = 1;
Regions region = Regions.getRegionAtLocation(point); Regions region = Regions.getRegionAtLocation(point);
if(region != null) { if(region != null) {
//if (!region.stairs)
// point.setY(region.center.y);
//else
// point.setY(region.lerpY(point));
path.add(new Vector3fImmutable(region.center.x,region.center.y,region.center.z)); //only use center points when travelling through regions path.add(new Vector3fImmutable(region.center.x,region.center.y,region.center.z)); //only use center points when travelling through regions
continue; continue;
@ -463,9 +459,4 @@ private static final int cellGap = 1;
//return false; //return false;
} }
private static boolean collidesWithBuilding(Building building, Vector3fImmutable end){
MeshBounds mb = Bounds.meshBoundsCache.get(building.meshUUID);
return (end.x > mb.minX && end.x < mb.maxX && end.z > mb.minZ && end.z < mb.maxZ);
}
} }

6
src/engine/objects/Building.java

@ -1536,12 +1536,6 @@ public class Building extends AbstractWorldObject {
} }
public void updateNavMesh(){ public void updateNavMesh(){
int xPoint = (int)(this.loc.x - this.getBounds().getHalfExtents().x);
int zPoint = (int) (this.loc.z - this.getBounds().getHalfExtents().y);
int extentsX = (int) (this.getBounds().getHalfExtents().x * 2);
int extentsZ = (int) (this.getBounds().getHalfExtents().y * 2);
this.parentZone.navMesh.subtract( new Area(new Rectangle(xPoint, zPoint, extentsX, extentsZ)));//remove entire footprint of building from navMesh
for(Regions region : this.getBounds().getRegions()) for(Regions region : this.getBounds().getRegions())
this.parentZone.navMesh.add(region.getArea()); this.parentZone.navMesh.add(region.getArea());
} }

Loading…
Cancel
Save