From 6290c6d0af877efebd5a88f83ed4c79365429961 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 20 Sep 2023 11:40:29 -0400 Subject: [PATCH] Start separate PLANAR from TARGA --- src/engine/InterestManagement/HeightMap.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java index 89b603b2..03bdb9df 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -238,6 +238,13 @@ public class HeightMap { // We will need the parent height if we got this far into the method + return interpolatePLANAR(worldLoc, heightMapZone, zoneLoc, interpolatedTerrainHeight); + + } + + private static float interpolatePLANAR(Vector3fImmutable worldLoc, Zone heightMapZone, Vector2f zoneLoc, float interpolatedTerrainHeight) { + Zone parentZone; + float interpolatedParentTerrainHeight; parentZone = HeightMap.getNextZoneWithTerrain(heightMapZone.getParent()); interpolatedParentTerrainHeight = HeightMap.getWorldHeight(parentZone, worldLoc); interpolatedParentTerrainHeight += parentZone.worldAltitude; @@ -269,7 +276,6 @@ public class HeightMap { interpolatedTerrainHeight = FastMath.LERP(percentage, interpolatedTerrainHeight, interpolatedParentTerrainHeight); return interpolatedTerrainHeight; - } public static float getWorldHeight(Vector3fImmutable worldLoc) {