From 0d1d1f0f37195eb9479c776d5e32f915fed53688 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 25 Oct 2023 13:01:21 -0400 Subject: [PATCH] Added raw blend value to class --- src/engine/InterestManagement/Terrain.java | 19 ++++++++++--------- src/engine/devcmd/cmds/GetHeightCmd.java | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index feef47bd..30aca17f 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -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 { // 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; diff --git a/src/engine/devcmd/cmds/GetHeightCmd.java b/src/engine/devcmd/cmds/GetHeightCmd.java index 2683925a..62a329a5 100644 --- a/src/engine/devcmd/cmds/GetHeightCmd.java +++ b/src/engine/devcmd/cmds/GetHeightCmd.java @@ -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, "------------");