Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Trying to add DistanceConstraint for my TearableCloth but getting IndexOutOfRange
#22
(10-08-2022, 08:19 PM)josemendez Wrote: Yes, my bad. I understand what you're doing now. Not sure why the out of bounds exception, but it's happening inside the constraint evaluation method so one or more indices passed to it are wrong in some way.


When testing your project, I hadn't installed any extra packages so Obi was using the fallback backend (Oni). Since it does not perform any out of bounds checks, the error passed undetected. But as I previously mentioned it's dangerous nonetheless, as it's writing outside the allocated memory for the arrays and that's undefined behavior.

Testing again using the Burst backend and Jobs Debugger enabled, I got the same error as you did.


In my previous post you have my modified version of the AttachParticlePairInColon() function. It works without errors, constraints are persistent (even if you add/remove actors from the solver) and it's faster since it does not require to loop over all particles in the solver to find the closest to a vertex: it uses the mesh topology to look it up in constant time.

Let me know if I can be of further help,

Your code works perfect. However when choosing the Burst backend my frame rate is 4 times slower than Oni backend, is that normal?

Also I noticed that the sewn colon is jittering a little bit, is there a way to get rid of the jitter?

Thanks a lot!
Reply


Messages In This Thread
RE: Trying to add DistanceConstraint for my TearableCloth but getting IndexOutOfRange - by snowtv - 12-08-2022, 08:06 PM