This project has moved and is read-only. For the latest updates, please go here.

creating a rope between two objects.

Feb 4, 2009 at 5:47 PM
Currently i have two bodies which im trying to connect together with a chain or a rope. one of the bodies is controlled by the player the other is just sitting there. In the end i want to be able to pull the one body with a non stretching rope which is created when the player specifies.

I used "ComplexFactory.Instance.CreateChain" to create a rope between the two bodies with a "LinkType.PinJoint"
Then i used two "JointFactory.PinJoints" to attach each end of the rope to its respective body.

what I'm getting right now is a very stretchy rope type, which seems to be preventing the character from pulling the desired object. I was hoping that the rope would not be able to stretch and if the objects mass is too big for the player to pull then the player wont be able to move further then the length of the rope from the player to the object. (like a dog tied to a chain).
Feb 4, 2009 at 5:52 PM
Using the revolutejoint or the pinjoint should not make a stretchable chain. Take a look at demo5 from the advanced samples, they show how to use the different chain types.
Feb 4, 2009 at 6:55 PM
what is appearing to be happening is when i have a small "height" and "width" the rope seems to be stretching. This occurs usually when hieght and width equals to '0.1'..

when i up the hight and width to something like '1.0' I recieve the desired effect but now there are very few links to the chain 'visualy'

rope = ComplexFactory.Instance.CreateChain(physicsSimulatorInstance, body_1.Position, body_2.Position, 1f, 1f, 1, 2, LinkType.RevoluteJoint);

is there a way to satisfy there being many chains and the chain not producing a stretchy effect?
Feb 4, 2009 at 7:36 PM
could the unit size of my objects effect the chain?