My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages

pymunk is a easy-to-use pythonic 2d physics library that can be used whenever you need 2d rigid body physics from Python. It is built on top of the very nice 2d physics library Chipmunk, http://code.google.com/p/chipmunk-physics/

pymunk vision

Make 2d physics easy to include in your game :)

It is (or striving to be):

  • Easy to use It should be easy to use, no complicated stuff should be needed to add physics to your game/program.
  • "Pythonic" It should not be visible that a c-library (chipmunk) is in the bottom, it should feel like a python library (no strange naming, OO, no memory handling and more)
  • Simple to build & install You shouldnt need to have a zillion of libraries installed to make it install, or do a lot of command line trixs.
  • Multiplatform Should work on both windows, nix and OSX.
  • Non-intrusive It should not put restrictions on how you structure your program and not force you to use a special game loop, it should be possible to use with other libraries like pygame and pyglet.

I hope and believe that with the latest release (2.1.0) these points are mostly fulfilled and visible if you use pymunk.

pymunk 2.1.0!

A bugfix release of pymunk is here!

The most visible change in this release is that now the source release contains all of it including examples and chipmunk src. :) Other fixes are a new velocity limit property of the body, and some removed methods (Reasoning behind removing them and still on same version: You would get an exception calling them anyway. The removal should not affect code that works). Note, all users should create static bodies by setting the input parameters to None, not using infinity. inf will be removed in an upcoming release.

Changes

  • Marked pymunk.inf as deprecated
  • Added velocity limit property to the body
  • Fixed bug on 64bit python
  • Recompiled chipmunk.dll with python 2.5
  • Updated chipmunk src.
  • New method in Vec2d to get int tuple
  • Removed slew and resize hash methods
  • Removed pymunk.init calls from examples/tests
  • Updated examples/tests to create static bodies the good way

Have fun with it!

pymunk 2.0.0!

Today Im happy to announce the new pymunk 2 release!

New goodies in this release comes mainly form the updated chipmunk library. Its now possible for bodies to sleep, there is a new data structure holding the objects and other smaller improvements. The updated version number comes mainly from the new sleep methods.

Another new item in the release is some simplification, you now dont need to initialize pymunk on your own, thats done automatically on import. Another cool feature is that pymunk passes all its unit tests on the latest pypy source which I think is a great thing! Have not had time to do any performance tests, but pypy claims improvements of the ctypes library over cpython.

Note, this release is not completely backwards compatible with pymunk 1.0, some minor adjustments will be necessary (one of the reasons the major version number were increased).

Changes from the last release:

  • Removed init pymunk method, its done automatically on import
  • Support for sleeping bodies.
  • Updated to latest version of Chipmunk
  • More API docs, more unittests.
  • Only dependent on msvcrt.dll on windows now.
  • Removed dependency on setuptools
  • Minor updates on other API, added some missing properties and methods.

Enjoy!

Documentation

See http://pymunk.googlecode.com/svn/tags/pymunk-2.1.0/docs/api/index.html for the API documentation of pymunk 2.1.0.

A snapshot of the latest svn version of the docs is located here: http://pymunk.googlecode.com/svn/trunk/docs/api/index.html

Support

Stackoverflow

You can ask questions/browse old ones at stackoverflow, just look for the pymunk tag. http://stackoverflow.com/questions/tagged/pymunk

Forum

Currently pymunk has no separate forum, but you can use the general Chipmunk forum at http://www.slembcke.net/forums/index.php Many issues are the same, like how to create a rag doll. If you have a pymunk specific question you can mark your post with [pymunk]

Mail

You can mail me: vbxviblo.se (replace x with @)

Tutorial

(Not very updated, instead its better to see the scripts in /examples They are always compatible with the latest release) There is a new tutorial in the wiki area. It will walk you through the slide and pinjoint demo included in the release. Go here to read it: SlideAndPinJointsExample

Screenshots from the included demos

Do you have nice looking screenshots of a game or other program using pymunk that you want to share? Please contact me and Ill put them on display here

From the contact demo, which paints red balls with big radius for big collisions, and small radius for small ones.

From the balls and lines demo. Static lines drawn by the mouse, balls added by mouseclick and growing balls when hoovering above them.

Displays a L shape with two joints, one pin joint in red and one slide joint in green. After a while the L will tip over and release the balls.

Powered by Google Project Hosting