exception@ pDynamicsWorld->getBroadphase()->getOverlapping()

khoowaikeong
Posts: 43
Joined: Fri Jun 15, 2012 7:11 am

exception@ pDynamicsWorld->getBroadphase()->getOverlapping()

Post by khoowaikeong »

Unhandled exception at 0xbaadf00d in DustyTestkitPC.exe: 0xC0000005: Access violation.

the funny thing is this runs fine on debug and only encounter this exception on release build.. before running the function, i usually check for pointers, the following conditions are at the start of the function, the exception is strangely cause by them as well:

Code: Select all

			if(!pRigidBody)return;
			if(!pDynamicsWorld)return;
			if(!pDynamicsWorld->getBroadphase())return;
			if(!pDynamicsWorld->getBroadphase()->getOverlappingPairCache())return;	// hang here
the code hang in the check! :shock:
i do get a value(pointer) for broadphase, and i assume my initialization code below has setup a broadphase unit. i am however unsure as to if there should be any "OverlappingPairCache" as this code is call when adding object into the scene, so the first time it is call, it would have NO object on the scene, would this be a problem? yet it work fine in debug...
:lol:

following is my scene constructor (initialization) before calling the above troubled function:

Code: Select all

pCollisionConfiguration = new btDefaultCollisionConfiguration();
pDispatcher	= new ColliderDispatcher(pCollisionConfiguration);
pDebugDraw = new ColliderDebugDraw();
pBroadphase= new btDbvtBroadphase();//new btSimpleBroadphase();
btVoronoiSimplexSolver* pSolveSimplex = new btVoronoiSimplexSolver();
btMinkowskiPenetrationDepthSolver* pSolvePd = new btMinkowskiPenetrationDepthSolver();
btConvex2dConvex2dAlgorithm::CreateFunc* pAlgoConvex2d = new btConvex2dConvex2dAlgorithm::CreateFunc(pSolveSimplex,pSolvePd);
btBox2dBox2dCollisionAlgorithm::CreateFunc* pAlgoBox2d = new btBox2dBox2dCollisionAlgorithm::CreateFunc();	
pDispatcher->registerCollisionCreateFunc(CONVEX_2D_SHAPE_PROXYTYPE,	CONVEX_2D_SHAPE_PROXYTYPE,	pAlgoConvex2d);
pDispatcher->registerCollisionCreateFunc(BOX_2D_SHAPE_PROXYTYPE,	CONVEX_2D_SHAPE_PROXYTYPE,	pAlgoConvex2d);
pDispatcher->registerCollisionCreateFunc(CONVEX_2D_SHAPE_PROXYTYPE,	BOX_2D_SHAPE_PROXYTYPE,		pAlgoConvex2d);
pDispatcher->registerCollisionCreateFunc(BOX_2D_SHAPE_PROXYTYPE,	BOX_2D_SHAPE_PROXYTYPE,		pAlgoBox2d);

pSolveConst = new btSequentialImpulseConstraintSolver;
pDynamicsWorld = new btDiscreteDynamicsWorld(pDispatcher, pBroadphase, pSolveConst, pCollisionConfiguration);
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: exception@ pDynamicsWorld->getBroadphase()->getOverlappi

Post by xexuxjy »

From what I remember the overlapping pair cache will be created during construction of the broadphase if you don't provide one yourself. Can you inspect the broadphase to see if the other parts of it have 'sensible' values?