From 6a750f4eb2f632f67d5790e719001c262cbc07e3 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 7 Oct 2023 20:04:26 -0400 Subject: [PATCH] Unused methods removed --- src/engine/InterestManagement/HeightMap.java | 53 +------------------- 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java index 217acd23..b71a1be5 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -12,8 +12,6 @@ import engine.Enum; import engine.gameManager.ConfigManager; import engine.gameManager.DbManager; import engine.gameManager.ZoneManager; -import engine.math.Bounds; -import engine.math.FastMath; import engine.math.Vector2f; import engine.math.Vector3fImmutable; import engine.objects.Zone; @@ -32,8 +30,6 @@ import java.sql.SQLException; import java.util.HashMap; import java.util.stream.Stream; -import static java.lang.Math.abs; - public class HeightMap { // Class variables @@ -235,57 +231,10 @@ public class HeightMap { float interpolatedTerrainHeight = heightMapZone.getHeightMap().getInterpolatedTerrainHeight(zoneLoc); interpolatedTerrainHeight += heightMapZone.worldAltitude; - // Heightmap blending is based on distance to edge of zone. - - // if (Bounds.collide(worldLoc, heightMapZone.blendBounds) == true) - return interpolatedTerrainHeight; - - // We will need the parent height if we got this far into the method - - // return interpolatePLANAR(worldLoc, heightMapZone, zoneLoc, interpolatedTerrainHeight); + return interpolatedTerrainHeight; } - private static float interpolatePLANAR(Vector3fImmutable worldLoc, Zone heightMapZone, Vector2f zoneLoc, float interpolatedTerrainHeight) { - - // zones of type PLANAR - - Zone parentZone; - float interpolatedParentTerrainHeight; - - parentZone = HeightMap.getNextZoneWithTerrain(heightMapZone.parent); - - interpolatedParentTerrainHeight = HeightMap.getWorldHeight(parentZone, worldLoc); - interpolatedParentTerrainHeight += parentZone.worldAltitude; - - Bounds blendBounds = Bounds.borrow(); - zoneLoc.x = abs(zoneLoc.x); - zoneLoc.y = abs(zoneLoc.x); - - blendBounds.setBounds(new Vector2f(heightMapZone.absX, heightMapZone.absZ), zoneLoc, 0.0f); - - float maxBlendArea = (heightMapZone.blendBounds.getHalfExtents().x) * - (heightMapZone.blendBounds.getHalfExtents().y); - float currentArea = (blendBounds.getHalfExtents().x) * - (blendBounds.getHalfExtents().y); - float zoneArea = (heightMapZone.bounds.getHalfExtents().x) * - (heightMapZone.bounds.getHalfExtents().y); - - blendBounds.release(); - - float blendDelta = zoneArea - maxBlendArea; - float currentDelta = zoneArea - currentArea; - - float percentage; - - if (currentDelta != 0 && blendDelta != 0) - percentage = currentDelta / blendDelta; - else - percentage = 0.0f; - - interpolatedTerrainHeight = FastMath.LERP(percentage, interpolatedTerrainHeight, interpolatedParentTerrainHeight); - return interpolatedTerrainHeight; - } public static float getWorldHeight(Vector3fImmutable worldLoc) {