Add WVec.HorizontalLengthSquared to simplify range checks.

This commit is contained in:
Paul Chote
2013-07-20 19:04:19 +12:00
parent 56da57bc09
commit f18994f800
3 changed files with 12 additions and 10 deletions

View File

@@ -38,6 +38,7 @@ namespace OpenRA
public static int Dot(WVec a, WVec b) { return a.X * b.X + a.Y * b.Y + a.Z * b.Z; }
public long LengthSquared { get { return (long)X * X + (long)Y * Y + (long)Z * Z; } }
public int Length { get { return (int)Math.Sqrt(LengthSquared); } }
public long HorizontalLengthSquared { get { return (long)X * X + (long)Y * Y; } }
public WVec Rotate(WRot rot)
{