summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpathfindingconsole.cpp
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/llfloaterpathfindingconsole.cpp
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/llfloaterpathfindingconsole.cpp')
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp36
1 files changed, 19 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);
+ }
+}