Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Manually tear the cloth
#3
(09-06-2020, 09:31 AM)Andrew Graham Wrote: I would also be interested in this. I am trying to implement a knife that will instantly cut the cloth whenever it comes into contact with it. It there a way to do this with Obi Cloth?

Thanks.

Hi Andrew,

Sure, there's three steps involved:
  • Detect contacts between the knife and the cloth particles. See:
    http://obi.virtualmethodstudio.com/tutor...sions.html
  • Get the contact particle index, and find out which constraint (s) involve that particle by iterating over all constraint batches.
  • Call cloth.Tear() passing a StructuralConstraint struct, that references the constraint and its batch.

You can see an example of the last two steps in ObiTearableCloth's ApplyTearing method: It iterates over all constraint batches, finds the ones whose force exceeds a threshold (you would find the ones in contact with the knife instead), then calls Tear() for them.

Here's an example of this made by a fellow user, found it in reddit recently:
Reply


Messages In This Thread
Manually tear the cloth - by bluedrag0n - 31-05-2020, 03:27 PM
RE: Manually tear the cloth - by Andrew Graham - 09-06-2020, 09:31 AM
RE: Manually tear the cloth - by josemendez - 09-06-2020, 10:32 AM