Momentum conservation on collision with btStaticPlaneShap

sharethis
Posts: 6
Joined: Sat May 04, 2013 3:18 pm

Momentum conservation on collision with btStaticPlaneShap

Post by sharethis »

Say, a rigid body stays on a plane. When a I apply an central downward impulse to that rigid body, it doesn't jump upwards. Isn't it supposed to revert the impulse due to the collision with the plane shape of infinite mass?
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Momentum conservation on collision with btStaticPlaneSha

Post by Basroil »

Impulses work instantaneously, and since bodies are infinitely stiff, impulse travels instantaneously. Physically the counter impulse cancels out the primary impulse and there's no motion.

In the case of bullet, there's going to be inaccuracies in solving and you might see twitching.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Momentum conservation on collision with btStaticPlaneSha

Post by Dirk Gregorius »

You must set the restitution for the both bodies.
sharethis
Posts: 6
Joined: Sat May 04, 2013 3:18 pm

Re: Momentum conservation on collision with btStaticPlaneSha

Post by sharethis »

Thank you, Basroil, for the explanation. However, even if a shape falls some distance down on the plane shape, it doesn't jump up after collision. But it does when landing on other shapes like boxes or meshes.

I'll try setting restitution as suggested by Dirk Gregorius, that may do the trick.
Last edited by sharethis on Sat Jul 13, 2013 7:04 pm, edited 1 time in total.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Momentum conservation on collision with btStaticPlaneSha

Post by Basroil »

Yup, for that one it's different since the box is already in penetration and will jump up with proper coefficients (at least in bullet!). Dirk Gregorius knows a heck of a ton of things in this engine, if he says it should work with that fix it very likely will. Just meant to say that it's not a realistic situation, even if it does work in bullet (since it's technically an error in the approximation, and that same reason is why it's so hard to find reasonable restitution results for many materials).