Debug Draw Setup Help. No Actions in List?

kurasu1415
Posts: 1
Joined: Sat Aug 17, 2013 9:14 am

Debug Draw Setup Help. No Actions in List?

Post by kurasu1415 »

So, I'm trying to setup a simple debug drawer. I've implemented my debug drawer, but upon debugging it looks like Bullet isn't even getting to my custom debug drawer. It looks like Bullet doesn't even know that I have something that needs drawing. It seems I have no actions, which means I have nothing to draw. I don't see how this is the case when I clearly have activity based on text output.

First, I initialize my drawer, and pass it to setDebugDrawer().

Code: Select all

debugDrawer.setDebugMode(btIDebugDraw::DBG_DrawWireframe);
dynamicsWorld->setDebugDrawer(&debugDrawer);


Then each game loop I run my simulation, and tell bullet to draw using its debug drawer.

Code: Select all

while(gameIsRunning())
{
dynamicsWorld->stepSimulation(1.f/60.f,10);
dynamicsWorld->debugDrawWorld();
}
With this, I stepped through my program and it does get into debugDrawWorld(). It get's into a loop going through a list of actions. For some reason, I have no actions even though I clearly have things happening based on text output. the loop I'm referring to is in

btDiscreteDynamicsWorld.cpp

Code: Select all

if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb | btIDebugDraw::DBG_DrawNormals)))
	{
		int i;

		if (getDebugDrawer() && getDebugDrawer()->getDebugMode())
		{
			for (i=0;i<m_actions.size();i++)
			{
				m_actions[i]->debugDraw(m_debugDrawer);
			}
		}
	}
Does anyone have any idea why bullet would not be attempting to draw any of my objects?
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Debug Draw Setup Help. No Actions in List?

Post by xexuxjy »

it wouldn't be in the actions section. Most of the work for drawing the debug shapes is in btCollisionWorld::debugDrawWorld which is the first thing called in btDiscreteDynamicsWorld::debugDrawWorld . It's worth putting a breakpoint there and seeing why it's not being hit.