2

I've been working on rigid body simulation for a while and I still have no idea how to deal with this problem. (I use discrete collision detection and use LCP to solve the impulse of each contact point.)

Imagine a fixed bowl (a hemisphere centered at C) and a particle at the edge of the bowl. The particle rolls down on the surface to the inside of the bowl. And at some time step, there should be a contact point A, and the LCP solver will give the result impulse which makes the particle's velocity perpendicular to vector CA. But after updating one time step, the particle moves along this velocity a little bit and actually goes out of the bowl, and things get worse after several more time steps. When I used a cube instead of the particle, the cube can penetrate and sink through the bowl.

So is there a way to avoid this? The impulse method is not perfect and there can still be penetration after the collision response. I need to somehow correct the penetration, but simply moving the object along the surface normal at the contact point is not a good idea, because it can produce new penetrations.


Edit:

It is not the problem of bowl being too thin or time step being too large. The reason is the Euler's integral produce a polygon instead of a circle. And we cannot just modify the positions of these 2 object, because if there is a third object on the other side, object 2 and 3 may have a new penetration. I think one way is to add some elastic force based on the penetration depth, but it is not neat enough.

Thanks it's a good idea to look through the Bullet source code, working on it.

quanke0801
  • 41
  • 5
  • you can check how this is solved in molecular dynamics packages, e.g. AMBER or GROMACS. – Andrey Jan 15 '17 at 07:32
  • I want to give you a +1 just for the title: "rigid body dynamics penetration" – o_weisman Jan 15 '17 at 09:15
  • Does reducing the timestep reduces the sinking ? – cmourglia Jan 16 '17 at 12:30
  • Maybe you could also have a look at bullet's source code for this, I think I never have experienced sinking with it. https://github.com/bulletphysics/bullet3/blob/master/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp – cmourglia Jan 16 '17 at 12:33
  • Is the bowl thin enough that the particle can tunnel *through* the bowl in one step? And can you elaborate on how "moving the object along the surface normal at the contact point... can produce new penetrations"? – Beta Jan 16 '17 at 17:48
  • You say you can't just modify the position of the 2 objects, because of a potential 3rd object on the side. Have you read http://stackoverflow.com/questions/13046033/an-efficient-way-to-simulate-many-particle-collisions? – pingul Jan 19 '17 at 16:20

1 Answers1

0

Compute a step, get penetration of all particles. Compute spherical probability of occurences on the penetrated points, mirror the occurence probabilities from surfaces, delete the penetrated probabilities, subtract other particles' probabilities from its local probability map, place the particle on the highest probability point.

Example:

   o --->   |  

            |        o      penetrated to here

            | %5 %50 %90

 %90 %50 %5 |

 o          |

probabilities to left of it and right of it is same(about %80) so it is stationary now, so it is non-elastic collision.

now lets assume there is a second particle

  o ---> o  |

         o  |       o      penetrated here

     -100%  | %5 %50 %90

 %90 %0 %-45|

  o      o  | 

so particle bounced back from other particle which also bounced back from wall but gave its momentum back to first particle. Then, probability to left side is bigger so its final velocity is "left" handside. Do this serially for all penetrated particles (which should be a few only?)

Its adding N particles N*M probabilities subtracted from all other particles probability maps which is N * N * M operations where M is K * L * M of a K by L by M sized cube space

huseyin tugrul buyukisik
  • 11,469
  • 4
  • 45
  • 97