Browse Source

Blend function installed

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
53f7165e24
  1. 8
      src/engine/InterestManagement/Terrain.java
  2. 8
      src/engine/objects/Zone.java

8
src/engine/InterestManagement/Terrain.java

@ -103,8 +103,8 @@ public class Terrain { @@ -103,8 +103,8 @@ public class Terrain {
// Interpolate height for this position in terrain
float interpolatedTerrainHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc);
interpolatedTerrainHeight += terrainZone.worldAltitude;
float interpolatedChildHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc);
interpolatedChildHeight += terrainZone.worldAltitude;
// Interpolate height for this position in parent
@ -113,9 +113,7 @@ public class Terrain { @@ -113,9 +113,7 @@ public class Terrain {
// Blend between heights
interpolatedTerrainHeight = interpolatedTerrainHeight + interpolatedParentTerrainHeight * (1 - terrainZone.terrain.heightBlend(terrainLoc));
return interpolatedTerrainHeight;
return interpolatedChildHeight + interpolatedParentTerrainHeight * (1 - parentZone.terrain.heightBlend(parentLoc));
}

8
src/engine/objects/Zone.java

@ -229,13 +229,7 @@ public class Zone extends AbstractGameObject { @@ -229,13 +229,7 @@ public class Zone extends AbstractGameObject {
}
this.setBounds();
try {
this.worldAltitude = ZoneManager.caclulateWorldAltitude(this);
} catch (Exception e) {
throw new RuntimeException(e);
}
this.worldAltitude = ZoneManager.caclulateWorldAltitude(this);
setSeaLevel();
}

Loading…
Cancel
Save