Skip to main content

pymunk is a easy-to-use pythonic 2d physics library built on top of Chipmunk

Project description

ABOUT

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.

2007 - 2011, Victor Blomqvist - vb@viblo.se, MIT License

This release is based on the latest pymunk release (2.1.0), using chipmunk 6.x (github rev 82ba83e, source included)

Homepage:

http://code.google.com/p/pymunk/

Forum:

http://www.slembcke.net/forums/viewforum.php?f=6

Email:

vb@viblo.se

Getting the latest SVN copy:

svn checkout http://pymunk.googlecode.com/svn/trunk pymunk-read-only

Chipmunk:

http://code.google.com/p/chipmunk-physics/

HOW TO USE

pymunk ships with a number of demos in the examples directory, and the API documentation. There is also a few tutorials on the googlecode page and in the (shared) forum.

If chipmunk doesnt ship with a chipmunk binary your platform can understand (currently Windows and Linux 32bit are included) you will have to compile chipmunk before install. See section CHIPMUNK in this readme for (very simple) instructions.

To install you can either run:

> python setup.py install

or simply put the pymunk folder where your program/game can find it. (like /my_python_scripts/yourgame/pymunk). The chipmunk binary library is located in the pymunk folder.

The easy way to get started is to check out the examples/ directory, and run ‘python contact.py’ and so on, and see what it does :) (Note: you will have to place /pymunk in the examples directory if you dont install pymunk to site-packages)

EXAMPLE

See the included demos (in examples/)

DEPENDENCIES/REQUIREMENTS

  • python (tested on 2.5, 2.6, 2.7 and 3.2)

  • ctypes (included in python 2.5)

  • pygame (optional, you need it to run most of the demos)

  • pyglet (optional, you need it to run the moon buggy demo)

  • ctypeslib & GCC_XML (optional, you need them to generate new bindings)

  • chipmunk (pymunk ships with a set of chipmunk libraries)

CHIPMUNK

Compiled libraries of Chipmunk compatible Windows and Linux 32bit are distributed with pymunk. If pymunk doesnt have your particular platform included, you can compile Chipmunk by hand with a custom setup argument:

> python setup.py build_chipmunk

The compiled file goes into the /pymunk folder (same as _chipmunk.py, util.py and others). If the compile fail, please check the readme in chipmunk_src for generic instructions on how to compile with gcc, or download the relevant release from Chipmunk homepage and follow its instructions.

HOW TO GENERATE BINDINGS

(optional – if you want to experiment :)

You will need the ctypes code generator, it is part of the ctypeslib package. You will also need GCC_XML. See the ctypes wiki for instructions on how to set it up: http://starship.python.net/crew/theller/wiki/CodeGenerator

When ctypeslib (h2xml and xml2py) and gcc_xml is installed then run:

> python generate_bindings.py

(use –help to display options, you will most probably want to change the include path and possibly the lib path) you have now created a _chipmunk.py file with generated bindings.

Note: If you only want one or two new functions its probably easier to just add them manually to _chipmunk.py. See the ctypes documentation for instructions on how the function definitons/structs/whatever should look like.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymunk-2.1.0.zip (547.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymunk-2.1.0.win32.exe (452.7 kB view details)

Uploaded Source

File details

Details for the file pymunk-2.1.0.zip.

File metadata

  • Download URL: pymunk-2.1.0.zip
  • Upload date:
  • Size: 547.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymunk-2.1.0.zip
Algorithm Hash digest
SHA256 9f140aeaf9ac5c6758220538b8fd22feb8ea204bc53eb895404c67d1daee9f2c
MD5 bb4e762550eac93d7daf535d8e1c40eb
BLAKE2b-256 3d77db98cbc9d44f3f80ac5dab9f80a8a7a23262cd33188af7f0d2f554396870

See more details on using hashes here.

File details

Details for the file pymunk-2.1.0.win32.exe.

File metadata

  • Download URL: pymunk-2.1.0.win32.exe
  • Upload date:
  • Size: 452.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymunk-2.1.0.win32.exe
Algorithm Hash digest
SHA256 b8c8beddb394a234b57daac48a0deb91bf4a97c1e75208286450925e00b31861
MD5 7462fec7d03306739926fd62c941a72f
BLAKE2b-256 108bb58f394f8df733bb700c8c474d59d60826a74dfdf13441cf8ad6be628cca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page