When I run this little code, which adds 16 boxes on the same position, take one simulation step and then adds 16 more boxes on the same position, and finally tries to step again, but this time it will crash.
Code: Select all
import pymunk as pm
from pymunk import Vec2d
pm.init_pymunk()
space = pm.Space()
for x in [1,2]:
for y in range(16):
size = 10
box_points = map(Vec2d, [(-size, -size), (-size, size), (size,size), (size, -size)])
body = pm.Body(10,20)
shape = pm.Poly(body, box_points, Vec2d(0,0))
space.add(body, shape)
space.step(1/50.0)
The code is in python using pymunk, but from the crash (inside the cpSpaceStep function of chipmunk) I think it's something in chipmunk and not python/pymunk related. It uses the latest trunk of chipmunk.
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app