I am trying to create a rope. I have been experimenting for 2 days now, trying al kinds of values. But unfortunately no good results sofar. Any suggestion for a command that would help to stabalize the rope would be great. See the txt file for the entire code.
--box1
box1Body = CreateBodyBox(1,1,1,box1)
box1=CreateCube()
box1:SetParent(box1Body,1)
box1Body:SetPosition(Vec3(0,30,0))
box1Body:SetMass(0)
--some variables
firstBodyCreated = 0
LastBody = nil
Vec3Pos = Vec3 (0,0,0)
i = 0
--Create more bodies in a loop
for i = 0, 5, i+1 do
Vec3Pos = Vec3 (0,i*1.1,0)
if firstBodyCreated == 0 then
NewBody = CreateBodyCylinder(0.5,2.5,box1Body)
firstBodyCreated= 1
else
NewBody = CreateBodyCylinder(0.5,2.6,LastBody)
end
NewBody:SetMass(10)
NewBody:SetCollisionType(1,1)
NewBody:SetPosition(Vec3Pos, 0)
SetBodyElasticity(NewBody,10)
NewBody:SetFriction( 5, 5 )
if LastBody~=nil then
NewJoint = CreateJointBall (NewBody, LastBody,Vec3 (1, 1, 1))
SetBallJointLimits (NewJoint, 100,100,100)
end
LastBody = NewBody
end
DebugPhysics(1)
Collisions(1,1,1)