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
精彩评论