Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rope 'jumps' when a particle is added or removed
#1
I've created a system with four Obi Rope cables and a hook for a crane simulation.
When I change the length of the rope, each time a particle is added or removed the rope makes a jump.
See video: 

I'm using this code to change the length of the cables:

Code:
 float flCableLength = rsc.rpcCablesOuter[0].GetComponent<ObiRope>().RestLength + Input.GetAxis("Hoist") * flHoistSpeed;
       foreach (ObiRopeCursor rpc in rsc.rpcCablesOuter) rpc.ChangeLength(flCableLength);

How can I prevent the 'jumping' ?
Reply
#2
(05-03-2018, 10:28 AM)Wilbert Wrote: I've created a system with four Obi Rope cables and a hook for a crane simulation.
When I change the length of the rope, each time a particle is added or removed the rope makes a jump.
See video: 

I'm using this code to change the length of the cables:

Code:
 float flCableLength = rsc.rpcCablesOuter[0].GetComponent<ObiRope>().RestLength + Input.GetAxis("Hoist") * flHoistSpeed;
       foreach (ObiRopeCursor rpc in rsc.rpcCablesOuter) rpc.ChangeLength(flCableLength);

How can I prevent the 'jumping' ?

Hi there,

This cannot be prevented in the general case when using lagrangian (particle-based) simulators, as is Obi's case. Mass is suddenly added or removed from the cable when a particle is created/destroyed (Obi tries to make this change a bit more smooth by gradually increasing/decreasing the mass of the last particle when changing rope length) but even then there's a sudden change in convergence speed when adding/removing a constraint, that affects rope elasticity.

The only way to avoid this (afaik) is to use an entirely different kind of physics solver altogether: an eulerian one, that does not discretize cable mass into particles. I'm not aware of any existing solver of this kind for Unity, unfortunately.
Reply
#3
(05-03-2018, 11:07 AM)josemendez Wrote: Hi there,

This cannot be prevented in the general case when using lagrangian (particle-based) simulators, as is Obi's case. Mass is suddenly added or removed from the cable when a particle is created/destroyed (Obi tries to make this change a bit more smooth by gradually increasing/decreasing the mass of the last particle when changing rope length) but even then there's a sudden change in convergence speed when adding/removing a constraint, that affects rope elasticity.

The only way to avoid this (afaik) is to use an entirely different kind of physics solver altogether: an eulerian one, that does not discretize cable mass into particles. I'm not aware of any existing solver of this kind for Unity, unfortunately.

Turning off 'Bending' in the solver made the problem largely disappear while maintaining a good enough simulation of the cables.
Great!
Reply
#4
(05-03-2018, 11:58 AM)Wilbert Wrote: Turning off 'Bending' in the solver made the problem largely disappear while maintaining a good enough simulation of the cables.
Great!

Good that this worked for you! If you still notice any jumps, try reducing the mass ratio between the ropes and the crane load. That should minimize the problems caused by mass lumping.
Reply