From e2fd0266ca7249e2008b68f11050973d1e429a62 Mon Sep 17 00:00:00 2001 From: prep Date: Thu, 5 Jan 2012 10:20:18 -0500 Subject: path-149 overlay of navmesh on onto renderables --- indra/llrender/llrendernavprim.cpp | 17 +++++++++++++---- indra/llrender/llrendernavprim.h | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp index 11e60548e2..1a0103e8f0 100644 --- a/indra/llrender/llrendernavprim.cpp +++ b/indra/llrender/llrendernavprim.cpp @@ -35,7 +35,7 @@ //============================================================================= LLRenderNavPrim gRenderNav; //============================================================================= -void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& end, int color ) const +void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& end, int color,bool overlayMode ) const { LLGLSLShader::sNoFixedFunction = false; LLColor4 colorA( color ); @@ -54,10 +54,17 @@ void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& en glLineWidth(1.0f); } //============================================================================= -void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ) const +void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color,bool overlayMode ) const { - glLineWidth(1.5f); - glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); + glLineWidth(1.5f); + if ( overlayMode ) + { + glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); + } + else + { + glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); + } LLGLDisable cull(GL_CULL_FACE); LLColor4 colorA( color ); colorA*=1.5f; @@ -71,6 +78,8 @@ void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const L } gGL.end(); gGL.flush(); + glLineWidth(1.0f); + glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); LLGLSLShader::sNoFixedFunction = true; } //============================================================================= diff --git a/indra/llrender/llrendernavprim.h b/indra/llrender/llrendernavprim.h index cd57fd2223..a30a14551d 100644 --- a/indra/llrender/llrendernavprim.h +++ b/indra/llrender/llrendernavprim.h @@ -40,9 +40,9 @@ class LLRenderNavPrim { public: //Draw a line - void renderSegment( const LLVector3& start, const LLVector3& end, int color ) const; + void renderSegment( const LLVector3& start, const LLVector3& end, int color,bool overlayMode ) const; //Draw simple tri - void renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ) const; + void renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color,bool overlayMode ) const; //Draw the contents of vertex buffer void renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt ); -- cgit v1.2.3