// You are creating a shape outside the world box.
b2Assert(inRange);
I'm hitting this assert trying to create a circle shape (in place of a previous, slightly larger circle) and dying. How can I test for and avoid this situation myself?
Store the b2AABB you created your b2World with, and test the shapes you want to create to make sure they are inside it.
Or better, create the AABB with a healthy margin of error, and have it surround every bit of space that you could possibly want to use. You don't gain much if anything by keeping the world AABB tight, the main thing is just that it shouldn't be too massive. I think Erin said anything up to a few km should be fine, and even if you go beyond that, the broadphase might just go a little slower.
I tried to have the world AABB be about 2 to 3 times as big as the space I'm actually using. I have a floor on the bottom of the screen with two tall walls on the left and right edges of the screen. Everything should stay inside this "cup" but some stuff is apparently slipping through or falling over the top.
Anyway, I fixed it by destroying bodies that fall below a certain point (that point being a good 500 units below the bottom of the screen).
On a related note, I had been trying to use the boundary contact listener to destroy bodies that would cause me to hit this assert, but that wasn't working. Is that a proper use of the boundary contact listener?
If you can reproduce it, a test-case showing this behaviour would likely help out.
Bill