Parallelization of Distance Computation #2849
-
|
Hello I want to speed up the collision computation, and in a nutshell I want to do some proximity check, and only if it is true I want to compute the precise distance. Something like: Is this thread safe, or is there some limitations that I need to be aware of? I also read in the docs that there is the computeDistances which does take care of the parallelization and could be coupled with custom distance_functors. Though I felt the above approach seems more intuitive for my example. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Hello @lukas-ramlab, You can give a look to the broadphase algorithm. The default implementation will use a BVH to check if a collision computation should be done. Calling
|
Beta Was this translation helpful? Give feedback.
-
|
Hello @jorisv Thanks for the clarification, that helps a lot! Does that mean that I have to do a warm-up first call to the The broadphase algorithm helps a lot, I can directly do that for collision avoidance. I see in that implementation though, that separate |
Beta Was this translation helpful? Give feedback.
It's only mandatory if you evaluate the same collision pair in two different thread. I don't see the use case for that.
If you want to be sure the first iteration of distance detection run as fast as the next one, warm up is a good idea.
computeCollisionswill write indata. So if you want to avoid a race condition, you should avoid using samedatain different threads.