diff options
author | prep <prep@lindenlab.com> | 2012-03-28 13:11:45 -0400 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2012-03-28 13:11:45 -0400 |
commit | 901ed57e6bc1fae1c3c0a6f6790c0361298c5744 (patch) | |
tree | 811a2a45af52a410a142262ddff58cf84e95d0e7 | |
parent | 473da43c1bbc20245b3a74c1adc7c92f91d25807 (diff) |
Added support for customizing the colors used in the navmesh visualizer.
-rw-r--r-- | indra/newview/app_settings/settings.xml | 249 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 51 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.h | 4 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 4 |
4 files changed, 307 insertions, 1 deletions
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 @@ <key>Value</key> <integer>0</integer> </map> + <key>NavMeshClearRGB</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.0</real> + <real>0.0</real> + </array> + </map> + <key>WalkableRGB</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>255.0</real> + <real>255.0</real> + <real>255.0</real> + </array> + </map> + <key>WalkableA</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>75</real> + </map> + <key>ObstacleRGB</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>255.0</real> + <real>0.0</real> + <real>0.0</real> + </array> + </map> + <key>ObstacleA</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>75</real> + </map> + <key>MaterialRGB</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>255.0</real> + <real>255.0</real> + <real>0.0</real> + </array> + </map> + <key>MaterialA</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>75</real> + </map> + <key>ExclusionRGB</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>255.0</real> + <real>0.0</real> + <real>0.0</real> + </array> + </map> + <key>ExclusionA</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>75</real> + </map> +<key>ConnectedEdgeRGB</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>40.0</real> + <real>114.0</real> + </array> + </map> + <key>ConnectedEdgeA</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>75</real> + </map> +<key>BoundaryEdgeRGB</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>170.0</real> + <real>0.0</real> + <real>0.0</real> + </array> + </map> + <key>BoundaryEdgeA</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>75</real> + </map> +<key>HeatColorBase</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>40.0</real> + <real>114.0</real> + </array> + </map> + <key>HeatColorBaseA</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>75</real> + </map> +<key>HeatColorMax</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>40.0</real> + <real>114.0</real> + </array> + </map> + <key>HeatColorMaxA</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>75</real> + </map> + <key>FaceColorRGB</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>255.0</real> + <real>255.0</real> + </array> + </map> + <key>FaceColorA</key> + <map> + <key>Comment</key> + <string>yay!</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0</real> + </map> </map> </llsd> 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<<type); } + void fillInColorsForNavMeshVisualization(); LLRootHandle<LLFloaterPathfindingConsole> mSelfHandle; LLCheckBoxCtrl *mShowNavMeshCheckBox; @@ -199,6 +200,9 @@ private: bool mHeartBeat; static LLHandle<LLFloaterPathfindingConsole> 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 );
}
|