Nov 10, 2011 at 6:19 PM
Edited Nov 10, 2011 at 6:22 PM
That is the voronoi diagram library that the second link uses. It is in actionscript, but it should not be too troublesome to port over to c#. And if you do port it, open source it! :p And credit Alan Shaw of course.
Now, actually breaking up a Body in farseer using the voronoi diagram will take a little bit of work as well. Check out the CuttingTools.cs file in the Common/PolygonManipulation folder of the farseer source. It will cut the polygons, but will
only work right if the cut you are making goes all the way across the polygon. You should be able to modify that to your needs as well. I am imagining it wouldn't be too difficult to get working, but I haven't actually looked at how the cutting
is done. I just know what the documentation says.
And actually, you may consider just creating new bodies in the shape of the voronoi regions and removing the old body. I have no idea what kind of performance hit either of my proposed methods would have.
If one of the dev's or someone who knows better could chime in with what would be a good method to pursue this I would be interested to know as well.