I have a relative big world. When all is sleep, bullet continue doing some calculations wasting cpu time. I notice that cleaning the overlapping pair cache instantly low the cpu consumption (for example, using SI solver, the bullet cpu time go from 7ms to 3ms; with hybrid SI/MLCP, go from 27ms to 5ms ). This is expected? ( I mean, overlapping pair cache is not autocleaned by bullet? (probably I am missing something) ). For the moment I will clean the cache periodically, but I would like know if there is something I am missing (maybe there is a flag that already do this)
Thanks!!
PS: the code I am using to clean the cache is:
Code: Select all
btBroadphasePairArray &pairArray = broadPhase->getOverlappingPairCache()->getOverlappingPairArray();
for( size_t i = 0; i < pairArray.size(); i++ ) {
broadPhase->getOverlappingPairCache()->cleanOverlappingPair(pairArray.at(i), dispatcher);
}