Giter Site home page Giter Site logo

viblo / pymunk Goto Github PK

View Code? Open in Web Editor NEW
880.0 21.0 183.0 30.58 MB

Pymunk is a easy-to-use pythonic 2d physics library that can be used whenever you need 2d rigid body physics from Python

Home Page: http://www.pymunk.org

License: MIT License

C 8.86% Python 60.66% Objective-C 0.30% Jupyter Notebook 29.64% Dockerfile 0.03% HTML 0.52%
python physics-2d library pygame pyglet physics-engine physics-simulation python-library

pymunk's Introduction

Pymunk

image

Pymunk is an easy-to-use pythonic 2D physics library that can be used whenever you need 2D rigid body physics from Python. Perfect when you need 2D physics in your game, demo or simulation! It is built on top of the very capable 2D physics library Chipmunk.

The first version was released in 2007 and Pymunk is still actively developed and maintained today, more than 15 years of active development!

Pymunk has been used with success in many projects, big and small. For example: 3 Pyweek game competition winners, dozens of published scientific papers and even in a self-driving car simulation! See the Showcases section on the Pymunk webpage for some examples.

2007 - 2024, Victor Blomqvist - [email protected], MIT License

This release is based on the latest Pymunk release (6.7.0), using Chipmunk 7 rev 2e8d4104b7e2380d1a73f5363a931b3eb3de8d07.

Installation

In the normal case Pymunk can be installed from PyPI with pip:

> pip install pymunk

It has one direct dependency, CFFI.

Pymunk can also be installed with conda, from the conda-forge channel:

> conda install -c conda-forge pymunk

For more detailed installation instructions, please see the complete Pymunk documentation.

Example

Quick code example:

import pymunk               # Import pymunk..

space = pymunk.Space()      # Create a Space which contain the simulation
space.gravity = 0,-981      # Set its gravity

body = pymunk.Body()        # Create a Body
body.position = 50,100      # Set the position of the body

poly = pymunk.Poly.create_box(body) # Create a box shape and attach to body
poly.mass = 10              # Set the mass on the shape
space.add(body, poly)       # Add both body and shape to the simulation

print_options = pymunk.SpaceDebugDrawOptions() # For easy printing 

for _ in range(100):        # Run simulation 100 steps in total
    space.step(0.02)        # Step the simulation one step forward
    space.debug_draw(print_options) # Print the state of the simulation

This will print (to console) the state of the simulation. For more visual, detailed and advanced examples, take a look at the included demos. They are included in the Pymunk install, in the pymunk.examples subpackage. They can be run directly. To list the examples:

> python -m pymunk.examples -l

And to run one of them:

> python -m pymunk.examples.breakout

Contact & Support

Homepage

http://www.pymunk.org/

Stackoverflow

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

E-Mail

You can email me directly at [email protected]

Issue Tracker

Please use the issue tracker at Github to report any issues you find. This is also the place for feature requests: https://github.com/viblo/pymunk/issues

Regardless of the method you use I will try to answer your questions as soon as I see them. (And if you ask on Stackoverflow other people might help as well!)

Documentation

The full documentation including API reference, showcase of usages and screenshots of examples is available on the Pymunk homepage, http://www.pymunk.org

The Pymunk Vision

"Make 2D physics easy to include in your game"

It is (or is striving to be):

  • Easy to use - It should be easy to use, no complicated code should be needed to add physics to your game or 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 shouldn't need to have a zillion of libraries installed to make it install, or do a lot of command line tricks.
  • Multi-platform - 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.

Dependencies / Requirements

Basically Pymunk have been made to be as easy to install and distribute as possible, usually pip install will take care of everything for you.

  • Python (Runs on CPython 3.7 and later and Pypy3)
  • Chipmunk (Prebuilt and included when using binary wheels)
  • CFFI (will be installed automatically by Pip)
  • Setuptools (should be included with Pip)
  • GCC and friends (optional, you need it to compile Pymunk from source. On windows Visual Studio is required to compile)
  • Pygame (optional, you need it to run the Pygame based demos)
  • Pyglet (optional, you need it to run the Pyglet based demos)
  • Matplotlib & Jupyter Notebook (optional, you need it to run the Matplotlib based demos)
  • Numpy (optional, you need to it run a few demos)
  • Sphinx & aafigure & sphinx_autodoc_typehints (optional, you need it to build documentation)

Older Pythons

  • Support for Python 2 (and Python 3.0 - 3.5) was dropped with Pymunk 6.0.
  • Support for Python 3.6 was dropped with Pymunk 6.5.2.

If you use any of these legacy versions of Python, please use an older Pymunk version. (It might work on newer Pymunks as well, but it's not tested, and no wheels are built.)

pymunk's People

Contributors

anthemion avatar berserker66 avatar cclauss avatar conductiveit avatar illume avatar jordanrobertdoerksen avatar mikhail avatar msis avatar norberg avatar oprypin avatar raaperrotta avatar viblo avatar zman97211 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pymunk's Issues

Unable to install pymunk on x64 ubuntu

From [email protected] on December 14, 2008 02:26:46

What steps will reproduce the problem? 1. py setup.py build_chipmunk What is the expected output? What do you see instead? Expected output is a successful build of chipmunk, the occurring error is

running build_chipmunk
compiling chipmunk...
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpSpace.c -o
chipmunk_src/cpSpace.o
chipmunk_src/cpSpace.c: In function ‘queryFunc’:
chipmunk_src/cpSpace.c:411: warning: cast from pointer to integer of
different size
chipmunk_src/cpSpace.c:411: warning: cast from pointer to integer of
different size
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpSpaceHash.c -o
chipmunk_src/cpSpaceHash.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpPolyShape.c -o
chipmunk_src/cpPolyShape.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpShape.c -o
chipmunk_src/cpShape.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpVect.c -o chipmunk_src/cpVect.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpJoint.c -o
chipmunk_src/cpJoint.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpArray.c -o
chipmunk_src/cpArray.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpBody.c -o chipmunk_src/cpBody.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpHashSet.c -o
chipmunk_src/cpHashSet.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/chipmunk.c -o
chipmunk_src/chipmunk.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpCollision.c -o
chipmunk_src/cpCollision.o
chipmunk_src/cpCollision.c: In function ‘findVerts’:
chipmunk_src/cpCollision.c:174: warning: cast from pointer to integer of
different size
chipmunk_src/cpCollision.c:180: warning: cast from pointer to integer of
different size
chipmunk_src/cpCollision.c: In function ‘findPointsBehindSeg’:
chipmunk_src/cpCollision.c:233: warning: cast from pointer to integer of
different size
chipmunk_src/cpCollision.c: In function ‘seg2poly’:
chipmunk_src/cpCollision.c:274: warning: cast from pointer to integer of
different size
chipmunk_src/cpCollision.c:276: warning: cast from pointer to integer of
different size
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpArbiter.c -o
chipmunk_src/cpArbiter.o
cc -O3 -std=gnu99 -ffast-math -c chipmunk_src/cpBB.c -o chipmunk_src/cpBB.o
cc -shared chipmunk_src/cpSpace.o chipmunk_src/cpSpaceHash.o
chipmunk_src/cpPolyShape.o chipmunk_src/cpShape.o chipmunk_src/cpVect.o
chipmunk_src/cpJoint.o chipmunk_src/cpArray.o chipmunk_src/cpBody.o
chipmunk_src/cpHashSet.o chipmunk_src/chipmunk.o chipmunk_src/cpCollision.o
chipmunk_src/cpArbiter.o chipmunk_src/cpBB.o -o pymunk/libchipmunk.so
/usr/bin/ld: chipmunk_src/cpSpace.o: relocation R_X86_64_32 against `a
local symbol' can not be used when making a shared object; recompile with -fPIC
chipmunk_src/cpSpace.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'cc' failed with exit status 1 What version of the product are you using? On what operating system? SVN on Linux godzilla 2.6.27-9-generic #1 SMP Thu Nov 20 22:15:32 UTC 2008
x86_64 GNU/Linux Please provide any additional information below.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=12

py2app compatibility for libload.py

From swiftcoder on July 07, 2008 23:04:50

When using py2app to pack executables on Mac OS X, all supporting libraries (including
libchipmunk.dylib) are placed inside the application bundle, in the 'Content/Frameworks' directory.

I would suggest a modification such as the following to libload.py to account for this case:

...

    if hasattr(sys, "frozen") or hasattr(sys, "importers") or hasattr(imp, "is_frozen") and 

imp.is_forzen("main"):
if 'site-packages.zip' in file:
path = os.path.join(os.path.dirname(os.getcwd()), 'Frameworks')
else:
path = os.path.dirname(os.path.abspath(sys.executable))

...

Original issue: http://code.google.com/p/pymunk/issues/detail?id=6

Crash on OSX in cpCollideShapes

From [email protected] on October 22, 2010 06:17:50

What steps will reproduce the problem? Run the following script:

!/usr/bin/python

from future import print_function, division

import pymunk as pm

vec = pm.Vec2d

space = pm.Space()
space.gravity = vec(0,-9.81)

body = pm.Body(pm.inf,pm.inf)

shape = pm.Segment(body, vec(-100,0), vec(100,0), 0)

shape = pm.Poly(body, [vec(-100,0), vec(100,0), vec(100,-10), vec(-100,-10)])
space.add_static(shape)

ball = pm.Body(1,1)
ball.position = vec(0,2)
shape = pm.Circle(ball, 1)
space.add(ball, shape)

while True:
print(ball.position)
space.step(1/10) What is the expected output? What do you see instead? $ python test.py
Loading chipmunk for Darwin (32bit) [/Users/ata/Library/Python/2.7/lib/python/site-packages/pymunk-1.0.0-py2.7.egg/pymunk/libchipmunk.dylib]
Vec2d(0.0, 2.0)
Vec2d(0.0, 2.0)
Vec2d(0.0, 1.9019)
Vec2d(0.0, 1.7057)
Vec2d(0.0, 1.4114)
Vec2d(0.0, 1.019)
Bus error
$

Crash report:

Process: Python [8779]
Path: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: bash [8745]

Date/Time: 2010-10-22 00:08:20.805 +0200
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6

Interval Since Last Report: 558616 sec
Crashes Since Last Report: 18
Per-App Crashes Since Last Report: 9
Anonymous UUID: C89781A2-37AA-49C8-82FC-7AF014B52CED

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000018
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libchipmunk.dylib 0x0056b3e2 cpCollideShapes + 50
1 libchipmunk.dylib 0x0057426b queryFunc + 363
2 libchipmunk.dylib 0x0057274c cpSpaceHashQuery + 284
3 libchipmunk.dylib 0x00573a48 active2staticIter + 104
4 libchipmunk.dylib 0x0056d7bf cpHashSetEach + 63
5 libchipmunk.dylib 0x00571858 cpSpaceHashEach + 56
6 libchipmunk.dylib 0x00574072 cpSpaceStep + 1090
7 _ctypes.so 0x002f0e3d ffi_call_SYSV + 29 (x86-darwin.S:77)
8 _ctypes.so 0x002f11f1 ffi_call + 97
9 _ctypes.so 0x002eb41f _ctypes_callproc + 687
10 _ctypes.so 0x002e4c12 PyCFuncPtr_call + 274
11 org.python.python 0x0000f375 PyObject_Call + 85
12 org.python.python 0x000c8ad6 PyEval_EvalFrameEx + 14310
13 org.python.python 0x000cbc88 PyEval_EvalFrameEx + 27032
14 org.python.python 0x000cc4ba PyEval_EvalCodeEx + 2042
15 org.python.python 0x000cc647 PyEval_EvalCode + 87
16 org.python.python 0x000f0ae8 PyRun_FileExFlags + 168
17 org.python.python 0x000f1a23 PyRun_SimpleFileExFlags + 867
18 org.python.python 0x0010a42b Py_Main + 3163
19 org.python.python 0x00001f82 0x1000 + 3970
20 org.python.python 0x00001ea9 0x1000 + 3753

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000006 ebx: 0x0056b3c4 ecx: 0x003386c0 edx: 0x00000000
edi: 0x003414d0 esi: 0x0033f600 ebp: 0xbfffeb28 esp: 0xbfffeb18
ss: 0x0000001f efl: 0x00010206 eip: 0x0056b3e2 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x00000018

Binary Images:
0x1000 - 0x1ff5 +org.python.python 2.7.0 (2.7.0) /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
0x5000 - 0x142fe3 +org.python.python 2.7.0, (c) 2004-2008 Python Software Foundation. (2.7.0) <2815ECAD-BE96-97DE-C757-303EB571862B> /Library/Frameworks/Python.framework/Versions/2.7/Python
0x2e0000 - 0x2f2fff +_ctypes.so ??? (???) <58DDBAA8-9719-8196-1645-2EC2484ECE2E> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so
0x500000 - 0x503fff +_struct.so ??? (???) <0770C896-2971-B7E4-99F6-ECC9506E3A18> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so
0x54b000 - 0x54eff7 +operator.so ??? (???) <286CBCF9-86C0-F84F-659C-F3EE95C7D4E1> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so
0x555000 - 0x559fef +math.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/math.so
0x55f000 - 0x562fff +strop.so ??? (???) <255B3A81-AAF1-B616-41BC-C7B31DC15E8E> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so
0x568000 - 0x578ff7 +libchipmunk.dylib ??? (???) <3BBE0ADA-294B-C958-AA3A-F8E6DD9210E4> /Users/ata/Library/Python/2.7/lib/python/site-packages/pymunk-1.0.0-py2.7.egg/pymunk/libchipmunk.dylib
0x5bf000 - 0x5bfff3 +_functools.so ??? (???) <16603A15-F05E-ABA0-1AC4-86CD702988ED> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so
0x8fe00000 - 0x8fe4162b dyld 132.1 (???) /usr/lib/dyld
0x90c63000 - 0x90d10fe7 libobjc.A.dylib 227.0.0 (compatibility 1.0.0) /usr/lib/libobjc.A.dylib
0x9176f000 - 0x9177dfe7 libz.1.dylib 1.2.3 (compatibility 1.0.0) <3CE8AA79-F077-F1B0-A039-9103A4A02E92> /usr/lib/libz.1.dylib
0x93a5a000 - 0x93a5dfe7 libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <1622A54F-1A98-2CBE-B6A4-2122981A500E> /usr/lib/system/libmathCommon.A.dylib
0x93bf1000 - 0x93d73fe7 libicucore.A.dylib 40.0.0 (compatibility 1.0.0) <2314BD12-0821-75BB-F3BC-98D324CFD30A> /usr/lib/libicucore.A.dylib
0x93dfd000 - 0x93e43ff7 libauto.dylib ??? (???) <85670A64-3B67-8162-D441-D8E0BE15CA94> /usr/lib/libauto.dylib
0x94a0a000 - 0x94bb0feb libSystem.B.dylib 125.2.0 (compatibility 1.0.0) <3441F338-2218-6D36-3F95-3A16FBF6713D> /usr/lib/libSystem.B.dylib
0x96077000 - 0x960e1fe7 libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) <411D87F4-B7E1-44EB-F201-F8B4F9227213> /usr/lib/libstdc++.6.dylib
0x98986000 - 0x98b00fe3 com.apple.CoreFoundation 6.6.3 (550.29) <00373783-3744-F47D-2191-BEEA658F0C3D> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0xffff0000 - 0xffff1fff libSystem.B.dylib ??? (???) <3441F338-2218-6D36-3F95-3A16FBF6713D> /usr/lib/libSystem.B.dylib

Model: MacBookPro5,5, BootROM MBP55.00AC.B03, 2 processors, Intel Core 2 Duo, 2.26 GHz, 2 GB, SMC 1.47f2
Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB
Memory Module: global_name
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.10.91.27)
Bluetooth: Version 2.3.7f1, 2 service, 19 devices, 1 incoming serial ports
Network Service: Ethernet, Ethernet, en0
Serial ATA Device: WDC WD6400BEVT-00A0RT0, 596...

Original issue: http://code.google.com/p/pymunk/issues/detail?id=44

Windows installer application configuration is incorrect

From [email protected] on July 29, 2009 14:10:57

What steps will reproduce the problem? 1. Download pymunk-0.8.3.win32.exe on XP SP3
2. Try to run installer
3. Received error dialog reporting
"This application has failed to start because the application configuration
is incorrect. Reinstalling the application may fix this problem.

If it helps, I do not have visual studio installed. Not sure if that is
related.

Thanks,
-Alex

Original issue: http://code.google.com/p/pymunk/issues/detail?id=25

python2.4 compatibility

From [email protected] on July 03, 2008 18:39:13

pymunk fails in python 2.4:
File "[snip]python2.4/site-packages/pymunk-0.8-py2.4.egg/pymunk/util.py",
line 5, in ?
from functools import partial
ImportError: No module named functools

Its the only dependency on 2.5, so with just:

try:

from functools import partial

except ImportError:

def partial(func, *args, **keywords):

        def newfunc(*fargs, **fkeywords):

            newkeywords = keywords.copy()

            newkeywords.update(fkeywords)

            return func(*(args + fargs), **newkeywords)

        newfunc.func = func

        newfunc.args = args

        newfunc.keywords = keywords

        return newfunc

it now works.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=5

shapes sometimes switched in arbiter.shapes

From [email protected] on April 16, 2011 00:56:10

What steps will reproduce the problem? space.add_collision_handler(0,1,handler,None,None,None)

def handler(space, arbiter):
assert(arbiter._get_shapes()[0]._get_collision_type() == 0)
print('right order')

make collision types 0 and 1 collide a lot (such as in the attached file) What is the expected output? What do you see instead? expected: as per http://pymunk.googlecode.com/svn/tags/pymunk-1.0.0/docs/api/pymunk.Arbiter-class.html#shapes , The assertion should always pass.

observed: occasionally the assertion fails. The exception is caught and printed to the screen. The collision handler stops executing at the point of the assert, and the program continues. What version of the product are you using? On what operating system? pymunk-1.0.0.win32-py2.6.msi pymunk 1.0.0 windows runtime installer (msi for python 2.6) Mar 2010
Windows 7 Please provide any additional information below.

Attachment: bugReport.py

Original issue: http://code.google.com/p/pymunk/issues/detail?id=51

Missing file libchipmunk.dylib after install on mac os x

From [email protected] on May 12, 2009 22:19:41

What steps will reproduce the problem? 1. python setup.py install
2. cd examples
3. python demo_contact.py

What is the expected output?
... I expect to see some sort of demo ...

What do you see instead?
Loading chipmunk for Darwin (32bit)
[/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pymunk-0.8.2-py2.5.egg/pymunk/libchipmunk.dylib]
Traceback (most recent call last):
File "demo_contact.py", line 4, in
import pymunk as pm
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pymunk-0.8.2-py2.5.egg/pymunk/init.py",
line 14, in
import pymunk._chipmunk as cp
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pymunk-0.8.2-py2.5.egg/pymunk/_chipmunk.py",
line 8, in
chipmunk_lib = load_library("chipmunk", print_path=_lib_debug)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pymunk-0.8.2-py2.5.egg/pymunk/libload.py",
line 39, in load_library
lib = ctypes.cdll.LoadLibrary(libfn)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ctypes/init.py",
line 431, in LoadLibrary
return self._dlltype(name)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ctypes/init.py",
line 348, in init
self._handle = _dlopen(self._name, mode)
OSError:
dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pymunk-0.8.2-py2.5.egg/pymunk/libchipmunk.dylib,
6): image not found What version of the product are you using? On what operating system? pymunk 0.8.2
mac os x 10.4.11, power pc
python 2.5 Please provide any additional information below. setup log did not show any reference to the dylib file.

% ls
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pymunk-0.8.2-py2.5.egg/pymunk
init.py _chipmunk.py chipmunk.dll libload.py util.py
vec2d.py
init.pyc _chipmunk.pyc libchipmunk.so libload.pyc util.pyc
vec2d.pyc

I've forgotten too much of mac os x to fix this myself. I remember fixing a
similar problem for another project 5 years ago...

Info to help (me!) remember: http://www.finkproject.org/doc/porting/shared.php

Original issue: http://code.google.com/p/pymunk/issues/detail?id=21

can't use vectors in conditional statements

From [email protected] on January 15, 2009 09:24:41

What steps will reproduce the problem? import pymunk

v = pymunk.Vec2d(1,1)
if v: print "one"

z = pymunk.Vec2d(0,0)
if z: print "two" What is the expected output? What do you see instead? Should print "one". Instead receive this error message:

Traceback (most recent call last):
File "", line 1, in
TypeError: nonzero should return bool or int, returned float What version of the product are you using? On what operating system? pymunk 0.8.1 Please provide any additional information below. Fix is to replace nonzero method in class Vec2d with this:

def nonzero(self):
return self.x != 0.0 or self.y != 0.0

Original issue: http://code.google.com/p/pymunk/issues/detail?id=14

"wrong image" for ctypes loader on OSX10.6

From [email protected] on January 04, 2010 10:43:43

What steps will reproduce the problem? 1. Compile pymunk using system Python on OSX10.6. (setup.py build_pymunk)
2. install pymonk
3. import pymonk What is the expected output? What do you see instead? File "libs/pymunk/_chipmunk.py", line 8, in
chipmunk_lib = load_library("chipmunk", print_path=_lib_debug)
File "libs/pymunk/libload.py", line 39, in load_library
lib = ctypes.cdll.LoadLibrary(libfn)
File
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/init.py
", line 423, in LoadLibrary
return self._dlltype(name)
File
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/init.py
", line 345, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/.../code/libs/pymunk/libchipmunk.dylib, 6): no suitable image found. Did
find:
/.../code/libs/pymunk/libchipmunk.dylib: mach-o, but wrong architecture What version of the product are you using? On what operating system? 0.8.4 on Mac OSX10.6.2 Please provide any additional information below. I think build might need supply a 32 and 64 bit version for the Mac. Default system Python 2.6
on OSX10.6 is 64 bit. One from Python site is 32 bit (I believe). I don't want 2 versions of Python
installed.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=36

Shapes added to space as static does not respect angle or position property

From [email protected] on March 18, 2011 10:37:29

What steps will reproduce the problem? 1. Create a body with inf mass and inertia and use it to create a shape.
2. Add the shape to the space with space.add_static(shape)
3. Change the value of shape.body.angle or shape.body.position

The expected result would be that the body is moved or rotated to the angle or position it was changed to. What happens is that the shape.body object will report the new values but the collisions will still occur at the position and angle that was set before the call to space.add_static.

I'm running this on archlinux with pymunk 1.0.0 from archlinux aur

Original issue: http://code.google.com/p/pymunk/issues/detail?id=50

Py3k doesn't like the 'L' on the end of large integers.

From [email protected] on November 09, 2010 02:16:26

What steps will reproduce the problem? 1. Try importing pymunk in Python 3.1.2
2. See the trace below... What is the expected output? What do you see instead? Nothing expected.

Traceback (most recent call last):
File "X:\Documents\BOB SOURCE CODE\workspace\Games2010\src\Destroy\destroy.py", line 14, in
import pymunk
File "X:\Documents\BOB SOURCE CODE\workspace\Games2010\src\Destroy\pymunk__init__.py", line 48, in
import pymunk._chipmunk as cp
File "X:\Documents\BOB SOURCE CODE\workspace\Games2010\src\Destroy\pymunk_chipmunk.py", line 1120
CP_ALL_LAYERS = 4294967295L # Variable c_uint '-1u'
^
SyntaxError: invalid syntax What version of the product are you using? On what operating system? SVN 297, Windows XP SP3 Please provide any additional information below.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=46

_set_elasticity used as a setter for friction property of Arbiter

From pawel.sobkowiak on February 28, 2011 03:02:00

There is a typo due to copy-pasting in Arbiter class: http://code.google.com/p/pymunk/source/browse/trunk/pymunk/__init__.py#1228 There is:
friction = property(_get_friction, _set_elasticity, doc="""Friction""")

Should be:
friction = property(_get_friction, _set_friction, doc="""Friction""")

I have attached a patch to fix this.

Attachment: fix_for_arbiter_friction_setter.patch

Original issue: http://code.google.com/p/pymunk/issues/detail?id=49

Dependency on msvcr90.dll

From [email protected] on April 27, 2009 11:46:29

What steps will reproduce the problem? 1. Install 0.8.2.
2. Get error when using:

File "C:\Python25\lib\ctypes__init__.py", line 348, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

  1. Using Dependency Walker, see missing dependency: msvcr90.dll

Either include the DLL with the installer, or build a statically-linked
version.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=19

segment_query_first fails on static objects

From [email protected] on January 15, 2011 22:20:25

What steps will reproduce the problem? 1. Make a static object
2. segment_query_first with a segment intersecting that object
3. Get a hash table key error What is the expected output? What do you see instead? Expect the static object to be returned. What version of the product are you using? On what operating system? pymunk 1.0.0 on Windows 7 64-bit, Python 2.6.5

Original issue: http://code.google.com/p/pymunk/issues/detail?id=48

Typo in vector multiplication routine

From [email protected] on October 20, 2008 22:42:08

Typo in vector multiplication routine (y instead of x). See patch below.

BTW, thanks for pymunk. I just love it!

Index: pymunk/vec2d.py

--- pymunk/vec2d.py ( revision 146 )
+++ pymunk/vec2d.py (working copy)
@@ -148,7 +148,7 @@
# Multiplication
def mul(self, other):
if isinstance(other, Vec2d):

  •        return Vec2d(self.x_other.y, self.y_other.y)
    
  •        return Vec2d(self.x_other.x, self.y_other.y)
     if (hasattr(other, "**getitem**")):
         return Vec2d(self.x_other[0], self.y_other[1])
     else:
    

Original issue: http://code.google.com/p/pymunk/issues/detail?id=10

libchipmunk.so not moved to expected location

From [email protected] on September 08, 2008 08:52:59

What steps will reproduce the problem? 1. download pymunk-0.8
2. sudo python setup.py install
3. run example (i.e. box2d_vertical_stack.py) What is the expected output? What do you see instead? I expect to see the simulation run. Instead I get this error:

python -u "box2d_vertical_stack.py"
Loading chipmunk for Linux (32bit)
[/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/libchipmunk32.so]
Loading chipmunk for Linux (32bit)
[/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/libchipmunk.so]
Traceback (most recent call last):
File "box2d_vertical_stack.py", line 11, in
import pymunk
File
"/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/init.py",
line 14, in
import _chipmunk as cp
File
"/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/_chipmunk.py", line
8, in
chipmunk_lib = load_library("chipmunk", print_path=_lib_debug)
File
"/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/libload.py",
line 44, in load_library
lib = ctypes.cdll.LoadLibrary(libfn)
File "ctypes/init.py", line 431, in LoadLibrary
File "ctypes/init.py", line 348, in init
OSError:
/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/libchipmunk.so: cannot
open shared object file: No such file or directory What version of the product are you using? On what operating system? Ubuntu 7.10
PyMunk 0.8
Python 2.5 Please provide any additional information below. I fixed this by manually copying the file as follows:

localhost:/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk$ pwd
/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk
localhost:/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk$ cp
/home/user/Desktop/pymunk-0.8/pymunk/libchipmunk.so ./

Original issue: http://code.google.com/p/pymunk/issues/detail?id=7

Forgotten binding to space.elasticIterations

From [email protected] on February 18, 2009 03:31:50

What steps will reproduce the problem? 1. create a Space object
2. try to set space.elasticIterations What is the expected output? What do you see instead? The expected output is that it will work and things will now be bouncy
again (using Chipmunk 4.1.0 or newer). I see an error message. What version of the product are you using? On what operating system? I use pymunk 0.8.1 and Chipmunk 4.1.0. Please provide any additional information below. It works if I type:
space._space.contents.elasticIterations = 10
I think this makes more sense:
space.elasticIterations = 10

THANKS FOR THIS GREAT BINDING! :D

Original issue: http://code.google.com/p/pymunk/issues/detail?id=18

Body angle seems wrong on Mac

From [email protected] on January 17, 2010 04:13:51

What steps will reproduce the problem? 1. Create bodies and collide them so they rotate.
2. Read angle. It seems too small. What is the expected output? What do you see instead? An angle 0-359. I get 6.61257175138e-15. What version of the product are you using? On what operating system? Mac 10.6. System Python in 32 bit mode. Please provide any additional information below.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=38

Missing a way to store userdata in structures

From txprog on September 09, 2009 06:32:44

If we made a class who manipulate some Segment or Circle as example (like
having the same class for physics and drawing), if we want to use the
collide callback, you must maintain a ourself the link between the physics
and the real class.

A userdata property (like a dict) to store any information can be good !

eg:

def collide_found(shapeA, shapeB, *largs):
my_original_class_A = shapeA.userdata['class']
my_original_class_B = shapeB.userdata['class']

class TestClass:
def init(self):
self.seg = pymunk.Segment(body, (0, 0), (10, 0))
self.seg.userdata['class'] = self

etc... :)

Original issue: http://code.google.com/p/pymunk/issues/detail?id=27

collisions not working.

From [email protected] on January 19, 2009 01:39:41

What steps will reproduce the problem? http://www.megaupload.com/?d=CARMDEFG -> run test.py What is the expected output? What do you see instead? I expect the lower ball to bounce of the upper one. What version of the product are you using? On what operating system? 0.8.1 Please provide any additional information below. I have written some classes around the pymunk for experimentation.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=15

Error in libload under Windows Vista

From [email protected] on June 18, 2008 04:02:52

What steps will reproduce the problem? 1. Install Pymunk 0.8 on Vista Premium 32 bit
2. In console, "import pymunk"

Expect to see Pymunk import correctly. Instead, get UnboundLocalError:
local variable 'libfn' referenced before assignment in libload.py

Think this is because under Vista 32 bit, platform.system() returns
'Microsoft' and not 'Windows' as expected in libload. Suggest adding
another condition to handle this - see attached example

Attachment: libload.py

Original issue: http://code.google.com/p/pymunk/issues/detail?id=4

Py3k doesn't like mixing bytes and strings

From [email protected] on November 09, 2010 02:20:31

What steps will reproduce the problem? 1. import pymunk
2. See traceback... What is the expected output? What do you see instead? No expected output...

Loading chipmunk for Windows (32bit) [X:\Documents\BOB SOURCE CODE\workspace\Games2010\src\Destroy\pymunk\chipmunk.dll]
Traceback (most recent call last):
File "X:\Documents\BOB SOURCE CODE\workspace\Games2010\src\Destroy\destroy.py", line 14, in
import pymunk
File "X:\Documents\BOB SOURCE CODE\workspace\Games2010\src\Destroy\pymunk__init__.py", line 60, in
chipmunk_version = cp.cpVersionString.value + " r585 "
TypeError: can't concat bytes to str What version of the product are you using? On what operating system? svn 297, Windows XP SP3 Please provide any additional information below.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=47

Elastic collisions do not work. Fix inside.

From [email protected] on December 13, 2008 05:06:22

What steps will reproduce the problem? 1. Try to set an object's elasticity.
2. Notice that it doesn't do diddly squat. Everything is still inelastic. What is the expected output? What do you see instead? Well, I wanted to give my collisions some elasticity, but it wouldn't work. What version of the product are you using? On what operating system? All of them. Please provide any additional information below. You can fix the problem by setting
your_space._space.contents.elasticIterations = 5

This should be easy to add to the source. I would do it myself, but I don't
really want to mess with it right now. I have things to do.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=11

build_chipmunk setup command fails on 64 bit

From [email protected] on July 16, 2009 12:55:27

the setup script has a small over sight in it that causes the build script
to fail for build_chipmunk 0.8.2 on 64 bit.

in the script it has

linker_preargs += '-fPIC' on line 47

but it should be

linker_preargs += ['-fPIC']

which is causing the compilation command to be
cc -shared - f P I C [files...]
which is broken compared with what it should be
cc -shared -fPIC [files...]

Original issue: http://code.google.com/p/pymunk/issues/detail?id=24

libchipmunk.so compiled without PIC, causing SELinux problems

From [email protected] on January 04, 2010 17:32:54

What steps will reproduce the problem? 1. Try to load pymunk on SELinux system
2. See eu-findtextrel throw a fit
3. File bug Please provide any additional information below. The libchipmunk.so in the repo isn't compiled with -fPIC or -fpic, which
causes it to attempt text relocation for every single symbol. This isn't a
problem, except that SELinux absolutely hates it.

This is justified for libraries like libGL.so which need text relocs, but
chipmunk doesn't need it, so this should be changed.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=37

SVN version works, Downloads link don't

From [email protected] on September 17, 2008 00:47:06

What steps will reproduce the problem? Downloading pymunk from http://pymunk.googlecode.com/files/pymunk-0.8.zip and trying to install it. What is the expected output? What do you see instead? when finished, I open python:

import pymunk
Loading chipmunk for Linux (32bit)
[/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/libchipmunk32.so]
Loading chipmunk for Linux (32bit)
[/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/libchipmunk.so]
Traceback (most recent call last):
File "", line 1, in
File
"/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/init.py",
line 14, in
import _chipmunk as cp
File
"/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/_chipmunk.py", line
8, in
chipmunk_lib = load_library("chipmunk", print_path=_lib_debug)
File
"/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/libload.py",
line 44, in load_library
lib = ctypes.cdll.LoadLibrary(libfn)
File "/usr/lib/python2.5/ctypes/init.py", line 431, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python2.5/ctypes/init.py", line 348, in init
self._handle = _dlopen(self._name, mode)
OSError:
/usr/lib/python2.5/site-packages/pymunk-0.8-py2.5.egg/pymunk/libchipmunk.so: cannot
open shared object file: No such file or directory What version of the product are you using? On what operating system? OS: Debian Lenny.
python 2.5 Please provide any additional information below. I solved it installing from svn. http://pymunk.googlecode.com/files/pymunk-0.8.zip could be updated :)

Original issue: http://code.google.com/p/pymunk/issues/detail?id=8

demo_balls_and_lines.py mouse collide does not work as expected

From joss82 on June 18, 2008 02:53:30

What steps will reproduce the problem? 1. launch demo_balls_and_lines.py
2. create a cup with RMB or any static shape that can contains balls.
3. Put balls in the "cup"
4. Move your mouse cursor over a ball : nothing happens. What is the expected output? What do you see instead? As said in the source code, moving the mouse cursor over a shape should
make it bigger.
Instead, there is no perceptible effect (in fact, the shape representing
the mouse cursor is "falling" down). Please provide any additional information below. I know this seems no big deal but the "add_collisionpair_func" mechanism is
actually key to mouse interaction with the simulation.

Thanks

Original issue: http://code.google.com/p/pymunk/issues/detail?id=3

cpVect breaks pymunk callbacks

From [email protected] on June 24, 2009 04:14:42

from pymunk._chipmunk import cpVect
from ctypes import CFUNCTYPE
def fuh(vec):
... print vec
...
fnp = CFUNCTYPE(None, cpVect)(fuh)
fnp(cpVect(1,2))
create argument 0:
TypeError: init() takes at least 2 arguments (1 given)
def ah():
... print 'guh'
...
bah = CFUNCTYPE(None)(ah)
bah()
guh

Ok, this should obviously work! Otherwise every callback that has cpVect as
an argument just breaks.

For instance, I have this nifty godfinger -class, which will really much
benefit if it can have it's velocity updated. It does this:

self.body._bodycontents.velocity_func = cpBodyVelocityFunc(
    self.update_velocity
)

(which, I guess, I could write in to the pymunk.)

Ok, anyway I found out a hack that does it:

class Vec2d(ctypes.Structure):
...
def init(self, x_or_pair = None, y = None):
if x_or_pair != None:
if y == None:
self.x = x_or_pair[0]
self.y = x_or_pair[1]
else:
self.x = x_or_pair
self.y = y
...

After I make the x_or_pair an optional argument, it starts working.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=23

setup.py -fPIC flags

From [email protected] on May 06, 2009 00:10:35

symptom:

$ python setup.py build_chipmunk
running build_chipmunk
compiling chipmunk...
cc -shared - f P I C chipmunk_src/cpArbiter.o chipmunk_src/chipmunk.o
chipmunk_src/cpCollision.o chipmunk_src/cpBB.o chipmunk_src/cpHashSet.o
chipmunk_src/cpSpaceHash.o chipmunk_src/cpShape.o chipmunk_src/cpVect.o
chipmunk_src/cpArray.o chipmunk_src/cpJoint.o chipmunk_src/cpBody.o
chipmunk_src/cpPolyShape.o chipmunk_src/cpSpace.o -o pymunk/libchipmunk.so
cc: f: No such file or directory
cc: P: No such file or directory
cc: I: No such file or directory
cc: C: No such file or directory
cc: -E or -x required when input is from standard input
error: command 'cc' failed with exit status 1

fix:
@@ -44,7 +44,7 @@
libname = compiler.library_filename(libname, lib_type='shared')
linker_preargs = []
if platform.system() == 'Linux' and platform.machine() == 'x86_64':

  •        linker_preargs += '-fPIC'
    
  •        linker_preargs += ['-fPIC']
    
     compiler.link(cc.CCompiler.SHARED_LIBRARY, objs, libname,
    

    output_dir = 'pymunk', extra_preargs=linker_preargs)

Original issue: http://code.google.com/p/pymunk/issues/detail?id=20

Error accessing Arbiter's is_first_contact property

From [email protected] on July 15, 2010 05:07:57

What steps will reproduce the problem? 1. Add a post_solve callback collision handler to space.
2. Inside the callback function, try to access arbiter.is_first_contact What is the expected output? What do you see instead? Here is the traceback from python:

Traceback (most recent call last):
File "_ctypes/callbacks.c", line 295, in 'calling callback function'
File "/Users/pnguyen/Projects/FarmGame/pymunk/init.py", line 421, in cf
return func(self, arbiter, _args, *_kwargs)
File "/Users/pnguyen/Projects/FarmGame/gamemap.py", line 201, in my_post_solve
if not arbiter.is_first_contact:
File "/Users/pnguyen/Projects/FarmGame/pymunk/init.py", line 1212, in _get_is_first_contact
return bool(self._arbiter.contents.firstColl)
AttributeError: 'cpArbiter' object has no attribute 'firstColl' What version of the product are you using? On what operating system? pymunk 1.0.0 on Mac OS 10.6.4 Please provide any additional information below. I made the following change to the Arbiter class in init.py to
potentially fix the problem (line 1211 or so):

def _get_is_first_contact(self):
    #return bool(self._arbiter.contents.firstColl)
    return bool(cp._cpArbiterIsFirstContact(self._arbiter))

However, since I only barely understand what I'm doing, a sanity check would be good.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=41

chipmunk compile is required on x64(linux)

From [email protected] on June 23, 2009 17:47:23

What steps will reproduce the problem? 1. Have a 64bit linux system.
2. easy_install pymunk

Instead of installing the library, easy_install fails.

I solved the problem locally by downloading pymunk-0.8.2 sources, then
compiled chipmunk manually and replaced libchipmunk.so with compiled
version. This was approximately a 40 second step.

Doing this isn't a trouble for a decent programmer, though perhaps should
be documented into README?

Another possibility would be to put in the 64bit .so there as well. Sure,
if you get it working. Notice that you should somehow detect in which mode
the python is running.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=22

"AssertionError: shape already added to space"

From [email protected] on August 30, 2010 12:56:30

What steps will reproduce the problem? 1. OSX +64-bit Python
2. Run pymunk unit tests. What is the expected output? What do you see instead? As discussed here: http://www.sweclockers.com/forum/10-programmering-och-digitalt-skapande/909659-python-osx-testa-mitt-fysiklib/ What version of the product are you using? On what operating system? Trunk, on OS-X Snow Leopard, with a 64-bit Python. Please provide any additional information below. I mainly filed this bug so that there will be a common location for people to track the issue.

Original issue: http://code.google.com/p/pymunk/issues/detail?id=42

Crash on OSX in cpCollideShapes

From [email protected] on October 22, 2010 06:17:42

What steps will reproduce the problem? Run the following script:

!/usr/bin/python

from future import print_function, division

import pymunk as pm

vec = pm.Vec2d

space = pm.Space()
space.gravity = vec(0,-9.81)

body = pm.Body(pm.inf,pm.inf)

shape = pm.Segment(body, vec(-100,0), vec(100,0), 0)

shape = pm.Poly(body, [vec(-100,0), vec(100,0), vec(100,-10), vec(-100,-10)])
space.add_static(shape)

ball = pm.Body(1,1)
ball.position = vec(0,2)
shape = pm.Circle(ball, 1)
space.add(ball, shape)

while True:
print(ball.position)
space.step(1/10) What is the expected output? What do you see instead? $ python test.py
Loading chipmunk for Darwin (32bit) [/Users/ata/Library/Python/2.7/lib/python/site-packages/pymunk-1.0.0-py2.7.egg/pymunk/libchipmunk.dylib]
Vec2d(0.0, 2.0)
Vec2d(0.0, 2.0)
Vec2d(0.0, 1.9019)
Vec2d(0.0, 1.7057)
Vec2d(0.0, 1.4114)
Vec2d(0.0, 1.019)
Bus error
$

Crash report:

Process: Python [8779]
Path: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: bash [8745]

Date/Time: 2010-10-22 00:08:20.805 +0200
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6

Interval Since Last Report: 558616 sec
Crashes Since Last Report: 18
Per-App Crashes Since Last Report: 9
Anonymous UUID: C89781A2-37AA-49C8-82FC-7AF014B52CED

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000018
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libchipmunk.dylib 0x0056b3e2 cpCollideShapes + 50
1 libchipmunk.dylib 0x0057426b queryFunc + 363
2 libchipmunk.dylib 0x0057274c cpSpaceHashQuery + 284
3 libchipmunk.dylib 0x00573a48 active2staticIter + 104
4 libchipmunk.dylib 0x0056d7bf cpHashSetEach + 63
5 libchipmunk.dylib 0x00571858 cpSpaceHashEach + 56
6 libchipmunk.dylib 0x00574072 cpSpaceStep + 1090
7 _ctypes.so 0x002f0e3d ffi_call_SYSV + 29 (x86-darwin.S:77)
8 _ctypes.so 0x002f11f1 ffi_call + 97
9 _ctypes.so 0x002eb41f _ctypes_callproc + 687
10 _ctypes.so 0x002e4c12 PyCFuncPtr_call + 274
11 org.python.python 0x0000f375 PyObject_Call + 85
12 org.python.python 0x000c8ad6 PyEval_EvalFrameEx + 14310
13 org.python.python 0x000cbc88 PyEval_EvalFrameEx + 27032
14 org.python.python 0x000cc4ba PyEval_EvalCodeEx + 2042
15 org.python.python 0x000cc647 PyEval_EvalCode + 87
16 org.python.python 0x000f0ae8 PyRun_FileExFlags + 168
17 org.python.python 0x000f1a23 PyRun_SimpleFileExFlags + 867
18 org.python.python 0x0010a42b Py_Main + 3163
19 org.python.python 0x00001f82 0x1000 + 3970
20 org.python.python 0x00001ea9 0x1000 + 3753

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000006 ebx: 0x0056b3c4 ecx: 0x003386c0 edx: 0x00000000
edi: 0x003414d0 esi: 0x0033f600 ebp: 0xbfffeb28 esp: 0xbfffeb18
ss: 0x0000001f efl: 0x00010206 eip: 0x0056b3e2 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x00000018

Binary Images:
0x1000 - 0x1ff5 +org.python.python 2.7.0 (2.7.0) /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
0x5000 - 0x142fe3 +org.python.python 2.7.0, (c) 2004-2008 Python Software Foundation. (2.7.0) <2815ECAD-BE96-97DE-C757-303EB571862B> /Library/Frameworks/Python.framework/Versions/2.7/Python
0x2e0000 - 0x2f2fff +_ctypes.so ??? (???) <58DDBAA8-9719-8196-1645-2EC2484ECE2E> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so
0x500000 - 0x503fff +_struct.so ??? (???) <0770C896-2971-B7E4-99F6-ECC9506E3A18> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so
0x54b000 - 0x54eff7 +operator.so ??? (???) <286CBCF9-86C0-F84F-659C-F3EE95C7D4E1> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so
0x555000 - 0x559fef +math.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/math.so
0x55f000 - 0x562fff +strop.so ??? (???) <255B3A81-AAF1-B616-41BC-C7B31DC15E8E> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so
0x568000 - 0x578ff7 +libchipmunk.dylib ??? (???) <3BBE0ADA-294B-C958-AA3A-F8E6DD9210E4> /Users/ata/Library/Python/2.7/lib/python/site-packages/pymunk-1.0.0-py2.7.egg/pymunk/libchipmunk.dylib
0x5bf000 - 0x5bfff3 +_functools.so ??? (???) <16603A15-F05E-ABA0-1AC4-86CD702988ED> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so
0x8fe00000 - 0x8fe4162b dyld 132.1 (???) /usr/lib/dyld
0x90c63000 - 0x90d10fe7 libobjc.A.dylib 227.0.0 (compatibility 1.0.0) /usr/lib/libobjc.A.dylib
0x9176f000 - 0x9177dfe7 libz.1.dylib 1.2.3 (compatibility 1.0.0) <3CE8AA79-F077-F1B0-A039-9103A4A02E92> /usr/lib/libz.1.dylib
0x93a5a000 - 0x93a5dfe7 libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <1622A54F-1A98-2CBE-B6A4-2122981A500E> /usr/lib/system/libmathCommon.A.dylib
0x93bf1000 - 0x93d73fe7 libicucore.A.dylib 40.0.0 (compatibility 1.0.0) <2314BD12-0821-75BB-F3BC-98D324CFD30A> /usr/lib/libicucore.A.dylib
0x93dfd000 - 0x93e43ff7 libauto.dylib ??? (???) <85670A64-3B67-8162-D441-D8E0BE15CA94> /usr/lib/libauto.dylib
0x94a0a000 - 0x94bb0feb libSystem.B.dylib 125.2.0 (compatibility 1.0.0) <3441F338-2218-6D36-3F95-3A16FBF6713D> /usr/lib/libSystem.B.dylib
0x96077000 - 0x960e1fe7 libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) <411D87F4-B7E1-44EB-F201-F8B4F9227213> /usr/lib/libstdc++.6.dylib
0x98986000 - 0x98b00fe3 com.apple.CoreFoundation 6.6.3 (550.29) <00373783-3744-F47D-2191-BEEA658F0C3D> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0xffff0000 - 0xffff1fff libSystem.B.dylib ??? (???) <3441F338-2218-6D36-3F95-3A16FBF6713D> /usr/lib/libSystem.B.dylib

Model: MacBookPro5,5, BootROM MBP55.00AC.B03, 2 processors, Intel Core 2 Duo, 2.26 GHz, 2 GB, SMC 1.47f2
Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB
Memory Module: global_name
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.10.91.27)
Bluetooth: Version 2.3.7f1, 2 service, 19 devices, 1 incoming serial ports
Network Service: Ethernet, Ethernet, en0
Serial ATA Device: WDC WD6400BEVT-00A0RT0, 596...

Original issue: http://code.google.com/p/pymunk/issues/detail?id=43

OverflowError in examples/pymunx.py

From [email protected] on March 03, 2010 16:14:26

First of all, thanks for this wrapper. Really useful.
Now, I somehow managed to generate this exception by dropping a polygon on
a lot of balls... no idea what I did exactly, but thought you might want to
know.

pymunk-0.8.4/examples$ python pymunx_demo8_gravityfun.py
Loading chipmunk for Linux (32bit)
[/usr/lib/python2.6/site-packages/pymunk/libchipmunk.so]
Traceback (most recent call last):
File "pymunx_demo8_gravityfun.py", line 252, in
main()
File "pymunx_demo8_gravityfun.py", line 227, in main
world.draw(screen)
File "/tmp/pymunk-0.8.4/examples/pymunx.py", line 410, in draw
if not self.draw_shape(surface, shape):
File "
/tmp/pymunk-0.8.4/examples/pymunx.py", line 446, in draw_shape
pygame.draw.circle(surface, shape.color, p, int(r), 3)
OverflowError: long int too large to convert to int

Greetings from Germany,
Felix

Original issue: http://code.google.com/p/pymunk/issues/detail?id=39

Crash on OSX in cpCollideShapes

From [email protected] on October 22, 2010 06:18:25

What steps will reproduce the problem? Run the following script:

!/usr/bin/python

from future import print_function, division

import pymunk as pm

vec = pm.Vec2d

space = pm.Space()
space.gravity = vec(0,-9.81)

body = pm.Body(pm.inf,pm.inf)

shape = pm.Segment(body, vec(-100,0), vec(100,0), 0)

shape = pm.Poly(body, [vec(-100,0), vec(100,0), vec(100,-10), vec(-100,-10)])
space.add_static(shape)

ball = pm.Body(1,1)
ball.position = vec(0,2)
shape = pm.Circle(ball, 1)
space.add(ball, shape)

while True:
print(ball.position)
space.step(1/10) What is the expected output? What do you see instead? $ python test.py
Loading chipmunk for Darwin (32bit) [/Users/ata/Library/Python/2.7/lib/python/site-packages/pymunk-1.0.0-py2.7.egg/pymunk/libchipmunk.dylib]
Vec2d(0.0, 2.0)
Vec2d(0.0, 2.0)
Vec2d(0.0, 1.9019)
Vec2d(0.0, 1.7057)
Vec2d(0.0, 1.4114)
Vec2d(0.0, 1.019)
Bus error
$

Crash report:

Process: Python [8779]
Path: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: bash [8745]

Date/Time: 2010-10-22 00:08:20.805 +0200
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6

Interval Since Last Report: 558616 sec
Crashes Since Last Report: 18
Per-App Crashes Since Last Report: 9
Anonymous UUID: C89781A2-37AA-49C8-82FC-7AF014B52CED

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000018
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libchipmunk.dylib 0x0056b3e2 cpCollideShapes + 50
1 libchipmunk.dylib 0x0057426b queryFunc + 363
2 libchipmunk.dylib 0x0057274c cpSpaceHashQuery + 284
3 libchipmunk.dylib 0x00573a48 active2staticIter + 104
4 libchipmunk.dylib 0x0056d7bf cpHashSetEach + 63
5 libchipmunk.dylib 0x00571858 cpSpaceHashEach + 56
6 libchipmunk.dylib 0x00574072 cpSpaceStep + 1090
7 _ctypes.so 0x002f0e3d ffi_call_SYSV + 29 (x86-darwin.S:77)
8 _ctypes.so 0x002f11f1 ffi_call + 97
9 _ctypes.so 0x002eb41f _ctypes_callproc + 687
10 _ctypes.so 0x002e4c12 PyCFuncPtr_call + 274
11 org.python.python 0x0000f375 PyObject_Call + 85
12 org.python.python 0x000c8ad6 PyEval_EvalFrameEx + 14310
13 org.python.python 0x000cbc88 PyEval_EvalFrameEx + 27032
14 org.python.python 0x000cc4ba PyEval_EvalCodeEx + 2042
15 org.python.python 0x000cc647 PyEval_EvalCode + 87
16 org.python.python 0x000f0ae8 PyRun_FileExFlags + 168
17 org.python.python 0x000f1a23 PyRun_SimpleFileExFlags + 867
18 org.python.python 0x0010a42b Py_Main + 3163
19 org.python.python 0x00001f82 0x1000 + 3970
20 org.python.python 0x00001ea9 0x1000 + 3753

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000006 ebx: 0x0056b3c4 ecx: 0x003386c0 edx: 0x00000000
edi: 0x003414d0 esi: 0x0033f600 ebp: 0xbfffeb28 esp: 0xbfffeb18
ss: 0x0000001f efl: 0x00010206 eip: 0x0056b3e2 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x00000018

Binary Images:
0x1000 - 0x1ff5 +org.python.python 2.7.0 (2.7.0) /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
0x5000 - 0x142fe3 +org.python.python 2.7.0, (c) 2004-2008 Python Software Foundation. (2.7.0) <2815ECAD-BE96-97DE-C757-303EB571862B> /Library/Frameworks/Python.framework/Versions/2.7/Python
0x2e0000 - 0x2f2fff +_ctypes.so ??? (???) <58DDBAA8-9719-8196-1645-2EC2484ECE2E> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so
0x500000 - 0x503fff +_struct.so ??? (???) <0770C896-2971-B7E4-99F6-ECC9506E3A18> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so
0x54b000 - 0x54eff7 +operator.so ??? (???) <286CBCF9-86C0-F84F-659C-F3EE95C7D4E1> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so
0x555000 - 0x559fef +math.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/math.so
0x55f000 - 0x562fff +strop.so ??? (???) <255B3A81-AAF1-B616-41BC-C7B31DC15E8E> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so
0x568000 - 0x578ff7 +libchipmunk.dylib ??? (???) <3BBE0ADA-294B-C958-AA3A-F8E6DD9210E4> /Users/ata/Library/Python/2.7/lib/python/site-packages/pymunk-1.0.0-py2.7.egg/pymunk/libchipmunk.dylib
0x5bf000 - 0x5bfff3 +_functools.so ??? (???) <16603A15-F05E-ABA0-1AC4-86CD702988ED> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so
0x8fe00000 - 0x8fe4162b dyld 132.1 (???) /usr/lib/dyld
0x90c63000 - 0x90d10fe7 libobjc.A.dylib 227.0.0 (compatibility 1.0.0) /usr/lib/libobjc.A.dylib
0x9176f000 - 0x9177dfe7 libz.1.dylib 1.2.3 (compatibility 1.0.0) <3CE8AA79-F077-F1B0-A039-9103A4A02E92> /usr/lib/libz.1.dylib
0x93a5a000 - 0x93a5dfe7 libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <1622A54F-1A98-2CBE-B6A4-2122981A500E> /usr/lib/system/libmathCommon.A.dylib
0x93bf1000 - 0x93d73fe7 libicucore.A.dylib 40.0.0 (compatibility 1.0.0) <2314BD12-0821-75BB-F3BC-98D324CFD30A> /usr/lib/libicucore.A.dylib
0x93dfd000 - 0x93e43ff7 libauto.dylib ??? (???) <85670A64-3B67-8162-D441-D8E0BE15CA94> /usr/lib/libauto.dylib
0x94a0a000 - 0x94bb0feb libSystem.B.dylib 125.2.0 (compatibility 1.0.0) <3441F338-2218-6D36-3F95-3A16FBF6713D> /usr/lib/libSystem.B.dylib
0x96077000 - 0x960e1fe7 libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) <411D87F4-B7E1-44EB-F201-F8B4F9227213> /usr/lib/libstdc++.6.dylib
0x98986000 - 0x98b00fe3 com.apple.CoreFoundation 6.6.3 (550.29) <00373783-3744-F47D-2191-BEEA658F0C3D> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0xffff0000 - 0xffff1fff libSystem.B.dylib ??? (???) <3441F338-2218-6D36-3F95-3A16FBF6713D> /usr/lib/libSystem.B.dylib

Model: MacBookPro5,5, BootROM MBP55.00AC.B03, 2 processors, Intel Core 2 Duo, 2.26 GHz, 2 GB, SMC 1.47f2
Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB
Memory Module: global_name
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.10.91.27)
Bluetooth: Version 2.3.7f1, 2 service, 19 devices, 1 incoming serial ports
Network Service: Ethernet, Ethernet, en0
Serial ATA Device: WDC WD6400BEVT-00A0RT0, 596...

Original issue: http://code.google.com/p/pymunk/issues/detail?id=45

Compile problem with example code

From [email protected] on October 07, 2008 04:40:38

Note: This is a problem with the documentation, not the module itself. What steps will reproduce the problem? To to the SlideAndPinJointsExample at http://code.google.com/p/pymunk/wiki/SlideAndPinJointsExample A lot of code uses vec2d instead of Vec2d. (Be careful not to do a search-
and-replace, though, as the module is called vec2d and the class is called
Vec2d) What version of the product are you using? On what operating system? PyMunk 0.8, Win32

Original issue: http://code.google.com/p/pymunk/issues/detail?id=9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.