Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tearing cloth via code (Finding constraintIndex)
#1
Hey so I'm trying to tear a ribbon in half at a specific point. I've been doing as described on this page http://obi.virtualmethodstudio.com/tutor...aints.html but I'm haivng a hard time figuring out where to tear. How do I figure out what the constraintindex of a specific point is? So far I've managed to guess my way to two out of three tear spots, but I've been guessing for a while now with no luck figuring out the last one...

Code:
public void CutAtPoints()
   {
       cloth.DistanceConstraints.RemoveFromSolver(null);
       cloth.BendingConstraints.RemoveFromSolver(null);
       for (int i = 0; i < constraintsToCut.Count; i++)
       {
           cloth.Tear(constraintsToCut[i]);
       }
       cloth.BendingConstraints.AddToSolver(cloth);
       cloth.DistanceConstraints.AddToSolver(cloth);
       cloth.BendingConstraints.SetActiveConstraints();
       cloth.UpdateDeformableTriangles();
       cloth.Solver.UpdateActiveParticles();
   }
Reply


Messages In This Thread
Tearing cloth via code (Finding constraintIndex) - by Cadpeople - 08-08-2018, 09:11 AM