Questions tagged [pymunk]

Pymunk is a 2D physics library for Python built on top of Chipmunk.

Pymunk is a 2D rigid body physics library for Python based on the MIT licensed Chipmunk Project. It's home page is http://www.pymunk.org/en/latest/.

According to the home page, Pymunk is intended to be easy to use and "pythonic". Pymunk allows you to define and simulate the behaviour of objects with mass, position, velocity and collision properties (i.e. a shape) in a 2D space. It is frequently used for game development. Pymunk provides a large number of examples.

Further Information

176 questions
1
vote
0 answers

Making a shape out of a mask

I'm Struggling to find out a way to make a pixel perfect collision shape out of a mask in pymunk. Is there a way to do this? I've built a class in PIL that returns the mask of an image, where the transparent area is black and non-transparent area…
phyce
  • 65
  • 5
1
vote
0 answers

Pymunk Memory leak and/or Hangs

I've been writing a game in Python that requires being able to add and remove a lot of objects from the physics engine. In extreme testing scenarios I can run out of memory is seconds. In normal cases it will take a while to accumulate. After two…
Kaliber64
  • 586
  • 1
  • 5
  • 16
1
vote
1 answer

Pymunk Segment trouble?

I'm using Pymunk 3.0.0 on a Raspberry Pi running Debian Wheezy 7.0. When I try making a shape using the 'pymunk.Segment' function I end up with only the first line of the polygon. The same happens in both the Flipper and BouncingBalls demos so I'm…
1
vote
1 answer

Error with pymunk space.remove method

I have a ball generator, that "generates" and adds balls(circles) to the simulation. The ball is to be removed when it hits a static poly in list s_boxes. This is done by a collision handler ball_wall_collision. The Error: The following pop-up…
pradyunsg
  • 18,287
  • 11
  • 43
  • 96
1
vote
2 answers

Cast an array of pointers to other objects?

I'm trying to send an array of objects to my c library. The object I'm trying to send is a pymunk Body.It has a pointer object embedded in it Body._body. I was able to pass a single one to my function and extract with Chipmunk functions anything I…
Kaliber64
  • 586
  • 1
  • 5
  • 16
1
vote
2 answers

Using Pymunk with Pyinstaller

I have literally found nothing googling that could help. Even for py2exe but I would like to use pyinstaller. My problem is the module (pymunk[aka Chipmunk]) is not fully included in the exe build. It is probably missing some kind of dll. Basically…
Kaliber64
  • 586
  • 1
  • 5
  • 16
1
vote
2 answers

Pymunk (chipmunk) - how to turn off physics/collisions temporarily for concrete object

How to turn off collisions for some objects and then again turn it on using pymunk lib in python? Let me show you the example, based on the code below. I want all red balls to go through first border of lines and stop on the lower border. Blue balls…
Stanyko
  • 95
  • 3
  • 15
1
vote
1 answer

Changing the shape of a pymunk/Chipmunk physics body

I am just getting started with pymunk, and I have a problem that I wasn't able to find a solution to in the documentation. I have a character body that changes shape during a specific animation. I know how to attach shapes to a physics body, but…
1
vote
1 answer

Using pymunk gravity with pyglet

This code displays the image assassin1.png on a black screen standing still at position (50, 80). The goal is to induce the pymunk gravity on that image so that it falls down. I followed the pymunk tutorial which is written using pygame and tried…
Bentley4
  • 10,678
  • 25
  • 83
  • 134
0
votes
0 answers

difference between force and impulse

I'm making my first steps with the pymunk library and i'm reading the documentation. I found this extract: People are sometimes confused by the difference between a force and an impulse. An impulse is a very large force applied over a very short…
baronch
  • 3
  • 3
0
votes
1 answer

Pymunk multi-core collision resolution?

I have a very basic space set up with a large number (10000) of circles falling under gravity. It seems that only one of my cores is active at all at any point in time, but as far as I know collision resolution is extremely parallelizable with space…
AmanKP
  • 95
  • 8
0
votes
0 answers

PyMunk Ray Casting Always Returns False Regardless of Actual Line of Sight

I am working on a billiards game using Python and PyMunk for the physics engine. I have a method in my Decision_Tree class called in_line_of_sight that is supposed to use ray casting to determine whether there is a clear path (i.e., no balls…
0
votes
1 answer

Active ragdoll in pymunk

I'm writing a script in pymunk/pygame to create a character for a game. At this point, I have a ragdoll (the skeleton) with body parts linked by PinJoints. The problem is that in this way I don't have an active ragdoll, but only a dead stickman that…
0
votes
1 answer

Failed building wheel for pymunk using pypy3

I am trying to install pymunk using the command pypy3 -m pip install pymunk The output I get is: Defaulting to user installation because normal site-packages is not writeable Collecting pymunk Using cached pymunk-6.4.0.zip (7.7 MB) Installing…
Zipra
  • 31
  • 6
0
votes
1 answer

Installing Pygame and Pymunk on Mac OS X 10.6

I have not been able to install Pymunk and Pygame for the same version of python. I have tried binaries, source installs, fink, and Macports, for system python, python 2.6, and python 2.7, with 32 and 64 bit versions. In some cases the pymunk unit…