I love how Farseer has an inbuilt texture-to-polygon function and polygon subtraction and union, and have had some success in using these to make a Worms/Lemmings-style deformable-scenery system (after a lot of fiddling)
In my current test-setup, I have one static background body with multiple pieces of geometry attached to it, and a button-press generates a subtractive circle around the player-controlled spaceship.
The subtraction works up to a point, but could do with providing two extra functions - providing for full-geometry subtraction, and outputting multiple polygons when a subtraction splits a geometry.
I think these should be fixed in Farseer, but I've not been coding in C# long enough to do a decent job and contribute a fix myself :(
At the moment, if the subtractee geom is within the subtracted geom (ie. a small piece of background geom completely enclosed by an explosion) there doesn't appear to be any way of knowing; the output is null, and the error is "NoIntersections",
as none of the edges are intersecting. I can't find an inbuilt function for finding geometry that overlaps in this way, so I guess I'll have to do a distance-test on all the subtractee's verts for now.
This ought to provide an empty vert-list instead of just Null.
If the middle of a long piece geometry is subtracted, only one side of the long geometry is retained, as only one vert-list is provided. I think the subtraction-function (or a new extended more-functional one) is required that will output a list of
vert-lists instead just a vert-list.
Can anyone think of a simple way to achieve these things with what's currently in the engine? I don't want to look too complainy if I've missed something obvious ;)