Non-penetration constraints in Box2D

Please don't post Bullet support questions here, use the above forums instead.
eatjason
Posts: 2
Joined: Sun Nov 15, 2009 2:47 pm

Non-penetration constraints in Box2D

Post by eatjason »

I have been reading Erin Catto's Box2D slides & papers, and I'm wondering about some details how non-penetration constraints work.

Here are two cases that I am curious about:
Image

The only difference in B is that it is using a longer time step. Both top boxes are traveling downward, and the bottom boxes are fixed. Also in these cases, there is no gravity (boxes happen to have a downward velocity). Now, what I understand, is that impulses are used to correct these positions. Since case B will need a larger impulse, it seems to me that in case B the top box will have a higher velocity once it is out of the bottom box, due to the fact that it had to travel farther and with conservation of momentum, it will keep that velocity.

Is this correct? Does this mean getting the box to stop would be difficult? You could set the normal velocity to zero I guess, but what if there are other forces acting on the top box that shouldn't be messed with?
eatjason
Posts: 2
Joined: Sun Nov 15, 2009 2:47 pm

Re: Non-penetration constraints in Box2D

Post by eatjason »

I think I figured it out, I see that the contact constraint prevents motion in the normal direction, therefore making velocity zero. I see that he ends up reintroducing bounce with a velocity bias.