Hey guys, do you see anything wrong this code? Debugging reveals that difference is for some reason becoming a NaN:
public void turnToFacePoint(Vector2 p)
{
float distanceX = p.X - position.X;
float distanceY = p.Y - position.Y;
float targetRotation = (float)Math.Atan2(distanceY, distanceX);
float difference = MathHelper.WrapAngle(targetRotation - Rotation);
//Clamp the difference to the maximum rotational speed.
difference = MathHelper.Clamp(difference, -1f, 1f);
Rotation = MathHelper.WrapAngle(Rotation + difference);