From 65acaab16ffaa4cc6bed0934973ead659df20741 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 13 May 2010 01:31:45 -0500 Subject: working inworld vis --- indra/newview/llspatialpartition.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'indra/newview/llspatialpartition.cpp') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index ed99f8648f..025c5084c3 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2671,24 +2671,36 @@ void renderPhysicsShape(LLDrawable* drawable) if (decomp) { gGL.pushMatrix(); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glMultMatrixf((F32*) volume->getRelativeXform().mMatrix); static std::vector color; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + for (U32 i = 0; i < decomp->mHull.size(); ++i) { if (color.size() <= i) { - color.push_back(LLColor4U(rand()%128+127, rand()%128+127, rand()%128+127)); + color.push_back(LLColor4U(rand()%128+127, rand()%128+127, rand()%128+127, 255)); } - glColor4ubv(color[i].mV); - - LLVertexBuffer* buff = decomp->mMesh; + + LLVertexBuffer* buff = decomp->mMesh[i]; buff->setBuffer(LLVertexBuffer::MAP_VERTEX); + + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glColor4ubv(color[i].mV); buff->drawArrays(LLRender::TRIANGLES, 0, buff->getNumVerts()); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + + { + LLGLEnable blend(GL_BLEND); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + glColor4ub(color[i].mV[0], color[i].mV[1], color[i].mV[2], 64); + buff->drawArrays(LLRender::TRIANGLES, 0, buff->getNumVerts()); + } } - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + gGL.popMatrix(); } } -- cgit v1.2.3