13-06-2024, 06:18 PM
(13-06-2024, 07:52 AM)josemendez Wrote: 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
Thank you, that's extremely helpful and gives me exactly what I needed. I hadn't realized what simplices were and somehow missed that raycast example. Cheers!