I am running into a few challenges trying to rotate a body by dragging a separate body at the end of an attached chain of bodies, connected via revolute joints. Here is a picture of what I have:

BoxAndChain.tiff [ 165.75 KiB | Viewed 109 times ]
The body has several fixtures:
What I would like to do is be able to drag the end of the “chain” and cause the main body (and "hook" fixtures) to rotate in position as a result of the movement of the chain. I am able to get the chain to move by attaching a mousejoint to the last/end body in the chain when a touch occurs, however I am encountering a few problems:
Am I going to be able to achieve this type of movement within box2D? Also, is there a way to "strengthen" the revolute joints so they do not pull apart or rotate beyond the specified limits? Should I be using a different type of joint?
Any suggestions or insights would be greatly appreciated.
Thanks!
Attachment:
BoxAndChain.tiff [ 165.75 KiB | Viewed 109 times ]
The body has several fixtures:
- 1. The pink box in the center represents the main object and is defined as a sensor fixture.
2. The top 2 small boxes represent “hooks” that allow the body to rest on static bodies/platforms in the world (the one long flat green box in the center).
3. The series of thin boxes below the main body fixture represent a hanging chain/rope – these are separate bodies connected to each other and to the main body via revolute joints (modeled after the chain test in the testbed examples).
What I would like to do is be able to drag the end of the “chain” and cause the main body (and "hook" fixtures) to rotate in position as a result of the movement of the chain. I am able to get the chain to move by attaching a mousejoint to the last/end body in the chain when a touch occurs, however I am encountering a few problems:
- 1. When I move the attached “chain link”, the chain moves together as expected but does not cause the main body to move at all.
2. If I drag the chain far enough (about when the distance > 50% of the length of the chain), the revolute joints begin to fail and pull apart.
3. If I move the main body or hook fixtures, everything moves together and the chain follows, but as in #2, the chain's links begin to pull apart at the joints, even during relatively minor movements.
4. The revolute joints don't always honor their min/max angles. When I drag the chain, it is possible to wrap the chain around itself fairly easily. I have the angle limit enable for a range of -30 to 30 degrees (converted to radians for the joint def). I'm guessing the force of movement is too great and is causing the joints to fail again as above.
Am I going to be able to achieve this type of movement within box2D? Also, is there a way to "strengthen" the revolute joints so they do not pull apart or rotate beyond the specified limits? Should I be using a different type of joint?
Any suggestions or insights would be greatly appreciated.
Thanks!