diff options
-rw-r--r-- | src/render/debugdrawer.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/render/debugdrawer.cc b/src/render/debugdrawer.cc index 03d5746..b2ed87e 100644 --- a/src/render/debugdrawer.cc +++ b/src/render/debugdrawer.cc @@ -23,13 +23,16 @@ DebugDrawer::~DebugDrawer() void DebugDrawer::drawLine(const btVector3& from, const btVector3& to,const btVector3& color) { + gl::color(color[0], color[1], color[2]); gl::vertex(from[0], from[1], from[2]); gl::vertex(to[0], to[1], to[2]); } void DebugDrawer::drawLine(const btVector3& from, const btVector3 & to, const btVector3 & fromColor, const btVector3 & toColor) { + gl::color(fromColor[0], fromColor[1], fromColor[2]); gl::vertex(from[0], from[1], from[2]); + gl::color(toColor[0], toColor[1], toColor[2]); gl::vertex(to[0], to[1], to[2]); } @@ -75,6 +78,7 @@ void DebugDrawer::drawSphere(const btVector3 & p, btScalar radius, const btVecto void DebugDrawer::drawBox(const btVector3 & bbMin, const btVector3 & bbMax, const btVector3 & color) { + gl::color(color[0], color[1], color[2]); drawLine(btVector3(bbMin[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMin[1], bbMin[2]), color); drawLine(btVector3(bbMax[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMax[1], bbMin[2]), color); drawLine(btVector3(bbMax[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMax[1], bbMin[2]), color); @@ -91,6 +95,7 @@ void DebugDrawer::drawBox(const btVector3 & bbMin, const btVector3 & bbMax, cons void DebugDrawer::drawBox(const btVector3 & bbMin, const btVector3 & bbMax, const btTransform & trans, const btVector3 & color) { + gl::color(color[0], color[1], color[2]); drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), color); drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), color); drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), color); |