DanielChappuis/reactphysics3d

Failed assertion in OverlappingPairs::setNeedToTestOverlap in v0.10.1

MonsieurBleu opened this issue · 4 comments

I have a simple scene with a few capsule and a box. The program encounter an assertion fail every time I use the setTransform on a kinematic body that is exting the collision with another body. I saw that this issue was marked as fixed in release 0.10.1 but even with the latest version I encounter it.

I'm working on windows with mingw and linking my program with g++ in c++23. The library was compiled using cmake gui on windows in debug mode.

Here is the gdb report :

#1 0x00007ff961711019 in ucrtbase!_get_wpgmptr ()
from C:\WINDOWS\System32\ucrtbase.dll
(gdb)
#2 0x00007ff961711201 in ucrtbase!_assert ()
from C:\WINDOWS\System32\ucrtbase.dll
(gdb)
#3 0x00007ff7d7eef566 in reactphysics3d::OverlappingPairs::setNeedToTestOverlap (needToTestOverlap=true,
pairId=59, this=0x2227964f090)
at C:/DEV/libs_build/reactphysics3d-0.10.1/include/reactphysics3d/engine/OverlappingPairs.h:461
461 assert(mMapConvexPairIdToPairIndex.containsKey(pairId) || mMapConcavePairIdToPairIndex.containsKey(pairId));
(gdb)
#4 reactphysics3d::CollisionDetectionSystem::notifyOverlappingPairsToTestOverlap (this=0x2227964ef80,
collider=0x22279678af0)
at C:\DEV\libs_build\reactphysics3d-0.10.1\src\systems\CollisionDetectionSystem.cpp:801
801 mOverlappingPairs.setNeedToTestOverlap(overlappingPairs[i], true);
(gdb)
#5 0x00007ff7d7f027a3 in reactphysics3d::BroadPhaseSystem::addMovedCollider (this=0x2227964f268,
broadPhaseID=3, collider=0x22279678af0)
at C:\DEV\libs_build\reactphysics3d-0.10.1\src\systems\BroadPhaseSystem.cpp:198
198 mCollisionDetection.notifyOverlappingPairsToTestOverlap(collider);
(gdb)
#6 0x00007ff7d7f01fa2 in reactphysics3d::BroadPhaseSystem::updateColliderInternal (this=0x2227964f268,
broadPhaseId=3, collider=0x22279678af0, aabb=...,
forceReInsert=false)
at C:\DEV\libs_build\reactphysics3d-0.10.1\src\systems\BroadPhaseSystem.cpp:150
150 addMovedCollider(broadPhaseId, collider);
(gdb)
#7 0x00007ff7d7f026ef in reactphysics3d::BroadPhaseSystem::updateCollidersComponents (this=0x2227964f268,
startIndex=3, nbItems=1)
at C:\DEV\libs_build\reactphysics3d-0.10.1\src\systems\BroadPhaseSystem.cpp:180
180 updateColliderInternal(broadPhaseId, mCollidersComponents.mColliders[i], aabb, forceReInsert);
(gdb)
#8 0x00007ff7d7f01ebf in reactphysics3d::BroadPhaseSystem::updateCollider (this=0x2227964f268,
colliderEntity=...)
at C:\DEV\libs_build\reactphysics3d-0.10.1\src\systems\BroadPhaseSystem.cpp:121
121 updateCollidersComponents(index, 1);
(gdb)
#9 0x00007ff7d7eaea4a in reactphysics3d::CollisionDetectionSystem::updateCollider (colliderEntity=...,
this=0x2227964ef80)
at C:/DEV/libs_build/reactphysics3d-0.10.1/include/reactphysics3d/systems/CollisionDetectionSystem.h:457
457 mBroadPhaseSystem.updateCollider(colliderEntity);
(gdb)
#10 reactphysics3d::Body::updateBroadPhaseState (
this=0x22279660330)
at C:\DEV\libs_build\reactphysics3d-0.10.1\src\body\Body.cpp:235
235 mWorld.mCollisionDetection.updateCollider(colliderEntities[i]);
(gdb)
#11 0x00007ff7d7eb1029 in reactphysics3d::Body::setTransform (this=0x22279660330, transform=...)
at C:\DEV\libs_build\reactphysics3d-0.10.1\src\body\Body.cpp:399
399 updateBroadPhaseState();
(gdb)
#12 0x00007ff7d7ec299f in reactphysics3d::RigidBody::setTransform (this=0x22279660330, transform=...)
at C:\DEV\libs_build\reactphysics3d-0.10.1\src\body\RigidBody.cpp:853
853 Body::setTransform(transform);
(gdb)
#13 0x00007ff7d7e9c1ca in operator() (
__closure=, entity=...)
at ../src/Game__physicsloop.cpp:105
105 b->setTransform(t);

I'm encountering the same problem here in 0.10.1 too. It happens to me every time I move a Dynamic Capsule over a static box using setTransform(). I can provide a project to reproduce this site if you need, Daniel. Btw, debugging with ECS system is killing me, haha. But I do think your structure is a right choice.
If you need that project please message me. It's a private Unity Game. That's why I can't post it here.

Thanks a lot for taking the time to report this.

I am starting to think that this issue has been fixed but the original issue #376 which was about this has not been fixed actually.

I will investigate this.