Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Efficiently determine actor under ray
#3
(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:

[Image: KcYlGg0.png]

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!
Reply


Messages In This Thread
Efficiently determine actor under ray - by 4ringz - 12-06-2024, 11:47 PM
RE: Efficiently determine actor under ray - by 4ringz - 13-06-2024, 06:18 PM