Skip to content

Commit

Permalink
adjust path debug for altitude
Browse files Browse the repository at this point in the history
  • Loading branch information
alzeih committed Jul 21, 2010
1 parent 578f47d commit 8469718
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions OpenRA.Game/Graphics/WorldRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,22 @@ void DrawUnitPath(Actor selectedUnit)
var mobile = selectedUnit.traits.WithInterface<IMove>().FirstOrDefault();
if (mobile != null)
{
var unit = selectedUnit.traits.Get<Unit>();
var alt = (unit != null)? new float2(0, -unit.Altitude) : float2.Zero;
var path = mobile.GetCurrentPath(selectedUnit);
var start = selectedUnit.CenterLocation;
var start = selectedUnit.CenterLocation + alt;

var c = Color.Green;

foreach (var step in path)
{
lineRenderer.DrawLine(step + new float2(-1, -1), step + new float2(-1, 1), c, c);
lineRenderer.DrawLine(step + new float2(-1, 1), step + new float2(1, 1), c, c);
lineRenderer.DrawLine(step + new float2(1, 1), step + new float2(1, -1), c, c);
lineRenderer.DrawLine(step + new float2(1, -1), step + new float2(-1, -1), c, c);
lineRenderer.DrawLine(start, step, c, c);
start = step;
var stp = step + alt;
DrawLine(stp + new float2(-1, -1), stp + new float2(-1, 1), c, c);
DrawLine(stp + new float2(-1, 1), stp + new float2(1, 1), c, c);
DrawLine(stp + new float2(1, 1), stp + new float2(1, -1), c, c);
DrawLine(stp + new float2(1, -1), stp + new float2(-1, -1), c, c);
DrawLine(start, stp, c, c);
start = stp;
}
}
}
Expand Down

0 comments on commit 8469718

Please sign in to comment.