Erin Catto wrote:
What constraints are you having trouble with?
Well, I'm tripping a bunch of asserts like edge length and area (too small). I've tried to replicate your checks so that I could avoid them, but it doesn't seem to be working for some reason. I need to look at it a bit more yet.
I think I'm going to need a better decomposer. The one I'm using will generate a lot of thin triangles when a circle is subtracted from a polygon. I might have to use a sort of mesh instead to avoid this problem and keep Box2D happy.
@mayobutter: It's not too complicated really. When a collision impulse exceeds the "breaking point", I basically "draw" a circle around the point of impact, and subtract that from the fixture that collided. That divides it into a circular cutout, and the remainder. What I didn't anticipate originally, but worked out quite nicely, was that these two pieces can then collide again and it creates a sort of chain reaction which chips off several chunks until the forces are exhausted.
Glad you guys like it 🙂 I was worried no one would be interested. You probably don't want to jump into the code just yet anyway, I still need to do some more refactoring.