diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index 463f8fe8..be730b55 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -22,7 +22,6 @@ public class Terrain { public static final HashMap _heightmap_pixel_cache = new HashMap<>(); Zone zone; public short[][] terrain_pixel_data; - public Vector2f terrain_size = new Vector2f(); public Vector2f cell_size = new Vector2f(); public Vector2f cell_count = new Vector2f(); @@ -35,8 +34,15 @@ public class Terrain { this.terrain_size.x = zone.major_radius; this.terrain_size.y = zone.minor_radius; - this.terrain_pixel_data = + this.terrain_pixel_data = _heightmap_pixel_cache.get(zone.terrain_image); + + this.cell_count.x = this.terrain_pixel_data.length - 1; + this.cell_count.y = this.terrain_pixel_data[0].length - 1; + + this.cell_size.x = terrain_size.x / this.cell_count.x; + this.cell_size.y = terrain_size.y / this.cell_count.y; + this.terrain_scale = zone.terrain_max_y / 255f; }