DanielChappuis / reactphysics3d

Open source C++ physics engine library in 3D
http://www.reactphysics3d.com
zlib License
1.55k stars 224 forks source link

CollisionDetectionSystem::createContacts() assert crash #364

Closed darktemplar216 closed 8 months ago

darktemplar216 commented 11 months ago

in void CollisionDetectionSystem::createContacts() {

by using triggers in the game, I found that the assertion below fails

for (uint32 p=0; p < nbContactPairsToProcess; p++) { uint32 contactPairIndex = mWorld->mProcessContactPairsOrderIslands[p]; ContactPair& contactPair = (*mCurrentContactPairs)[contactPairIndex]; ...

   assert(potentialManifold.nbPotentialContactPoints > 0);

After I went through the code, I think we are not generating contact points for the triggers. So I add a if() continue to prevents it from happenning.

for (uint32 p=0; p < nbContactPairsToProcess; p++) { uint32 contactPairIndex = mWorld->mProcessContactPairsOrderIslands[p]; ContactPair& contactPair = (*mCurrentContactPairs)[contactPairIndex]; ...

    if (contactPair.isTrigger)
    {
        continue;
    }

So far seems fine Does it make any sense? Daniel

DanielChappuis commented 9 months ago

Hello. Thanks a lot for reporting this issue. I take some time to take a look and I think this is already fixed in the "develop" branch. This will be available in the next release of the library.

DanielChappuis commented 8 months ago

This is now fixed in version v0.10.0 of the library. Thanks a lot for reporting the issue.