Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 May 2011
Offline Last Active Yesterday, 04:12 AM

#5306131 Implementing position-based rigid body dynamics

Posted by on 16 August 2016 - 05:07 AM

I'm studying Jan Bender's position-based dynamics library (which is the closest to this paper impl i've found) and have lots of questions.


1) Why don't they have position constraints for contacts? why do they resolve interpenetrations only with velocities?

2) Why do they perform collision detection after velocity update, not after moving bodies to interpolated positions?


Their main loop is as follows:



    1. Apply external forces, advance velocities, integrate positions (first rigid bodies, then particles - is the order important?)

    2. Solve ("Project"?) position constraints (for X iterations: solve position constraints for typed constraints, but not for contact constraints (why?))

    3. Update velocities (first rigid bodies, then particles)

    4. Perform collision detection, create contacts (shouldn't this be done after the first step, after updating the positions?)

    5. Solve ("Project"?) velocity constraints (for Y iterations: solve typed constraints, then rigid body contacts, then particle vs rigid body contacts)


3) Can you describe in a few words (or point me to beginner-friendly resources) how to solve position constraints for 3D contacts?

(or how to turn an abstract "Non-Linear Gauss-Seidel Solver" for solving position constraints into working code)