clearing overlapping pair cache

Post Reply
Misterblue
Posts: 14
Joined: Wed Apr 28, 2010 3:09 pm

clearing overlapping pair cache

Post by Misterblue »

I have a case where I need to clear the overlapping pair cache for one object (repeatedly changing position of a static object that is colliding with a physical object).

I tried using cleanProxyFromPairs() in overlappingPairCache but it didn't seem to be working. Looking at Bullet's code, in both HashedOverlappingPairCache and SortedOverlappingPairCache, the cleanProxyfromPairs routine creates a CleanPairCallback class which is applied to all pairs. If a matching pair is found, the CleanPairCallback calls pair->cleanOverlappingPair() and returns false.

The call to pair->cleanOverlappingPair() removes the pair from the algorithm but the returning false means the code in processAllOverlappingPairs is not executed so the pair is not actually removed from the pair cache.

Is there someone who knows this code better and can see why the removal code should never be called when clearing? Am I missing some nuance to removing an object's pairs from the cache?

Thanks.

-- mb
Post Reply