Array size helpful if debugging
This commit is contained in:
@@ -21,6 +21,8 @@ import static java.lang.Math.PI;
|
|||||||
public class Terrain {
|
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<>();
|
||||||
public short[][] terrain_pixel_data;
|
public short[][] terrain_pixel_data;
|
||||||
|
|
||||||
|
public Vector2f image_size = new Vector2f();
|
||||||
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();
|
||||||
@@ -44,6 +46,7 @@ public class Terrain {
|
|||||||
// Load pixel data for this terrain from cache
|
// Load pixel data for this terrain from cache
|
||||||
|
|
||||||
this.terrain_pixel_data = Terrain._heightmap_pixel_cache.get(heightmap);
|
this.terrain_pixel_data = Terrain._heightmap_pixel_cache.get(heightmap);
|
||||||
|
this.image_size.set(this.terrain_pixel_data.length, this.terrain_pixel_data[0].length);
|
||||||
|
|
||||||
if (terrain_pixel_data == null)
|
if (terrain_pixel_data == null)
|
||||||
Logger.error("Pixel map empty for zone: " + this.zone.getObjectUUID() + ":" + this.zone.zoneName);
|
Logger.error("Pixel map empty for zone: " + this.zone.getObjectUUID() + ":" + this.zone.zoneName);
|
||||||
@@ -53,8 +56,8 @@ public class Terrain {
|
|||||||
this.terrain_size.x = this.zone.major_radius * 2;
|
this.terrain_size.x = this.zone.major_radius * 2;
|
||||||
this.terrain_size.y = this.zone.minor_radius * 2;
|
this.terrain_size.y = this.zone.minor_radius * 2;
|
||||||
|
|
||||||
this.cell_count.x = this.terrain_pixel_data.length - 1;
|
this.cell_count.x = this.image_size.x - 1;
|
||||||
this.cell_count.y = this.terrain_pixel_data[0].length - 1;
|
this.cell_count.y = this.image_size.y - 1;
|
||||||
|
|
||||||
this.cell_size.x = terrain_size.x / this.cell_count.x;
|
this.cell_size.x = terrain_size.x / this.cell_count.x;
|
||||||
this.cell_size.y = terrain_size.y / this.cell_count.y;
|
this.cell_size.y = terrain_size.y / this.cell_count.y;
|
||||||
|
|||||||
Reference in New Issue
Block a user