开发者

How to restrict motion to vertical in box2d

I have a box2d body that has a fixture of a ball. It just bounces up and down on top of a rectangular box. Sometimes it will fall off of the box for n开发者_如何学Pythono apparent reason. I there a way to restrict gravity to only vertical so that I can solve this problem?


Or you could use a prismatic joint. Check out this video.


Use b2LineJoint to allow your body to move in one direction only

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜