01-02-2023, 11:13 AM
(This post was last modified: 01-02-2023, 11:28 AM by josemendez.)
(01-02-2023, 10:51 AM)alex798 Wrote: Thanks a lot, but now have another problem- created particles create weight that affected by gravity create more stretch- in some cases it ruin rope... And this new gravity stretch prevent rope to rollBack restLenght. Tryed to create 0 weight particle and clone it, but in this case particles don't stretch parallel (because of weight difference)...
Mass/weight doesn't work like this, and is not at all the reason why the rope is stretching.
By itself, mass doesn't affect at all the dynamics of an object: have two objects of the same mass collide with each other, and the results will be identical regardless of them being both 10, 100, or 1000 kg. The important part is their mass ratio: how much mass one of them has compared to the other.
Same in a rope: reducing the weight of all particles won't make the rope stretch lessĀ (and increasing mass doesn't make it stretch more) since the mass distribution is still exactly the same across all particles. If only some particles in the rope have higher mass than the rest, these will "pull" the rest of the rope around which can be useful in some situations.
Also note mass doesn't affect gravity at all: gravity is an acceleration (not a force), so all objects fall at the same speed regardless of their mass. No matter how heavy your rope is or how many particles are in it, gravity will always make it fall at the same speed.
The stretching you're experiencing is a basic consequence of how physics engines work: the more constraints an engine needs to simulate (in a rope, constraints are the "links" holding particles together), the slower convergence becomes. This is because corrections on a body (particle) need to "propagate" to neighboring bodies trough constraints over multiple iterations: the more constraints you have, the longer it takes for corrections to propagate to all particles in the rope because they have to traverse a path with more steps in it.
In some engines (like Unity's built-in engine), this low convergence speed manifests as instabilities: jittering, dancing objects, explosions, etc, because object velocities can't be corrected fast enough. In others like Obi, it manifests as spurious elasticity: things become stretchy/soft, because positional corrections can't be propagated across all particles given the current simulation budget. This is why you can't have arbitrarily long ropes at fixed cost: at some point you have to limit their length, or spend more resources simulating them, or reduce their resolution (less particles->less constraints).
There's two ways to fix this: increase the amount of distance constraint iterations in your ObiSolver (to spend more time propagating constraint corrections, which will allow these to reach further along the rope) or increase the amount of substeps in your ObiFixedUpdater to reduce the amount of correction required in the first place.
The manual contains a very in-depth explanation of what iterations/substeps are and how they affect simulation quality: http://obi.virtualmethodstudio.com/manua...gence.html
kind regards,