From 901ed57e6bc1fae1c3c0a6f6790c0361298c5744 Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 28 Mar 2012 13:11:45 -0400 Subject: Added support for customizing the colors used in the navmesh visualizer. --- indra/newview/app_settings/settings.xml | 249 ++++++++++++++++++++++++++ indra/newview/llfloaterpathfindingconsole.cpp | 51 ++++++ indra/newview/llfloaterpathfindingconsole.h | 4 + indra/newview/pipeline.cpp | 4 +- 4 files changed, 307 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index eb2b0834e9..aac04ae15f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13516,6 +13516,255 @@ Value 0 + NavMeshClearRGB + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 0.0 + 0.0 + 0.0 + + + WalkableRGB + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 255.0 + 255.0 + 255.0 + + + WalkableA + + Comment + yay! + Persist + 1 + Type + F32 + Value + 75 + + ObstacleRGB + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 255.0 + 0.0 + 0.0 + + + ObstacleA + + Comment + yay! + Persist + 1 + Type + F32 + Value + 75 + + MaterialRGB + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 255.0 + 255.0 + 0.0 + + + MaterialA + + Comment + yay! + Persist + 1 + Type + F32 + Value + 75 + + ExclusionRGB + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 255.0 + 0.0 + 0.0 + + + ExclusionA + + Comment + yay! + Persist + 1 + Type + F32 + Value + 75 + +ConnectedEdgeRGB + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 0.0 + 40.0 + 114.0 + + + ConnectedEdgeA + + Comment + yay! + Persist + 1 + Type + F32 + Value + 75 + +BoundaryEdgeRGB + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 170.0 + 0.0 + 0.0 + + + BoundaryEdgeA + + Comment + yay! + Persist + 1 + Type + F32 + Value + 75 + +HeatColorBase + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 0.0 + 40.0 + 114.0 + + + HeatColorBaseA + + Comment + yay! + Persist + 1 + Type + F32 + Value + 75 + +HeatColorMax + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 0.0 + 40.0 + 114.0 + + + HeatColorMaxA + + Comment + yay! + Persist + 1 + Type + F32 + Value + 75 + + FaceColorRGB + + Comment + yay! + Persist + 1 + Type + Vector3 + Value + + 0.0 + 255.0 + 255.0 + + + FaceColorA + + Comment + yay! + Persist + 1 + Type + F32 + Value + 0 + diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index c83153a15d..0af16052d0 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -170,6 +170,7 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) } else { + fillInColorsForNavMeshVisualization(); if (!mNavMeshZoneSlot.connected()) { mNavMeshZoneSlot = mNavMeshZone.registerNavMeshZoneListener(boost::bind(&LLFloaterPathfindingConsole::onNavMeshZoneCB, this, _1)); @@ -1008,3 +1009,53 @@ void LLFloaterPathfindingConsole::regionCrossingOccured() statusText = getString("navmesh_update_needed"); mPathfindingViewerStatus->setText((LLStringExplicit)statusText, styleParams); } + +void LLFloaterPathfindingConsole::fillInColorsForNavMeshVisualization() +{ + LLPathingLib::NavMeshColors colors; + + LLVector3 in = gSavedSettings.getVector3("WalkableRGB"); + F32 a = gSavedSettings.getF32("WalkableA"); + colors.mWalkable= LLColor4U( in[0],in[1],in[2],a ); + + in = gSavedSettings.getVector3("ObstacleRGB"); + a = gSavedSettings.getF32("ObstacleA"); + colors.mObstacle= LLColor4U( in[0],in[1],in[2],a ); + + in = gSavedSettings.getVector3("MaterialRGB"); + a = gSavedSettings.getF32("MaterialA"); + colors.mMaterial= LLColor4U( in[0],in[1],in[2],a ); + + in = gSavedSettings.getVector3("ExclusionRGB"); + a = gSavedSettings.getF32("ExclusionA"); + colors.mExclusion= LLColor4U( in[0],in[1],in[2],a ); + + in = gSavedSettings.getVector3("ConnectedEdgeRGB"); + a = gSavedSettings.getF32("ConnectedEdgeA"); + colors.mConnectedEdge= LLColor4U( in[0],in[1],in[2],a ); + + in = gSavedSettings.getVector3("BoundaryEdgeRGB"); + a = gSavedSettings.getF32("BoundaryEdgeA"); + colors.mBoundaryEdge= LLColor4U( in[0],in[1],in[2],a ); + + in = gSavedSettings.getVector3("HeatColorBase"); + a = gSavedSettings.getF32("HeatColorBaseA"); + colors.mHeatColorBase= LLColor4U( in[0],in[1],in[2],a ); + + in = gSavedSettings.getVector3("HeatColorMax"); + a = gSavedSettings.getF32("HeatColorMaxA"); + colors.mHeatColorMax= LLColor4U( in[0],in[1],in[2],a ); + + in = gSavedSettings.getVector3("FaceColorRGB"); + a = gSavedSettings.getF32("FaceColorA"); + colors.mFaceColor= LLColor4U( in[0],in[1],in[2],a ); + + in = gSavedSettings.getVector3("NavMeshClearRGB"); + colors.mNavMeshClear= LLColor4U( in[0],in[1],in[2],0 ); + + mNavMeshColors = colors; + + LLPathingLib::getInstance()->setNavMeshColors( colors ); +} + + diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index 447eaf726d..3ead048fc7 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -157,6 +157,7 @@ private: void updatePathTestStatus(); void resetShapeRenderFlags() { mShapeRenderFlags = 0; } void setShapeRenderFlag( LLPathingLib::LLShapeType type ) { mShapeRenderFlags |= (1< mSelfHandle; LLCheckBoxCtrl *mShowNavMeshCheckBox; @@ -199,6 +200,9 @@ private: bool mHeartBeat; static LLHandle sInstanceHandle; + +public: + LLPathingLib::NavMeshColors mNavMeshColors; }; #endif // LL_LLFLOATERPATHFINDINGCONSOLE_H diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c58b216c6a..8a691d3a16 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4343,7 +4343,9 @@ void LLPipeline::renderDebug() } else { - glClearColor(0,0,0,0); + //glClearColor(0,0,0,0); + LLColor4U clearColor = pathfindingConsole->mNavMeshColors.mNavMeshClear; + glClearColor(clearColor.mV[0],clearColor.mV[1],clearColor.mV[2],0); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); } -- cgit v1.2.3