Debug simplex colors patch

pc0de
Posts: 3
Joined: Sun Oct 29, 2006 5:04 pm

Debug simplex colors patch

Post by pc0de »

I think the line colors are intended to be red, green, and blue. To be consistent with the colors created in "btDiscreteDynamicsWorld::debugDrawWorld":

Code: Select all

Index: src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
===================================================================
--- src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp	(revision 1390)
+++ src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp	(working copy)
@@ -935,9 +935,9 @@
 	// Draw a small simplex at the center of the object
 	{
 		btVector3 start = worldTransform.getOrigin();
-		getDebugDrawer()->drawLine(start, start+worldTransform.getBasis() * btVector3(1,0,0), btVector3(1,0,0));
-		getDebugDrawer()->drawLine(start, start+worldTransform.getBasis() * btVector3(0,1,0), btVector3(0,1,0));
-		getDebugDrawer()->drawLine(start, start+worldTransform.getBasis() * btVector3(0,0,1), btVector3(0,0,1));
+		getDebugDrawer()->drawLine(start, start+worldTransform.getBasis() * btVector3(1,0,0), btVector3(255,0,0));
+		getDebugDrawer()->drawLine(start, start+worldTransform.getBasis() * btVector3(0,1,0), btVector3(0,255,0));
+		getDebugDrawer()->drawLine(start, start+worldTransform.getBasis() * btVector3(0,0,1), btVector3(0,0,255));
 	}
 
 	if (shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE)

mi076
Posts: 144
Joined: Fri Aug 01, 2008 6:36 am
Location: Bonn, Germany

Re: Debug simplex colors patch

Post by mi076 »

I don't believe this color notation (0-255) is consistent, everywhere (GL_ShapeDrawer,
GLDebugDrawer) glColor3f() is called, and it requires float argument from 0.0 to 1.0. Giving 255 to glColor3f is not correct. It resembles glColor3ub notation, but i have not seen it. Better to set to 0.0-1.0 everywhere.