Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-07-13 16:48:18 +0000
committerStijn Buys <ingar@osirion.org>2011-07-13 16:48:18 +0000
commit134d7e6b27944bf47c81b75fa5906661f1de6f40 (patch)
treeb9fcf7f455990ec8c18369b7d1cd083c537d1489 /src/render/debugdrawer.cc
parent5a49f660dfbdb0c684daf83c39a845efd58efc0b (diff)
Colour support in the bullet debug drawer.
Diffstat (limited to 'src/render/debugdrawer.cc')
-rw-r--r--src/render/debugdrawer.cc5
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);