## Bridges Revisited

Official forum for the Chipmunk2D Physics Library.
RitterGT
Posts: 3
Joined: Mon Jul 27, 2009 3:51 pm
Contact:

### Bridges Revisited

Hi everyone. Just started using Chipmunk about a week ago and I'm extremely impressed. Got a situation though that could use a bit of a walkthrough however - been stepping it constantly with the debugger, but I think I need something a bit higher level.

I'm currently playing around with the constraints in order to make a bridge-like environment. To do so I have played with using pin and pivot joints as well as slide joints with a small max length to add some give. I've also used your breakablejoint wrapper for each one so that if I roll a heavy ball across it, the bridge snaps. Things look good, but I get confused when the breakablejoint calls the getImpulse function. In the pivot and pin joint, the number returned (cpvLength(jAcc)) is constantly growing. Basically if I create a joint between two segments which are anchored by static body joints, eventually (I believe the growth of jAcc is linear) the center joint (the one between the segments) will snap no matter how high I put the maxForce.

I understand that the physics aren't necessarily perfect and that rounding errors have to occur - is there a work around to make this more accurate? It appears that increasing the number of steps actually increases the growth rate as well, and I don't see much of a difference when altering the bias_coef of constraints.

EDIT::
Figured I'd add in an image just in case this doesn't quite make sense:
Picture 4.png

In this case, the center joint between the two is a Pivot Joint which is breakable with the max force set to extremely high and the joints on either side are pivot joints that are not breakable. Gravity is (0,-400) and the segment masses are 1.0f

Thanks,
-Ritter

P.S - if anything I said didn't make sense, let me know and I'll try to clarify!
slembcke