From 154e569923d0caf99fb0d24af8475731f5ceaf33 Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 21 Mar 2012 09:53:32 -0400 Subject: Path-282: Added support for viewing the walkability map for various character types --- indra/newview/llfloaterpathfindingconsole.cpp | 29 +++++++++++++++++++++++++++ indra/newview/llfloaterpathfindingconsole.h | 2 +- indra/newview/pipeline.cpp | 3 ++- 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index ae08a166a1..f830dc1fac 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -368,6 +368,35 @@ LLFloaterPathfindingConsole::ERenderHeatmapType LLFloaterPathfindingConsole::get return renderHeatmapType; } +int LLFloaterPathfindingConsole::getHeatMapType() const +{ + //converts the pathfinding console values to the navmesh filter values + + int renderHeatmapType = 4; //none + + switch ( mShowNavMeshWalkabilityComboBox->getValue().asInteger() ) + { + case XUI_RENDER_HEATMAP_A : + renderHeatmapType = 0; + break; + case XUI_RENDER_HEATMAP_B : + renderHeatmapType = 1; + break; + case XUI_RENDER_HEATMAP_C : + renderHeatmapType = 2; + break; + case XUI_RENDER_HEATMAP_D : + renderHeatmapType = 3; + break; + default : + renderHeatmapType = 4; + break; + } + + return renderHeatmapType; +} + + void LLFloaterPathfindingConsole::setRenderHeatmapType(ERenderHeatmapType pRenderHeatmapType) { LLSD comboBoxValue; diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index 8c22e5ead7..dff9b08383 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -112,7 +112,7 @@ public: bool getHeartBeat() const { return mHeartBeat;} void setHeartBeat( bool state ) { mHeartBeat=state; } void regionCrossingOccured(); - + int getHeatMapType() const; protected: diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f0c5342425..f91dfa7c27 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4347,7 +4347,8 @@ void LLPipeline::renderDebug() glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); } - llPathingLibInstance->renderNavMesh(); + int materialIndex = pathfindingConsole->getHeatMapType(); + llPathingLibInstance->renderNavMesh( materialIndex ); glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); glLineWidth(1.0f); gGL.flush(); -- cgit v1.2.3