Method is now called

This commit is contained in:
2023-10-12 06:33:22 -04:00
parent 1b2c218e83
commit affe6b08ab
+10 -1
View File
@@ -102,17 +102,26 @@ public class Terrain {
// Retrieve the next zone with a terrain defined. // Retrieve the next zone with a terrain defined.
Zone terrainZone = getNextZoneWithTerrain(zone); Zone terrainZone = getNextZoneWithTerrain(zone);
Zone parentZone = getNextZoneWithTerrain(zone);
// Transform world loc into zone space coordinate system // Transform world loc into zone space coordinate system
Vector2f terrainLoc = ZoneManager.worldToTerrainSpace(world_loc, terrainZone); Vector2f terrainLoc = ZoneManager.worldToTerrainSpace(world_loc, terrainZone);
Vector2f terrainOffset = ZoneManager.worldToZoneOffset(world_loc, terrainZone);
Vector2f parentLoc = ZoneManager.worldToTerrainSpace(world_loc, parentZone);
// Interpolate height for this position in terrain // Interpolate height for this position in terrain
float interpolatedChildHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc); float interpolatedChildHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc);
interpolatedChildHeight += terrainZone.global_height; interpolatedChildHeight += terrainZone.global_height;
return interpolatedChildHeight; float interpolatedParentTerrainHeight = parentZone.terrain.getInterpolatedTerrainHeight(parentLoc);
interpolatedParentTerrainHeight += parentZone.global_height;
// Blend between terrains
return interpolatedChildHeight + interpolatedParentTerrainHeight * (1 - terrainZone.terrain.terrainBlend(terrainOffset));
} }
public static float getWorldHeight(Vector3fImmutable world_loc) { public static float getWorldHeight(Vector3fImmutable world_loc) {