Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  No particles collision after resize
#1
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.
Reply
#2
(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,
Reply
#3
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
Reply