From 761ec6f4afb889d258e43cd682a52e012748c04a Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 15 Oct 2023 14:55:19 -0400 Subject: [PATCH] Blend test --- src/engine/InterestManagement/Terrain.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index 8bba456a..f8aa914b 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -123,7 +123,12 @@ public class Terrain { // Blend between terrains - return interpolatedChildHeight * (1 - terrainZone.terrain.terrainBlend(terrainOffset)); + float blendFactor = terrainZone.terrain.terrainBlend(terrainOffset); + + float terrainHeight = interpolatedChildHeight * blendFactor; + terrainHeight += interpolatedParentTerrainHeight * (1 - blendFactor); + + return terrainHeight; }