Start terrain refactor

This commit is contained in:
2023-10-08 09:18:43 -04:00
parent ffb541a12e
commit 0d75e6db9b
12 changed files with 52 additions and 53 deletions
@@ -11,7 +11,6 @@ package engine.objects;
import engine.Enum;
import engine.Enum.*;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.InterestManager;
import engine.InterestManagement.WorldGrid;
import engine.exception.SerializationException;
+2 -2
View File
@@ -13,7 +13,7 @@ import engine.Enum.DispatchChannel;
import engine.Enum.EffectSourceType;
import engine.Enum.GameObjectType;
import engine.Enum.GridObjectType;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.Terrain;
import engine.InterestManagement.WorldGrid;
import engine.job.AbstractScheduleJob;
import engine.job.JobContainer;
@@ -506,7 +506,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
if(this instanceof AbstractCharacter && this.region != null){
this.loc = this.loc.setY(this.region.lerpY(this) + this.getAltitude());
} else{
this.loc = this.loc.setY(HeightMap.getWorldHeight(this.getLoc()) + this.getAltitude());
this.loc = this.loc.setY(Terrain.getWorldHeight(this.getLoc()) + this.getAltitude());
}
+2 -2
View File
@@ -11,8 +11,8 @@ package engine.objects;
import engine.Enum;
import engine.Enum.*;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.RealmMap;
import engine.InterestManagement.Terrain;
import engine.InterestManagement.WorldGrid;
import engine.db.archive.CityRecord;
import engine.db.archive.DataWarehouse;
@@ -206,7 +206,7 @@ public class Building extends AbstractWorldObject {
// Altitude of this building is derived from the heightmap engine.
Vector3fImmutable tempLoc = new Vector3fImmutable(this.statLat + this.parentZone.absX, 0, this.statLon + this.parentZone.absZ);
tempLoc = new Vector3fImmutable(tempLoc.x, HeightMap.getWorldHeight(tempLoc), tempLoc.z);
tempLoc = new Vector3fImmutable(tempLoc.x, Terrain.getWorldHeight(tempLoc), tempLoc.z);
this.setLoc(tempLoc);
}
}
+2 -2
View File
@@ -11,8 +11,8 @@ package engine.objects;
import engine.Enum;
import engine.Enum.*;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.RealmMap;
import engine.InterestManagement.Terrain;
import engine.InterestManagement.WorldGrid;
import engine.db.archive.CityRecord;
import engine.db.archive.DataWarehouse;
@@ -588,7 +588,7 @@ public class City extends AbstractWorldObject {
this.setBounds(cityBounds);
if (zone.getHeightMap() == null && this.isNpc == 1 && this.getObjectUUID() != 1213) {
HeightMap.GenerateCustomHeightMap(zone);
Terrain.GenerateCustomHeightMap(zone);
Logger.info(zone.zoneName + " created custom heightmap");
}
} catch (Exception e) {
+4 -4
View File
@@ -11,9 +11,9 @@ package engine.objects;
import engine.Enum;
import engine.Enum.*;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.InterestManager;
import engine.InterestManagement.RealmMap;
import engine.InterestManagement.Terrain;
import engine.InterestManagement.WorldGrid;
import engine.db.archive.CharacterRecord;
import engine.db.archive.DataWarehouse;
@@ -4760,7 +4760,7 @@ public class PlayerCharacter extends AbstractCharacter {
// If char is flying they aren't quite swimming
try {
float localAltitude = HeightMap.getWorldHeight(currentLoc);
float localAltitude = Terrain.getWorldHeight(currentLoc);
Zone zone = ZoneManager.findSmallestZone(currentLoc);
@@ -4832,7 +4832,7 @@ public class PlayerCharacter extends AbstractCharacter {
} else
this.altitude = this.getDesiredAltitude();
this.loc = this.loc.setY(HeightMap.getWorldHeight(this.getLoc()) + this.getAltitude());
this.loc = this.loc.setY(Terrain.getWorldHeight(this.getLoc()) + this.getAltitude());
this.setTakeOffTime(0);
MovementManager.finishChangeAltitude(this, this.getDesiredAltitude());
@@ -4840,7 +4840,7 @@ public class PlayerCharacter extends AbstractCharacter {
return;
}
this.loc = this.loc.setY(HeightMap.getWorldHeight(this.getLoc()) + this.getAltitude());
this.loc = this.loc.setY(Terrain.getWorldHeight(this.getLoc()) + this.getAltitude());
}
public boolean hasBoon() {
+7 -7
View File
@@ -10,7 +10,7 @@
package engine.objects;
import engine.Enum;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.Terrain;
import engine.db.archive.DataWarehouse;
import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager;
@@ -193,15 +193,15 @@ 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);
HeightMap heightMap = this.getHeightMap();
Terrain terrain = this.getHeightMap();
// Set heightmap blending bounds
if (heightMap == null) {
if (terrain == null) {
this.blendBounds = bounds;
} else {
this.blendBounds = Bounds.borrow();
this.blendBounds.setBounds(new Vector2f(this.absX, this.absZ), bounds.getHalfExtents().subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f);
this.blendBounds.setBounds(new Vector2f(this.absX, this.absZ), bounds.getHalfExtents().subtract(terrain.zone_minBlend, terrain.zone_minBlend), 0.0f);
}
}
@@ -325,12 +325,12 @@ public class Zone extends AbstractGameObject {
// Return heightmap for this Zone.
public HeightMap getHeightMap() {
public Terrain getHeightMap() {
if (this.guild_zone)
return HeightMap.PlayerCityHeightMap;
return Terrain.playerCityTerrain;
return HeightMap.heightmapByLoadNum.get(this.template);
return Terrain.heightmapByLoadNum.get(this.template);
}
}