|
|
|
@ -25,6 +25,7 @@ public class Terrain {
@@ -25,6 +25,7 @@ public class Terrain {
|
|
|
|
|
public Vector2f cell_size = new Vector2f(); |
|
|
|
|
public Vector2f cell_count = new Vector2f(); |
|
|
|
|
public float terrain_scale; |
|
|
|
|
public Vector2f blend_values = new Vector2f(); |
|
|
|
|
public Vector2f blend_ratio = new Vector2f(); |
|
|
|
|
public int heightmap; |
|
|
|
|
Zone zone; |
|
|
|
@ -62,22 +63,22 @@ public class Terrain {
@@ -62,22 +63,22 @@ public class Terrain {
|
|
|
|
|
// the blending area between child and parent terrains when
|
|
|
|
|
// they are stitched together.
|
|
|
|
|
|
|
|
|
|
float max_blend = this.zone.template.max_blend; |
|
|
|
|
float min_blend = this.zone.template.min_blend; |
|
|
|
|
this.blend_values.x = this.zone.template.max_blend; |
|
|
|
|
this.blend_values.y = this.zone.template.min_blend; |
|
|
|
|
|
|
|
|
|
// Zones with a zero blend inherit from their parent terrain
|
|
|
|
|
|
|
|
|
|
if (this.zone.template.max_blend == 0) { |
|
|
|
|
Zone parentZone = this.getNextZoneWithTerrain(this.zone.parent); |
|
|
|
|
max_blend = parentZone.template.max_blend; |
|
|
|
|
min_blend = parentZone.template.min_blend; |
|
|
|
|
Zone parentZone = getNextZoneWithTerrain(this.zone.parent); |
|
|
|
|
this.blend_values.x = parentZone.template.max_blend; |
|
|
|
|
this.blend_values.y = parentZone.template.min_blend; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Vector2f major_blend = new Vector2f(max_blend / this.zone.major_radius, |
|
|
|
|
min_blend / this.zone.major_radius); |
|
|
|
|
Vector2f major_blend = new Vector2f(this.blend_values.x / this.zone.major_radius, |
|
|
|
|
this.blend_values.y / this.zone.major_radius); |
|
|
|
|
|
|
|
|
|
Vector2f minor_blend = new Vector2f(max_blend / this.zone.minor_radius, |
|
|
|
|
min_blend / this.zone.minor_radius); |
|
|
|
|
Vector2f minor_blend = new Vector2f(this.blend_values.x / this.zone.minor_radius, |
|
|
|
|
this.blend_values.y / this.zone.minor_radius); |
|
|
|
|
|
|
|
|
|
if (major_blend.y > 0.4f) |
|
|
|
|
blend_ratio.x = major_blend.y; |
|
|
|
|