How do you implement a \"servo\" joint in Pymunk?
I\'m trying to create a simple model where a box is balanced on a single thin \"leg\" below it. I\'ve been able create
A couple of things that can cause problems:
Ignore collisions between the two shapes. Since the motor and pin joint force them together, but collision resolution pushes them apart strange things might happen. You can do this by setting the two shapes to the same group:
shape_filter = pymunk.ShapeFilter(group=1)
shape1.filter = shape_filter
shape2.filter = shape_filter
The center of gravity for the two shapes are at their ends, not in the center. Try to move it to center ([(-50, -1), (50, -1), (50, 1), (-50, 1)]
).
(In this case I think 1 is enough to fix the problem, but I added 2 in case you notice other strange things)