Split Impulses and Post Projection
I’ve been tinkering with Box2D.
The original version uses Baumgarte stabilization of position errors. The problem with Baumgarte is that it affects the momentum, leading to bouncy or spongy constraints. I’ve attempted to address that problem with Split Impulses and Post Projection
Split Impulses works by making a separate set of pseudo velocities and impulses that serve to reduce position error and don’t influence the velocity solver. This is a fairly cheap solution because it is mixed in with the velocity solver. It works great for contact constraints. However, it does not work so well for joints. I don’t know why it doesn’t work well for joints, but on the other hand, I don’t know why it works so well for contact.
Post Projection is a more mathematically correct method of dealing with position errors. Post Projection (PP) waits until the velocity solver is done and the positions are integrated. PP then attempts to solve the position errors. PP introduces an outer iteration loop which recomputes the Jacobians and updates the positions. PP is the most expensive solution so far, but it is also the most effective.
See this post on Erwin’s site for more info: Bullet Forum Discussion
I also added correct handling of joint softness. This allow me to simulate a suspension bridge with soft joints and gets rid of the relaxation hack.
January 10th, 2007 at 5:08 am
Coo, that sounds impressive, however I have no idea what your talking about ^.^
Which is why I really like your box2d physics system, as I can nearly understand most of it! None of this jacobian matrix nonsense (whatever that is) ^_^
January 10th, 2007 at 2:45 pm
I stumbled across yor site and I find your solution really nice. I can’t understand all of it yet as I’m no math wizard :9), but it seems simple and very stable. I like simple solutions.
My own engine uses Jakobsen style particle simulation. But I’m kind of hooked to 2d simulations and always in search of impressive stuff
I’ll put a link to your site.
Keep the interesting posts coming…
April 5th, 2007 at 10:39 pm
Hi,
Nice work, and better documented than most other work on game physics!
Why do you call the “relaxation” a hack. It can be done systematically, even constitutively..
What alternative to this are you using for the jointed bridge?
April 5th, 2007 at 10:58 pm
Relaxation is an indirect way to soften the joints. In the GDC07 version of the bridge I directly use softness and the Baumgarte parameter to achieve a specified joint stiffness and damping. Unlike a true spring and damper, the SI algorithm can handle large stiffness and damping values.