I think I have to leave the Flash board for this one...
Okay, so here's an example: http://www.TumbleBall.com/?z77e
The simulation is a series of dynamic circles falling down and hitting static circles. That's it. There is nothing special about any of the bodies, no joints, no damping, bulletmode is off...
If I drop one ball down this kind of gauntlet, it follows a set path with no deviation, as you would expect from a physics engine. Two balls, fine. Ten balls, fine. But in the upper numbers, the paths start to deviate - consistently and painfully. In the demo above, the balls will start off hitting every balloon, but where the red balloon is in the middle of the level, balls will deviate left or right, down two separate paths, with no reason, seemingly.
I have a feeling that it has to do with the order in which objects are solved. That as bodies are destroyed and re-instated, that the sequence in which bodies are solved changes, which has the potential of changing the simulation, especially if two dynamic bodies are colliding. Does this make sense?
Or is this going to be one of those b2Settings problems, like max contacts per island or something?
Basically - how does Box2D decide which body to solve first and which to solve last? And how often does it change?
Any help for finding and solving this bug would be immensely appreciated. Thanks.
Okay, so here's an example: http://www.TumbleBall.com/?z77e
The simulation is a series of dynamic circles falling down and hitting static circles. That's it. There is nothing special about any of the bodies, no joints, no damping, bulletmode is off...
If I drop one ball down this kind of gauntlet, it follows a set path with no deviation, as you would expect from a physics engine. Two balls, fine. Ten balls, fine. But in the upper numbers, the paths start to deviate - consistently and painfully. In the demo above, the balls will start off hitting every balloon, but where the red balloon is in the middle of the level, balls will deviate left or right, down two separate paths, with no reason, seemingly.
I have a feeling that it has to do with the order in which objects are solved. That as bodies are destroyed and re-instated, that the sequence in which bodies are solved changes, which has the potential of changing the simulation, especially if two dynamic bodies are colliding. Does this make sense?
Or is this going to be one of those b2Settings problems, like max contacts per island or something?
Basically - how does Box2D decide which body to solve first and which to solve last? And how often does it change?
Any help for finding and solving this bug would be immensely appreciated. Thanks.