I'm currently working on a project using Box2D on the iPhone, and I'm noticing a performance bottleneck, which I think is coming from the physics calculations. The project uses the accelerometer for gravity, and so the following issue has come up: when a number of objects ( i would say about 30 to 35) are created in the world, they are able to run at the maximum fps (I cap at 30) with no problem when there is no gravity (phone flat) and they float freely; however, when there is more gravity and they bunch up at the bottom of the screen, the framerate drops dramatically. I think this just has to do with the way Box2D reduces the number of collision checks it has to do (when the objects are floating freely, it is doing less object comparisons), but I was wondering if there was any way of improving the performance even when the objects are bunched up. I haven't tried changing the number of iterations (I'm using 10), so I'm guessing that's probably the best way of improving the performance with larger numbers of collisions.
Thanks for input 😀.
Thanks for input 😀.