Verlet integration polygons with collision

I REALLY didn’t think it was gonna be this easy… no complex maths, just a bunch of looping and hitTest, hitTestPoint kind of code :)

Click for teh Collidin Verlet integratin kick butt multicolored polygons explorer demo

screenshot of colliding polygons application

While coding, I was sure I would roast my cpu, maybe run up to 20-30 polygons, but my trusty laptop can churn out 70 shapes at a time before the framerate starts to slowdown. I find it mesmerizing to watch… Cool with 70 shapes, but also very cool to watch a fewer number and actually appreciate the “realism” of the collisions (not perfect, but not bad). It’s late, the code is dirty, time to shut down and watch heroes :D

…but if you want the dirty source code, ’tis yours

More to come… am really enjoying this… :thumbsup:

Tags: , ,

One Response to “Verlet integration polygons with collision”

  1. David Says:

    Still looking great, and yeah, framerate is way better than I expected! On collision, the reactionary force seems to be out of proportion of the impact force, which doesn’t really allow the situation to resolve to a restful state as it would in real life (especially with a higher polygon count), tho that would probably mean replacing the hittest code ;)

Leave a Reply