Jump to content

Rope


cassius
 Share

Recommended Posts

When i remember correctly, that demo was made using balljoints to link the rope parts together.

 

I hacked something together for you:

 

DebugPhysics (1);
TBody LastBody = NULL;
TVec3 Vec3Pos = Vec3 (0.0F);
for (int i = 0; i < 10; i++)
{
	Vec3Pos = Vec3 (0.0F, 0.0F, (float)i * 6.0F);
	TBody NewBody = CreateBodyBox (0.5F, 0.5F, 5.0F, 0);
	SetBodyMass (NewBody, 1.0F);
	EntityType (NewBody, 1, 0);
	PositionEntity (NewBody, Vec3Pos, 0);
	if (NULL != LastBody)
	{
		TJoint NewJoint = CreateJointBall (NewBody, LastBody,
				Vec3 (0.0F, 0.0F, Vec3Pos.Z * 0.5F), 
				Vec3 (0.0F, 0.0F, 1.0F));
		SetBallJointLimits (NewJoint, 2.0F, 0.0F, 0.0F);
		SetJointCollisionMode (NewJoint, 0);
	}
	LastBody = NewBody;
}

 

Far from ideal, but it has some kind of a rope structure :)

(Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI)

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...