From 53f7165e24dcd4c0b4f486e62016514dcd25164c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 9 Oct 2023 07:47:50 -0400 Subject: [PATCH] Blend function installed --- src/engine/InterestManagement/Terrain.java | 8 +++----- src/engine/objects/Zone.java | 8 +------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index 21ea9849..254cb398 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -103,8 +103,8 @@ public class Terrain { // Interpolate height for this position in terrain - float interpolatedTerrainHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc); - interpolatedTerrainHeight += terrainZone.worldAltitude; + float interpolatedChildHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc); + interpolatedChildHeight += terrainZone.worldAltitude; // Interpolate height for this position in parent @@ -113,9 +113,7 @@ public class Terrain { // Blend between heights - interpolatedTerrainHeight = interpolatedTerrainHeight + interpolatedParentTerrainHeight * (1 - terrainZone.terrain.heightBlend(terrainLoc)); - - return interpolatedTerrainHeight; + return interpolatedChildHeight + interpolatedParentTerrainHeight * (1 - parentZone.terrain.heightBlend(parentLoc)); } diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index ee1db826..dfb78c6a 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -229,13 +229,7 @@ public class Zone extends AbstractGameObject { } this.setBounds(); - - try { - this.worldAltitude = ZoneManager.caclulateWorldAltitude(this); - } catch (Exception e) { - throw new RuntimeException(e); - } - + this.worldAltitude = ZoneManager.caclulateWorldAltitude(this); setSeaLevel(); }