15-07-2023, 07:30 AM
Hello,
How can I obtain the actors that have collided with my cloth object?
Thanks!
Christopher
How can I obtain the actors that have collided with my cloth object?
Thanks!
Christopher
Help Cloth collision actors
|
15-07-2023, 07:30 AM
Hello,
How can I obtain the actors that have collided with my cloth object? Thanks! Christopher
15-07-2023, 11:03 AM
(15-07-2023, 07:30 AM)domopuff Wrote: Hello, Hi! You can get a list of all particle-particle contacts each frame by subscribing to solver.OnParticleCollision. Then it’s just a matter of retrieving the actor(s) involved in each contact. How to do this is explained in the manual: http://obi.virtualmethodstudio.com/manua...sions.html Kind regards,
15-07-2023, 02:55 PM
(15-07-2023, 11:03 AM)josemendez Wrote: Hi! Thanks for the reply! I managed to get the collisions detection working but performance did take a heavy hit. Any way we can try get the center points of a cloth instead?
17-07-2023, 07:01 AM
(This post was last modified: 17-07-2023, 07:02 AM by josemendez.)
(15-07-2023, 02:55 PM)domopuff Wrote: Thanks for the reply! I managed to get the collisions detection working but performance did take a heavy hit. If you iterate trough all contacts in the main thread using a simple for loop and there's many contacts in your scene, performance will of course be less than good. Try doing this using jobs instead. (15-07-2023, 02:55 PM)domopuff Wrote: Any way we can try get the center points of a cloth instead? Sure, iterate trough all particles in the cloth and calculate their center of mass. There's a snippet in the manual that does just this, pasting it here for convenience: http://obi.virtualmethodstudio.com/manua...icles.html Code: using UnityEngine; Again, doing this in the main thread using a for loop will be slow. Note you can directly use Obi solver arrays in a job, see the "Using Jobs to process particles" section at the end of the page linked above. kind regards, |
« Next Oldest | Next Newest »
|