Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
softbody cut
#11
(19-12-2022, 12:30 PM)josemendez Wrote: You don't.

Or more, precisely: you iterate trough all constraints in all batches until you find the one that references the two particles you're looking for. This is of course extremely slow, but neither simulation or tearing need to know which constraints affect a specific particle: you only need to know which particles are involved in each constraint. At no point you need to map particles-->constraint, it's always constraint-->particles.

You shouldn't need to do this for softbody cutting. What you do is you iterate trough all constraints just once per frame, and for each constraint you determine whether it's involved in a cut or not, then update it accordingly.


You're mixing up distance and shape matching constraints here, shape matching constraints generally have more than 2 particles per constraint. You're supposed to use the firstIndex and numIndex arrays to retrieve the list of particles in each constraint. See the API documentation for shape matching batches:


So to the indices of the particles in constraint #5 are found in the <firstIndex[5], firstIndex[5]+numIndex[5]> range of entries in batch.particleIndices. If you've used Flex's API before, this works the exact same way.


It's pretty self-explanatory: it removes a particle from the constraint, so it's no longer affected by it.

A demo of this at some point would be top notch. Anyway, to understand the breakdown here:

- Detect the particles affected by the cut
- Search for the constraints that include those particles
- Break the found constraints.

How about the remeshing/unbinding + rebinding part?
Reply


Messages In This Thread
softbody cut - by Seahorse - 15-12-2022, 05:16 AM
RE: softbody cut - by josemendez - 15-12-2022, 12:40 PM
RE: softbody cut - by Seahorse - 15-12-2022, 01:50 PM
RE: softbody cut - by josemendez - 15-12-2022, 02:59 PM
RE: softbody cut - by Seahorse - 15-12-2022, 03:13 PM
RE: softbody cut - by josemendez - 15-12-2022, 03:24 PM
RE: softbody cut - by Seahorse - 15-12-2022, 03:28 PM
RE: softbody cut - by josemendez - 15-12-2022, 03:41 PM
RE: softbody cut - by Seahorse - 19-12-2022, 12:19 PM
RE: softbody cut - by josemendez - 19-12-2022, 12:30 PM
RE: softbody cut - by manurocker95 - 20-07-2023, 12:14 PM
RE: softbody cut - by josemendez - 25-07-2023, 09:33 AM