I'm trying to join/separate lots of bodies at run time. I've tried using the revolute joint and setting its tolerance to zero so that two bodies get welded together, but this becomes very unstable as I add more and more bodies and the whole thing eventually breaks apart. So instead I've made some creative use of the user data pointer and b2XForm to move shapes between bodies and back again so that the bodies connected together are (and therefore act as) a single concave body.
However there is a weird bug(?) where small objects hitting these large compound shapes causes huge impulses that cause them to spin very fast and launch themselves into the ether. I've tried messing around with the update dT and iteration count, but nothing seems to help.
I've uploaded a demo that shows the problem. Red objects stick to each other, green objects don't stick to anything. Press space to break all objects on screen apart, hit return to restart the sim.
Any ideas as to what I could be doing wrong?
However there is a weird bug(?) where small objects hitting these large compound shapes causes huge impulses that cause them to spin very fast and launch themselves into the ether. I've tried messing around with the update dT and iteration count, but nothing seems to help.
I've uploaded a demo that shows the problem. Red objects stick to each other, green objects don't stick to anything. Press space to break all objects on screen apart, hit return to restart the sim.
Any ideas as to what I could be doing wrong?