Pymunk servo joint

岁酱吖の 提交于 2019-12-02 02:34:40

A couple of things that can cause problems:

  1. 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

  2. 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)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!