Tweak lasers to work better in other directions

This commit is contained in:
Paul Chote
2010-02-07 00:50:35 +13:00
parent b559d69d4e
commit 0d8bbac2f1
2 changed files with 5 additions and 2 deletions

View File

@@ -36,8 +36,11 @@ namespace OpenRa.Effects
int alpha = (int)((1-(float)(totalTime-timeUntilRemove)/totalTime)*255); int alpha = (int)((1-(float)(totalTime-timeUntilRemove)/totalTime)*255);
Color rc = Color.FromArgb(alpha,color); Color rc = Color.FromArgb(alpha,color);
float2 unit = 1.0f/(from - to).Length*(from - to).ToFloat2();
float2 norm = new float2(-unit.Y, unit.X);
for (int i = -radius; i < radius; i++) for (int i = -radius; i < radius; i++)
Game.world.WorldRenderer.lineRenderer.DrawLine(from + new int2(i, 0), to + new int2(i, 0), rc, rc); Game.world.WorldRenderer.lineRenderer.DrawLine(from + i * norm, to + i * norm, rc, rc);
yield break; yield break;
} }

View File

@@ -24,7 +24,7 @@ Warhead=Super
Report=obelray1 Report=obelray1
Charges=yes Charges=yes
RenderAsLaser=true RenderAsLaser=true
BeamRadius=2 BeamRadius=1
UsePlayerColor=true UsePlayerColor=true