Merge pull request #5767 from pchote/isqrt
Add Exts.ISqrt to avoid fp sqrt calculations.
This commit is contained in:
@@ -42,7 +42,7 @@ namespace OpenRA
|
||||
public CVec Sign() { return new CVec(Math.Sign(X), Math.Sign(Y)); }
|
||||
public CVec Abs() { return new CVec(Math.Abs(X), Math.Abs(Y)); }
|
||||
public int LengthSquared { get { return X * X + Y * Y; } }
|
||||
public int Length { get { return (int)Math.Sqrt(LengthSquared); } }
|
||||
public int Length { get { return Exts.ISqrt(LengthSquared); } }
|
||||
|
||||
public CVec Clamp(Rectangle r)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user