Circular Border in farseer 3.2

Topics: User Forum
Feb 22, 2011 at 10:45 PM

I'm sorry for my English

 I have the same problem as the guy there http://farseerphysics.codeplex.com/discussions/26076?ProjectName=farseerphysics 

That solution don't work in 3.2 version (There is no GeomFactory.cs and maybe something else). Please help to make a circular border in 3.2 version.

Developer
Feb 22, 2011 at 10:56 PM

Take a look at the loop shape. You'll find code to produce a circle in the DebugView method for rendering circle shapes. Use that to generate vertices for a circle and create a loop shape from that.

Feb 7, 2012 at 7:37 AM
Edited Feb 7, 2012 at 7:40 AM

I had the same issue. Here's what I did to create circular border for our game. I adapted what that guy did in his post to 3.2.

Apparently the Code snippet block is broken in Chrome?
http://pastebin.com/ctDJTZHm

To create a loop shape do:

int SizeOfBounds = 5000; // In pixels          
Vertices verts = Boundaries.CreateConcaveSemiCircle(ConvertUnits.ToSimUnits(SizeOfBounds), SizeOfSystem/20);
Body border = BodyFactory.CreateLoopShape(PhysicsManager.world, verts, Vector2.Zero);