Browse Source

Preparation for blend lerp insertion.

combat-2
MagicBot 1 year ago
parent
commit
240373898a
  1. 8
      src/engine/InterestManagement/HeightMap.java

8
src/engine/InterestManagement/HeightMap.java

@ -209,7 +209,9 @@ public class HeightMap {
public static float getWorldHeight(Zone currentZone, Vector3fImmutable worldLoc) { public static float getWorldHeight(Zone currentZone, Vector3fImmutable worldLoc) {
Zone heightMapZone; Zone heightMapZone;
Zone parentZone;
float worldHeight; float worldHeight;
float parentHeight;
// Seafloor is rather flat. // Seafloor is rather flat.
@ -237,6 +239,11 @@ public class HeightMap {
return worldHeight; return worldHeight;
} }
// We will need the parent height if we got this far into the method
parentZone = HeightMap.getNextZoneWithTerrain(heightMapZone.getParent());
parentHeight = HeightMap.getWorldHeight(parentZone, worldLoc);
if (Bounds.collide(worldLoc, heightMapZone.minBlend) == true) { if (Bounds.collide(worldLoc, heightMapZone.minBlend) == true) {
// How far into blend zone are we? // How far into blend zone are we?
@ -246,6 +253,7 @@ public class HeightMap {
zoneLoc.y = abs(zoneLoc.x); zoneLoc.y = abs(zoneLoc.x);
blendBounds.setBounds(new Vector2f(heightMapZone.absX, heightMapZone.absZ), zoneLoc, 0.0f); blendBounds.setBounds(new Vector2f(heightMapZone.absX, heightMapZone.absZ), zoneLoc, 0.0f);
} }
// Position returned from Heightmap engine is relative to zone world height // Position returned from Heightmap engine is relative to zone world height

Loading…
Cancel
Save