I'm using farseer 3.2 and i have a body who's rotation i continuosly set manually, so that it is facing the mouse. The object is viewed by a camera (TLCorner is the top left corner of the camera's view.) The problem is that if i move this object about by
applying force to it and spin it a bit by rotating the mouse round the circle, the accuracy of the rotation slowly goes out a little bit. It's rotation is set like this
circleBody.Rotation = StaticHelpers.TurnToFace(ConvertUnits.ToDisplayUnits(circleBody.Position),
new Vector2(Mouse.GetState().X + cam.TLCorner.X, Mouse.GetState().Y + cam.TLCorner.Y)) +
MathHelper.PiOver2;
Where TurnToFace() looks like this:
public static float TurnToFace(Vector2 position, Vector2 faceThis)
{
float x = faceThis.X  position.X;
float y = faceThis.Y  position.Y;
float desiredAngle = (float)Math.Atan2(y, x);
return WrapAngle(desiredAngle);
}
private static float WrapAngle(float radians)
{
while (radians < MathHelper.Pi)
{
radians += MathHelper.TwoPi;
}
while (radians > MathHelper.Pi)
{
radians = MathHelper.TwoPi;
}
return radians;
}
I just don't understand it, can anyone think of a potential problem?
