Pin joint and chain failing

Topics: User Forum
Aug 18, 2010 at 4:11 AM

I'm attempting to create a floating body with no gravity that has a pin joint chain attached to the bottom of it with a revolute joint which is affected by gravity.

The problems I'm having are that the pin joints in the chain do not seem to have any regard for the their length restriction and the revolute joint attaching the chain won't keep the chain attached to anything. Anyone have any ideas as to why this may be happening?

 

This is the code I'm using the create the chain and the attaching joint. 'chains' is a List<> of chains in the simulation and 'bodies[0]' is the floating body.

chains.Add(ComplexFactory.Instance.CreateChain(physicsSimulator, start, end, chainLength, 1, LinkType.PinJoint));

JointFactory.Instance.CreateRevoluteJoint(physicsSimulator, bodies[0], chains[0].Bodies[0], chains[0].Bodies[0].Position);