InteractiveComputerGraphics / PositionBasedDynamics

PositionBasedDynamics is a library for the physically-based simulation of rigid bodies, deformable solids and fluids.
MIT License
1.93k stars 365 forks source link

Collision handling #49

Closed airatsa closed 6 years ago

airatsa commented 6 years ago

According to PBD paper (http://matthias-mueller-fischer.ch/publications/posBasedDyn.pdf) collision constraints are handled in the same way (and solved in the same loop) as spring constraints. So collision contraints affect postions.

In the PositionBasedDynamics library collision constraints are solved in a separate loop and affect velocities rather than position.

Why is it implemented in such a way?

janbender commented 6 years ago

Müller et al. only handle collisions between deformable solids and neglect repulsion forces which is acceptable for deformables. However, in our library we currently handle only collisions between rigid bodies where a repulsion is important for a realistic impression. However, repulsion can only be handled realistically on velocity level and not on position level.

Moreover, I think our solution works well in practice as you can see here:

https://www.youtube.com/watch?v=x_Iq2yM4FcA

airatsa commented 6 years ago

I agree on handling repulsion on velocity level, I faced it in my own experiments with PBD. Can't position-level constraint handling (along with velocity level) be useful? For example, rubber ball jumping on the rigid floor.