Cleanups
This commit is contained in:
@@ -185,7 +185,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
public float GetExactDistSq(float x, float y, float z)
|
public float GetExactDistSq(float x, float y, float z)
|
||||||
{
|
{
|
||||||
float dz = posZ - z;
|
float dz = z - posZ;
|
||||||
|
|
||||||
return GetExactDist2dSq(x, y) + dz * dz;
|
return GetExactDist2dSq(x, y) + dz * dz;
|
||||||
}
|
}
|
||||||
@@ -207,8 +207,8 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
public float GetExactDist2dSq(float x, float y)
|
public float GetExactDist2dSq(float x, float y)
|
||||||
{
|
{
|
||||||
float dx = posX - x;
|
float dx = x - posX;
|
||||||
float dy = posY - y;
|
float dy = y - posY;
|
||||||
|
|
||||||
return dx * dx + dy * dy;
|
return dx * dx + dy * dy;
|
||||||
}
|
}
|
||||||
@@ -225,9 +225,7 @@ namespace Game.Entities
|
|||||||
float dx = x - GetPositionX();
|
float dx = x - GetPositionX();
|
||||||
float dy = y - GetPositionY();
|
float dy = y - GetPositionY();
|
||||||
|
|
||||||
float ang = (float)Math.Atan2(dy, dx);
|
return NormalizeOrientation(MathF.Atan2(dy, dx));
|
||||||
ang = ang >= 0 ? ang : 2 * MathFunctions.PI + ang;
|
|
||||||
return ang;
|
|
||||||
}
|
}
|
||||||
public float GetAbsoluteAngle(Position pos)
|
public float GetAbsoluteAngle(Position pos)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user