Using Farseer 3.3.1 I want to create a rectangular BreakableBody with many pieces. Right now here is my code:
Vertices polygon = PolygonTools.CreateRectangle( 2.5f , 1.25f ); List<Vertices> triangulated = FlipcodeDecomposer.ConvexPartition(polygon); BreakableBody breakableBody = new BreakableBody(triangulated, World, 1); breakableBody.MainBody.Position = Vector2.Zero; breakableBody.Strength = 5; World.AddBreakableBody(breakableBody);
This code turns the rectangle into two pieces (cut from corner to corner). I have tried four of the five decomposing methods (Flipcode, Bayazit, CDT and Earclip). I also haven't been able to find any good examples of a rectangle being divided into multiple pieces.
Preferably, I am looking for a way to create random sized pieces, but cutting it into 32 cubes ( 8 x 4 ) would be fine also.