favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Bug in SpuGatheringCollisionDispatcher #551

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a btKinematicCharacterController, the internal 
btPairCachingGhostObject m_ghostObject contains a btHashedOverlappingPairCache 
wich may have no overlapping pairs;
2. This btHashedOverlappingPairCache is then sent to the 
SpuGatheringCollisionDispatcher::dispatchAllCollisionPairs(...) via 
btKinematicCharacterController::recoverFromPenetration from 
btKinematicCharacterController::preStep from 
btKinematicCharacterController::updateAction...
3. Finally the line 209 from SpuGatheringCollisionDispatcher.cpp:
  btBroadphasePair* pairPtr = pairCache->getOverlappingPairArrayPtr();

returns an assertion error in debug mode, because the internal 
btAlignedObjectArray has size equal to 0 and the operator [] used is protected 
with debug asserts.

What is the expected output? What do you see instead?
It's expected to work without assertion errors in debug mode.

What version of the product are you using? On what operating system?
I'm using bullet 2.79 on Windows 7 64bits compiled with Visual C++ 2008 Express 
(premake script tweaked to remove the "StaticRuntime" flag and to include the 
BulletMultiThreaded project without the GpuSoftBodySolvers folder)

Please provide any additional information below.

Original issue reported on code.google.com by aymar.fi...@gmail.com on 20 Sep 2011 at 5:43

GoogleCodeExporter commented 9 years ago
I forgot to suggest a simple fix.
Only define the "pairPtr" variable if "numTotalPairs" is greater than 0.

Original comment by aymar.fi...@gmail.com on 20 Sep 2011 at 5:50

GoogleCodeExporter commented 9 years ago
It is fixed in latest trunk:
http://code.google.com/p/bullet/source/detail?spec=svn2504&r=2483

Thanks for the report!
Erwin

Original comment by erwin.coumans on 29 Feb 2012 at 5:32