reactphysics3d icon indicating copy to clipboard operation
reactphysics3d copied to clipboard

Capsule vs Capsule Collision Make sure the penetration depth is not zero

Open robertocapuano opened this issue 1 year ago • 0 comments

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().

robertocapuano avatar Apr 12 '24 18:04 robertocapuano