From 240373898a94b516285769f1d4fa802d0d54327c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 17 Sep 2023 08:08:28 -0400 Subject: [PATCH] Preparation for blend lerp insertion. --- src/engine/InterestManagement/HeightMap.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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