Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Obi rope deleteingt cutted part after cut?
#3
(24-06-2021, 04:19 PM)josemendez Wrote: Hi,

Can you share the code you have so far? Otherwise helping you it’s going to be hard Guiño
Code:
ObiSolver.ParticleInActor pa = solver.particleToActor[particleIndex];

        //solver.colors[particleIndex] = Color.black;

        obiRopes[0].Tear(obiRopes[0].elements[pa.indexInActor + 1]);

        for (int i = pa.indexInActor + 1; i < obiRopes[0].elements.Count; i++)
        {
            obiRopes[0].DeactivateParticle(solver.particleToActor[obiRopes[0].elements[i].particle2].indexInActor);
            obiRopes[0].elements.RemoveAt(i);
        }

        obiRopes[0].RebuildConstraintsFromElements();

        foreach (ObiRopeCursor cr in cursors)
        {
            cr.cursorMu = (float)pa.indexInActor / (float)obiRopes[0].activeParticleCount;
            cr.UpdateCursor();
        }
Here is my code . I am not sure about the for loop
Reply


Messages In This Thread
RE: Obi rope deleteingt cutted part after cut? - by debruw - 24-06-2021, 04:39 PM