Blending configuration setup in SetParent()

This commit is contained in:
2023-09-17 07:42:46 -04:00
parent b717c3d550
commit a3a3070158
2 changed files with 16 additions and 5 deletions
+2 -2
View File
@@ -55,8 +55,8 @@ public class HeightMap {
private float seaLevel = 0;
private int[][] pixelColorValues;
private float zone_minBlend;
private float zone_maxBlend;
public float zone_minBlend;
public float zone_maxBlend;
public HeightMap(ResultSet rs) throws SQLException {
+14 -3
View File
@@ -60,6 +60,10 @@ public class Zone extends AbstractGameObject {
private float seaLevel = 0f;
public static final Set<Mob> respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>());
public static long lastRespawn = 0;
public Bounds minBlend;
public Bounds maxBlend;
/**
* ResultSet Constructor
*/
@@ -162,9 +166,6 @@ public class Zone extends AbstractGameObject {
*/
public void setBounds() {
float halfExtentX;
float halfExtentY;
// Set initial bounds object
this.bounds = Bounds.borrow();
@@ -185,6 +186,16 @@ public class Zone extends AbstractGameObject {
else
bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents), 0.0f);
HeightMap heightMap = this.getHeightMap();
// Set heightmap blending bounds
if (heightMap != null) {
this.minBlend = Bounds.borrow();
this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents).subtract(heightMap.zone_maxBlend, heightMap.zone_maxBlend), 0.0f);
this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents).subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f);
}
}
public int getPlayerCityUUID() {