summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpathfindingconsole.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-04-05 12:16:42 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-04-05 12:16:42 -0700
commit3d9374d1fd766f8724f801056b21651cbc244f69 (patch)
tree2d816b7024c5fb5a49113f7685abed618595dac2 /indra/newview/llfloaterpathfindingconsole.cpp
parent4e9d9ebe8a480ffdd9e069388c1e9845477f5f66 (diff)
parentc1dab242520b20394f9e0c1dd1652c74f925d6eb (diff)
Pull and merge from ssh://hg@bitbucket.org/stinson_linden/viewer-development-pf-xray.
Diffstat (limited to 'indra/newview/llfloaterpathfindingconsole.cpp')
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp87
1 files changed, 49 insertions, 38 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index d1606cbd49..d0e047d48b 100644
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -97,6 +97,10 @@ BOOL LLFloaterPathfindingConsole::postBuild()
llassert(mShowWorldCheckBox != NULL);
mShowWorldCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWorldToggle, this));
+ mShowXRayCheckBox = findChild<LLCheckBoxCtrl>("x-ray");
+ llassert(mShowXRayCheckBox != NULL);
+ mShowXRayCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowXRayToggle, this));
+
mViewCharactersButton = findChild<LLButton>("view_characters_floater");
llassert(mViewCharactersButton != NULL);
mViewCharactersButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onViewCharactersClicked, this));
@@ -225,6 +229,7 @@ void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting)
mShowStaticObstaclesCheckBox->set( false );
mShowExclusionVolumesCheckBox->set( false );
mShowWorldCheckBox->set( false );
+ mShowXRayCheckBox->set(false);
}
BOOL LLFloaterPathfindingConsole::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down)
@@ -346,6 +351,17 @@ void LLFloaterPathfindingConsole::setRenderWorld(BOOL pIsRenderWorld)
mShowWorldCheckBox->set(pIsRenderWorld);
}
+BOOL LLFloaterPathfindingConsole::isRenderXRay() const
+{
+ return mShowXRayCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderXRay(BOOL pIsRenderXRay)
+{
+ mShowXRayCheckBox->set(pIsRenderXRay);
+}
+
+
LLFloaterPathfindingConsole::ERenderHeatmapType LLFloaterPathfindingConsole::getRenderHeatmapType() const
{
ERenderHeatmapType renderHeatmapType;
@@ -373,6 +389,7 @@ LLFloaterPathfindingConsole::ERenderHeatmapType LLFloaterPathfindingConsole::get
break;
}
+ LLPathingLib::getInstance()->rebuildNavMesh( getHeatMapType() );
return renderHeatmapType;
}
@@ -599,6 +616,12 @@ void LLFloaterPathfindingConsole::onShowWorldToggle()
}
}
+void LLFloaterPathfindingConsole::onShowXRayToggle()
+{
+ //nothing to do (xray parameter not stored in pathing lib
+}
+
+
void LLFloaterPathfindingConsole::onCharacterWidthSet()
{
generatePath();
@@ -1025,56 +1048,44 @@ void LLFloaterPathfindingConsole::fillInColorsForNavMeshVisualization()
LLPathingLib::NavMeshColors colors;
- LLVector3 in = gSavedSettings.getVector3("WalkableRGB");
- F32 a = gSavedSettings.getF32("WalkableA");
- colors.mWalkable= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ LLColor4 in = gSavedSettings.getColor4("PathfindingWalkable");
+ colors.mWalkable= LLColor4U(in);
- in = gSavedSettings.getVector3("ObstacleRGB");
- a = gSavedSettings.getF32("ObstacleA");
- colors.mObstacle= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ in = gSavedSettings.getColor4("PathfindingObstacle");
+ colors.mObstacle= LLColor4U(in);
- in = gSavedSettings.getVector3("MaterialRGB");
- a = gSavedSettings.getF32("MaterialA");
- colors.mMaterial= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ in = gSavedSettings.getColor4("PathfindingMaterial");
+ colors.mMaterial= LLColor4U(in);
- in = gSavedSettings.getVector3("ExclusionRGB");
- a = gSavedSettings.getF32("ExclusionA");
- colors.mExclusion= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ in = gSavedSettings.getColor4("PathfindingExclusion");
+ colors.mExclusion= LLColor4U(in);
- in = gSavedSettings.getVector3("ConnectedEdgeRGB");
- a = gSavedSettings.getF32("ConnectedEdgeA");
- colors.mConnectedEdge= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ in = gSavedSettings.getColor4("PathfindingConnectedEdge");
+ colors.mConnectedEdge= LLColor4U(in);
- in = gSavedSettings.getVector3("BoundaryEdgeRGB");
- a = gSavedSettings.getF32("BoundaryEdgeA");
- colors.mBoundaryEdge= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ in = gSavedSettings.getColor4("PathfindingBoundaryEdge");
+ colors.mBoundaryEdge= LLColor4U(in);
- in = gSavedSettings.getVector3("HeatColorBase");
- a = gSavedSettings.getF32("HeatColorBaseA");
- colors.mHeatColorBase= LLVector4(in, a);
+ in = gSavedSettings.getColor4("PathfindingHeatColorBase");
+ colors.mHeatColorBase= LLVector4(in.mV);
- in = gSavedSettings.getVector3("HeatColorMax");
- a = gSavedSettings.getF32("HeatColorMaxA");
- colors.mHeatColorMax= LLVector4( in, a );
+ in = gSavedSettings.getColor4("PathfindingHeatColorMax");
+ colors.mHeatColorMax= LLVector4( in.mV );
- in = gSavedSettings.getVector3("FaceColorRGB");
- a = gSavedSettings.getF32("FaceColorA");
- colors.mFaceColor= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ in = gSavedSettings.getColor4("PathfindingFaceColor");
+ colors.mFaceColor= LLColor4U(in);
- in = gSavedSettings.getVector3("StarValidColorRGB");
- a = gSavedSettings.getF32("StarValidColorA");
- colors.mStarValid= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ in = gSavedSettings.getColor4("PathfindingStarValidColor");
+ colors.mStarValid= LLColor4U(in);
- in = gSavedSettings.getVector3("StarInvalidRGB");
- a = gSavedSettings.getF32("StarInvalidA");
- colors.mStarInvalid= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ in = gSavedSettings.getColor4("PathfindingStarInvalidColor");
+ colors.mStarInvalid= LLColor4U(in);
- in = gSavedSettings.getVector3("TestPathColorRGB");
- a = gSavedSettings.getF32("TestPathColorA");
- colors.mTestPath= LLColor4U( (U8)in[0],(U8)in[1],(U8)in[2],(U8)a );
+ in = gSavedSettings.getColor4("PathfindingTestPathColor");
+ colors.mTestPath= LLColor4U(in);
- in = gSavedSettings.getVector3("NavMeshClearRGB");
- colors.mNavMeshClear= LLColor4(in[0], in[1], in[2], 0);
+ in = gSavedSettings.getColor4("PathfindingNavMeshClear");
+ colors.mNavMeshClear= LLColor4(in);
mNavMeshColors = colors;