PDA

View Full Version : Chipmunk Physics hourglass demo


Skorche
2006.09.05, 08:49 PM
I've been working on my physics library for a couple of years now. A couple of weeks ago I found a really nifty new algorithm that can solve collision, contact (with elasticity and friction) and penetration using impulses exclusively. It also has a plus that it only needs one collision detection pass per timestep.

GPhysics: Box2D (http://www.gphysics.com/?page_id=16) Be warned that the code doesn't compile directly under g++.

I've been rolling the algorithm into my existing physics code and the result is already pretty impressive: Hourglass Demo (http://cda.morris.umn.edu/~lemb0029/ChipmunkDemo.tgz)

If someone with an older G4 could tell me how well this runs, that would be handy.

OneSadCookie
2006.09.05, 09:07 PM
A vile hack to make the original demo code work with GCC is here:

http://onesadcookie.com/~keith/GDC2006_ErinCatto.tar.bz2

Duane
2006.09.07, 05:08 PM
oooh! potential screensaver here!

how hard would it be to turn that into liquid?

Frank C.
2006.09.07, 06:39 PM
I've been working on my physics library for a couple of years now...
Looking good... What are your plans for this? I'm curious about licensing, 3D support, etc.

Skorche
2006.09.08, 09:18 AM
Looking good... What are your plans for this? I'm curious about licensing, 3D support, etc.

Well I'm really not interested in making 3D games myself, and there's already plenty of good 3D physics engines. Not that the math is very different in most cases, everything except the collision detection would be straightforward to convert.

Once I get my poly to poly collider working with the new algorithm, I'll probably release it officially under a BSD-ish license.

Fenris
2006.09.08, 10:28 AM
Try upping the gravity to 1000 - looks a lot better! :)
Love the demo though, I've been having it spinning for the better part of an hour as entertainment. ;)

Frank C.
2006.09.08, 04:58 PM
Well I'm really not interested in making 3D games myself, and there's already plenty of good 3D physics engines.
Ya, I've played around with most of them - It just seems your approach is simpler, (probably faster) and better suited for games in a lot of ways. Either way keep it up - a decent/fast 2D physics library is certainly useful as well.

Nick
2006.09.08, 05:33 PM
Ya, I've played around with most of them - It just seems your approach is simpler, (probably faster) and better suited for games in a lot of ways. Either way keep it up - a decent/fast 2D physics library is certainly useful as well.
Have you looked at Newton? I got it up and running in a couple days with some really nifty effects. It's quite fast and (seems to be) very efficient. If you want to do 3d, try that. And, now that I think of it, you can also do 2D with it using some joints I believe. Someone used it for a contest entry a while back, but I can't remember which.

Frank C.
2006.09.08, 06:34 PM
Have you looked at Newton?
Newton is definitely my favourite right now, and it's my first choice 3D, there do seem to be some bugs that affect the Mac build though. I also get a little nervous around free-yet-closed-source stuff in general.

I started out with ODE but haven't touched it in a long while - it was basically too slow/buggy back then but has likely improved. I've been meaning to spend some more time with Bullet but the Mac demos don't run all that well for me, and the build system is ugly. I know you can build it with Xcode with a little work but that's just an extra pain in the arse and another strike against it...

What I like about Skorche's efforts are the Mac first (only?) approach and that it seems to be built with games in mind. Those other physics libraries are more like personal educational exercises for the authors. They basically simulate too much, which admittedly some people need/want but that extra stuff and accuracy can otherwise just get in your way and add complexity/bloat. Personally I want fast fun game physics - not a real-world simulation.

Skorche
2006.09.09, 12:49 AM
I looked into using ODE for 2D physics a while back, but it seemed like it would be a pain in the neck to use. I was impressed by the results, but not the API.

Newton looks pretty cool, but back when I started on my stuff there was no Linux version. I have a lot of Linux friends so it was important to me to be able to share my stuff with them.

Even more importantly...

What I like about Skorche's efforts are the Mac first (only?) approach and that it seems to be built with games in mind. Those other physics libraries are more like personal educational exercises for the authors.

While I did have games in mind, this is absolutely a learning experience. I thought it would be fun to make a physics library, and wanted to see if I could actually do it.

So while it might be "Mac first", it's ran on Linux for just about as long. Sorry Frank, not to completely debunk your post. I appreciate the enthusiasm though.

funkboy
2006.09.09, 01:47 AM
That is mesmerizing and awesome.