Anyone used a Python Physic Engine.


may88

Well-Known Member
Joined
Dec 17, 2007
Messages
1,178
Location
Bury St. Edmunds, UK
Hi,


Has anyone used a Physics Engine with Python/Pygame?


pyBox2d seems to be a choice but there are others like pyODE.


Any feedback,reviews or opinions on these would be great.
 
I have used pyBox2D and pyMunk (chipmunk python bindings). I've also dabbled with ODE. I would recommend box2d for games. Nicer (IMO) API, can (IIRC) use integer math and has a mature codebase. Try making a simple scene with each and pick one that suits you :)
 
I have used pyBox2D and pyMunk (chipmunk python bindings). I've also dabbled with ODE. I would recommend box2d for games. Nicer (IMO) API, can (IIRC) use integer math and has a mature codebase. Try making a simple scene with each and pick one that suits you :)
Thanks. I'll have a quick look at pyMunk now.
 
Three main contenders are pyBox2d, pyMunk and pyODE.


Initial feelings:


Box2d is more advanced (than chipmunk)


pyMunk's python bindings are more pythony than Box2d


ODE is in the Angstrom Repository.


I can't judge which is best on merit yet as I have no idea what I need these things to do.


So far I've installed pyMunk on my ubuntu system. Simple. Find and download the Version 1.0.0 zip. Unzip somewhere. cd to the top level. python set-up install.


cd examples. python <pick one>.py


I've read a pyMunk example script and pyODE online tutorial. I'm getting confused.


I see the logic. You create a physics world or space and in there you create bodies. These have props like mass, location, shape and velocity. Advance the time in the world (a few small steps per program cycle) and then read back the location of your object and visually plot these on your screen.


So all I need to do is spot specific collisions and alter the properties at various points in the game. Simple.
 
Let me know if you have any questions specifically on box2d if you end up using it. I have some experience with it in both C++ and python. Also check back to report how things are working out and stuff even if you end up using one of the others. I'd be glad to comment :)
 
Only have you got a Pandora? And is pyBox2D running on it? (not that I think it'll take a lot of porting, uneducated guess).


I hope to find time look at box2d (lots of reasons to go this way) this week-end.
 
Back
Top