Browse Source

Method cleanup

combat-2
MagicBot 1 year ago
parent
commit
20d9a232cc
  1. 32
      src/engine/InterestManagement/Terrain.java

32
src/engine/InterestManagement/Terrain.java

@ -28,8 +28,9 @@ public class Terrain {
public Vector2f cell_size = new Vector2f(); public Vector2f cell_size = new Vector2f();
public Vector2f cell_count = new Vector2f(); public Vector2f cell_count = new Vector2f();
public float terrain_scale; public float terrain_scale;
public float min_blend;
public float max_blend; public Vector2f minor_blend;
public Vector2f major_blend;
public int heightmap; public int heightmap;
Zone zone; Zone zone;
@ -64,8 +65,13 @@ public class Terrain {
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;
this.max_blend = this.zone.max_blend / this.zone.major_radius; // Blending and scaling configuration
this.min_blend = this.zone.min_blend / this.zone.minor_radius;
this.major_blend.x = this.zone.max_blend / this.zone.major_radius;
this.major_blend.y = this.zone.min_blend / this.zone.major_radius;
this.minor_blend.x = this.zone.max_blend / this.zone.minor_radius;
this.minor_blend.y = this.zone.min_blend / this.zone.minor_radius;
this.terrain_scale = this.zone.terrain_max_y / 255f; this.terrain_scale = this.zone.terrain_max_y / 255f;
@ -185,25 +191,19 @@ public class Terrain {
Vector2f normalizedLoc = new Vector2f(zoneOffset.x / this.terrain_size.x, Vector2f normalizedLoc = new Vector2f(zoneOffset.x / this.terrain_size.x,
zoneOffset.y / terrain_size.y); zoneOffset.y / terrain_size.y);
float minp = this.zone.min_blend / this.zone.major_radius;
float maxp = this.zone.max_blend / this.zone.major_radius;
float minpy = this.zone.min_blend / this.zone.minor_radius;
float maxpy = this.zone.max_blend / this.zone.minor_radius;
float xval; float xval;
if (minp > 0.4f) if (this.major_blend.y > 0.4f)
xval = minp; xval = this.major_blend.y;
else else
xval = Math.min(maxp, 0.4f); xval = Math.min(this.major_blend.x, 0.4f);
float yval; float yval;
if (minpy > 0.4f) if (this.minor_blend.y > 0.4f)
yval = minpy; yval = this.minor_blend.y;
else else
yval = Math.min(maxpy, 0.4f); yval = Math.min(this.minor_blend.x, 0.4f);
float value; float value;

Loading…
Cancel
Save