Browse Source

Named for context

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
928be0facb
  1. 10
      src/engine/InterestManagement/Terrain.java

10
src/engine/InterestManagement/Terrain.java

@ -206,19 +206,19 @@ public class Terrain { @@ -206,19 +206,19 @@ public class Terrain {
Vector2f normalizedOffset = new Vector2f(Math.abs(zone_offset.x) / this.zone.major_radius,
Math.abs(zone_offset.y) / this.zone.minor_radius);
float value;
float blendCoefficient;
if (normalizedOffset.x <= 1 - blend_ratio.x || normalizedOffset.x <= normalizedOffset.y) {
if (normalizedOffset.y < 1 - blend_ratio.y)
return 1;
value = (normalizedOffset.y - (1 - blend_ratio.y)) / blend_ratio.y;
blendCoefficient = (normalizedOffset.y - (1 - blend_ratio.y)) / blend_ratio.y;
} else
value = (normalizedOffset.x - (1 - blend_ratio.x)) / blend_ratio.x;
blendCoefficient = (normalizedOffset.x - (1 - blend_ratio.x)) / blend_ratio.x;
value = (float) Math.atan((0.5f - value) * PI);
blendCoefficient = (float) Math.atan((0.5f - blendCoefficient) * PI);
return (value + 1) * 0.5f;
return (blendCoefficient + 1) * 0.5f;
}
}

Loading…
Cancel
Save