Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Increase rope length with correct tethers
#8
(16-11-2018, 10:29 AM)imtehQ Wrote: Is there a way to limit the amount of movement between the particles to 0?
Make a rope that can only rotate around its particle?

I know this will be tricky to do because it all with physics, you cant just set its location in anyway.
But for example by predicting its (fixed) location as in where it needs to be,

Example, point A is at 1,0,0 while point B is at 2,0,0 its distance may never be bigger then 0.1 then its B's predicted location will be 1.1,0,0.
So to add force on point B to match that predicted point within the next frame, if reached add force in the opposite direction equal to the force you applied before +/- some possible drag.
Then once that's done trough out all particles going from top to bottom at the same time, will that not stop the rope for experiencing a spring like effect?

It might break physics for that 1 frame, but it will force the particles to bound together.
You would still be able to break it if the distance is bigger then what you define before.

Let me enplane what im trying to do, that might help a bit,

I got a rope hanging from a beam, this beam moves forwards, the rope itself can be made bigger or smaller.
The bottom of the rope is a connection point where sometimes nothing is on, but sometimes a weight of around 6000 kg.

The rope needs to act the same in both cases, it needs to move with the beam without wobbling around randomly
https://i.imgur.com/Z8MH693.gifv

And it needs to spring as little as possible
https://i.imgur.com/MBPxZJy.gifv

In this case you're out of luck. Iterative solvers (PhysX, Havok, ODE, Obi..pretty much all realtime solvers) are absolutely incapable of achieving this. There's two big no-nos when it comes to them:

- Large mass ratios: in your case 1/60000 (0.1kg per particle, vs 6000kg load), which is way larger than the maximum recommended by Unity: 1/10).
- Long chains of constraints: the longer the rope, the slower the convergence.

The only options left are using a direct solver (AgX Dynamics comes to mind) which are usually much more expensive (both in terms of price and performance), or use articulated bodies (which are also costlier in terms of performance, and unfortunately haven't been integrated in Unity yet).

----
By the way, the algorithm you described is called FTL (follow the leader) and unfortunately it does not produce accurate physics, just a very rough approximation. The problem with it is that by only adjusting B (the second particle in each pair), you're implicitly assigning the above chain infinite mass. This has the effect of curling the rope on itself in a very visually unpleasant way. But, by adding a largish damping factor, it can be tolerated. This is generally used for hair simulation (Nvidia Hairworks) since you cannot tell the difference with 10.000 individual hairs. However it does not work for rope (I tried).
Reply


Messages In This Thread
RE: Increase rope length with correct tethers - by josemendez - 16-11-2018, 12:18 PM