In Farseer 3.3.1 for XNA, how do I change the origin of a Body? For example, when I create a Circle Body, instead of it rotating around its center, I want it to rotate around another specified point.
I guess the revoulte joint is what you want. You can use it to pin the circle at a given position and the circle will rotate around that position.
The centroid is necessary for physics calculations. In other words that is not the origin you are trying to move but the center of mass. Unless I'm mistaken you're going to have to do a bit of trig or get fancy with matrices.
Just to give a late answer to the question, answering what the question literally asks (for anyone who comes across it by searching):
You don't so much change the origin of a
For example, assuming:
A centred circle would be this:
But a circle offset from the body origin by its radius would be:
(Other shapes have similar offset parameters available. Raw polygons vertices are specified relative to the body's origin.)
Now, even if you do this, the centre of mass will still be at centre of the circle. If you want to move the centre of mass, you can do this:
That is in the case where you've moved the circle centre away from the body's origin (as above), but you want to keep the centre of mass at the origin.
If you don't move the circle fixture, and just want to move the centre of mass, then do something like this:
It is important to note, however, that Farseer normally recalculates the centre of mass! It does so if any of these things happen:
So if you do any of those things, you must set