I am new to Farseer, and I am having trouble alligning my body shape with the textures drawn on screen.
Before I have use the Physics Helper library (http://physicshelper.codeplex.com/) and Blend to make my WP7 games here: www.luketobrien.com
Now I am trying to recreate the games in XNA so that I can use MonoGame (http://monogame.codeplex.com/) to port them to Android et al.
I have four buffers that make up the table, and 13 balls inside that table, but of course the body shapes are not aligned, so the balls are colliding with shapes that are out of proportion and in the wrong place.
Here is the code for one of the buffer bodies:
bufferBody = BodyFactory.CreateRectangle(world, 25, 500, 4);
bufferBody.Position = new Vector2(0, 50);
bufferBody.IsStatic = true;
And here is the draw code for a buffer texture:
spriteBatch.Draw(buffers, new Rectangle(0, 50, 25, 500), Color.White);
For a disk body:
And the texture:
body = BodyFactory.CreateCircle(table.World, 12.5f, 1);
body.BodyType = BodyType.Dynamic;
body.Position = pos;
spriteBatch.Draw(texture, new Rectangle((int)pos.X, (int)pos.Y, 25, 25), colour);
My game is very simple, and I am not using a projection or view Matrices, just a very simple 0,0 at top left.
The buffers are 500px,25px horizontal (25px,500px vertical), and the disks are 25px,25px.