Motor Physics: sequential impulses

May 27, 2007 on 5:01 pm | In Actionscript, Physics | 5 Comments
move mouse inside stage, press ‘F’ for more fun

I have now implemented Erin Catto’s Sequential Impulses solver which he presented in his Box2D mini demo. It’s equivalent to the PGS (Projected Gauss Seidel) algorithm when using SI with clamped accumulated impulses. You find more information in his paper.

The flash runs currently very slow because it’s not optimized at all, but so far I’m happy that it works. I really love SI as it overcomes the jitter of objects which also made stacking nearly impossible in the previous version. But I keep my old solver because it’s very fast and great for non-gravity environments or particle-sized objects where jitter was not an issue.

The last (and probably hardest) step is to rewrite all my collision functions to add contact caching capability, which is quite complicated. The Box2D engine only supports (guess what.. boxes) and the collision and contact generation code is far to slow to be enjoyable in flash, so it’s crucial to find a fast solution for this. Once this is done I can concentrate on the API.

5 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Can hardly wait!

    Comment by Rendall — May, 28 2007 #

  2. Looks very nice! The movements look really stable.

    Comment by Patrick — May, 29 2007 #

  3. Once again, incredible work!

    Comment by Nate Chatellier — May, 29 2007 #

  4. Looks great Mike!

    I can’t wait to see what you’ll come up with.

    I don’t know if you’ve already seen this, but it’s an open source Java implementation of Box2D with more than boxes. http://www.cokeandcode.com/phys2d/
    Maybe it can help out.

    Good Luck,
    Oz

    Comment by Oz — June, 5 2007 #

  5. Yes, I stumbled across phys2d some time ago. But I’m wondering why it’s so slow compared to the C++ version. And my current version already supports all kinds of shapes, but I need to augment them to so they can manage a contact manifold for a feature called warm-starting (mentioned in Erin’s paper) to make the simulation a little more robust.

    Comment by Michael — June, 7 2007 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Proudly powered by WordPress Theme based upon Pool theme by Borja Fernandez.
Entries and comments feeds.