reactphysics3d
reactphysics3d copied to clipboard
Capsule vs Capsule Collision Make sure the penetration depth is not zero
Sometimes assertion fails in NarrowPhaseInfoBatch::addContactPoint():
assert(penDepth > decimal(0.0));
This happens for Capsule/Capsule collision check.
Probable cause is float approssimation in
bool CapsuleVsCapsuleAlgorithm::testCollision(NarrowPhaseInfoBatch& narrowPhaseInfoBatch, uint32 batchStartIndex, uint32 batchNbItems, MemoryAllocator& /*memoryAllocator*/) ;
I inserted a double check on penetrationDepth.
if (penetrationDepth > 0)
The logic is the same of SphereVsSphereAlgorithm::testCollision().