Skip to content
Hüseyin Tuğrul BÜYÜKIŞIK edited this page Mar 18, 2022 · 2 revisions

Welcome to the FastCollisionDetectionLib wiki!

Single instance of thread pool object can be used for multiple adaptive grids.

FastColDetLib::ThreadPool<float> thr;

auto adaptive=FastColDetLib::AdaptiveGrid<float>(thr,      // uses this thread pool when computing all-pairs collision list
                                                 -1,-1,-1, // mapping volume's minimum corner X,Y,Z
                                                 1, 1,  1  // mapping volume's maximum corner X,Y,Z
);
auto adaptive2=FastColDetLib::AdaptiveGrid<float>(thr,-1,-1,-1,1,1,1);

// in thread 1
auto collisions = adaptive.getCollisions(); // gets all-pairs collision list

// in thread 2
auto collisions = adaptive2.getCollisions(); // gets all-pairs collision list

// scope end: thr stops its internal threads

Even when adaptive grids are used in different cpu threads, thread-pool computes both of their enqueued work.

Clone this wiki locally