diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java index 48edff22..39879260 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -209,7 +209,9 @@ public class HeightMap { public static float getWorldHeight(Zone currentZone, Vector3fImmutable worldLoc) { Zone heightMapZone; + Zone parentZone; float worldHeight; + float parentHeight; // Seafloor is rather flat. @@ -237,6 +239,11 @@ public class HeightMap { return worldHeight; } + // We will need the parent height if we got this far into the method + + parentZone = HeightMap.getNextZoneWithTerrain(heightMapZone.getParent()); + parentHeight = HeightMap.getWorldHeight(parentZone, worldLoc); + if (Bounds.collide(worldLoc, heightMapZone.minBlend) == true) { // How far into blend zone are we? @@ -246,6 +253,7 @@ public class HeightMap { zoneLoc.y = abs(zoneLoc.x); blendBounds.setBounds(new Vector2f(heightMapZone.absX, heightMapZone.absZ), zoneLoc, 0.0f); + } // Position returned from Heightmap engine is relative to zone world height