How to use GLDebugDrawer correctly?

lemonriver
Posts: 23
Joined: Thu Dec 30, 2010 4:04 am
Location: Hangzhou China

How to use GLDebugDrawer correctly?

Post by lemonriver »

It does not display the triangles of any softbody in AppAllBulletDemos , except
when I tick the "WireFrame" checkbox.
What's the reason? I found the "AppSoftBodyDemo" shows correctly.
Thanks! :)
lemonriver
Posts: 23
Joined: Thu Dec 30, 2010 4:04 am
Location: Hangzhou China

Re: How to use GLDebugDrawer correctly?

Post by lemonriver »

plus: I always work with the latest svn version of bullet .
lemonriver
Posts: 23
Joined: Thu Dec 30, 2010 4:04 am
Location: Hangzhou China

Re: How to use GLDebugDrawer correctly?

Post by lemonriver »

Solved !

Code: Select all

void	btSoftRigidDynamicsWorld::debugDrawWorld()
{
	btDiscreteDynamicsWorld::debugDrawWorld();

	if (getDebugDrawer())
	{
		int i;
		for (  i=0;i<this->m_softBodies.size();i++)
		{
			btSoftBody*	psb=(btSoftBody*)this->m_softBodies[i];
			if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))
			{
				btSoftBodyHelpers::DrawFrame(psb,m_debugDrawer);
				btSoftBodyHelpers::Draw(psb,m_debugDrawer,m_drawFlags);
			}
			
			if (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawAabb))
			{
				if(m_drawNodeTree)		btSoftBodyHelpers::DrawNodeTree(psb,m_debugDrawer);
				if(m_drawFaceTree)		btSoftBodyHelpers::DrawFaceTree(psb,m_debugDrawer);
				if(m_drawClusterTree)	btSoftBodyHelpers::DrawClusterTree(psb,m_debugDrawer);
			}
		}		
	}	
}
I comment out the words "& (btIDebugDraw::DBG_DrawWireframe)". It works :)