Vertically bouncing body mysteriously toppling

Hi guys,

this is a bit of a weird one, maybe someone has an idea of what's happening!

I'm using box2d v2.0, and I've set up a bouncy platform by making a static body (a box), placed horizontally in my universe. In order to make it bouncy, I have set it's restitution to 1.

Now slightly above the bouncy platform is a dynamic body, also a box, which is slightly taller than it is wide, with zero rotation. it's basically a like a guy bouncing on a trampoline.

When I run the simulation, the dynamic box falls onto the bouncy platform, and bounces straight back up again to it's original height. Exactly as expected. It does this three times. But on the fourth bounce, the dynamic body topples over as if some horizontal force was suddenly applied to it (which it isn't).

Any thoughts?

Thanks. 🙂

Ric.
I think its because box2d uses estimations to improve performance, so some things get a little ...unstable. Search the forums for people talking about stability of stacked boxes to get some ideas on how to deal with it (or you could prevent rotation on your dynamic box if that's an option).

Original thread: https://box2d.org/forum/viewtopic.php?t=5281