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