Game Development Community

Moving a bone from the engine side of things.

by Bryce · in Torque 3D Professional · 03/23/2012 (3:45 pm) · 5 replies

Hey there, all.

Got a quick question. I'm trying to simulate a rope that slides with the player's hand as he rappels down the side of a building. One end of the rope would pivot at the top of the building, and the other end of the rope would connect to the player's hand.

I'm not doing anything too complicated here, so my idea was to make a simple cube model for the "rope." There would be a joint for the top four verticies (let's call it JointA, and a joint on the bottom four verticies (how about JointB). From the engine side of things, probably in Player::updateMove, I'm wondering if it's possible to set the positions of JointA and JointB in that cube model, so that the it stretches out like a tightrope to the positions I want. Any thoughts from you kind individuals?

Cheerio,
-Bryce

#1
03/25/2012 (11:32 pm)
You might need to create a different kind of object. Maybe something like a verlet based object. Have the player make contact with different segments as they go down and have the rope bend. Or just draw lines and just have the player rappelling until they get to a landing. You could draw lines and use verlet math for the bottom of the rope so it dangles and can take forces so to speak.
#2
03/26/2012 (1:07 pm)
These threads have some information on procedural animation from the days of TGE - not sure how relevant they are still. But I agree with Frank, you'll probably want to create a custom object type for this rather than stretching a shape. Stretching a shape will give you issues with texture scaling (I think), unless you ensure that all ropes are solid-colour.
#3
03/26/2012 (2:15 pm)
It'd be a simple, solid colored rope, that I'd probably keep as a part of the player model attached to the hand (which I could then show using setMeshHidden). That way, in Player::updateMove, all I'd have to do is something like this:

//Pseudocode is the best code.
if (Con::getBoolVariable("$isRappeling") == true) // Single player
{
  node = findNode("ropeEndNode");
  node.setPosition(mRopeDestination);
}
Where mRopeDestination is where the player is rappeling from, e.g. a chimney. I already have this part in my code.

So essentially, I'm just wondering how to move a node on a player model to a Point3F location.
#4
03/26/2012 (5:55 pm)
Maybe you can view this I don't know but
it's a blender video on making a chain.

It's on Vimeo.

Hope this helps.
Mike
#5
03/26/2012 (6:01 pm)
Not quite. The player rappels down the wall dynamically, through jumping and releasing the brake, so it can't be done with animation. The node has to be moved through code to account for wherever the player may be on the wall.