I put together a quick Processing (== Java, for all intents and purposes) sketch for a polygon convex decomposition algorithm: http://www.ewjordan.com/earClip/. I had a question, though - for the purposes of Box2D, would it be better to have the decomposition be quick and non-optimal (potentially produce more polygons than the minimum necessary to cover a region), or slow and closer to optimal? Unfortunately the code for a truly optimal convex decomposition gets pretty nasty, so right now I just apply an extremely naive algorithm, just walking over the triangle list and trying to combine neighbors sequentially, but if you think it's worth it to minimize the polygon count as much as possible, there are some other tricks that could be employed so that you will at least come very close to an optimal decomposition (at a speed hit, of course - the current algorithm is O(N^2) in vertices, and to do better without seriously restructuring the algorithm would probably require an additional pass through the vertices for each bit, bringing us to O(N^3)). Speed doesn't matter much at initialization, but if people are dynamically creating shapes all over the place, it might be an issue.
In any case, take a look at the applet, let me know if you think this kind of decomposition would do the job okay. If so, I'll clean up the code a bit, add the maximum number of vertices and max shapes per body restrictions (this would be good, because it would allow people to pass convex polygons with too many vertices to the decomposition algo and get back a list of polygons that do the same job) and put together a C++ version.
In any case, take a look at the applet, let me know if you think this kind of decomposition would do the job okay. If so, I'll clean up the code a bit, add the maximum number of vertices and max shapes per body restrictions (this would be good, because it would allow people to pass convex polygons with too many vertices to the decomposition algo and get back a list of polygons that do the same job) and put together a C++ version.