Add Exts.ISqrt to avoid fp sqrt calculations.
This commit is contained in:
@@ -37,9 +37,9 @@ 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 int Length { get { return (int)Exts.ISqrt(LengthSquared); } }
|
||||
public long HorizontalLengthSquared { get { return (long)X * X + (long)Y * Y; } }
|
||||
public int HorizontalLength { get { return (int)Math.Sqrt(HorizontalLengthSquared); } }
|
||||
public int HorizontalLength { get { return (int)Exts.ISqrt(HorizontalLengthSquared); } }
|
||||
|
||||
public WVec Rotate(WRot rot)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user