I have recently stardted to work with Bullet and I found it great. Recently I was trying to simulate 10k of exactly identical balls, which share one collision shape (sphere), have the same mass but different positions. All of them are enclosed in a static box, just to limit their possible positions. I am applying random speeds to balls just to mix them in space. The problem I have encountered is that when I use around 8k balls simulation is initialized properly and work properly (I use multithreading solver and dispatcher), but when I increase balls number to 10k I get an exception:
Code: Select all
ntdll.dll!76fd15de()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!76fd15de()
ntdll.dll!76fc014e()
msvcr100d.dll!_unlock(int locknum) Line 375 C
msvcr100d.dll!_heap_alloc_dbg_impl(unsigned int nSize, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 507 + 0x7 bytes C++
msvcr100d.dll!_heap_alloc_dbg_impl(unsigned int nSize, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 504 + 0xc bytes C++
msvcr100d.dll!_nh_malloc_dbg_impl(unsigned int nSize, int nhFlag, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 239 + 0x19 bytes C++
25a8dd68()
Core.exe!btAllocDefault() Line 24 + 0x9 bytes C++
Core.exe!btAlignedAllocDefault() Line 70 + 0x13 bytes C++
00000010()
00000010()
Core.exe!btDbvtTreeCollider::Process() Line 107 + 0x27 bytes C++
Core.exe!btDbvtTreeCollider::Process(bool (QTableWidgetItem * const &) n) Line 114 C++
Core.exe!btDbvt::collideTV<btDbvtTreeCollider>() Line 949 C++
Core.exe!btDbvtBroadphase::createProxy() Line 186 C++
Core.exe!btCollisionWorld::addCollisionObject() Line 137 + 0x4c bytes C++
Core.exe!btDiscreteDynamicsWorld::addCollisionObject() Line 535 C++
Core.exe!btDiscreteDynamicsWorld::addRigidBody() Line 595 + 0x1d bytes C++
Code: Select all
Core.exe!btDbvtTreeCollider::Process(bool (QTableWidgetItem * const &) n) Line 114
Code: Select all
00000010()
00000010()
Code: Select all
Core.exe!btAllocDefault() Line 24 + 0x9 bytes
Could anybody take a look on it? Is there some bullet internal limitation for number of primitive objects like speheres? Additionally, I am using
Code: Select all
btHashedOverlappingPairCache* pairCache = new btHashedOverlappingPairCache();
overlappingPairCache = new btDbvtBroadphase(pairCache);
I would be very gratefull for any help. For now I have just limited number of objects to 8k but I have seen posts with simulations of more than 10k objects and I am confused right now what am I doing wrong or what might be the true problem.
Thanks in advance for any help,
Mateusz Janiak