Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Cutting Cloth
#3
(18-12-2020, 09:09 AM)josemendez Wrote: Hi there,

ObiTearableCloth has a Tear() method, that takes a StructuralConstraint as input. A structural constraint is a struct that contains a reference to a distance constraint batch, a constraint index, and a force. You can build a StructuralConstraint referencing the distance constraint you want to tear, and pass it to the Tear() method.

See the ApplyTearing() method in ObiTearableCloth for an example of using Tear(). ApplyTearing() iterates trough all distance constraints in the cloth, finds the constraints that are over the tear threshold, puts them into a List<StructuralConstraints>, sorts them by force, and then tears the first few of them.

In your case, you'll need to figure out how to get the constraints joining the vertices you want to tear, then generate the list of StructuralConstraints to tear.


Thank you very much, I'll try this right away !
Reply


Messages In This Thread
Cutting Cloth - by IT_Tao - 17-12-2020, 02:13 PM
RE: Cutting Cloth - by josemendez - 18-12-2020, 09:09 AM
RE: Cutting Cloth - by IT_Tao - 18-12-2020, 09:16 AM
RE: Cutting Cloth - by IT_Tao - 29-12-2020, 12:19 PM