Obi Official Forum
Help No particles collision after resize - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help No particles collision after resize (/thread-2402.html)



No particles collision after resize - vizgl - 05-08-2020

After I change rope length through code:
Code:
ropeCursor.ChangeLength(rope.restLength + 10);

newly added particles not colliding with each other, but old ones does.


RE: No particles collision after resize - josemendez - 06-08-2020

(05-08-2020, 06:28 PM)vizgl Wrote: After I change rope length through code:
Code:
ropeCursor.ChangeLength(rope.restLength + 10);

newly added particles not colliding with each other, but old ones does.

Hi there,

This was fixed in Obi 5.4, though it's not yet on the store. Write to support(at)virtualmethodstudio.com and I'll send it to you.

Alternatively, you can just add this line:
Code:
rope.RecalculateRestPositions();

to ObiRopeCursor.cs at the end of the ChangeLength() method. It should look like this:

Code:
rope.RebuildConstraintsFromElements();
rope.RecalculateRestLength();
rope.RecalculateRestPositions();
}

kind regards,


RE: No particles collision after resize - vizgl - 06-08-2020

Thanks, that work.
Also I found another bug in the ObiRopeBlueprint. First particle has different mass from another ones.

// In case the path is open, add a first particle. In closed paths, the last particle is also the first one.
if (!path.Closed)
{
particlePositions.Add(path.points.GetPositionAtMu(path.Closed,0));
particleThicknesses.Add(path.thicknesses.GetAtMu(path.Closed,0));
particleInvMasses.Add(ObiUtils.MassToInvMass(path.thicknesses.GetAtMu(path.Closed,0)));
particlePhases.Add(path.phases.GetAtMu(path.Closed,0));
particleColors.Add(path.colors.GetAtMu(path.Closed,0));
}

Should be:
particleInvMasses.Add(ObiUtils.MassToInvMass(path.masses.GetAtMu(path.Closed,0)));

Another bug:
After I change rope size, newly added particles has different BendCompliance behaviour