New Shape Primitive - b2ConcaveArc (for Box2DAS3 2.0.1)

It's been a long time, but I finally gritted my teeth and ported my old code to Box2DAS3 2.0. It's an extensive patch to Box2D to add a 3rd shape type, which allows you to do circular arcs that bend inwards. Demo available here.

The 2.0 version supports most of the new features, and should work fine with CCD. It has a slightly changed framework in place for adding further shapes (specifically b2Distance.Distance now has an array lookup rather than a series of ifs), so I recommend if you are also adding a shape you start from this patch.

The biggest outstanding issue is that concave arcs do not collide with each other. I find this code too hard to write (at least, using solid shapes rather than thin arcs, which are simpler), but last time people reassured me they mainly wanted such shapes for static scenery, so this isn't a huge problem. Masses are not calculated correctly either.

It's still a bit buggy, though. Specifically, when I pull objects against a static concave arc, and then slide them over one of the two vertices at the ends of the arc, you sometimes see 'popping'. I think it's some warm starting issue, but I cannot reproduce it reliably, so if you can, let me know. Also, I haven't written TestSegment code, though this is rather trivial compared with the rest. Hence I've only provided a patch rather than a full download. That way, only the savvy types will download it, and we won't have buggy versions circulating after things are fixed.

USAGE
b2ConcaveArcShape
This shape can represent any polygon with a circle subtracted from it. It works exactly the same as b2PolygonShape, except the edge from vertex 0 to vertex 1 is a concave arc, with radius given by the radius property. The diameter should be longer than the distance between the vertices, and the rest of the polygonal shape should be large enough to enclose the resulting curve (this is not checked).
The demo is looking good Boris. I'm building a game at the moment and I built my own concave arc using compound polygons and I found slightly odd behaviour when firing circles at it. I will download the patch and give it a bash. Thanks, once again.
Awesome, can't wait to play around with this!
this is so good, the reason i still have 1.4.3 installed aswell as 2 is because 2 doesn't have your concave arcs, but now it does! thanks again
Argh this is annoying! Trying to apply your patch on OSX, but the patch command strips the windows "CRLF" from the files, which causes it to not match the target files.

Any chance I could just get the Box2d folder with your b2ConcaveArc & Ray Cast code?

Thanks.
Ok, I've put in the Box2D folder, and the Testbed one in case you want it, in the OP. The odds are low that I'll return to touch up this project soon, so I guess my original reasons for not putting up a zip are pointless.

Currently I'm using TortoiseSVN to make these patch files, but you're not the first to have complained of problems. Any suggestions for what I should be doing?
Boris,

Is this compatible with your ray cast code? I was able to apply your ray cast patch to the project you provided here, but got an error in TestSegment. Actually... it looks like these shapes aren't even compatible with the default "ray casting." Guess I'll forget about the half-pipe-with-lasers level.

I fired up TortiseSVN through parallels to get things done... got some warnings but was able to work through them. Thanks for the files.
Uh, no, they are not compatible, simply because I haven't implemented TestSegment for b2ConcaveArcShape. Other than that, it would probably be fine. I'll look into it, as the TestSegment code shouldn't be too difficult.

Original thread: https://box2d.org/forum/viewtopic.php?t=1141