From 4c60c59610493c5f95776af2ac93ff34f741b427 Mon Sep 17 00:00:00 2001 From: prep Date: Fri, 9 Dec 2011 15:56:12 -0500 Subject: added vbo support for physics shapes & fixed navmesh/shape menu toggle --- indra/llrender/llrendernavprim.cpp | 48 ++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 20 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp index 3e14c34168..96027ba65b 100644 --- a/indra/llrender/llrendernavprim.cpp +++ b/indra/llrender/llrendernavprim.cpp @@ -24,7 +24,7 @@ * $/LicenseInfo$ */ - + #include "linden_common.h" #include "llrendernavprim.h" #include "llerror.h" @@ -34,17 +34,17 @@ LLRenderNavPrim gRenderNav; //============================================================================= void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& end, int color ) const -{ +{ LLColor4 colorA( color ); glLineWidth(1.5f); - gGL.color3fv( colorA.mV ); - - gGL.begin(LLRender::LINES); - { - gGL.vertex3fv( start.mV ); - gGL.vertex3fv( end.mV ); - } + gGL.color3fv( colorA.mV ); + + gGL.begin(LLRender::LINES); + { + gGL.vertex3fv( start.mV ); + gGL.vertex3fv( end.mV ); + } gGL.end(); glLineWidth(1.0f); } @@ -58,21 +58,29 @@ void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const L glLineWidth(1.5f); LLColor4 colorA( color ); colorA*=2.0f; - gGL.color4fv( colorA.mV ); - - gGL.begin(LLRender::TRIANGLES); - { - gGL.vertex3fv( a.mV ); - gGL.vertex3fv( b.mV ); - gGL.vertex3fv( c.mV ); - } - gGL.end(); + gGL.color4fv( colorA.mV ); + + gGL.begin(LLRender::TRIANGLES); + { + gGL.vertex3fv( a.mV ); + gGL.vertex3fv( b.mV ); + gGL.vertex3fv( c.mV ); + } + gGL.end(); gGL.flush(); } //============================================================================= void LLRenderNavPrim::renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt ) { - //pVBO->setBuffer( LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR ); + glPolygonMode(GL_NONE, GL_FILL); + LLGLDisable cull(GL_CULL_FACE); + glColor3f ( 1.0f, 0.0f, 0.0f ) ; + glDisable( GL_COLOR_MATERIAL ); + + pVBO->setBuffer( LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR ); pVBO->drawArrays( LLRender::TRIANGLES, 0, vertCnt ); + gGL.flush(); + glEnable( GL_COLOR_MATERIAL ); + } -//============================================================================= \ No newline at end of file +//============================================================================= -- cgit v1.2.3