summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-02-01 12:51:44 -0800
committerTodd Stinson <stinson@lindenlab.com>2012-02-01 12:51:44 -0800
commit2cd52d43e5b4e185922b76f3d070931d698f1213 (patch)
tree0ea3a37e5e6c790717e3fa6383b5ec14e9030d7c /indra/newview
parent00c64bf14db9440fcd5eae8a6b7595dfc11d0bfe (diff)
PATH-235: Rewiring a bit of the path generation code to remove extraneous error messages and to rebuild when the character width or the start point changes.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp36
-rw-r--r--indra/newview/llfloaterpathfindingconsole.h3
2 files changed, 22 insertions, 17 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index a39869eddd..50edc55d76 100644
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -342,7 +342,9 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
mTerrainMaterialB(NULL),
mTerrainMaterialC(NULL),
mTerrainMaterialD(NULL),
- mNavMeshCnt(0)
+ mNavMeshCnt(0),
+ mHasStartPoint(false),
+ mHasEndPoint(false)
{
for (int i=0;i<MAX_OBSERVERS;++i)
{
@@ -521,19 +523,10 @@ void LLFloaterPathfindingConsole::onPathSelectionSwitch()
switch (getPathSelectionState())
{
case kPathSelectNone :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mPathSelectionRadioGroup->getName() << "' to PathSelectNone"
- << llendl;
break;
case kPathSelectStartPoint :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mPathSelectionRadioGroup->getName() << "' to PathSelectStartPoint"
- << llendl;
break;
case kPathSelectEndPoint :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mPathSelectionRadioGroup->getName() << "' to PathSelectEndPoint"
- << llendl;
break;
default :
llassert(0);
@@ -543,9 +536,7 @@ void LLFloaterPathfindingConsole::onPathSelectionSwitch()
void LLFloaterPathfindingConsole::onCharacterWidthSet()
{
- F32 characterWidth = getCharacterWidth();
- llwarns << "functionality has not yet been implemented to set '" << mCharacterWidthSlider->getName()
- << "' to the value (" << characterWidth << ")" << llendl;
+ generatePath();
}
void LLFloaterPathfindingConsole::onCharacterTypeSwitch()
@@ -636,17 +627,28 @@ void LLFloaterPathfindingConsole::providePathingData( const LLVector3& point1, c
case kPathSelectStartPoint :
mPathData.mStartPointA = point1;
mPathData.mEndPointA = point2;
+ mHasStartPoint = true;
break;
case kPathSelectEndPoint :
mPathData.mStartPointB = point1;
mPathData.mEndPointB = point2;
- mPathData.mCharacterWidth = getCharacterWidth();
- LLPathingLib::getInstance()->generatePath( mPathData );
+ mHasEndPoint = true;
break;
default :
llassert(0);
break;
- }
-} \ No newline at end of file
+ }
+
+ generatePath();
+}
+
+void LLFloaterPathfindingConsole::generatePath()
+{
+ if (mHasStartPoint && mHasEndPoint)
+ {
+ mPathData.mCharacterWidth = getCharacterWidth();
+ LLPathingLib::getInstance()->generatePath(mPathData);
+ }
+}
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h
index e97e4d0933..f62fd9742b 100644
--- a/indra/newview/llfloaterpathfindingconsole.h
+++ b/indra/newview/llfloaterpathfindingconsole.h
@@ -122,6 +122,7 @@ private:
void onTerrainMaterialBSet();
void onTerrainMaterialCSet();
void onTerrainMaterialDSet();
+ void generatePath();
LLCheckBoxCtrl *mShowNavMeshCheckBox;
LLCheckBoxCtrl *mShowExcludeVolumesCheckBox;
@@ -143,6 +144,8 @@ private:
//Container that is populated and subsequently submitted to the LLPathingSystem for processing
LLPathingLib::PathingPacket mPathData;
+ bool mHasStartPoint;
+ bool mHasEndPoint;
};
#endif // LL_LLFLOATERPATHFINDINGCONSOLE_H