
Hello.
Basically I have a ship, like in a space shooter. I want to be able to move the ship in the direction that it is facing. So if I rotate the ship 45 degrees clockwise, and I apply a force to the ship to move it, it will move in the direction its facing which
is 45 degrees. I have done some research but really couldn't find what I needed to make this happen.
I know how to get this to happen by just getting the current linear velocity, calculating a new vector, then just saving it to the bodies linear velocity property, but that is not recommended in farseer for realistic simulations.
Any help would be great.



Try this
_body.ApplyForce(AngleToVector(_body.Rotation), _body.WorldCenter);
public Vector2 AngleToVector(float angle)
{
return new Vector2((float)Math.Sin(angle), (float)Math.Cos(angle));
}



Thanks again HAL!! It works well except I would like to put a limit to the ships velocities. A speed limit basically. Any ideas?



Hmm not sure, never had to do it but I'd look at the LinearDamping variable on the body. Then play around with the dampening, density and force applied to get the right feel for what you want.



I will look into it. Thanks again. :)



Update:
Using the linear damping works perfectly. Thanks for all your help!! Take care.

