From e80dd66809b9429099929ed31bd64014859725f5 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 9 Oct 2023 06:20:17 -0400 Subject: [PATCH] Interpolation cleanup --- src/engine/InterestManagement/Terrain.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index e2e5f38e..cd5423d7 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -152,10 +152,10 @@ public class Terrain { // Interpolate between the 4 vertices - interpolatedHeight = topRightHeight * (1 - offsetY) * (offsetX); - interpolatedHeight += (bottomRightHeight * offsetY * offsetX); + interpolatedHeight = topLeftHeight * (1 - offsetX) * (1 - offsetY); + interpolatedHeight += topRightHeight * (1 - offsetY) * (offsetX); interpolatedHeight += (bottomLeftHeight * (1 - offsetX) * offsetY); - interpolatedHeight += (topLeftHeight * (1 - offsetX) * (1 - offsetY)); + interpolatedHeight += (bottomRightHeight * offsetY * offsetX); interpolatedHeight *= this.terrain_scale; // Scale height