Browse Source

Added raw blend value to class

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
0d1d1f0f37
  1. 19
      src/engine/InterestManagement/Terrain.java
  2. 2
      src/engine/devcmd/cmds/GetHeightCmd.java

19
src/engine/InterestManagement/Terrain.java

@ -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;

2
src/engine/devcmd/cmds/GetHeightCmd.java

@ -61,7 +61,7 @@ public class GetHeightCmd extends AbstractDevCmd { @@ -61,7 +61,7 @@ public class GetHeightCmd extends AbstractDevCmd {
this.throwbackInfo(playerCharacter, "offset: " + "[" + childZoneOffset.x + "]" + "[" + childZoneOffset.y + "]");
this.throwbackInfo(playerCharacter, "Normalized offset: " + "[" + normalizedOffset.x + "]" + "[" + normalizedOffset.y + "]");
this.throwbackInfo(playerCharacter, "Heightmap blend Values: max/min" + heightmapZone.template.min_blend + " /" + heightmapZone.template.max_blend);
this.throwbackInfo(playerCharacter, "Parent blend Values: nax/min" + parentZone.template.min_blend + " /" + parentZone.template.max_blend);
this.throwbackInfo(playerCharacter, "blend Values: max/min" + heightmapZone.terrain.blend_values.x + " /" + heightmapZone.terrain.blend_values.y);
this.throwbackInfo(playerCharacter, "Blend coefficient: " + heightmapZone.terrain.getTerrainBlendCoefficient(childZoneOffset));
this.throwbackInfo(playerCharacter, "------------");

Loading…
Cancel
Save