Sign in to follow this  

Question about target velocities in sequential impulses contact resolution [3D]

Recommended Posts

Posted (edited)

I'm using sequential impulses to drive the velocities of contact points to their targets:

 

- for collisions that means the target is the restitution velocity (separating)

- for resting contacts it's 0.0 (the objects were already in contact so there was no distance to accelerate over so the target should remain zero)

 

How are targets chosen for other points that are *initially separating* but whose velocities become *closing* velocities as a result of handling the other contact points in the contact manifold?

 

If the same reasoning for resting contacts are applied, then there is no distance over which to accelerate so the restitution should not be some positive rebound velocity, so that leaves only two real choices of targets that I can see: either 0.0 or the *original* separating velocity. I'm guessing 0.0 but I don't have a real reason for it other than that's the way contacts work, but is the answer the same for both collisions and contacts?

Edited by PrestoChung

Share this post


Link to post
Share on other sites

Right, but my question is what should the target velocity be for the second point after the accumulated impulse is applied? It was separating before the impulse for the first point was applied, now it is negative (closing). I want to find an impulse for the second point that either: makes the relative velocity 0.0? or returns it to the positive separating velocity it had at the time of impact?

 

After the impulse for the second point is found the the solver will loop back around to the first point and repeat the process.

Share this post


Link to post
Share on other sites

Conceptually you are solving an LCP. Either the relative velocities are separating (e.g. the contact is breaking) and there is no contact impulse/force. Or the relative velocities at the contact point are approaching in which case the contact is active you have a contact impulse/force. The accumulated impulse and clamping in SI take care of this. You might want to have a look at this presentation: http://box2d.org/files/GDC2013/Tonge_Richard_PhysicsForGame.pdf

 

Check the part on multiple contacts and Signorini conditions.

Share this post


Link to post
Share on other sites
Posted (edited)

That is the presentation I have mainly been working from. Part of the confusion might come from trying to apply the conditions to colliding contacts. The 3rd condition:

 

vrel_i = 0   or  \lambda = 0

 

seems different for collisions:

 

if you have a colliding contact point with a negative relative velocity of magnitude -1.0 in the normal direction, you want to drive the velocity to a positive value scaled by some restitution factor, say, 0.5: -1.0 -> 0.5

 

so you want to apply an impulse that changes the velocity in the normal direction +1.5. so the impulse \lambda is positive (non-zero), and the target velocity is positive (non-zero).

 

for the second point, say it is initially separating with velocity +0.7, by the signiori conditions because the velocity is positive, \lambda has to be zero (no impulse at separating contacts), at least for the 1st iteration.

 

but applying the impulse to the first point results in the second point having a negative velocity, say -0.3. if this was a resting contact, i would assume that we need to apply a positive impulse \lambda now that changes that -0.3 velocity to 0.0 velocity, fine. but this is a colliding contact, should the target velocity for the second point be a positive velocity determined by the restitution factor? 0.3  * 0.5 = +0.15, should it be 0.0 since the point was already "in contact" there's no distance to accelerate to -0.3 so this velocity is more or less virtual? or should the target be the original separating velocity +0.7? either way a positive \lambda is chosen, i *think* the answer is the target should be 0.0 for this second point since it was already in contact when the first point caused a collision in the first place.

Edited by PrestoChung

Share this post


Link to post
Share on other sites
Posted (edited)

The law of restitution reverts the approaching velocity scaled by some factor. If you have initially a separating velocity at a contact point when you setup the constraint you have two options:

You can ignore it and don't add it to the solver considering it not active. Or you set the target velocity to zero. Obviously you cannot revert the separating velocity as you would suck in the other body into deep penetration. I set the target velocity to zero in this case.

Edited by Dirk Gregorius

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this