From 0538dcf62e3c13b50fc0828e930fa50e4050302d Mon Sep 17 00:00:00 2001 From: prep Date: Thu, 1 Dec 2011 10:54:21 -0500 Subject: New navmesh viewer options, rendering improvements, etc. --- indra/llrender/llrendersegment.cpp | 31 +++++++--- indra/llrender/llrendersegment.h | 1 + indra/newview/llnavmeshstation.cpp | 2 +- indra/newview/llviewermenufile.cpp | 68 +++++++--------------- indra/newview/pipeline.cpp | 16 +++-- indra/newview/skins/default/xui/en/menu_viewer.xml | 20 +++++-- 6 files changed, 71 insertions(+), 67 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llrendersegment.cpp b/indra/llrender/llrendersegment.cpp index 8f856f62f3..1f57af174e 100644 --- a/indra/llrender/llrendersegment.cpp +++ b/indra/llrender/llrendersegment.cpp @@ -36,19 +36,36 @@ LLRenderSegment gSegment; //============================================================================= void LLRenderSegment::renderSegment( const LLVector3& start, const LLVector3& end, int color ) -{ - LLColor4 colorA = LLColor4::yellow; - - gGL.color4fv( colorA.mV ); +{ + + LLColor4 colorA( color ); + glLineWidth(1.5f); + gGL.color3fv( colorA.mV ); gGL.begin(LLRender::LINES); { gGL.vertex3fv( start.mV ); - gGL.vertex3fv( end.mV ); } - + gGL.end(); + glLineWidth(1.0f); +} +//============================================================================= +void LLRenderSegment::renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ) +{ + LLGLEnable offset(GL_POLYGON_OFFSET_LINE); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glLineWidth(1.5f); + LLColor4 colorA( color ); + gGL.color4fv( colorA.mV ); + gGL.begin(LLRender::TRIANGLES); + { + gGL.vertex3fv( a.mV ); + gGL.vertex3fv( b.mV ); + gGL.vertex3fv( c.mV ); + } gGL.end(); - + + glLineWidth(1.f); } //============================================================================= \ No newline at end of file diff --git a/indra/llrender/llrendersegment.h b/indra/llrender/llrendersegment.h index d929d6f628..58bc083e25 100644 --- a/indra/llrender/llrendersegment.h +++ b/indra/llrender/llrendersegment.h @@ -40,6 +40,7 @@ class LLRenderSegment { public: void renderSegment( const LLVector3& start, const LLVector3& end, int color ); + void renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ); private: }; diff --git a/indra/newview/llnavmeshstation.cpp b/indra/newview/llnavmeshstation.cpp index 2f7e62b8ae..9ae8492380 100644 --- a/indra/newview/llnavmeshstation.cpp +++ b/indra/newview/llnavmeshstation.cpp @@ -27,7 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llnavmeshstation.h" #include "llcurl.h" -#include "LLPathingLib.h"//prep# fixme +#include "llpathinglib.h" #include "llagent.h" #include "llviewerregion.h" #include "llsdutil.h" diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 2c826788a2..91ca4175f4 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -74,13 +74,12 @@ #include "lluuid.h" #include "llvorbisencode.h" #include "message.h" +#include "llpathinglib.h" +#include "llnavmeshstation.h" // system libraries #include -#include "LLPathingLib.h" -#include "llnavmeshstation.h" - class LLBuildNavMesh : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -89,56 +88,29 @@ class LLBuildNavMesh : public view_listener_t return result; } }; -//prep#TODO#remove if not needed for ship -class LLFileUploadNavMesh : public view_listener_t, LLNavMeshObserver +class LLNavMeshRenderingToggle : public view_listener_t { - bool handleEvent(const LLSD& userdata) { - LLPathingLib::initSystem(); - - if ( LLPathingLib::getInstance() == NULL ) - { - llinfos<<"No implementation of pathing library."<toggleRenderNavMeshState( ); } - else - { - LLPathingLib::getInstance()->testNavMeshGenerationWithLocalAsset(); - LLSD data; - LLPLResult result = LLPathingLib::getInstance()->getNavMeshAsLLSD( data ); - if ( result == LLPL_OK ) - { - std::string capability = "NavMeshUpload"; - std::string url = gAgent.getRegion()->getCapability( capability ); - if ( !url.empty() ) - { - llinfos<< typeid(*this).name() <<"setNavMeshUploadURL "<< url <getRegionID(); - data["sim_host"] = gAgent.getRegion()->getHost().getString(); - data["sim_port"] = (S32)gAgent.getRegion()->getHost().getPort(); - LLNavMeshStation::getInstance()->setNavMeshUploadURL( url ); - LLNavMeshStation::getInstance()->postNavMeshToServer( data, getObserverHandle() ); - } - else - { - llinfos<<"region contained no capability of type ["<toggleRenderNavMeshandShapesState( ); } - return true; } }; - - +//prep# class LLPathingTools : public view_listener_t, LLNavMeshDownloadObserver { @@ -173,8 +145,7 @@ class LLPathingTools : public view_listener_t, LLNavMeshDownloadObserver { llinfos<<"Region has does not required caps of type ["<renderNavMesh(); + if ( LLPathingLib::getInstance() ) + { + if ( LLPathingLib::getInstance()->getRenderNavMeshState() ) + { + LLPathingLib::getInstance()->renderNavMesh(); + } + if ( LLPathingLib::getInstance()->getRenderNavMeshandShapesState() ) + { + LLPathingLib::getInstance()->renderNavMeshandShapes(); + } } if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred) diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index e7a0f1b0e0..2f88b6fbf1 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -657,17 +657,25 @@ name="Pathing Tools" tear_off="true" visible="true"> - - - + + + label="Toggle Navigation Mesh Display" + name="Toggle Navigation Mesh View"> + + + + -- cgit v1.2.3