Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tear Issue
#1
Hi i've been trying to tear a cloth with a gameobject but i came across to a bug which makes the cloth look like this:

[Image: view.php?img=LPic6267fb1269bf4869992675]
If i change the tear resistance the bug doesn't happen all the time and i can cut the flag succesfully most of the time. However this is not the definite solution.
Can you help me with that?


Here where i call the Tear() method:

void ModifyConstraints(int collisionParticleIndex)
{
    var distanceConstraints =
        flag.GetConstraintsByType(Oni.ConstraintType.Distance) as ObiConstraints<ObiDistanceConstraintsBatch>;
    if (distanceConstraints == null) return;
    IterateAllConstraints(distanceConstraints, collisionParticleIndex);
}

void IterateAllConstraints(ObiConstraints<ObiDistanceConstraintsBatch> distanceConstraints, int particleToTear)
{
    IStructuralConstraintBatch currentBatch;

    foreach (var batch in distanceConstraints.batches)
    {
        currentBatch = (IStructuralConstraintBatch) batch;

        for (int i = 0; i < batch.activeConstraintCount; i++)
        {
            if (batch.particleIndices[i * 2] == particleToTear)

            {
                StructuralConstraint sc =
                    new StructuralConstraint(currentBatch, batch.GetConstraintIndex(i), tearForce);
                flag.Tear(sc);
                flag.solver.PushSolverParameters();
            }
        }
    }
}
Reply


Messages In This Thread
Tear Issue - by charlotte - 26-04-2022, 03:54 PM
RE: Tear Issue - by josemendez - 27-04-2022, 07:42 AM
RE: Tear Issue - by charlotte - 27-04-2022, 09:10 AM
RE: Tear Issue - by josemendez - 27-04-2022, 09:12 AM
RE: Tear Issue - by charlotte - 27-04-2022, 03:25 PM
RE: Tear Issue - by josemendez - 27-04-2022, 03:46 PM
RE: Tear Issue - by charlotte - 27-04-2022, 03:49 PM
RE: Tear Issue - by josemendez - 27-04-2022, 04:08 PM
RE: Tear Issue - by charlotte - 29-04-2022, 12:22 PM