05-03-2018, 11:07 AM
(This post was last modified: 05-03-2018, 11:10 AM by josemendez.)
(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.