Browse Source

Dev command updated

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
5279fa8fbe
  1. 7
      src/engine/InterestManagement/Terrain.java
  2. 20
      src/engine/devcmd/cmds/GetHeightCmd.java
  3. 12
      src/engine/objects/Zone.java

7
src/engine/InterestManagement/Terrain.java

@ -55,8 +55,6 @@ public class Terrain { @@ -55,8 +55,6 @@ public class Terrain {
public short[][] pixelColorValues;
public int cell_count_x;
public int cell_count_y;
public float zone_minBlend;
public float zone_maxBlend;
public float terrain_scale;
@ -69,9 +67,6 @@ public class Terrain { @@ -69,9 +67,6 @@ public class Terrain {
this.zoneLoadID = rs.getInt("zoneLoadID");
this.seaLevel = rs.getFloat("seaLevel");
this.zone_minBlend = rs.getFloat("outsetZ");
this.zone_maxBlend = rs.getFloat("outsetX");
// Cache the full extents to avoid the calculation
this.fullExtentsX = halfExtentsX * 2;
@ -121,8 +116,6 @@ public class Terrain { @@ -121,8 +116,6 @@ public class Terrain {
int halfExtentsY = (int) Enum.CityBoundsType.ZONE.halfExtents;
this.zoneLoadID = 0;
this.seaLevel = 0;
this.zone_minBlend = 0;
this.zone_maxBlend = 0;
// Cache the full extents to avoid the calculation

20
src/engine/devcmd/cmds/GetHeightCmd.java

@ -12,7 +12,6 @@ package engine.devcmd.cmds; @@ -12,7 +12,6 @@ package engine.devcmd.cmds;
import engine.InterestManagement.Terrain;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ZoneManager;
import engine.math.Bounds;
import engine.math.Vector2f;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
@ -44,28 +43,15 @@ public class GetHeightCmd extends AbstractDevCmd { @@ -44,28 +43,15 @@ public class GetHeightCmd extends AbstractDevCmd {
this.throwbackInfo(playerCharacter, "Current Zone : " + currentZone.zoneName);
this.throwbackInfo(playerCharacter, "Heightmap Zone : " + heightmapZone.zoneName);
this.throwbackInfo(playerCharacter, "Zone Height: " + heightmapZone.worldAltitude);
this.throwbackInfo(playerCharacter, "Global Height: " + heightmapZone.worldAltitude);
this.throwbackInfo(playerCharacter, "Sea Level: " + heightmapZone.seaLevel);
this.throwbackInfo(playerCharacter, "Drowning Height: " + (heightmapZone.seaLevel + playerCharacter.getCharacterHeight()));
this.throwbackInfo(playerCharacter, "Grid : " + (int) gridSquare.x + "x" + (int) gridSquare.y);
this.throwbackInfo(playerCharacter, "*** 256: " + currentHeight);
this.throwbackInfo(playerCharacter, "***Adjusted Height: " + (currentHeight + playerCharacter.getCharacterHeight()));
this.throwbackInfo(playerCharacter, "Grid : " + Math.floor(gridSquare.x) + "x" + Math.floor(gridSquare.y));
this.throwbackInfo(playerCharacter, "Height returned: " + currentHeight);
this.throwbackInfo(playerCharacter, "------------");
this.throwbackInfo(playerCharacter, "Parent : " + parentZone.zoneName);
this.throwbackInfo(playerCharacter, "Height returned : " + parentHeight);
this.throwbackInfo(playerCharacter, "------------");
this.throwbackInfo(playerCharacter, "Min: " + heightmapZone.getHeightMap().zone_minBlend + " Max: " + heightmapZone.getHeightMap().zone_maxBlend);
if (Bounds.collide(playerCharacter.getLoc(), heightmapZone.blendBounds)) {
this.throwbackInfo(playerCharacter, "Blend: Max (Child)");
return;
}
this.throwbackInfo(playerCharacter, "Blend: Min (LERP)");
}
@Override

12
src/engine/objects/Zone.java

@ -60,7 +60,6 @@ public class Zone extends AbstractGameObject { @@ -60,7 +60,6 @@ public class Zone extends AbstractGameObject {
public float seaLevel = 0f;
public static final Set<Mob> respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>());
public static long lastRespawn = 0;
public Bounds blendBounds;
public float major_radius;
public float minor_radius;
public float min_blend;
@ -193,17 +192,6 @@ public class Zone extends AbstractGameObject { @@ -193,17 +192,6 @@ public class Zone extends AbstractGameObject {
else
bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.halfExtents, Enum.CityBoundsType.ZONE.halfExtents), 0.0f);
Terrain terrain = this.getHeightMap();
// Set heightmap blending bounds
if (terrain == null) {
this.blendBounds = bounds;
} else {
this.blendBounds = Bounds.borrow();
this.blendBounds.setBounds(new Vector2f(this.absX, this.absZ), bounds.getHalfExtents().subtract(terrain.zone_minBlend, terrain.zone_minBlend), 0.0f);
}
}
public void setParent(final Zone value) {

Loading…
Cancel
Save