There's an openGL one that come with the examples that I'm guessing I can use however for portability (when the OpenGL driver isn't used) it would be nice.
Has anyone taken the time to do this?
Cheers,
Adversus.
Has anyone written a btIDebugDraw for Irrlicht
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Last edited by rogerborg on Fri Nov 14, 2008 3:38 pm, edited 1 time in total.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
But btIDebugDraw does 
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Here's a modified version of what I'm using (debug lines only):
m_debugNode is a custom scene node that is used to accumulate and render the debug lines. It's reset in the render loop. You can view sample code for it at: m_debugNode
A bit incomplete but hopefully you get the idea.
Code: Select all
static void BulletToIrr(const btVector3& in, vector3df& result)
{
result.set(in.getX(),in.getY(),-in.getZ());
}
class BulletDebugDraw : public btIDebugDraw
{
public:
//
// debug functionality
//
void drawLine(const btVector3& from,const btVector3& to,const btVector3& color);
{
vector3df v1,v2;
BulletToIrr(from,v1);
BulletToIrr(to,v2);
// handle bullet simplex debug color bug...
SColor icolor((u32)color.x()*255.0, (u32)color.y()*255.0, (u32)color.z()*255.0);
S3DVertex vert1(v1,v1,icolor,vector2df());
S3DVertex vert2(v2,v2,icolor,vector2df());
m_debugNode->addLine(vert1,vert2);
}
void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,float distance,int lifeTime,const btVector3& color)
{
}
void draw3dText(const btVector3& location,const char* textString)
{
}
}
A bit incomplete but hopefully you get the idea.

