13-06-2024, 07:52 AM
(This post was last modified: 13-06-2024, 08:01 AM by josemendez.)
Hi!
There's built-in raycast queries (as well as box and sphere overlap queries) that run in parallel across all particles using specialized spatial subdivision structures. See spatial queries in the manual. Also see the SoftbodyRaycast sample scene for an example use case:
Additionally, you also have contact callbacks, which work with both regular colliders and triggers. None of these require to iterate trough all actors & particles.
Also note that anytime you have the index of a particle (be it returned by spatial quieries, contacts, or manually obtained any other way), you can get a direct reference to the actor it belongs to using the solver.particleToActor array. See "retrieving the actor involved in a contact": http://obi.virtualmethodstudio.com/manua...sions.html
There's built-in raycast queries (as well as box and sphere overlap queries) that run in parallel across all particles using specialized spatial subdivision structures. See spatial queries in the manual. Also see the SoftbodyRaycast sample scene for an example use case:
Additionally, you also have contact callbacks, which work with both regular colliders and triggers. None of these require to iterate trough all actors & particles.
Also note that anytime you have the index of a particle (be it returned by spatial quieries, contacts, or manually obtained any other way), you can get a direct reference to the actor it belongs to using the solver.particleToActor array. See "retrieving the actor involved in a contact": http://obi.virtualmethodstudio.com/manua...sions.html