Browse Source

Interpolating world altitude

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
e359b1dfdf
  1. 6
      src/engine/InterestManagement/HeightMap.java

6
src/engine/InterestManagement/HeightMap.java

@ -262,11 +262,9 @@ public class HeightMap { @@ -262,11 +262,9 @@ public class HeightMap {
percentage = currentDelta / blendDelta;
else
percentage = 0.0f;
interpolatedTerrainHeight = FastMath.LERP(percentage, interpolatedTerrainHeight, interpolatedParentTerrainHeight);
float interpolatedWorldAltitude = FastMath.LERP(percentage, heightMapZone.worldAltitude, parentZone.worldAltitude);
interpolatedTerrainHeight = FastMath.LERP(percentage, interpolatedTerrainHeight, interpolatedParentTerrainHeight);
return interpolatedTerrainHeight + heightMapZone.worldAltitude;
return interpolatedTerrainHeight + interpolatedWorldAltitude;
}

Loading…
Cancel
Save