Browse Source

Constructor filled in

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
79bf0523a5
  1. 10
      src/engine/InterestManagement/Terrain.java

10
src/engine/InterestManagement/Terrain.java

@ -22,7 +22,6 @@ public class Terrain {
public static final HashMap<Integer, short[][]> _heightmap_pixel_cache = new HashMap<>(); public static final HashMap<Integer, short[][]> _heightmap_pixel_cache = new HashMap<>();
Zone zone; Zone zone;
public short[][] terrain_pixel_data; public short[][] terrain_pixel_data;
public Vector2f terrain_size = new Vector2f(); public Vector2f terrain_size = new Vector2f();
public Vector2f cell_size = new Vector2f(); public Vector2f cell_size = new Vector2f();
public Vector2f cell_count = 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.x = zone.major_radius;
this.terrain_size.y = zone.minor_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;
} }

Loading…
Cancel
Save