Contact force situation
#1 Members - Reputation: 149
Posted 10 August 2012 - 09:15 AM
A ball is in contact with a plane. At the contact point, the relative velocity along the contact normal is zero. The ball's centre of mass (COM) has accn of -g. The ball is spinning at such a rate that at the contact point, the centripetal accn cancels out the gravitational accn. So the calculated contact force to prevent penetration of the point is zero.
Obviously, this will not prevent the ball penetrating the plane.
I've now looked at the equations by Baraff, Eberly and Coutinho and all get this result of zero contact force.
What am I doing wrong? Do I ignore centripetal accn (even though the above authors don't)? Is it simply an unavoidable situation that I'll to code for?
Could anyone do an example calculation for me?
#2 Members - Reputation: 631
Posted 10 August 2012 - 10:01 AM
#3 Members - Reputation: 149
Posted 10 August 2012 - 10:54 AM
wow thats a really good point they do use convex polyhedra whereas I was using a perfect sphere. Guess Ill have to bite the bullet and implement a general intersection test for trimeshes. Im thinking either V-clip or GJK.. any recommendations?
Still, even if it were a polytope, the force required still wouldn't be enough in one go, it would take 1 or more iterations of the response algorithm to prevent penetration. Does that sound right? (I was previously under the impression that once the force was calculated, it would at least prevent penetration until the end of the time step).
Anyway thanks alot Inferiarum
#4 Members - Reputation: 631
Posted 10 August 2012 - 11:35 AM
edit: concerning the algorithms I cannot really help you. Implement something you find easy to understand i guess.
Edited by Inferiarum, 10 August 2012 - 02:14 PM.
#5 Members - Reputation: 113
Posted 10 August 2012 - 12:17 PM
#6 Members - Reputation: 149
Posted 10 August 2012 - 12:45 PM
#8 Members - Reputation: 381
Posted 11 August 2012 - 01:07 PM
Have you seen my 'Physics engines for dummies' article?
http://www.wildbunny.co.uk/blog/2011/04/06/physics-engines-for-dummies/
It should give you some pointers
Cheers, Paul.
#9 Members - Reputation: 631
Posted 11 August 2012 - 05:26 PM
I strongly urge you to discard the force/acceleration model in favour of impulse/velocity. The later is a million times easier to implement and to find up to date tutorials / example code.
Have you seen my 'Physics engines for dummies' article?
http://www.wildbunny...es-for-dummies/
It should give you some pointers
Cheers, Paul.
I guess each physics simulator works with impulses implicitly because of the discrete nature of the simulations. The forces under consideration are used to keep bodies in resting contact.
#10 Members - Reputation: 381
Posted 12 August 2012 - 05:09 AM
I guess each physics simulator works with impulses implicitly because of the discrete nature of the simulations. The forces under consideration are used to keep bodies in resting contact.
Certainly it used to be the case that most simulators would treat collisions via impulses and then resting contacts via a force/acceleration model, but things have come a long way since then - these days its popular to treat collision and resting contact via impulses only - if handled correctly they are just visually stable, handle stacking very nicely, can treat friction without having to linearise and are numerically stable and you'll never end up in a situation where your LCP solver suddenly explodes due to an 'infeasible solution'.
For research, I suggest googling 'sequential impulses' ref Erin Catto.
Cheers, Paul.
#11 Members - Reputation: 113
Posted 12 August 2012 - 03:21 PM
I guess each physics simulator works with impulses implicitly because of the discrete nature of the simulations. The forces under consideration are used to keep bodies in resting contact.
I suppose you could integrate the equations symbolicly inside the time step. In classic RBD, you almost have to do this in order to conserve angular momentum properly, otherwise the system will leak energy. You can see this clearly when an object is nutating. A first order integrator will not work, or only work for a few seconds.
As far as stability, I haven't seen an LCP engine, so I can't say one way or another. I do know that adhoc methods have problems, because they have no concept that the solution depends on the entire system, rather work on pairs of objects separately from all the others.
This leads to impulses applied in opposite directions that grow in strength in order to componsate for the impulses working in the opposite directions. To use an analogy, think of people talking at a party, and having to talk louder and louder in order to be heard, meanwhile all the other people also start talking louder and louder so they can be heard, and so forth.






