Chipmunk 2d physics lib
In the same spirit as Hectigo and tsmaster, I have now with this post released a small library called pymunk just for pyweek! :)
Chipmunk is a 2d physics engine written in C, and can be found here: Chipmunk.
pymunk is a low level binding made with ctypes, so you can now use Chipmunk in your Python code!
The link: pymunk-0.1.zipAnd a screenshot from the included demo:
And a cut-n-paste from the readme:pymunk - pyweek5 edition
2007, Victor Blomqvist - email@example.com
pymunk is a wrapper around the 2d physics library Chipmunk
At the moment, its an autogenerated ctypes binding + a modified version
of the vector2d cookbook-snippet from pygame.org at
HOW TO USE
There is no specific pymunk documentation yet except for this readme.
However, The Chipmunk docs should be more or less enough together with ctypes,
as pymunk is just a very low level ctypes binding at the moment.
Chipmunk documentation can be found here:
See demo1.py for an example of how easy it is to use! :)
* A windows-dll of Chipmunk (or a *nix-library if you are on *nix). See COMPILE
for compile-instructions. The dll/lib should be placed somewhere where pymunk
can find it. A safe bet should be in the same folder, at least on Windows ;)
pymunk uses the source from Chipmunk SVN revision 125.
* ctypes (included in python 2.5)
If you are on a platform other than windows, you will have to build Chipmunk
on your own. It should be no problem, the source is included in the
> gcc -O3 -std=gnu99 -ffast-math -c *.c
> gcc -shared -o libChipmunkPyEd.so *.o
or run build.sh (untested!) to compile.
The output should be placed somewhere pymunk can find it.
I have plans to do a more high-level/pythonic wrapper in the future, and even
started a little. But the pyweek library release stop is today(! or tomorrow?),
so the low-level stuff had to do for now.
(log in to comment)