This project has moved. For the latest updates, please go here.

position of a polygon

Jul 19, 2011 at 4:31 PM

Hi i'm using farseer 3.2. Can anyone tell me where the position of a polygon is defined. I noticed that when you define a circle fixture for example and then get and set it's position, you're getting and setting the centre of the circle. For a polygon, where is this position vector? Is it in the centre of the AABB or the top left hand corner or what ...? Thanks in advance

Jul 19, 2011 at 5:32 PM
Edited Jul 19, 2011 at 5:39 PM

It's in the center of mass, becouse in physics is where you have to apply the forces to calculate things like the speed. You can view if with the debug view. Have in mind it can be outside of the shape.

Take a look at this:

Jul 19, 2011 at 6:00 PM

Oh cool. When you draw things would you normally draw everything from the centre of its mass because i'm having real trouble drawing things in the correct place. I'm used to drawing everything from the top left hand corner but i don't know how to find that anymore ?

Jul 19, 2011 at 6:10 PM

I just draw them and if they are not in the correct place, I move them. Not easy, not efficient, but it works.