Skip to content Skip to sidebar Skip to footer

How To Make "compound" Shapes In Pymunk?

As the title says, How can I join/constraint 2 pymunk bodies/shapes so that they don't they act as one single object?? For example, in this case, I have a cricket bat, made up of 2

Solution 1:

The best way to build a complex shape in pymunk is simply to attach the shapes to the same body. So unless you have a good reason why you want them separate I suggest you try and add both shapes to the same body.

However, sometimes you might want to do something else, for example be able to break the objects. I havent really implmented anything myself, but Scott (of Chipmunk) writes in this post http://chipmunk-physics.net/forum/viewtopic.php?f=1&t=2420&p=10644&hilit=breakable#p10644 that using a PivotJoint and a GearJoint might be a good idea to keep the two bodies together.

Post a Comment for "How To Make "compound" Shapes In Pymunk?"