Game Development Community

Connecting by Emitter [AKA a Rope]

by Timothy Volpe · in Torque Game Engine Advanced · 10/25/2010 (10:47 pm) · 4 replies

UPDATED:

How do I make a rope, basicly an emitter, from one object to another? I want a rope, 2D, no collision, static, has a sag in it, that goes from the center of Point A to the center of Point B. I have no idea how to do this. I need this in TORQUESCRIPT that is the word C++ shall never be said (Whos gunna make a smart comment ^.^). I can't even begin where to start on something like this, so I need help.

#1
10/26/2010 (9:48 pm)
i887.photobucket.com/albums/ac71/WillSmith_BL/wireDiagram.pngI crappy diagram of what I want
#2
10/27/2010 (2:20 am)
In TorqueScript, one unorthodox way I can think of would be displaying a number of objects (ie. chain pieces as billboards) over a spline with a knot placed on the ground in the middle. But it would more efficient to poke the source and create a new object for this.
#3
10/27/2010 (9:36 pm)
Hm, well I really didn't want to get into C++ with this... is it, perhaps, easier to make it just straight? No sag?
#4
10/27/2010 (10:42 pm)
You would need to do some vector math to plot and store a number of points in a line between object1 and object2, and then place an emitter at each point. Total number needed will depend on distance between the two objects and density/size of the particle/billboard effect. The trick (hard part) will be to account for the sag, measuring curves through script isn't exactly straight forward, although you might be able to simply find incremental points on a spline -- not sure, never tried.

Or you could simply stretch a billboard between the two objects -- there is a PlasticGem that demonstrates this.

This is assuredly a situation where C++ is the way to go if you want precision and detail. The math itself will be far more efficient and then you could have a new render object that most likely would consist of nothing but linked billboards all done in the same drawcall.