From a33e24413ea74aaad91d9eeaa685d1c523c5d210 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 2 Mar 2012 19:17:16 -0800 Subject: PATH-304,PATH-205: Initial reworking of the navmesh download functionality. --- indra/newview/llpathfindingnavmesh.cpp | 133 +++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 indra/newview/llpathfindingnavmesh.cpp (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp new file mode 100644 index 0000000000..fd1a498e3b --- /dev/null +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -0,0 +1,133 @@ +/** + * @file llpathfindingnavmesh.cpp + * @author William Todd Stinson + * @brief A class for representing the navmesh of a pathfinding region. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "lluuid.h" +#include "llpathfindingnavmesh.h" +#include "llsdserialize.h" + +#include + +//--------------------------------------------------------------------------- +// LLPathfindingNavMesh +//--------------------------------------------------------------------------- + +LLPathfindingNavMesh::LLPathfindingNavMesh(const LLUUID &pRegionUUID) + : mRegionUUID(pRegionUUID), + mNavMeshRequestStatus(kNavMeshRequestUnknown), + mNavMeshSignal(), + mNavMeshData(), + mNavMeshVersion(0U) +{ +} + +LLPathfindingNavMesh::~LLPathfindingNavMesh() +{ +} + +LLPathfindingNavMesh::navmesh_slot_t LLPathfindingNavMesh::registerNavMeshListener(navmesh_callback_t pNavMeshCallback) +{ + return mNavMeshSignal.connect(pNavMeshCallback); +} + +bool LLPathfindingNavMesh::hasNavMeshVersion(U32 pNavMeshVersion) const +{ + return (((mNavMeshRequestStatus == kNavMeshRequestStarted) || (mNavMeshRequestStatus == kNavMeshRequestCompleted)) && (mNavMeshVersion == pNavMeshVersion)); +} + +void LLPathfindingNavMesh::handleRefresh() +{ + mNavMeshSignal(mNavMeshRequestStatus, mRegionUUID, mNavMeshVersion, mNavMeshData); +} + +void LLPathfindingNavMesh::handleNavMeshStart(U32 pNavMeshVersion) +{ + mNavMeshVersion = pNavMeshVersion; + setRequestStatus(kNavMeshRequestStarted); +} + +void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion) +{ + llassert(mNavMeshVersion == pNavMeshVersion); + if (mNavMeshVersion == pNavMeshVersion) + { + if ( pContent.has("navmesh_data") ) + { + const LLSD::Binary &value = pContent["navmesh_data"].asBinary(); + unsigned int binSize = value.size(); + std::string newStr(reinterpret_cast(&value[0]), binSize); + std::istringstream streamdecomp( newStr ); + unsigned int decompBinSize = 0; + bool valid = false; + U8* pUncompressedNavMeshContainer = unzip_llsdNavMesh( valid, decompBinSize, streamdecomp, binSize ) ; + if ( !valid ) + { + llwarns << "Unable to decompress the navmesh llsd." << llendl; + setRequestStatus(kNavMeshRequestFormatError); + } + else + { + llassert(pUncompressedNavMeshContainer); + mNavMeshData.resize( decompBinSize ); + memcpy( &mNavMeshData[0], &pUncompressedNavMeshContainer[0], decompBinSize ); + setRequestStatus(kNavMeshRequestCompleted); + } + if ( pUncompressedNavMeshContainer ) + { + free( pUncompressedNavMeshContainer ); + } + } + else + { + llwarns << "No mesh data received" << llendl; + setRequestStatus(kNavMeshRequestMessageError); + } + } +} + +void LLPathfindingNavMesh::handleNavMeshNotEnabled() +{ + mNavMeshData.clear(); + setRequestStatus(kNavMeshRequestNotEnabled); +} + +void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion) +{ + llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; + llassert(mNavMeshVersion == pNavMeshVersion); + mNavMeshData.clear(); + if (mNavMeshVersion == pNavMeshVersion) + { + setRequestStatus(kNavMeshRequestMessageError); + } +} + +void LLPathfindingNavMesh::setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus) +{ + mNavMeshRequestStatus = pNavMeshRequestStatus; + mNavMeshSignal(mNavMeshRequestStatus, mRegionUUID, mNavMeshVersion, mNavMeshData); +} -- cgit v1.3 From 581de7c7b8025c48e585c1af80e060af94aca328 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 5 Mar 2012 17:20:35 -0800 Subject: PATH-205,PATH-304: More work to handle downloading of out-of-date navmeshes. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfloaterpathfindingconsole.cpp | 114 +++------- indra/newview/llfloaterpathfindingconsole.h | 77 ++++--- indra/newview/llpathfindingnavmesh.cpp | 6 +- indra/newview/llpathfindingnavmesh.h | 3 +- indra/newview/llpathfindingnavmeshzone.cpp | 230 +++++++++++++++++++++ indra/newview/llpathfindingnavmeshzone.h | 99 +++++++++ .../default/xui/en/floater_pathfinding_console.xml | 3 +- 8 files changed, 396 insertions(+), 138 deletions(-) create mode 100644 indra/newview/llpathfindingnavmeshzone.cpp create mode 100644 indra/newview/llpathfindingnavmeshzone.h (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c5eac457fd..44cb23b648 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -421,6 +421,7 @@ set(viewer_SOURCE_FILES llpathfindinglinksetlist.cpp llpathfindingmanager.cpp llpathfindingnavmesh.cpp + llpathfindingnavmeshzone.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp llplacesinventorybridge.cpp @@ -975,6 +976,7 @@ set(viewer_HEADER_FILES llpathfindinglinksetlist.h llpathfindingmanager.h llpathfindingnavmesh.h + llpathfindingnavmeshzone.h llphysicsmotion.h llphysicsshapebuilderutil.h llplacesinventorybridge.h diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 02f2bf8d72..094f7749c1 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -46,7 +46,7 @@ #include "llviewerwindow.h" #include "llviewercamera.h" #include "llviewercontrol.h" -#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshzone.h" #include "llpathfindingmanager.h" #include "LLPathingLib.h" @@ -64,9 +64,6 @@ #define XUI_TEST_TAB_INDEX 1 -const int CURRENT_REGION = 99; -const int MAX_OBSERVERS = 10; - LLHandle LLFloaterPathfindingConsole::sInstanceHandle; //--------------------------------------------------------------------------- @@ -165,16 +162,17 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) if ( LLPathingLib::getInstance() == NULL ) { setConsoleState(kConsoleStateLibraryNotImplemented); - llwarns <<"Errror: cannout find pathing library implementation."<registerNavMeshListenerForCurrentRegion(boost::bind(&LLFloaterPathfindingConsole::onNavMeshDownloadCB, this, _1, _2, _3, _4)); + mNavMeshZone.registerNavMeshZoneListener(boost::bind(&LLFloaterPathfindingConsole::onNavMeshZoneCB, this, _1)); } - pathfindingManagerInstance->requestGetNavMeshForCurrentRegion(); + + mNavMeshZone.setCurrentRegionAsCenter(); + mNavMeshZone.refresh(); #if 0 LLPathingLib::getInstance()->cleanupResidual(); @@ -262,12 +260,13 @@ void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting) mAgentStateSlot.disconnect(); } - if (mNavMeshSlot.connected()) + if (mNavMeshZoneSlot.connected()) { - mNavMeshSlot.disconnect(); + mNavMeshZoneSlot.disconnect(); } - clearNavMesh(); + //mNavMeshZone.disable(); + LLFloater::onClose(pIsAppQuitting); setHeartBeat( false ); setConsoleState(kConsoleStateUnknown); @@ -516,26 +515,6 @@ void LLFloaterPathfindingConsole::setCharacterType(ECharacterType pCharacterType mCharacterTypeRadioGroup->setValue(radioGroupValue); } -#if 0 -void LLFloaterPathfindingConsole::setHasNavMeshReceived() -{ - std::string str = getString("navmesh_fetch_complete_available"); - mPathfindingStatus->setText((LLStringExplicit)str); - //check to see if all regions are done loading and they are then stitch the navmeshes together - --mNavMeshCnt; - if ( mNavMeshCnt == 0 ) - { - LLPathingLib::getInstance()->stitchNavMeshes( gSavedSettings.getBOOL("EnableVBOForNavMeshVisualization") ); - } -} - -void LLFloaterPathfindingConsole::setHasNoNavMesh() -{ - std::string str = getString("navmesh_fetch_complete_none"); - mPathfindingStatus->setText((LLStringExplicit)str); -} -#endif - LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) : LLFloater(pSeed), mSelfHandle(), @@ -561,27 +540,16 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mCharacterTypeRadioGroup(NULL), mPathTestingStatus(NULL), mClearPathButton(NULL), - mNavMeshSlot(), + mNavMeshZoneSlot(), + mNavMeshZone(), mAgentStateSlot(), mConsoleState(kConsoleStateUnknown), - mHasNavMesh(false), - mNavMeshRegionVersion(0U), - mNavMeshRegionUUID(), -#if 0 - mNavMeshCnt(0), - mNeighboringRegion( CURRENT_REGION ), -#endif + mPathData(), mHasStartPoint(false), mHasEndPoint(false), mHeartBeat( false ) { mSelfHandle.bind(this); -#if 0 - for (int i=0;iextractNavMeshSrcFromLLSD(pNavMeshData, CURRENT_REGION); - } -} - -void LLFloaterPathfindingConsole::clearNavMesh() -{ - mHasNavMesh = false; - LLPathingLib::getInstance()->cleanupResidual(); -} - void LLFloaterPathfindingConsole::onAgentStateCB(LLPathfindingManager::EAgentState pAgentState) { setAgentState(pAgentState); @@ -792,8 +733,7 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mHasEndPoint = false; break; case kConsoleStateDownloading : - case kConsoleStateDownloadError : - case kConsoleStateNavMeshError : + case kConsoleStateError : mShowNavMeshCheckBox->setEnabled(FALSE); mShowNavMeshWalkabilityComboBox->setEnabled(FALSE); mShowWalkablesCheckBox->setEnabled(FALSE); @@ -861,12 +801,8 @@ void LLFloaterPathfindingConsole::updateStatusOnConsoleState() case kConsoleStateHasNavMeshDownloading : statusText = getString("navmesh_status_has_navmesh_downloading"); break; - case kConsoleStateDownloadError : - statusText = getString("navmesh_status_download_error"); - styleParams.color = warningColor; - break; - case kConsoleStateNavMeshError : - statusText = getString("navmesh_status_navmesh_error"); + case kConsoleStateError : + statusText = getString("navmesh_status_error"); styleParams.color = warningColor; break; default : diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index 237d4216bb..b1886fb716 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -32,7 +32,7 @@ #include "llhandle.h" #include "LLPathingLib.h" #include "llpathfindingmanager.h" -#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshzone.h" class LLSD; class LLPanel; @@ -123,8 +123,7 @@ private: kConsoleStateDownloading, kConsoleStateHasNavMesh, kConsoleStateHasNavMeshDownloading, - kConsoleStateDownloadError, - kConsoleStateNavMeshError + kConsoleStateError } EConsoleState; // Does its own instance management, so clients not allowed @@ -141,12 +140,10 @@ private: void onFreezeClicked(); void onViewEditLinksetClicked(); void onClearPathClicked(); - void onNavMeshDownloadCB(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLUUID &pRegionUUID, U32 pNavMeshVersion, const LLSD::Binary &pNavMeshData); + void onNavMeshZoneCB(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus); void onAgentStateCB(LLPathfindingManager::EAgentState pAgentState); void setConsoleState(EConsoleState pConsoleState); - void updateNavMesh(const LLUUID &pRegionUUID, U32 pNavMeshVersion, const LLSD::Binary &pNavMeshData); - void clearNavMesh(); void updateControlsOnConsoleState(); void updateStatusOnConsoleState(); @@ -158,48 +155,44 @@ private: void resetShapeRenderFlags() { mShapeRenderFlags = 0; } void setShapeRenderFlag( LLPathingLib::LLShapeType type ) { mShapeRenderFlags |= (1< mSelfHandle; - LLCheckBoxCtrl *mShowNavMeshCheckBox; - LLComboBox *mShowNavMeshWalkabilityComboBox; - LLCheckBoxCtrl *mShowWalkablesCheckBox; - LLCheckBoxCtrl *mShowStaticObstaclesCheckBox; - LLCheckBoxCtrl *mShowMaterialVolumesCheckBox; - LLCheckBoxCtrl *mShowExclusionVolumesCheckBox; - LLCheckBoxCtrl *mShowWorldCheckBox; - LLTextBase *mPathfindingStatus; - LLButton *mViewCharactersButton; - LLTabContainer *mEditTestTabContainer; - LLPanel *mEditTab; - LLPanel *mTestTab; - LLTextBase *mUnfreezeLabel; - LLButton *mUnfreezeButton; - LLTextBase *mLinksetsLabel; - LLButton *mLinksetsButton; - LLTextBase *mFreezeLabel; - LLButton *mFreezeButton; - LLSliderCtrl *mCharacterWidthSlider; - LLRadioGroup *mCharacterTypeRadioGroup; - LLTextBase *mPathTestingStatus; - LLButton *mClearPathButton; - LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot; - LLPathfindingManager::agent_state_slot_t mAgentStateSlot; - EConsoleState mConsoleState; - bool mHasNavMesh; - U32 mNavMeshRegionVersion; - LLUUID mNavMeshRegionUUID; - -#if 0 - LLNavMeshDownloadObserver mNavMeshDownloadObserver[10]; - int mCurrentMDO; - int mNavMeshCnt; - U32 mNeighboringRegion; -#endif + LLRootHandle mSelfHandle; + LLCheckBoxCtrl *mShowNavMeshCheckBox; + LLComboBox *mShowNavMeshWalkabilityComboBox; + LLCheckBoxCtrl *mShowWalkablesCheckBox; + LLCheckBoxCtrl *mShowStaticObstaclesCheckBox; + LLCheckBoxCtrl *mShowMaterialVolumesCheckBox; + LLCheckBoxCtrl *mShowExclusionVolumesCheckBox; + LLCheckBoxCtrl *mShowWorldCheckBox; + LLTextBase *mPathfindingStatus; + LLButton *mViewCharactersButton; + LLTabContainer *mEditTestTabContainer; + LLPanel *mEditTab; + LLPanel *mTestTab; + LLTextBase *mUnfreezeLabel; + LLButton *mUnfreezeButton; + LLTextBase *mLinksetsLabel; + LLButton *mLinksetsButton; + LLTextBase *mFreezeLabel; + LLButton *mFreezeButton; + LLSliderCtrl *mCharacterWidthSlider; + LLRadioGroup *mCharacterTypeRadioGroup; + LLTextBase *mPathTestingStatus; + LLButton *mClearPathButton; + + + LLPathfindingNavMeshZone::navmesh_zone_slot_t mNavMeshZoneSlot; + LLPathfindingNavMeshZone mNavMeshZone; + LLPathfindingManager::agent_state_slot_t mAgentStateSlot; + + EConsoleState mConsoleState; + //Container that is populated and subsequently submitted to the LLPathingSystem for processing LLPathingLib::PathingPacket mPathData; bool mHasStartPoint; bool mHasEndPoint; U32 mShapeRenderFlags; bool mHeartBeat; + static LLHandle sInstanceHandle; }; diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index fd1a498e3b..469972efa9 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -87,7 +87,7 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes if ( !valid ) { llwarns << "Unable to decompress the navmesh llsd." << llendl; - setRequestStatus(kNavMeshRequestFormatError); + setRequestStatus(kNavMeshRequestError); } else { @@ -104,7 +104,7 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes else { llwarns << "No mesh data received" << llendl; - setRequestStatus(kNavMeshRequestMessageError); + setRequestStatus(kNavMeshRequestError); } } } @@ -122,7 +122,7 @@ void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pR mNavMeshData.clear(); if (mNavMeshVersion == pNavMeshVersion) { - setRequestStatus(kNavMeshRequestMessageError); + setRequestStatus(kNavMeshRequestError); } } diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 1f033e15c7..26ef21f90e 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -50,8 +50,7 @@ public: kNavMeshRequestStarted, kNavMeshRequestCompleted, kNavMeshRequestNotEnabled, - kNavMeshRequestMessageError, - kNavMeshRequestFormatError + kNavMeshRequestError } ENavMeshRequestStatus; typedef boost::function navmesh_callback_t; diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp new file mode 100644 index 0000000000..986acfa3e8 --- /dev/null +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -0,0 +1,230 @@ +/** + * @file llpathfindingnavmeshzone.cpp + * @author William Todd Stinson + * @brief A class for representing the zone of navmeshes containing and possible surrounding the current region. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llsd.h" +#include "lluuid.h" +#include "llagent.h" +#include "llviewerregion.h" +#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshzone.h" +#include "llpathfindingmanager.h" +#include "llviewercontrol.h" + +#include "LLPathingLib.h" + +#include +#include + +#define CENTER_REGION 99 + +//--------------------------------------------------------------------------- +// LLPathfindingNavMeshZone +//--------------------------------------------------------------------------- + +LLPathfindingNavMeshZone::LLPathfindingNavMeshZone() + : mNavMeshLocations(), + mNavMeshZoneSignal(), + mNavMeshSlot() +{ +} + +LLPathfindingNavMeshZone::~LLPathfindingNavMeshZone() +{ +} + +LLPathfindingNavMeshZone::navmesh_zone_slot_t LLPathfindingNavMeshZone::registerNavMeshZoneListener(navmesh_zone_callback_t pNavMeshZoneCallback) +{ + return mNavMeshZoneSignal.connect(pNavMeshZoneCallback); +} + +void LLPathfindingNavMeshZone::setCurrentRegionAsCenter() +{ + llassert(LLPathingLib::getInstance() != NULL); + LLPathingLib::getInstance()->cleanupResidual(); + mNavMeshLocations.clear(); + LLViewerRegion *currentRegion = gAgent.getRegion(); + const LLUUID ¤tRegionUUID = currentRegion->getRegionID(); + NavMeshLocation centerNavMesh(currentRegionUUID, CENTER_REGION); + mNavMeshLocations.insert(std::pair(currentRegionUUID, centerNavMesh)); +} + +void LLPathfindingNavMeshZone::refresh() +{ + LLPathfindingManager *pathfindingManagerInstance = LLPathfindingManager::getInstance(); + if (!mNavMeshSlot.connected()) + { + pathfindingManagerInstance->registerNavMeshListenerForCurrentRegion(boost::bind(&LLPathfindingNavMeshZone::handleNavMesh, this, _1, _2, _3, _4)); + } + + pathfindingManagerInstance->requestGetNavMeshForCurrentRegion(); +} + +void LLPathfindingNavMeshZone::disable() +{ + if (mNavMeshSlot.connected()) + { + mNavMeshSlot.disconnect(); + } + + llassert(LLPathingLib::getInstance() != NULL); + LLPathingLib::getInstance()->cleanupResidual(); + + mNavMeshLocations.clear(); +} + +void LLPathfindingNavMeshZone::handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLUUID &pRegionUUID, U32 pNavMeshVersion, const LLSD::Binary &pNavMeshData) +{ + NavMeshLocations::iterator navMeshIter = mNavMeshLocations.find(pRegionUUID); + if (navMeshIter != mNavMeshLocations.end()) + { + navMeshIter->second.handleNavMesh(pNavMeshRequestStatus, pRegionUUID, pNavMeshVersion, pNavMeshData); + updateStatus(); + } +} + +void LLPathfindingNavMeshZone::updateStatus() +{ + bool hasRequestUnknown = false; + bool hasRequestStarted = false; + bool hasRequestCompleted = false; + bool hasRequestNotEnabled = false; + bool hasRequestError = false; + + for (NavMeshLocations::iterator navMeshIter = mNavMeshLocations.begin(); + navMeshIter != mNavMeshLocations.end(); ++navMeshIter) + { + switch (navMeshIter->second.getRequestStatus()) + { + case LLPathfindingNavMesh::kNavMeshRequestUnknown : + hasRequestUnknown = true; + break; + case LLPathfindingNavMesh::kNavMeshRequestStarted : + hasRequestStarted = true; + break; + case LLPathfindingNavMesh::kNavMeshRequestCompleted : + hasRequestCompleted = true; + break; + case LLPathfindingNavMesh::kNavMeshRequestNotEnabled : + hasRequestNotEnabled = true; + break; + case LLPathfindingNavMesh::kNavMeshRequestError : + hasRequestError = true; + break; + default : + hasRequestError = true; + llassert(0); + break; + } + } + + ENavMeshZoneRequestStatus zoneRequestStatus = kNavMeshZoneRequestUnknown; + if (hasRequestNotEnabled) + { + zoneRequestStatus = kNavMeshZoneRequestNotEnabled; + } + else if (hasRequestError) + { + zoneRequestStatus = kNavMeshZoneRequestError; + } + else if (hasRequestStarted) + { + zoneRequestStatus = kNavMeshZoneRequestStarted; + } + else if (hasRequestUnknown) + { + zoneRequestStatus = kNavMeshZoneRequestUnknown; + llassert(0); + } + else if (hasRequestCompleted) + { + zoneRequestStatus = kNavMeshZoneRequestCompleted; + LLPathingLib::getInstance()->stitchNavMeshes( gSavedSettings.getBOOL("EnableVBOForNavMeshVisualization") ); + } + else + { + zoneRequestStatus = kNavMeshZoneRequestError; + llassert(0); + } + + mNavMeshZoneSignal(zoneRequestStatus); +} + +//--------------------------------------------------------------------------- +// LLPathfindingNavMeshZone::NavMeshLocation +//--------------------------------------------------------------------------- + +LLPathfindingNavMeshZone::NavMeshLocation::NavMeshLocation(const LLUUID &pRegionUUID, S32 pDirection) + : mRegionUUID(pRegionUUID), + mDirection(pDirection), + mHasNavMesh(false), + mNavMeshVersion(0U), + mRequestStatus(LLPathfindingNavMesh::kNavMeshRequestUnknown) +{ +} + +LLPathfindingNavMeshZone::NavMeshLocation::NavMeshLocation(const NavMeshLocation &other) + : mRegionUUID(other.mRegionUUID), + mDirection(other.mDirection), + mHasNavMesh(other.mHasNavMesh), + mNavMeshVersion(other.mNavMeshVersion), + mRequestStatus(other.mRequestStatus) +{ +} + +LLPathfindingNavMeshZone::NavMeshLocation::~NavMeshLocation() +{ +} + +void LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLUUID &pRegionUUID, U32 pNavMeshVersion, const LLSD::Binary &pNavMeshData) +{ + llassert(mRegionUUID == pRegionUUID); + mRequestStatus = pNavMeshRequestStatus; + if ((pNavMeshRequestStatus == LLPathfindingNavMesh::kNavMeshRequestCompleted) && (!mHasNavMesh || (mNavMeshVersion != pNavMeshVersion))) + { + llassert(!pNavMeshData.empty()); + mHasNavMesh = true; + mNavMeshVersion = pNavMeshVersion; + LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD(pNavMeshData, mDirection); + } +} + +LLPathfindingNavMesh::ENavMeshRequestStatus LLPathfindingNavMeshZone::NavMeshLocation::getRequestStatus() const +{ + return mRequestStatus; +} + +LLPathfindingNavMeshZone::NavMeshLocation &LLPathfindingNavMeshZone::NavMeshLocation::operator =(const NavMeshLocation &other) +{ + mRegionUUID = other.mRegionUUID; + mDirection = other.mDirection; + mHasNavMesh = other.mHasNavMesh; + mNavMeshVersion = other.mNavMeshVersion; + mRequestStatus = other.mRequestStatus; + + return (*this); +} diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h new file mode 100644 index 0000000000..9d1139de32 --- /dev/null +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -0,0 +1,99 @@ +/** + * @file llpathfindingnavmeshzone.h + * @author William Todd Stinson + * @brief A class for representing the zone of navmeshes containing and possible surrounding the current region. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPATHFINDINGNAVMESHZONE_H +#define LL_LLPATHFINDINGNAVMESHZONE_H + +#include "llsd.h" +#include "lluuid.h" +#include "llpathfindingnavmesh.h" + +#include + +#include +#include + +class LLPathfindingNavMeshZone +{ +public: + typedef enum { + kNavMeshZoneRequestUnknown, + kNavMeshZoneRequestStarted, + kNavMeshZoneRequestCompleted, + kNavMeshZoneRequestNotEnabled, + kNavMeshZoneRequestError + } ENavMeshZoneRequestStatus; + + typedef boost::function navmesh_zone_callback_t; + typedef boost::signals2::signal navmesh_zone_signal_t; + typedef boost::signals2::connection navmesh_zone_slot_t; + + LLPathfindingNavMeshZone(); + virtual ~LLPathfindingNavMeshZone(); + + navmesh_zone_slot_t registerNavMeshZoneListener(navmesh_zone_callback_t pNavMeshZoneCallback); + void setCurrentRegionAsCenter(); + void refresh(); + void disable(); + + void handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLUUID &pRegionUUID, U32 pNavMeshVersion, const LLSD::Binary &pNavMeshData); + +protected: + +private: + class NavMeshLocation + { + public: + NavMeshLocation(const LLUUID &pRegionUUID, S32 pDirection); + NavMeshLocation(const NavMeshLocation &other); + virtual ~NavMeshLocation(); + + void handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLUUID &pRegionUUID, U32 pNavMeshVersion, const LLSD::Binary &pNavMeshData); + LLPathfindingNavMesh::ENavMeshRequestStatus getRequestStatus() const; + + NavMeshLocation &operator =(const NavMeshLocation &other); + + protected: + + private: + LLUUID mRegionUUID; + S32 mDirection; + bool mHasNavMesh; + U32 mNavMeshVersion; + LLPathfindingNavMesh::ENavMeshRequestStatus mRequestStatus; + }; + + typedef std::map NavMeshLocations; + + void updateStatus(); + + NavMeshLocations mNavMeshLocations; + navmesh_zone_signal_t mNavMeshZoneSignal; + LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot; +}; + +#endif // LL_LLPATHFINDINGNAVMESHZONE_H diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index 5577083303..6c97af2878 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -17,8 +17,7 @@ Downloading the navmesh ... Navmesh received. Downloading the latest navmesh ... - Unable to download navmesh successfully. - Unable to understand data format of the navmesh. + Unable to download navmesh successfully. Please choose start and end points. Please choose start point. Please choose end point. -- cgit v1.3 From f578181af9cbe3277374578c27487e2e72956079 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 8 Mar 2012 12:34:11 -0800 Subject: PATH-304: Adding functionality to handle the reloading of out-of-date navmeshes. --- etc/message.xml | 12 ++++- indra/newview/llfloaterpathfindingconsole.cpp | 20 ++++++-- indra/newview/llfloaterpathfindingconsole.h | 4 +- indra/newview/llpathfindingmanager.cpp | 60 ++++++++++++++++++---- indra/newview/llpathfindingmanager.h | 2 + indra/newview/llpathfindingnavmesh.cpp | 11 ++-- indra/newview/llpathfindingnavmesh.h | 2 + indra/newview/llpathfindingnavmeshzone.cpp | 58 ++++++++++++++++++++- indra/newview/llpathfindingnavmeshzone.h | 7 +++ .../default/xui/en/floater_pathfinding_console.xml | 2 +- 10 files changed, 153 insertions(+), 25 deletions(-) (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/etc/message.xml b/etc/message.xml index 3445975545..9407888a92 100644 --- a/etc/message.xml +++ b/etc/message.xml @@ -546,8 +546,16 @@ trusted-sender true - - + + NavmeshStatusUpdate + + flavor + llsd + trusted-sender + true + + + ScriptRunningReply flavor diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 6824e629c9..493b4617b5 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -171,6 +171,7 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) mNavMeshZoneSlot = mNavMeshZone.registerNavMeshZoneListener(boost::bind(&LLFloaterPathfindingConsole::onNavMeshZoneCB, this, _1)); } + mIsNavMeshUpdating = false; mNavMeshZone.initialize(); mNavMeshZone.enable(); @@ -478,6 +479,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mClearPathButton(NULL), mNavMeshZoneSlot(), mNavMeshZone(), + mIsNavMeshUpdating(false), mAgentStateSlot(), mConsoleState(kConsoleStateUnknown), mPathData(), @@ -616,10 +618,15 @@ void LLFloaterPathfindingConsole::onNavMeshZoneCB(LLPathfindingNavMeshZone::ENav case LLPathfindingNavMeshZone::kNavMeshZoneRequestUnknown : setConsoleState(kConsoleStateUnknown); break; + case LLPathfindingNavMeshZone::kNavMeshZoneRequestNeedsUpdate : + mIsNavMeshUpdating = true; + mNavMeshZone.refresh(); + break; case LLPathfindingNavMeshZone::kNavMeshZoneRequestStarted : setConsoleState(kConsoleStateDownloading); break; case LLPathfindingNavMeshZone::kNavMeshZoneRequestCompleted : + mIsNavMeshUpdating = false; setConsoleState(kConsoleStateHasNavMesh); break; case LLPathfindingNavMeshZone::kNavMeshZoneRequestNotEnabled : @@ -689,7 +696,6 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mHasEndPoint = false; break; case kConsoleStateHasNavMesh : - case kConsoleStateHasNavMeshDownloading : mShowNavMeshCheckBox->setEnabled(TRUE); mShowNavMeshWalkabilityComboBox->setEnabled(TRUE); mShowWalkablesCheckBox->setEnabled(TRUE); @@ -731,14 +737,18 @@ void LLFloaterPathfindingConsole::updateStatusOnConsoleState() styleParams.color = warningColor; break; case kConsoleStateDownloading : - statusText = getString("navmesh_status_downloading"); + if (mIsNavMeshUpdating) + { + statusText = getString("navmesh_status_updating"); + } + else + { + statusText = getString("navmesh_status_downloading"); + } break; case kConsoleStateHasNavMesh : statusText = getString("navmesh_status_has_navmesh"); break; - case kConsoleStateHasNavMeshDownloading : - statusText = getString("navmesh_status_has_navmesh_downloading"); - break; case kConsoleStateError : statusText = getString("navmesh_status_error"); styleParams.color = warningColor; diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index b1886fb716..8c29bf5909 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -122,7 +122,6 @@ private: kConsoleStateRegionNotEnabled, kConsoleStateDownloading, kConsoleStateHasNavMesh, - kConsoleStateHasNavMeshDownloading, kConsoleStateError } EConsoleState; @@ -179,9 +178,10 @@ private: LLTextBase *mPathTestingStatus; LLButton *mClearPathButton; - LLPathfindingNavMeshZone::navmesh_zone_slot_t mNavMeshZoneSlot; LLPathfindingNavMeshZone mNavMeshZone; + bool mIsNavMeshUpdating; + LLPathfindingManager::agent_state_slot_t mAgentStateSlot; EConsoleState mConsoleState; diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index cba0501ad2..ebefebbb64 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -26,8 +26,10 @@ */ #include +#include #include "llviewerprecompiledheaders.h" +#include "llsd.h" #include "llpathfindingmanager.h" #include "llsingleton.h" #include "llhttpclient.h" @@ -36,6 +38,7 @@ #include "llpathfindingnavmesh.h" #include "llpathfindinglinkset.h" #include "llpathfindinglinksetlist.h" +#include "llhttpnode.h" #include #include @@ -49,6 +52,20 @@ #define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties" #define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties" +#define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavmeshStatusUpdate" + +//--------------------------------------------------------------------------- +// LLNavMeshSimStateChangeNode +//--------------------------------------------------------------------------- + +class LLNavMeshSimStateChangeNode : public LLHTTPNode +{ +public: + virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const; +}; + +LLHTTPRegistration gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE); + //--------------------------------------------------------------------------- // NavMeshResponder //--------------------------------------------------------------------------- @@ -243,6 +260,12 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) } } +void LLPathfindingManager::handleNavMeshUpdate(const LLUUID &pRegionUUID, U32 pNavMeshVersion) +{ + LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegionUUID); + navMeshPtr->handleNavMeshNewVersion(++mNavMeshVersionXXX); +} + LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) { return mAgentStateSignal.connect(pAgentStateCallback); @@ -368,21 +391,14 @@ LLPathfindingManager::ELinksetsRequestStatus LLPathfindingManager::requestSetLin return status; } -LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion *pRegion) +LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(const LLUUID &pRegionUUID) { - - LLUUID regionUUID; - if (pRegion != NULL) - { - regionUUID = pRegion->getRegionID(); - } - LLPathfindingNavMeshPtr navMeshPtr; - NavMeshMap::iterator navMeshIter = mNavMeshMap.find(regionUUID); + NavMeshMap::iterator navMeshIter = mNavMeshMap.find(pRegionUUID); if (navMeshIter == mNavMeshMap.end()) { - navMeshPtr = LLPathfindingNavMeshPtr(new LLPathfindingNavMesh(regionUUID)); - mNavMeshMap.insert(std::pair(regionUUID, navMeshPtr)); + navMeshPtr = LLPathfindingNavMeshPtr(new LLPathfindingNavMesh(pRegionUUID)); + mNavMeshMap.insert(std::pair(pRegionUUID, navMeshPtr)); } else { @@ -392,6 +408,17 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion return navMeshPtr; } +LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion *pRegion) +{ + LLUUID regionUUID; + if (pRegion != NULL) + { + regionUUID = pRegion->getRegionID(); + } + + return getNavMeshForRegion(regionUUID); +} + bool LLPathfindingManager::isValidAgentState(EAgentState pAgentState) { return ((pAgentState == kAgentStateFrozen) || (pAgentState == kAgentStateUnfrozen)); @@ -513,6 +540,17 @@ LLViewerRegion *LLPathfindingManager::getCurrentRegion() const return gAgent.getRegion(); } +//--------------------------------------------------------------------------- +// LLNavMeshSimStateChangeNode +//--------------------------------------------------------------------------- + +void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const +{ + LLViewerRegion *region = gAgent.getRegion(); + U32 navMeshVersion = 0U; + LLPathfindingManager::getInstance()->handleNavMeshUpdate(region->getRegionID(), navMeshVersion); +} + //--------------------------------------------------------------------------- // NavMeshResponder //--------------------------------------------------------------------------- diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index eb8704e308..3e85cb1291 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -80,6 +80,7 @@ public: LLPathfindingNavMesh::navmesh_slot_t registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback); void requestGetNavMeshForRegion(LLViewerRegion *pRegion); + void handleNavMeshUpdate(const LLUUID &pRegionUUID, U32 pNavMeshVersion); agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback); EAgentState getAgentState(); @@ -92,6 +93,7 @@ public: protected: private: + LLPathfindingNavMeshPtr getNavMeshForRegion(const LLUUID &pRegionUUID); LLPathfindingNavMeshPtr getNavMeshForRegion(LLViewerRegion *pRegion); static bool isValidAgentState(EAgentState pAgentState); diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 469972efa9..84343cf31e 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -64,6 +64,13 @@ void LLPathfindingNavMesh::handleRefresh() mNavMeshSignal(mNavMeshRequestStatus, mRegionUUID, mNavMeshVersion, mNavMeshData); } +void LLPathfindingNavMesh::handleNavMeshNewVersion(U32 pNavMeshVersion) +{ + mNavMeshData.clear(); + mNavMeshVersion = pNavMeshVersion; + setRequestStatus(kNavMeshRequestNeedsUpdate); +} + void LLPathfindingNavMesh::handleNavMeshStart(U32 pNavMeshVersion) { mNavMeshVersion = pNavMeshVersion; @@ -72,7 +79,6 @@ void LLPathfindingNavMesh::handleNavMeshStart(U32 pNavMeshVersion) void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion) { - llassert(mNavMeshVersion == pNavMeshVersion); if (mNavMeshVersion == pNavMeshVersion) { if ( pContent.has("navmesh_data") ) @@ -118,10 +124,9 @@ void LLPathfindingNavMesh::handleNavMeshNotEnabled() void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion) { llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; - llassert(mNavMeshVersion == pNavMeshVersion); - mNavMeshData.clear(); if (mNavMeshVersion == pNavMeshVersion) { + mNavMeshData.clear(); setRequestStatus(kNavMeshRequestError); } } diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 26ef21f90e..eb9ef9683d 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -47,6 +47,7 @@ class LLPathfindingNavMesh public: typedef enum { kNavMeshRequestUnknown, + kNavMeshRequestNeedsUpdate, kNavMeshRequestStarted, kNavMeshRequestCompleted, kNavMeshRequestNotEnabled, @@ -65,6 +66,7 @@ public: bool hasNavMeshVersion(U32 pNavMeshVersion) const; void handleRefresh(); + void handleNavMeshNewVersion(U32 pNavMeshVersion); void handleNavMeshStart(U32 pNavMeshVersion); void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion); void handleNavMeshNotEnabled(); diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index 983b88fe05..3767834655 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -67,6 +67,24 @@ void LLPathfindingNavMeshZone::initialize() { mNavMeshLocationPtrs.clear(); +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + LLViewerRegion *currentRegion = gAgent.getRegion(); + if (currentRegion != NULL) + { + llinfos << "STINSON DEBUG: currentRegion: '" << currentRegion->getName() << "' (" << currentRegion->getRegionID().asString() << ")" << llendl; + std::vector availableRegions; + currentRegion->getNeighboringRegionsStatus( availableRegions ); + std::vector neighborRegionsPtrs; + currentRegion->getNeighboringRegions( neighborRegionsPtrs ); + for (std::vector::const_iterator statusIter = availableRegions.begin(); + statusIter != availableRegions.end(); ++statusIter) + { + LLViewerRegion *region = neighborRegionsPtrs[statusIter - availableRegions.begin()]; + llinfos << "STINSON DEBUG: region #" << *statusIter << ": '" << region->getName() << "' (" << region->getRegionID().asString() << ")" << llendl; + } + } + +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE NavMeshLocationPtr centerNavMeshPtr(new NavMeshLocation(CENTER_REGION, boost::bind(&LLPathfindingNavMeshZone::handleNavMeshLocation, this))); mNavMeshLocationPtrs.push_back(centerNavMeshPtr); @@ -122,20 +140,30 @@ void LLPathfindingNavMeshZone::handleNavMeshLocation() void LLPathfindingNavMeshZone::updateStatus() { bool hasRequestUnknown = false; + bool hasRequestNeedsUpdate = false; bool hasRequestStarted = false; bool hasRequestCompleted = false; bool hasRequestNotEnabled = false; bool hasRequestError = false; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update BEGIN" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE for (NavMeshLocationPtrs::iterator navMeshLocationPtrIter = mNavMeshLocationPtrs.begin(); navMeshLocationPtrIter != mNavMeshLocationPtrs.end(); ++navMeshLocationPtrIter) { NavMeshLocationPtr navMeshLocationPtr = *navMeshLocationPtrIter; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: region #" << navMeshLocationPtr->getDirection() << ": region(" << navMeshLocationPtr->getRegionUUID().asString() << ") status:" << navMeshLocationPtr->getRequestStatus() << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE switch (navMeshLocationPtr->getRequestStatus()) { case LLPathfindingNavMesh::kNavMeshRequestUnknown : hasRequestUnknown = true; break; + case LLPathfindingNavMesh::kNavMeshRequestNeedsUpdate : + hasRequestNeedsUpdate = true; + break; case LLPathfindingNavMesh::kNavMeshRequestStarted : hasRequestStarted = true; break; @@ -156,34 +184,62 @@ void LLPathfindingNavMeshZone::updateStatus() } ENavMeshZoneRequestStatus zoneRequestStatus = kNavMeshZoneRequestUnknown; - if (hasRequestStarted) + if (hasRequestNeedsUpdate) + { + zoneRequestStatus = kNavMeshZoneRequestNeedsUpdate; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is NEEDS UPDATE" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE + } + else if (hasRequestStarted) { zoneRequestStatus = kNavMeshZoneRequestStarted; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is STARTED" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE } else if (hasRequestError) { zoneRequestStatus = kNavMeshZoneRequestError; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is ERROR" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE } else if (hasRequestUnknown) { zoneRequestStatus = kNavMeshZoneRequestUnknown; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is UNKNOWN" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE } else if (hasRequestCompleted) { zoneRequestStatus = kNavMeshZoneRequestCompleted; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is stitching" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE llassert(LLPathingLib::getInstance() != NULL); if (LLPathingLib::getInstance() != NULL) { LLPathingLib::getInstance()->stitchNavMeshes( gSavedSettings.getBOOL("EnableVBOForNavMeshVisualization") ); } +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is COMPLETED" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE } else if (hasRequestNotEnabled) { zoneRequestStatus = kNavMeshZoneRequestNotEnabled; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is NOT ENABLED" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE } else { zoneRequestStatus = kNavMeshZoneRequestError; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is BAD ERROR" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE llassert(0); } diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index 8489b5899b..7084869b33 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -38,11 +38,14 @@ #include #include +#define XXX_STINSON_DEBUG_NAVMESH_ZONE + class LLPathfindingNavMeshZone { public: typedef enum { kNavMeshZoneRequestUnknown, + kNavMeshZoneRequestNeedsUpdate, kNavMeshZoneRequestStarted, kNavMeshZoneRequestCompleted, kNavMeshZoneRequestNotEnabled, @@ -78,6 +81,10 @@ private: void disable(); LLPathfindingNavMesh::ENavMeshRequestStatus getRequestStatus() const; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + const LLUUID &getRegionUUID() const {return mRegionUUID;}; + S32 getDirection() const {return mDirection;}; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE protected: diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index 6c97af2878..75465f1aea 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -15,8 +15,8 @@ Cannot find pathing library implementation. This region is not enabled for pathfinding. Downloading the navmesh ... + The navmesh has changed on the server. Downloading the latest navmesh ... Navmesh received. - Downloading the latest navmesh ... Unable to download navmesh successfully. Please choose start and end points. Please choose start point. -- cgit v1.3 From b3197fc12e41bc60e3510d840c67ef98816c3ae8 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 12 Mar 2012 18:48:40 -0700 Subject: PATH-304: Making the navmesh version information work for both Premium Wilderness regions (old pathfinding simulator build with missing capabilities) as well as the new pathfinding simulator builds with the version services. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llpathfindingmanager.cpp | 170 ++++++++++++++++++++++----- indra/newview/llpathfindingmanager.h | 11 +- indra/newview/llpathfindingnavmesh.cpp | 18 ++- indra/newview/llpathfindingnavmesh.h | 8 ++ indra/newview/llpathfindingnavmeshstatus.cpp | 134 +++++++++++++++++++++ indra/newview/llpathfindingnavmeshstatus.h | 77 ++++++++++++ indra/newview/llpathfindingnavmeshzone.cpp | 11 +- indra/newview/llviewerregion.cpp | 1 + 9 files changed, 391 insertions(+), 41 deletions(-) create mode 100644 indra/newview/llpathfindingnavmeshstatus.cpp create mode 100644 indra/newview/llpathfindingnavmeshstatus.h (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 44cb23b648..36b7e136d0 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -421,6 +421,7 @@ set(viewer_SOURCE_FILES llpathfindinglinksetlist.cpp llpathfindingmanager.cpp llpathfindingnavmesh.cpp + llpathfindingnavmeshstatus.cpp llpathfindingnavmeshzone.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp @@ -976,6 +977,7 @@ set(viewer_HEADER_FILES llpathfindinglinksetlist.h llpathfindingmanager.h llpathfindingnavmesh.h + llpathfindingnavmeshstatus.h llpathfindingnavmeshzone.h llphysicsmotion.h llphysicsshapebuilderutil.h diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index ebefebbb64..9cd3d5625c 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -30,12 +30,14 @@ #include "llviewerprecompiledheaders.h" #include "llsd.h" +#include "lluuid.h" #include "llpathfindingmanager.h" #include "llsingleton.h" #include "llhttpclient.h" #include "llagent.h" #include "llviewerregion.h" #include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" #include "llpathfindinglinkset.h" #include "llpathfindinglinksetlist.h" #include "llhttpnode.h" @@ -45,14 +47,16 @@ #define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" -#define CAP_SERVICE_AGENT_STATE "AgentPreferences" +#define CAP_SERVICE_NAVMESH_STATUS "NavMeshGenerationStatus" + +#define CAP_SERVICE_AGENT_STATE "AgentPreferences" #define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects" #define DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD "alter_permanent_objects" -#define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties" -#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties" +#define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties" +#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties" -#define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavmeshStatusUpdate" +#define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavMeshStatusUpdate" //--------------------------------------------------------------------------- // LLNavMeshSimStateChangeNode @@ -66,6 +70,27 @@ public: LLHTTPRegistration gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE); +//--------------------------------------------------------------------------- +// NavMeshStatusResponder +//--------------------------------------------------------------------------- + +class NavMeshStatusResponder : public LLHTTPClient::Responder +{ +public: + NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion); + virtual ~NavMeshStatusResponder(); + + virtual void result(const LLSD &pContent); + virtual void error(U32 pStatus, const std::string& pReason); + +protected: + +private: + std::string mCapabilityURL; + LLViewerRegion *mRegion; + LLUUID mRegionUUID; +}; + //--------------------------------------------------------------------------- // NavMeshResponder //--------------------------------------------------------------------------- @@ -193,7 +218,6 @@ private: LLPathfindingManager::LLPathfindingManager() : LLSingleton(), mNavMeshMap(), - mNavMeshVersionXXX(0), mAgentStateSignal(), mAgentState(kAgentStateUnknown), mLastKnownNonErrorAgentState(kAgentStateUnknown) @@ -206,7 +230,12 @@ LLPathfindingManager::~LLPathfindingManager() bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const { - std::string retrieveNavMeshURL = getRetrieveNavMeshURLForCurrentRegion(); + return isPathfindingEnabledForRegion(getCurrentRegion()); +} + +bool LLPathfindingManager::isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const +{ + std::string retrieveNavMeshURL = getRetrieveNavMeshURLForRegion(pRegion); return !retrieveNavMeshURL.empty(); } @@ -231,39 +260,64 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) { LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); - if (navMeshPtr->hasNavMeshVersion(mNavMeshVersionXXX)) + if ((pRegion == NULL) || !isPathfindingEnabledForRegion(pRegion)) { - navMeshPtr->handleRefresh(); + navMeshPtr->handleNavMeshNotEnabled(); } else { - if (pRegion == NULL) + std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion); +#ifdef DEPRECATED_UNVERSIONED_NAVMESH + if (navMeshStatusURL.empty()) { - navMeshPtr->handleNavMeshNotEnabled(); + sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, navMeshPtr->getNavMeshVersion() + 1U); } else { - std::string navMeshURL = getRetrieveNavMeshURLForRegion(pRegion); - if (navMeshURL.empty()) - { - navMeshPtr->handleNavMeshNotEnabled(); - } - else - { - navMeshPtr->handleNavMeshStart(mNavMeshVersionXXX); - LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, mNavMeshVersionXXX, navMeshPtr); + LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); + LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); + } +#else // DEPRECATED_UNVERSIONED_NAVMESH + llassert(!navMeshStatusURL.empty()); + LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); + LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); +#endif // DEPRECATED_UNVERSIONED_NAVMESH + } +} - LLSD postData; - LLHTTPClient::post(navMeshURL, postData, responder); - } +void LLPathfindingManager::handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion) +{ + LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pNavMeshStatus.getRegionUUID()); + + if (!pNavMeshStatus.isValid()) + { + navMeshPtr->handleNavMeshError(); + } + else + { + if (navMeshPtr->hasNavMeshVersion(pNavMeshStatus.getVersion())) + { + navMeshPtr->handleRefresh(); + } + else + { + sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, pNavMeshStatus.getVersion()); } } } -void LLPathfindingManager::handleNavMeshUpdate(const LLUUID &pRegionUUID, U32 pNavMeshVersion) +void LLPathfindingManager::handleNavMeshStatusUpdate(const LLPathfindingNavMeshStatus &pNavMeshStatus) { - LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegionUUID); - navMeshPtr->handleNavMeshNewVersion(++mNavMeshVersionXXX); + LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pNavMeshStatus.getRegionUUID()); + + if (!pNavMeshStatus.isValid()) + { + navMeshPtr->handleNavMeshError(); + } + else + { + navMeshPtr->handleNavMeshNewVersion(pNavMeshStatus.getVersion()); + } } LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) @@ -391,6 +445,31 @@ LLPathfindingManager::ELinksetsRequestStatus LLPathfindingManager::requestSetLin return status; } +void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, U32 pNavMeshVersion) +{ + if ((pRegion == NULL) || !pRegion->isAlive()) + { + navMeshPtr->handleNavMeshNotEnabled(); + } + else + { + std::string navMeshURL = getRetrieveNavMeshURLForRegion(pRegion); + + if (navMeshURL.empty()) + { + navMeshPtr->handleNavMeshNotEnabled(); + } + else + { + navMeshPtr->handleNavMeshStart(pNavMeshVersion); + LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshVersion, navMeshPtr); + + LLSD postData; + LLHTTPClient::post(navMeshURL, postData, responder); + } + } +} + LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(const LLUUID &pRegionUUID) { LLPathfindingNavMeshPtr navMeshPtr; @@ -487,9 +566,9 @@ void LLPathfindingManager::handleAgentStateError(U32 pStatus, const std::string setAgentState(kAgentStateError); } -std::string LLPathfindingManager::getRetrieveNavMeshURLForCurrentRegion() const +std::string LLPathfindingManager::getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const { - return getCapabilityURLForCurrentRegion(CAP_SERVICE_RETRIEVE_NAVMESH); + return getCapabilityURLForRegion(pRegion, CAP_SERVICE_NAVMESH_STATUS); } std::string LLPathfindingManager::getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const @@ -546,9 +625,40 @@ LLViewerRegion *LLPathfindingManager::getCurrentRegion() const void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const { - LLViewerRegion *region = gAgent.getRegion(); - U32 navMeshVersion = 0U; - LLPathfindingManager::getInstance()->handleNavMeshUpdate(region->getRegionID(), navMeshVersion); + LLPathfindingNavMeshStatus navMeshStatus(pContext); + LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(pContext); +} + +//--------------------------------------------------------------------------- +// NavMeshStatusResponder +//--------------------------------------------------------------------------- + +NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion) + : mCapabilityURL(pCapabilityURL), + mRegion(pRegion), + mRegionUUID() +{ + if (mRegion != NULL) + { + mRegionUUID = mRegion->getRegionID(); + } +} + +NavMeshStatusResponder::~NavMeshStatusResponder() +{ +} + +void NavMeshStatusResponder::result(const LLSD &pContent) +{ + LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, pContent); + LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion); +} + +void NavMeshStatusResponder::error(U32 pStatus, const std::string& pReason) +{ + llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; + LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID); + LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion); } //--------------------------------------------------------------------------- diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 3e85cb1291..3a849d0290 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -42,6 +42,7 @@ class LLFloater; class LLViewerRegion; +class LLPathfindingNavMeshStatus; class LLPathfindingManager : public LLSingleton { @@ -74,13 +75,16 @@ public: virtual ~LLPathfindingManager(); bool isPathfindingEnabledForCurrentRegion() const; + bool isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const; bool isAllowAlterPermanent(); bool isAllowViewTerrainProperties() const; LLPathfindingNavMesh::navmesh_slot_t registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback); void requestGetNavMeshForRegion(LLViewerRegion *pRegion); - void handleNavMeshUpdate(const LLUUID &pRegionUUID, U32 pNavMeshVersion); + + void handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion); + void handleNavMeshStatusUpdate(const LLPathfindingNavMeshStatus &pNavMeshStatus); agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback); EAgentState getAgentState(); @@ -93,6 +97,8 @@ public: protected: private: + void sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, U32 pNavMeshVersion); + LLPathfindingNavMeshPtr getNavMeshForRegion(const LLUUID &pRegionUUID); LLPathfindingNavMeshPtr getNavMeshForRegion(LLViewerRegion *pRegion); @@ -103,7 +109,7 @@ private: void handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState); void handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL); - std::string getRetrieveNavMeshURLForCurrentRegion() const; + std::string getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const; std::string getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const; std::string getAgentStateURLForCurrentRegion() const; std::string getObjectLinksetsURLForCurrentRegion() const; @@ -114,7 +120,6 @@ private: LLViewerRegion *getCurrentRegion() const; NavMeshMap mNavMeshMap; - U32 mNavMeshVersionXXX; // XXX stinson 03/02/2012 : a hacky way of doing versions for now agent_state_signal_t mAgentStateSignal; EAgentState mAgentState; diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 84343cf31e..81fa7b24db 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -66,9 +66,12 @@ void LLPathfindingNavMesh::handleRefresh() void LLPathfindingNavMesh::handleNavMeshNewVersion(U32 pNavMeshVersion) { - mNavMeshData.clear(); - mNavMeshVersion = pNavMeshVersion; - setRequestStatus(kNavMeshRequestNeedsUpdate); + if (mNavMeshVersion != pNavMeshVersion) + { + mNavMeshData.clear(); + mNavMeshVersion = pNavMeshVersion; + setRequestStatus(kNavMeshRequestNeedsUpdate); + } } void LLPathfindingNavMesh::handleNavMeshStart(U32 pNavMeshVersion) @@ -121,13 +124,18 @@ void LLPathfindingNavMesh::handleNavMeshNotEnabled() setRequestStatus(kNavMeshRequestNotEnabled); } +void LLPathfindingNavMesh::handleNavMeshError() +{ + mNavMeshData.clear(); + setRequestStatus(kNavMeshRequestError); +} + void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion) { llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; if (mNavMeshVersion == pNavMeshVersion) { - mNavMeshData.clear(); - setRequestStatus(kNavMeshRequestError); + handleNavMeshError(); } } diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index eb9ef9683d..3bdb485d37 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -42,6 +42,9 @@ class LLPathfindingNavMesh; typedef boost::shared_ptr LLPathfindingNavMeshPtr; +// XXX stinson 03/12/2012 : This definition is in place to support an older version of the pathfinding simulator that does not have versioned information +#define DEPRECATED_UNVERSIONED_NAVMESH + class LLPathfindingNavMesh { public: @@ -63,6 +66,10 @@ public: navmesh_slot_t registerNavMeshListener(navmesh_callback_t pNavMeshCallback); +#ifdef DEPRECATED_UNVERSIONED_NAVMESH + U32 getNavMeshVersion() const {return mNavMeshVersion;}; +#endif // DEPRECATED_UNVERSIONED_NAVMESH + bool hasNavMeshVersion(U32 pNavMeshVersion) const; void handleRefresh(); @@ -70,6 +77,7 @@ public: void handleNavMeshStart(U32 pNavMeshVersion); void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion); void handleNavMeshNotEnabled(); + void handleNavMeshError(); void handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion); protected: diff --git a/indra/newview/llpathfindingnavmeshstatus.cpp b/indra/newview/llpathfindingnavmeshstatus.cpp new file mode 100644 index 0000000000..67be0459a5 --- /dev/null +++ b/indra/newview/llpathfindingnavmeshstatus.cpp @@ -0,0 +1,134 @@ +/** + * @file llpathfindingnavmeshstatus.cpp + * @author William Todd Stinson + * @brief A class for representing the navmesh status of a pathfinding region. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llsd.h" +#include "lluuid.h" +#include "llstring.h" +#include "llpathfindingnavmeshstatus.h" + +#include + +#define REGION_FIELD "region" +#define STATE_FIELD "state" +#define VERSION_FIELD "version" + +const std::string LLPathfindingNavMeshStatus::sStatusPending("pending"); +const std::string LLPathfindingNavMeshStatus::sStatusBuilding("building"); +const std::string LLPathfindingNavMeshStatus::sStatusComplete("complete"); +const std::string LLPathfindingNavMeshStatus::sStatusRepending("repending"); + + +//--------------------------------------------------------------------------- +// LLPathfindingNavMeshStatus +//--------------------------------------------------------------------------- + +LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID) + : mIsValid(false), + mRegionUUID(pRegionUUID), + mVersion(0U), + mStatus(kComplete) +{ +} + +LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID, const LLSD &pContent) + : mIsValid(true), + mRegionUUID(pRegionUUID), + mVersion(0U), + mStatus(kComplete) +{ + parseStatus(pContent); +} + +LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLSD &pContent) + : mIsValid(true), + mRegionUUID(), + mVersion(0U), + mStatus(kComplete) +{ + llassert(pContent.has(REGION_FIELD)); + llassert(pContent.get(REGION_FIELD).isUUID()); + mRegionUUID = pContent.get(REGION_FIELD).asUUID(); + + parseStatus(pContent); +} + +LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLPathfindingNavMeshStatus &pOther) + : mIsValid(pOther.mIsValid), + mRegionUUID(pOther.mRegionUUID), + mVersion(pOther.mVersion), + mStatus(pOther.mStatus) +{ +} + +LLPathfindingNavMeshStatus::~LLPathfindingNavMeshStatus() +{ +} + +LLPathfindingNavMeshStatus &LLPathfindingNavMeshStatus::operator =(const LLPathfindingNavMeshStatus &pOther) +{ + mIsValid = pOther.mIsValid; + mRegionUUID = pOther.mRegionUUID; + mVersion = pOther.mVersion; + mStatus = pOther.mStatus; + + return *this; +} + +void LLPathfindingNavMeshStatus::parseStatus(const LLSD &pContent) +{ + llassert(pContent.has(VERSION_FIELD)); + llassert(pContent.get(VERSION_FIELD).isInteger()); + llassert(pContent.get(VERSION_FIELD).asInteger() >= 0); + mVersion = static_cast(pContent.get(VERSION_FIELD).asInteger()); + + llassert(pContent.has(STATE_FIELD)); + llassert(pContent.get(STATE_FIELD).isString()); + std::string status = pContent.get(STATE_FIELD).asString(); + + if (LLStringUtil::compareStrings(status, sStatusPending)) + { + mStatus = kPending; + } + else if (LLStringUtil::compareStrings(status, sStatusBuilding)) + { + mStatus = kBuilding; + } + else if (LLStringUtil::compareStrings(status, sStatusComplete)) + { + mStatus = kComplete; + } + else if (LLStringUtil::compareStrings(status, sStatusRepending)) + { + mStatus = kRepending; + } + else + { + mStatus = kComplete; + llassert(0); + } +} diff --git a/indra/newview/llpathfindingnavmeshstatus.h b/indra/newview/llpathfindingnavmeshstatus.h new file mode 100644 index 0000000000..fcc876059d --- /dev/null +++ b/indra/newview/llpathfindingnavmeshstatus.h @@ -0,0 +1,77 @@ +/** + * @file llpathfindingnavmeshstatus.h + * @author William Todd Stinson + * @brief A class for representing the navmesh status of a pathfinding region. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPATHFINDINGNAVMESHSTATUS_H +#define LL_LLPATHFINDINGNAVMESHSTATUS_H + +#include "lluuid.h" + +#include + +class LLSD; + +class LLPathfindingNavMeshStatus +{ +public: + typedef enum + { + kPending, + kBuilding, + kComplete, + kRepending + } ENavMeshStatus; + + LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID); + LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID, const LLSD &pContent); + LLPathfindingNavMeshStatus(const LLSD &pContent); + LLPathfindingNavMeshStatus(const LLPathfindingNavMeshStatus &pOther); + virtual ~LLPathfindingNavMeshStatus(); + + LLPathfindingNavMeshStatus &operator =(const LLPathfindingNavMeshStatus &pOther); + + bool isValid() const {return mIsValid;}; + const LLUUID &getRegionUUID() const {return mRegionUUID;}; + U32 getVersion() const {return mVersion;}; + ENavMeshStatus getStatus() const {return mStatus;}; + +protected: + +private: + void parseStatus(const LLSD &pContent); + + bool mIsValid; + LLUUID mRegionUUID; + U32 mVersion; + ENavMeshStatus mStatus; + + static const std::string sStatusPending; + static const std::string sStatusBuilding; + static const std::string sStatusComplete; + static const std::string sStatusRepending; +}; + +#endif // LL_LLPATHFINDINGNAVMESHSTATUS_H diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index 3767834655..83238ec869 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -311,10 +311,15 @@ LLPathfindingNavMesh::ENavMeshRequestStatus LLPathfindingNavMeshZone::NavMeshLoc void LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLUUID &pRegionUUID, U32 pNavMeshVersion, const LLSD::Binary &pNavMeshData) { llassert(mRegionUUID == pRegionUUID); - mRequestStatus = pNavMeshRequestStatus; - if ((pNavMeshRequestStatus == LLPathfindingNavMesh::kNavMeshRequestCompleted) && (!mHasNavMesh || (mNavMeshVersion != pNavMeshVersion))) + if (pNavMeshRequestStatus != LLPathfindingNavMesh::kNavMeshRequestCompleted) + { + mRequestStatus = pNavMeshRequestStatus; + mLocationCallback(); + } + else if (!mHasNavMesh || (mNavMeshVersion != pNavMeshVersion)) { llassert(!pNavMeshData.empty()); + mRequestStatus = pNavMeshRequestStatus; mHasNavMesh = true; mNavMeshVersion = pNavMeshVersion; llassert(LLPathingLib::getInstance() != NULL); @@ -322,8 +327,8 @@ void LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh(LLPathfindingNavMe { LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD(pNavMeshData, mDirection); } + mLocationCallback(); } - mLocationCallback(); } void LLPathfindingNavMeshZone::NavMeshLocation::clear() diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 6e422a5821..fc04546bb8 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1522,6 +1522,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("MapLayer"); capabilityNames.append("MapLayerGod"); capabilityNames.append("MeshUploadFlag"); + capabilityNames.append("NavMeshGenerationStatus"); capabilityNames.append("NavMeshUpload"); capabilityNames.append("NewFileAgentInventory"); capabilityNames.append("ObjectNavMeshProperties"); -- cgit v1.3 From c990cc71ce124059a072c7778ac962253bacb199 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 12 Mar 2012 19:18:19 -0700 Subject: PATH-304: Adding an extra state for the pathfinding console to report that the status of the navmesh is being checked. --- indra/newview/llfloaterpathfindingconsole.cpp | 7 +++++++ indra/newview/llfloaterpathfindingconsole.h | 1 + indra/newview/llpathfindingmanager.cpp | 4 +++- indra/newview/llpathfindingnavmesh.cpp | 22 +++++++++++++++++++--- indra/newview/llpathfindingnavmesh.h | 4 +++- indra/newview/llpathfindingnavmeshzone.cpp | 11 +++++++++++ indra/newview/llpathfindingnavmeshzone.h | 1 + .../default/xui/en/floater_pathfinding_console.xml | 1 + 8 files changed, 46 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 493b4617b5..487ef0933a 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -618,6 +618,9 @@ void LLFloaterPathfindingConsole::onNavMeshZoneCB(LLPathfindingNavMeshZone::ENav case LLPathfindingNavMeshZone::kNavMeshZoneRequestUnknown : setConsoleState(kConsoleStateUnknown); break; + case LLPathfindingNavMeshZone::kNavMeshZoneRequestChecking : + setConsoleState(kConsoleStateCheckingVersion); + break; case LLPathfindingNavMeshZone::kNavMeshZoneRequestNeedsUpdate : mIsNavMeshUpdating = true; mNavMeshZone.refresh(); @@ -677,6 +680,7 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mHasStartPoint = false; mHasEndPoint = false; break; + case kConsoleStateCheckingVersion : case kConsoleStateDownloading : case kConsoleStateError : mShowNavMeshCheckBox->setEnabled(FALSE); @@ -736,6 +740,9 @@ void LLFloaterPathfindingConsole::updateStatusOnConsoleState() statusText = getString("navmesh_status_region_not_enabled"); styleParams.color = warningColor; break; + case kConsoleStateCheckingVersion : + statusText = getString("navmesh_status_checking_version"); + break; case kConsoleStateDownloading : if (mIsNavMeshUpdating) { diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index 8c29bf5909..c58dc83653 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -120,6 +120,7 @@ private: kConsoleStateUnknown, kConsoleStateLibraryNotImplemented, kConsoleStateRegionNotEnabled, + kConsoleStateCheckingVersion, kConsoleStateDownloading, kConsoleStateHasNavMesh, kConsoleStateError diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 9cd3d5625c..9abd9fda1a 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -274,11 +274,13 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) } else { + navMeshPtr->handleNavMeshCheckVersion(); LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); } #else // DEPRECATED_UNVERSIONED_NAVMESH llassert(!navMeshStatusURL.empty()); + navMeshPtr->handleNavMeshCheckVersion(); LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); #endif // DEPRECATED_UNVERSIONED_NAVMESH @@ -297,7 +299,7 @@ void LLPathfindingManager::handleNavMeshStatusRequest(const LLPathfindingNavMesh { if (navMeshPtr->hasNavMeshVersion(pNavMeshStatus.getVersion())) { - navMeshPtr->handleRefresh(); + navMeshPtr->handleRefresh(pNavMeshStatus.getVersion()); } else { diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 81fa7b24db..138295a8cf 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -56,12 +56,28 @@ LLPathfindingNavMesh::navmesh_slot_t LLPathfindingNavMesh::registerNavMeshListen bool LLPathfindingNavMesh::hasNavMeshVersion(U32 pNavMeshVersion) const { - return (((mNavMeshRequestStatus == kNavMeshRequestStarted) || (mNavMeshRequestStatus == kNavMeshRequestCompleted)) && (mNavMeshVersion == pNavMeshVersion)); + return ((mNavMeshVersion == pNavMeshVersion) && + ((mNavMeshRequestStatus == kNavMeshRequestStarted) || (mNavMeshRequestStatus == kNavMeshRequestCompleted) || + ((mNavMeshRequestStatus == kNavMeshRequestChecking) && !mNavMeshData.empty()))); } -void LLPathfindingNavMesh::handleRefresh() +void LLPathfindingNavMesh::handleRefresh(U32 pNavMeshVersion) { - mNavMeshSignal(mNavMeshRequestStatus, mRegionUUID, mNavMeshVersion, mNavMeshData); + llassert(pNavMeshVersion == mNavMeshVersion); + if (mNavMeshRequestStatus == kNavMeshRequestChecking) + { + llassert(!mNavMeshData.empty()); + setRequestStatus(kNavMeshRequestCompleted); + } + else + { + mNavMeshSignal(mNavMeshRequestStatus, mRegionUUID, mNavMeshVersion, mNavMeshData); + } +} + +void LLPathfindingNavMesh::handleNavMeshCheckVersion() +{ + setRequestStatus(kNavMeshRequestChecking); } void LLPathfindingNavMesh::handleNavMeshNewVersion(U32 pNavMeshVersion) diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 3bdb485d37..46a114439a 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -50,6 +50,7 @@ class LLPathfindingNavMesh public: typedef enum { kNavMeshRequestUnknown, + kNavMeshRequestChecking, kNavMeshRequestNeedsUpdate, kNavMeshRequestStarted, kNavMeshRequestCompleted, @@ -72,7 +73,8 @@ public: bool hasNavMeshVersion(U32 pNavMeshVersion) const; - void handleRefresh(); + void handleNavMeshCheckVersion(); + void handleRefresh(U32 pNavMeshVersion); void handleNavMeshNewVersion(U32 pNavMeshVersion); void handleNavMeshStart(U32 pNavMeshVersion); void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion); diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index 83238ec869..8e558c3b00 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -140,6 +140,7 @@ void LLPathfindingNavMeshZone::handleNavMeshLocation() void LLPathfindingNavMeshZone::updateStatus() { bool hasRequestUnknown = false; + bool hasRequestChecking = false; bool hasRequestNeedsUpdate = false; bool hasRequestStarted = false; bool hasRequestCompleted = false; @@ -161,6 +162,9 @@ void LLPathfindingNavMeshZone::updateStatus() case LLPathfindingNavMesh::kNavMeshRequestUnknown : hasRequestUnknown = true; break; + case LLPathfindingNavMesh::kNavMeshRequestChecking : + hasRequestChecking = true; + break; case LLPathfindingNavMesh::kNavMeshRequestNeedsUpdate : hasRequestNeedsUpdate = true; break; @@ -189,6 +193,13 @@ void LLPathfindingNavMeshZone::updateStatus() zoneRequestStatus = kNavMeshZoneRequestNeedsUpdate; #ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE llinfos << "STINSON DEBUG: Navmesh zone update is NEEDS UPDATE" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE + } + else if (hasRequestChecking) + { + zoneRequestStatus = kNavMeshZoneRequestChecking; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is CHECKING" << llendl; #endif // XXX_STINSON_DEBUG_NAVMESH_ZONE } else if (hasRequestStarted) diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index 833f3ebb05..7b6583a663 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -45,6 +45,7 @@ class LLPathfindingNavMeshZone public: typedef enum { kNavMeshZoneRequestUnknown, + kNavMeshZoneRequestChecking, kNavMeshZoneRequestNeedsUpdate, kNavMeshZoneRequestStarted, kNavMeshZoneRequestCompleted, diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index 75465f1aea..d23d62674f 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -14,6 +14,7 @@ Cannot find pathing library implementation. This region is not enabled for pathfinding. + Checking the status of the navmesh ... Downloading the navmesh ... The navmesh has changed on the server. Downloading the latest navmesh ... Navmesh received. -- cgit v1.3 From 9aa0c58c20f8d60dc2f674ce1eaa805db8f599c8 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 13 Mar 2012 14:29:01 -0700 Subject: PATH-304: Using the embedded navmesh version information. --- indra/newview/llpathfindingnavmesh.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 138295a8cf..740d1cde24 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -32,6 +32,9 @@ #include +#define NAVMESH_VERSION_FIELD "navmesh_version" +#define NAVMESH_DATA_FIELD "navmesh_data" + //--------------------------------------------------------------------------- // LLPathfindingNavMesh //--------------------------------------------------------------------------- @@ -98,11 +101,24 @@ void LLPathfindingNavMesh::handleNavMeshStart(U32 pNavMeshVersion) void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion) { + if (pContent.has(NAVMESH_VERSION_FIELD)) + { + llassert(pContent.get(NAVMESH_VERSION_FIELD).isInteger()); + llassert(pContent.get(NAVMESH_VERSION_FIELD).asInteger() >= 0); + U32 embeddedNavMeshVersion = static_cast(pContent.get(NAVMESH_VERSION_FIELD).asInteger()); + llassert(embeddedNavMeshVersion == pNavMeshVersion); // stinson 03/13/2012 : does this ever occur? + if (embeddedNavMeshVersion != pNavMeshVersion) + { + llwarns << "Mismatch between expected and embedded navmesh versions occurred" << llendl; + pNavMeshVersion = embeddedNavMeshVersion; + } + } + if (mNavMeshVersion == pNavMeshVersion) { - if ( pContent.has("navmesh_data") ) + if ( pContent.has(NAVMESH_DATA_FIELD) ) { - const LLSD::Binary &value = pContent["navmesh_data"].asBinary(); + const LLSD::Binary &value = pContent.get(NAVMESH_DATA_FIELD).asBinary(); unsigned int binSize = value.size(); std::string newStr(reinterpret_cast(&value[0]), binSize); std::istringstream streamdecomp( newStr ); -- cgit v1.3 From d4fb7c99febf07b4eb7f3a9d2eab485e356d1439 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 14 Mar 2012 14:09:36 -0700 Subject: PATH-302: Adding in status reporting for the simulator navmesh status. Separating the viewer status messaging from the simulator status. --- indra/newview/llfloaterpathfindingconsole.cpp | 118 ++++++++++++++++--- indra/newview/llfloaterpathfindingconsole.h | 8 +- indra/newview/llpathfindingmanager.cpp | 27 +++-- indra/newview/llpathfindingmanager.h | 5 +- indra/newview/llpathfindingnavmesh.cpp | 65 +++++++---- indra/newview/llpathfindingnavmesh.h | 34 +++--- indra/newview/llpathfindingnavmeshstatus.cpp | 16 ++- indra/newview/llpathfindingnavmeshstatus.h | 8 ++ indra/newview/llpathfindingnavmeshzone.cpp | 130 +++++++++++++++++---- indra/newview/llpathfindingnavmeshzone.h | 25 +++- .../default/xui/en/floater_pathfinding_console.xml | 86 +++++++++++--- 11 files changed, 399 insertions(+), 123 deletions(-) (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 7e86819568..65a558b778 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -129,8 +129,11 @@ BOOL LLFloaterPathfindingConsole::postBuild() llassert(mFreezeButton != NULL); mFreezeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onFreezeClicked, this)); - mPathfindingStatus = findChild("pathfinding_status"); - llassert(mPathfindingStatus != NULL); + mPathfindingViewerStatus = findChild("pathfinding_viewer_status"); + llassert(mPathfindingViewerStatus != NULL); + + mPathfindingSimulatorStatus = findChild("pathfinding_simulator_status"); + llassert(mPathfindingSimulatorStatus != NULL); mCharacterWidthSlider = findChild("character_width"); llassert(mCharacterWidthSlider != NULL); @@ -469,7 +472,8 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mShowMaterialVolumesCheckBox(NULL), mShowExclusionVolumesCheckBox(NULL), mShowWorldCheckBox(NULL), - mPathfindingStatus(NULL), + mPathfindingViewerStatus(NULL), + mPathfindingSimulatorStatus(NULL), mViewCharactersButton(NULL), mEditTestTabContainer(NULL), mEditTab(NULL), @@ -731,50 +735,126 @@ void LLFloaterPathfindingConsole::updateStatusOnConsoleState() { static const LLColor4 warningColor = LLUIColorTable::instance().getColor("DrYellow"); - std::string statusText(""); - LLStyle::Params styleParams; + std::string simulatorStatusText(""); + std::string viewerStatusText(""); + LLStyle::Params viewerStyleParams; switch (mConsoleState) { case kConsoleStateUnknown : - statusText = getString("navmesh_status_unknown"); + simulatorStatusText = getString("navmesh_simulator_status_unknown"); + viewerStatusText = getString("navmesh_viewer_status_unknown"); break; case kConsoleStateLibraryNotImplemented : - statusText = getString("navmesh_status_library_not_implemented"); - styleParams.color = warningColor; + simulatorStatusText = getString("navmesh_simulator_status_unknown"); + viewerStatusText = getString("navmesh_viewer_status_library_not_implemented"); + viewerStyleParams.color = warningColor; break; case kConsoleStateRegionNotEnabled : - statusText = getString("navmesh_status_region_not_enabled"); - styleParams.color = warningColor; + simulatorStatusText = getString("navmesh_simulator_status_unknown"); + viewerStatusText = getString("navmesh_viewer_status_region_not_enabled"); + viewerStyleParams.color = warningColor; break; case kConsoleStateCheckingVersion : - statusText = getString("navmesh_status_checking_version"); + simulatorStatusText = getString("navmesh_simulator_status_unknown"); + viewerStatusText = getString("navmesh_viewer_status_checking_version"); break; case kConsoleStateDownloading : + simulatorStatusText = getSimulatorStatusText(); if (mIsNavMeshUpdating) { - statusText = getString("navmesh_status_updating"); + viewerStatusText = getString("navmesh_viewer_status_updating"); } else { - statusText = getString("navmesh_status_downloading"); + viewerStatusText = getString("navmesh_viewer_status_downloading"); } break; case kConsoleStateHasNavMesh : - statusText = getString("navmesh_status_has_navmesh"); + simulatorStatusText = getSimulatorStatusText(); + viewerStatusText = getString("navmesh_viewer_status_has_navmesh"); break; case kConsoleStateError : - statusText = getString("navmesh_status_error"); - styleParams.color = warningColor; + simulatorStatusText = getString("navmesh_simulator_status_unknown"); + viewerStatusText = getString("navmesh_viewer_status_error"); + viewerStyleParams.color = warningColor; break; default : - statusText = getString("navmesh_status_unknown"); + simulatorStatusText = getString("navmesh_simulator_status_unknown"); + viewerStatusText = getString("navmesh_viewer_status_unknown"); llassert(0); break; } - mPathfindingStatus->setText((LLStringExplicit)statusText, styleParams); + mPathfindingViewerStatus->setText((LLStringExplicit)viewerStatusText, viewerStyleParams); + mPathfindingSimulatorStatus->setText((LLStringExplicit)simulatorStatusText); } + +std::string LLFloaterPathfindingConsole::getSimulatorStatusText() const +{ + std::string simulatorStatusText(""); + +#ifdef DEPRECATED_UNVERSIONED_NAVMESH + if (LLPathfindingManager::getInstance()->isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX()) + { + switch (mNavMeshZone.getNavMeshZoneStatus()) + { + case LLPathfindingNavMeshZone::kNavMeshZonePending : + simulatorStatusText = getString("navmesh_simulator_status_pending"); + break; + case LLPathfindingNavMeshZone::kNavMeshZoneBuilding : + simulatorStatusText = getString("navmesh_simulator_status_building"); + break; + case LLPathfindingNavMeshZone::kNavMeshZoneSomePending : + simulatorStatusText = getString("navmesh_simulator_status_some_pending"); + break; + case LLPathfindingNavMeshZone::kNavMeshZoneSomeBuilding : + simulatorStatusText = getString("navmesh_simulator_status_some_building"); + break; + case LLPathfindingNavMeshZone::kNavMeshZonePendingAndBuilding : + simulatorStatusText = getString("navmesh_simulator_status_pending_and_building"); + break; + case LLPathfindingNavMeshZone::kNavMeshZoneComplete : + simulatorStatusText = getString("navmesh_simulator_status_complete"); + break; + default : + simulatorStatusText = getString("navmesh_simulator_status_unknown"); + break; + } + } + else + { + simulatorStatusText = getString("navmesh_simulator_status_region_not_enabled"); + } +#else // DEPRECATED_UNVERSIONED_NAVMESH + switch (mNavMeshZone.getNavMeshZoneStatus()) + { + case LLPathfindingNavMeshZone::kNavMeshZonePending : + simulatorStatusText = getString("navmesh_simulator_status_pending"); + break; + case LLPathfindingNavMeshZone::kNavMeshZoneBuilding : + simulatorStatusText = getString("navmesh_simulator_status_building"); + break; + case LLPathfindingNavMeshZone::kNavMeshZoneSomePending : + simulatorStatusText = getString("navmesh_simulator_status_some_pending"); + break; + case LLPathfindingNavMeshZone::kNavMeshZoneSomeBuilding : + simulatorStatusText = getString("navmesh_simulator_status_some_building"); + break; + case LLPathfindingNavMeshZone::kNavMeshZonePendingAndBuilding : + simulatorStatusText = getString("navmesh_simulator_status_pending_and_building"); + break; + case LLPathfindingNavMeshZone::kNavMeshZoneComplete : + simulatorStatusText = getString("navmesh_simulator_status_complete"); + break; + default : + simulatorStatusText = getString("navmesh_simulator_status_unknown"); + break; + } +#endif // DEPRECATED_UNVERSIONED_NAVMESH + + return simulatorStatusText; +} void LLFloaterPathfindingConsole::setAgentState(LLPathfindingManager::EAgentState pAgentState) { @@ -894,5 +974,5 @@ void LLFloaterPathfindingConsole::regionCrossingOccured() LLStyle::Params styleParams; styleParams.color = LLUIColorTable::instance().getColor("DrYellow"); statusText = getString("navmesh_update_needed"); - mPathfindingStatus->setText((LLStringExplicit)statusText, styleParams); + mPathfindingViewerStatus->setText((LLStringExplicit)statusText, styleParams); } \ No newline at end of file diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index a1973e0985..8c22e5ead7 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -147,8 +147,9 @@ private: void setConsoleState(EConsoleState pConsoleState); - void updateControlsOnConsoleState(); - void updateStatusOnConsoleState(); + void updateControlsOnConsoleState(); + void updateStatusOnConsoleState(); + std::string getSimulatorStatusText() const; void setAgentState(LLPathfindingManager::EAgentState pAgentState); @@ -165,7 +166,8 @@ private: LLCheckBoxCtrl *mShowMaterialVolumesCheckBox; LLCheckBoxCtrl *mShowExclusionVolumesCheckBox; LLCheckBoxCtrl *mShowWorldCheckBox; - LLTextBase *mPathfindingStatus; + LLTextBase *mPathfindingViewerStatus; + LLTextBase *mPathfindingSimulatorStatus; LLButton *mViewCharactersButton; LLTabContainer *mEditTestTabContainer; LLPanel *mEditTab; diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 46bfbe0bb0..e3242de812 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -41,7 +41,6 @@ #include "llpathfindinglinkset.h" #include "llpathfindinglinksetlist.h" #include "llhttpnode.h" -//#include "llpathfindingnavmeshzone.h" // XXX #include #include @@ -254,6 +253,14 @@ bool LLPathfindingManager::isPathfindingEnabledForRegion(LLViewerRegion *pRegion return !retrieveNavMeshURL.empty(); } +#ifdef DEPRECATED_UNVERSIONED_NAVMESH +bool LLPathfindingManager::isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX() const +{ + std::string navMeshStatusURL = getNavMeshStatusURLForRegion(getCurrentRegion()); + return !navMeshStatusURL.empty(); +} +#endif // DEPRECATED_UNVERSIONED_NAVMESH + bool LLPathfindingManager::isAllowAlterPermanent() { return (!isPathfindingEnabledForCurrentRegion() || (getAgentState() == kAgentStateUnfrozen)); @@ -285,7 +292,9 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) #ifdef DEPRECATED_UNVERSIONED_NAVMESH if (navMeshStatusURL.empty()) { - sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, navMeshPtr->getNavMeshVersion() + 1U); + LLPathfindingNavMeshStatus navMeshStatus = navMeshPtr->getNavMeshStatusXXX(); + navMeshStatus.incrementNavMeshVersionXXX(); + sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, navMeshStatus); } else { @@ -312,13 +321,13 @@ void LLPathfindingManager::handleNavMeshStatusRequest(const LLPathfindingNavMesh } else { - if (navMeshPtr->hasNavMeshVersion(pNavMeshStatus.getVersion())) + if (navMeshPtr->hasNavMeshVersion(pNavMeshStatus)) { - navMeshPtr->handleRefresh(pNavMeshStatus.getVersion()); + navMeshPtr->handleRefresh(pNavMeshStatus); } else { - sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, pNavMeshStatus.getVersion()); + sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, pNavMeshStatus); } } } @@ -333,7 +342,7 @@ void LLPathfindingManager::handleNavMeshStatusUpdate(const LLPathfindingNavMeshS } else { - navMeshPtr->handleNavMeshNewVersion(pNavMeshStatus.getVersion()); + navMeshPtr->handleNavMeshNewVersion(pNavMeshStatus); } } @@ -462,7 +471,7 @@ LLPathfindingManager::ELinksetsRequestStatus LLPathfindingManager::requestSetLin return status; } -void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, U32 pNavMeshVersion) +void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus) { if ((pRegion == NULL) || !pRegion->isAlive()) { @@ -478,8 +487,8 @@ void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPt } else { - navMeshPtr->handleNavMeshStart(pNavMeshVersion); - LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshVersion, navMeshPtr); + navMeshPtr->handleNavMeshStart(pNavMeshStatus); + LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshStatus.getVersion(), navMeshPtr); LLSD postData; LLHTTPClient::post(navMeshURL, postData, responder); diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 1cfd870897..b458d6513a 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -77,6 +77,9 @@ public: bool isPathfindingEnabledForCurrentRegion() const; bool isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const; +#ifdef DEPRECATED_UNVERSIONED_NAVMESH + bool isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX() const; +#endif // DEPRECATED_UNVERSIONED_NAVMESH bool isAllowAlterPermanent(); bool isAllowViewTerrainProperties() const; @@ -98,7 +101,7 @@ public: protected: private: - void sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, U32 pNavMeshVersion); + void sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus); LLPathfindingNavMeshPtr getNavMeshForRegion(const LLUUID &pRegionUUID); LLPathfindingNavMeshPtr getNavMeshForRegion(LLViewerRegion *pRegion); diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 740d1cde24..10e9abaf0c 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -28,6 +28,7 @@ #include "llviewerprecompiledheaders.h" #include "lluuid.h" #include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" #include "llsdserialize.h" #include @@ -40,11 +41,11 @@ //--------------------------------------------------------------------------- LLPathfindingNavMesh::LLPathfindingNavMesh(const LLUUID &pRegionUUID) - : mRegionUUID(pRegionUUID), + : mNavMeshStatus(pRegionUUID), mNavMeshRequestStatus(kNavMeshRequestUnknown), mNavMeshSignal(), - mNavMeshData(), - mNavMeshVersion(0U) + mNavMeshData() + { } @@ -57,16 +58,23 @@ LLPathfindingNavMesh::navmesh_slot_t LLPathfindingNavMesh::registerNavMeshListen return mNavMeshSignal.connect(pNavMeshCallback); } -bool LLPathfindingNavMesh::hasNavMeshVersion(U32 pNavMeshVersion) const +bool LLPathfindingNavMesh::hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const { - return ((mNavMeshVersion == pNavMeshVersion) && + return ((mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()) && ((mNavMeshRequestStatus == kNavMeshRequestStarted) || (mNavMeshRequestStatus == kNavMeshRequestCompleted) || ((mNavMeshRequestStatus == kNavMeshRequestChecking) && !mNavMeshData.empty()))); } -void LLPathfindingNavMesh::handleRefresh(U32 pNavMeshVersion) +void LLPathfindingNavMesh::handleNavMeshCheckVersion() +{ + setRequestStatus(kNavMeshRequestChecking); +} + +void LLPathfindingNavMesh::handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus) { - llassert(pNavMeshVersion == mNavMeshVersion); + llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID()); + llassert(mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()); + mNavMeshStatus = pNavMeshStatus; if (mNavMeshRequestStatus == kNavMeshRequestChecking) { llassert(!mNavMeshData.empty()); @@ -74,28 +82,30 @@ void LLPathfindingNavMesh::handleRefresh(U32 pNavMeshVersion) } else { - mNavMeshSignal(mNavMeshRequestStatus, mRegionUUID, mNavMeshVersion, mNavMeshData); + sendStatus(); } } -void LLPathfindingNavMesh::handleNavMeshCheckVersion() -{ - setRequestStatus(kNavMeshRequestChecking); -} - -void LLPathfindingNavMesh::handleNavMeshNewVersion(U32 pNavMeshVersion) +void LLPathfindingNavMesh::handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) { - if (mNavMeshVersion != pNavMeshVersion) + llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID()); + if (mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()) + { + mNavMeshStatus = pNavMeshStatus; + sendStatus(); + } + else { mNavMeshData.clear(); - mNavMeshVersion = pNavMeshVersion; + mNavMeshStatus = pNavMeshStatus; setRequestStatus(kNavMeshRequestNeedsUpdate); } } -void LLPathfindingNavMesh::handleNavMeshStart(U32 pNavMeshVersion) +void LLPathfindingNavMesh::handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus) { - mNavMeshVersion = pNavMeshVersion; + llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID()); + mNavMeshStatus = pNavMeshStatus; setRequestStatus(kNavMeshRequestStarted); } @@ -114,8 +124,9 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes } } - if (mNavMeshVersion == pNavMeshVersion) + if (mNavMeshStatus.getVersion() == pNavMeshVersion) { + ENavMeshRequestStatus status; if ( pContent.has(NAVMESH_DATA_FIELD) ) { const LLSD::Binary &value = pContent.get(NAVMESH_DATA_FIELD).asBinary(); @@ -128,14 +139,14 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes if ( !valid ) { llwarns << "Unable to decompress the navmesh llsd." << llendl; - setRequestStatus(kNavMeshRequestError); + status = kNavMeshRequestError; } else { llassert(pUncompressedNavMeshContainer); mNavMeshData.resize( decompBinSize ); memcpy( &mNavMeshData[0], &pUncompressedNavMeshContainer[0], decompBinSize ); - setRequestStatus(kNavMeshRequestCompleted); + status = kNavMeshRequestCompleted; } if ( pUncompressedNavMeshContainer ) { @@ -145,8 +156,9 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes else { llwarns << "No mesh data received" << llendl; - setRequestStatus(kNavMeshRequestError); + status = kNavMeshRequestError; } + setRequestStatus(status); } } @@ -165,7 +177,7 @@ void LLPathfindingNavMesh::handleNavMeshError() void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion) { llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; - if (mNavMeshVersion == pNavMeshVersion) + if (mNavMeshStatus.getVersion() == pNavMeshVersion) { handleNavMeshError(); } @@ -174,5 +186,10 @@ void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pR void LLPathfindingNavMesh::setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus) { mNavMeshRequestStatus = pNavMeshRequestStatus; - mNavMeshSignal(mNavMeshRequestStatus, mRegionUUID, mNavMeshVersion, mNavMeshData); + sendStatus(); +} + +void LLPathfindingNavMesh::sendStatus() +{ + mNavMeshSignal(mNavMeshRequestStatus, mNavMeshStatus, mNavMeshData); } diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 46a114439a..290f7a2cdf 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -29,7 +29,6 @@ #define LL_LLPATHFINDINGNAVMESH_H #include "llsd.h" -#include "lluuid.h" #include @@ -37,14 +36,13 @@ #include #include -class LLSD; +#include "llpathfindingnavmeshstatus.h" + +class LLUUID; class LLPathfindingNavMesh; typedef boost::shared_ptr LLPathfindingNavMeshPtr; -// XXX stinson 03/12/2012 : This definition is in place to support an older version of the pathfinding simulator that does not have versioned information -#define DEPRECATED_UNVERSIONED_NAVMESH - class LLPathfindingNavMesh { public: @@ -58,9 +56,9 @@ public: kNavMeshRequestError } ENavMeshRequestStatus; - typedef boost::function navmesh_callback_t; - typedef boost::signals2::signal navmesh_signal_t; - typedef boost::signals2::connection navmesh_slot_t; + typedef boost::function navmesh_callback_t; + typedef boost::signals2::signal navmesh_signal_t; + typedef boost::signals2::connection navmesh_slot_t; LLPathfindingNavMesh(const LLUUID &pRegionUUID); virtual ~LLPathfindingNavMesh(); @@ -68,15 +66,15 @@ public: navmesh_slot_t registerNavMeshListener(navmesh_callback_t pNavMeshCallback); #ifdef DEPRECATED_UNVERSIONED_NAVMESH - U32 getNavMeshVersion() const {return mNavMeshVersion;}; + const LLPathfindingNavMeshStatus &getNavMeshStatusXXX() const {return mNavMeshStatus;}; #endif // DEPRECATED_UNVERSIONED_NAVMESH - bool hasNavMeshVersion(U32 pNavMeshVersion) const; + bool hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const; void handleNavMeshCheckVersion(); - void handleRefresh(U32 pNavMeshVersion); - void handleNavMeshNewVersion(U32 pNavMeshVersion); - void handleNavMeshStart(U32 pNavMeshVersion); + void handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus); + void handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus); + void handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus); void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion); void handleNavMeshNotEnabled(); void handleNavMeshError(); @@ -86,12 +84,12 @@ protected: private: void setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus); + void sendStatus(); - LLUUID mRegionUUID; - ENavMeshRequestStatus mNavMeshRequestStatus; - navmesh_signal_t mNavMeshSignal; - LLSD::Binary mNavMeshData; - U32 mNavMeshVersion; + LLPathfindingNavMeshStatus mNavMeshStatus; + ENavMeshRequestStatus mNavMeshRequestStatus; + navmesh_signal_t mNavMeshSignal; + LLSD::Binary mNavMeshData; }; #endif // LL_LLPATHFINDINGNAVMESH_H diff --git a/indra/newview/llpathfindingnavmeshstatus.cpp b/indra/newview/llpathfindingnavmeshstatus.cpp index 2ef892c8cd..0ba28e0297 100644 --- a/indra/newview/llpathfindingnavmeshstatus.cpp +++ b/indra/newview/llpathfindingnavmeshstatus.cpp @@ -48,6 +48,14 @@ const std::string LLPathfindingNavMeshStatus::sStatusRepending("repending"); // LLPathfindingNavMeshStatus //--------------------------------------------------------------------------- +LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus() + : mIsValid(false), + mRegionUUID(), + mVersion(0U), + mStatus(kComplete) +{ +} + LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID) : mIsValid(false), mRegionUUID(pRegionUUID), @@ -127,19 +135,19 @@ void LLPathfindingNavMeshStatus::parseStatus(const LLSD &pContent) std::string status = pContent.get(STATUS_FIELD).asString(); #endif // DEPRECATED_STATE_FIELD - if (LLStringUtil::compareStrings(status, sStatusPending)) + if (LLStringUtil::compareStrings(status, sStatusPending) == 0) { mStatus = kPending; } - else if (LLStringUtil::compareStrings(status, sStatusBuilding)) + else if (LLStringUtil::compareStrings(status, sStatusBuilding) == 0) { mStatus = kBuilding; } - else if (LLStringUtil::compareStrings(status, sStatusComplete)) + else if (LLStringUtil::compareStrings(status, sStatusComplete) == 0) { mStatus = kComplete; } - else if (LLStringUtil::compareStrings(status, sStatusRepending)) + else if (LLStringUtil::compareStrings(status, sStatusRepending) == 0) { mStatus = kRepending; } diff --git a/indra/newview/llpathfindingnavmeshstatus.h b/indra/newview/llpathfindingnavmeshstatus.h index fcc876059d..7147fcdf36 100644 --- a/indra/newview/llpathfindingnavmeshstatus.h +++ b/indra/newview/llpathfindingnavmeshstatus.h @@ -32,6 +32,9 @@ #include +// XXX stinson 03/12/2012 : This definition is in place to support an older version of the pathfinding simulator that does not have versioned information +#define DEPRECATED_UNVERSIONED_NAVMESH + class LLSD; class LLPathfindingNavMeshStatus @@ -45,6 +48,7 @@ public: kRepending } ENavMeshStatus; + LLPathfindingNavMeshStatus(); LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID); LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID, const LLSD &pContent); LLPathfindingNavMeshStatus(const LLSD &pContent); @@ -53,6 +57,10 @@ public: LLPathfindingNavMeshStatus &operator =(const LLPathfindingNavMeshStatus &pOther); +#ifdef DEPRECATED_UNVERSIONED_NAVMESH + void incrementNavMeshVersionXXX() {++mVersion;}; +#endif // DEPRECATED_UNVERSIONED_NAVMESH + bool isValid() const {return mIsValid;}; const LLUUID &getRegionUUID() const {return mRegionUUID;}; U32 getVersion() const {return mVersion;}; diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index 8e558c3b00..f871204454 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -50,6 +50,7 @@ LLPathfindingNavMeshZone::LLPathfindingNavMeshZone() : mNavMeshLocationPtrs(), + mNavMeshZoneRequestStatus(kNavMeshZoneRequestUnknown), mNavMeshZoneSignal() { } @@ -132,6 +133,71 @@ void LLPathfindingNavMeshZone::refresh() } } +LLPathfindingNavMeshZone::ENavMeshZoneStatus LLPathfindingNavMeshZone::getNavMeshZoneStatus() const +{ + bool hasPending = false; + bool hasBuilding = false; + bool hasComplete = false; + bool hasRepending = false; + + for (NavMeshLocationPtrs::const_iterator navMeshLocationPtrIter = mNavMeshLocationPtrs.begin(); + navMeshLocationPtrIter != mNavMeshLocationPtrs.end(); ++navMeshLocationPtrIter) + { + const NavMeshLocationPtr navMeshLocationPtr = *navMeshLocationPtrIter; + + switch (navMeshLocationPtr->getNavMeshStatus()) + { + case LLPathfindingNavMeshStatus::kPending : + hasPending = true; + break; + case LLPathfindingNavMeshStatus::kBuilding : + hasBuilding = true; + break; + case LLPathfindingNavMeshStatus::kComplete : + hasComplete = true; + break; + case LLPathfindingNavMeshStatus::kRepending : + hasRepending = true; + break; + default : + hasPending = true; + llassert(0); + break; + } + } + + ENavMeshZoneStatus zoneStatus = kNavMeshZoneComplete; + if (hasRepending || (hasPending && hasBuilding)) + { + zoneStatus = kNavMeshZonePendingAndBuilding; + } + else if (hasComplete) + { + if (hasPending) + { + zoneStatus = kNavMeshZoneSomePending; + } + else if (hasBuilding) + { + zoneStatus = kNavMeshZoneSomeBuilding; + } + else + { + zoneStatus = kNavMeshZoneComplete; + } + } + else if (hasPending) + { + zoneStatus = kNavMeshZonePending; + } + else if (hasBuilding) + { + zoneStatus = kNavMeshZoneBuilding; + } + + return zoneStatus; +} + void LLPathfindingNavMeshZone::handleNavMeshLocation() { updateStatus(); @@ -150,10 +216,10 @@ void LLPathfindingNavMeshZone::updateStatus() #ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE llinfos << "STINSON DEBUG: Navmesh zone update BEGIN" << llendl; #endif // XXX_STINSON_DEBUG_NAVMESH_ZONE - for (NavMeshLocationPtrs::iterator navMeshLocationPtrIter = mNavMeshLocationPtrs.begin(); + for (NavMeshLocationPtrs::const_iterator navMeshLocationPtrIter = mNavMeshLocationPtrs.begin(); navMeshLocationPtrIter != mNavMeshLocationPtrs.end(); ++navMeshLocationPtrIter) { - NavMeshLocationPtr navMeshLocationPtr = *navMeshLocationPtrIter; + const NavMeshLocationPtr navMeshLocationPtr = *navMeshLocationPtrIter; #ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE llinfos << "STINSON DEBUG: region #" << navMeshLocationPtr->getDirection() << ": region(" << navMeshLocationPtr->getRegionUUID().asString() << ") status:" << navMeshLocationPtr->getRequestStatus() << llendl; #endif // XXX_STINSON_DEBUG_NAVMESH_ZONE @@ -226,14 +292,6 @@ void LLPathfindingNavMeshZone::updateStatus() else if (hasRequestCompleted) { zoneRequestStatus = kNavMeshZoneRequestCompleted; -#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE - llinfos << "STINSON DEBUG: Navmesh zone update is stitching" << llendl; -#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE - llassert(LLPathingLib::getInstance() != NULL); - if (LLPathingLib::getInstance() != NULL) - { - LLPathingLib::getInstance()->stitchNavMeshes( gSavedSettings.getBOOL("EnableVBOForNavMeshVisualization") ); - } #ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE llinfos << "STINSON DEBUG: Navmesh zone update is COMPLETED" << llendl; #endif // XXX_STINSON_DEBUG_NAVMESH_ZONE @@ -254,7 +312,24 @@ void LLPathfindingNavMeshZone::updateStatus() llassert(0); } - mNavMeshZoneSignal(zoneRequestStatus); + if ((mNavMeshZoneRequestStatus != kNavMeshZoneRequestCompleted) && + (zoneRequestStatus == kNavMeshZoneRequestCompleted)) + { +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is stitching" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE + llassert(LLPathingLib::getInstance() != NULL); + if (LLPathingLib::getInstance() != NULL) + { + LLPathingLib::getInstance()->stitchNavMeshes( gSavedSettings.getBOOL("EnableVBOForNavMeshVisualization") ); + } +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update stitching is done" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE + } + + mNavMeshZoneRequestStatus = zoneRequestStatus; + mNavMeshZoneSignal(mNavMeshZoneRequestStatus); } //--------------------------------------------------------------------------- @@ -266,6 +341,7 @@ LLPathfindingNavMeshZone::NavMeshLocation::NavMeshLocation(S32 pDirection, navme mRegionUUID(), mHasNavMesh(false), mNavMeshVersion(0U), + mNavMeshStatus(LLPathfindingNavMeshStatus::kComplete), mLocationCallback(pLocationCallback), mRequestStatus(LLPathfindingNavMesh::kNavMeshRequestUnknown), mNavMeshSlot() @@ -288,7 +364,7 @@ void LLPathfindingNavMeshZone::NavMeshLocation::enable() else { mRegionUUID = region->getRegionID(); - mNavMeshSlot = LLPathfindingManager::getInstance()->registerNavMeshListenerForRegion(region, boost::bind(&LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh, this, _1, _2, _3, _4)); + mNavMeshSlot = LLPathfindingManager::getInstance()->registerNavMeshListenerForRegion(region, boost::bind(&LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh, this, _1, _2, _3)); } } @@ -299,8 +375,9 @@ void LLPathfindingNavMeshZone::NavMeshLocation::refresh() if (region == NULL) { llassert(mRegionUUID.isNull()); + LLPathfindingNavMeshStatus newNavMeshStatus(mRegionUUID); LLSD::Binary nullData; - handleNavMesh(LLPathfindingNavMesh::kNavMeshRequestNotEnabled, mRegionUUID, 0U, nullData); + handleNavMesh(LLPathfindingNavMesh::kNavMeshRequestNotEnabled, newNavMeshStatus, nullData); } else { @@ -319,33 +396,38 @@ LLPathfindingNavMesh::ENavMeshRequestStatus LLPathfindingNavMeshZone::NavMeshLoc return mRequestStatus; } -void LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLUUID &pRegionUUID, U32 pNavMeshVersion, const LLSD::Binary &pNavMeshData) +LLPathfindingNavMeshStatus::ENavMeshStatus LLPathfindingNavMeshZone::NavMeshLocation::getNavMeshStatus() const { - llassert(mRegionUUID == pRegionUUID); - if (pNavMeshRequestStatus != LLPathfindingNavMesh::kNavMeshRequestCompleted) - { - mRequestStatus = pNavMeshRequestStatus; - mLocationCallback(); - } - else if (!mHasNavMesh || (mNavMeshVersion != pNavMeshVersion)) + return mNavMeshStatus; +} + +void LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLPathfindingNavMeshStatus &pNavMeshStatus, const LLSD::Binary &pNavMeshData) +{ + llassert(mRegionUUID == pNavMeshStatus.getRegionUUID()); + + if ((pNavMeshRequestStatus == LLPathfindingNavMesh::kNavMeshRequestCompleted) && + (!mHasNavMesh || (mNavMeshVersion != pNavMeshStatus.getVersion()))) { llassert(!pNavMeshData.empty()); - mRequestStatus = pNavMeshRequestStatus; mHasNavMesh = true; - mNavMeshVersion = pNavMeshVersion; + mNavMeshVersion = pNavMeshStatus.getVersion(); llassert(LLPathingLib::getInstance() != NULL); if (LLPathingLib::getInstance() != NULL) { LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD(pNavMeshData, mDirection); } - mLocationCallback(); } + + mRequestStatus = pNavMeshRequestStatus; + mNavMeshStatus = pNavMeshStatus.getStatus(); + mLocationCallback(); } void LLPathfindingNavMeshZone::NavMeshLocation::clear() { mHasNavMesh = false; mRequestStatus = LLPathfindingNavMesh::kNavMeshRequestUnknown; + mNavMeshStatus = LLPathfindingNavMeshStatus::kComplete; if (mNavMeshSlot.connected()) { mNavMeshSlot.disconnect(); diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index 7b6583a663..7f83e9d37b 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -31,6 +31,7 @@ #include "llsd.h" #include "lluuid.h" #include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" #include @@ -38,6 +39,8 @@ #include #include +class LLPathfindingNavMeshStatus; + //#define XXX_STINSON_DEBUG_NAVMESH_ZONE class LLPathfindingNavMeshZone @@ -53,9 +56,18 @@ public: kNavMeshZoneRequestError } ENavMeshZoneRequestStatus; + typedef enum { + kNavMeshZonePending, + kNavMeshZoneBuilding, + kNavMeshZoneSomePending, + kNavMeshZoneSomeBuilding, + kNavMeshZonePendingAndBuilding, + kNavMeshZoneComplete + } ENavMeshZoneStatus; + typedef boost::function navmesh_zone_callback_t; typedef boost::signals2::signal navmesh_zone_signal_t; - typedef boost::signals2::connection navmesh_zone_slot_t; + typedef boost::signals2::connection navmesh_zone_slot_t; LLPathfindingNavMeshZone(); virtual ~LLPathfindingNavMeshZone(); @@ -67,6 +79,8 @@ public: void disable(); void refresh(); + ENavMeshZoneStatus getNavMeshZoneStatus() const; + protected: private: @@ -82,6 +96,7 @@ private: void disable(); LLPathfindingNavMesh::ENavMeshRequestStatus getRequestStatus() const; + LLPathfindingNavMeshStatus::ENavMeshStatus getNavMeshStatus() const; #ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE const LLUUID &getRegionUUID() const {return mRegionUUID;}; S32 getDirection() const {return mDirection;}; @@ -90,7 +105,7 @@ private: protected: private: - void handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLUUID &pRegionUUID, U32 pNavMeshVersion, const LLSD::Binary &pNavMeshData); + void handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLPathfindingNavMeshStatus &pNavMeshStatus, const LLSD::Binary &pNavMeshData); void clear(); LLViewerRegion *getRegion() const; @@ -99,6 +114,7 @@ private: LLUUID mRegionUUID; bool mHasNavMesh; U32 mNavMeshVersion; + LLPathfindingNavMeshStatus::ENavMeshStatus mNavMeshStatus; navmesh_location_callback_t mLocationCallback; LLPathfindingNavMesh::ENavMeshRequestStatus mRequestStatus; LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot; @@ -110,8 +126,9 @@ private: void handleNavMeshLocation(); void updateStatus(); - NavMeshLocationPtrs mNavMeshLocationPtrs; - navmesh_zone_signal_t mNavMeshZoneSignal; + NavMeshLocationPtrs mNavMeshLocationPtrs; + ENavMeshZoneRequestStatus mNavMeshZoneRequestStatus; + navmesh_zone_signal_t mNavMeshZoneSignal; }; #endif // LL_LLPATHFINDINGNAVMESHZONE_H diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index aaf94483df..0373305941 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -2,7 +2,7 @@ - - Cannot find pathing library implementation. - This region is not enabled for pathfinding. - Checking the status of the navmesh ... - Downloading the navmesh ... - The navmesh has changed on the server. Downloading the latest navmesh ... - Navmesh received. - Unable to download navmesh successfully. + + Cannot find pathing library implementation. + This region is not enabled for pathfinding. + Checking the status of the navmesh. + Downloading the navmesh. + The navmesh has changed on the server. Downloading the latest navmesh. + Latest navmesh has been downloaded. + Unable to download navmesh successfully. + + This region does not expose the navmesh status. + Navmesh has pending changes. + Navmesh is building. + Some navmesh regions have pending changes. + Some navmesh regions are building. + Some navmesh regions have pending changes and others are building. + Navmesh is up-to-date. Please choose start and end points. Please choose start point. Please choose end point. Path is shown in blue. - Region boundary hit, navmesh may not be accurate. Update. + Region boundary hit, navmesh may not be accurate. + width="188"> Show walkability map: - Status + Viewer status + + + + + + + + Simulator status @@ -210,7 +262,7 @@ layout="topleft" left="230" top="35" - height="305" + height="373" width="214" visible="true" /> Prevent object / terrain changes and update the navmesh: @@ -306,7 +358,7 @@ label="Freeze" layout="topleft" name="enter_frozen_mode" - top_pad="9" + top_pad="3" width="116"/> Date: Tue, 24 Apr 2012 19:23:20 -0700 Subject: PATH-580: BUGFIX Adding functionality to detect when the region's capabilities have not yet been loading and deferring requests for the navmesh query until the capabilities are fully loaded. --- indra/newview/llfloaterpathfindingconsole.cpp | 9 + indra/newview/llfloaterpathfindingconsole.h | 1 + indra/newview/llpathfindingmanager.cpp | 1984 ++++++++++---------- indra/newview/llpathfindingmanager.h | 289 +-- indra/newview/llpathfindingnavmesh.cpp | 396 ++-- indra/newview/llpathfindingnavmesh.h | 193 +- indra/newview/llpathfindingnavmeshzone.cpp | 13 +- indra/newview/llpathfindingnavmeshzone.h | 270 +-- .../default/xui/en/floater_pathfinding_console.xml | 1 + 9 files changed, 1606 insertions(+), 1550 deletions(-) (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index e89d0c2cab..ca78042c2b 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -605,6 +605,9 @@ void LLFloaterPathfindingConsole::onNavMeshZoneCB(LLPathfindingNavMeshZone::ENav case LLPathfindingNavMeshZone::kNavMeshZoneRequestUnknown : setConsoleState(kConsoleStateUnknown); break; + case LLPathfindingNavMeshZone::kNavMeshZoneRequestWaiting : + setConsoleState(kConsoleStateRegionLoading); + break; case LLPathfindingNavMeshZone::kNavMeshZoneRequestChecking : setConsoleState(kConsoleStateCheckingVersion); break; @@ -723,6 +726,7 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() { case kConsoleStateUnknown : case kConsoleStateRegionNotEnabled : + case kConsoleStateRegionLoading : mShowLabel->setEnabled(FALSE); mShowWorldCheckBox->setEnabled(FALSE); mShowWorldMovablesOnlyCheckBox->setEnabled(FALSE); @@ -857,6 +861,11 @@ void LLFloaterPathfindingConsole::updateStatusOnConsoleState() viewerStatusText = getString("navmesh_viewer_status_region_not_enabled"); viewerStyleParams.color = errorColor; break; + case kConsoleStateRegionLoading : + simulatorStatusText = getString("navmesh_simulator_status_unknown"); + viewerStatusText = getString("navmesh_viewer_status_region_loading"); + viewerStyleParams.color = warningColor; + break; case kConsoleStateCheckingVersion : simulatorStatusText = getString("navmesh_simulator_status_unknown"); viewerStatusText = getString("navmesh_viewer_status_checking_version"); diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index fcb13955c3..3fdadfafad 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -103,6 +103,7 @@ private: kConsoleStateUnknown, kConsoleStateLibraryNotImplemented, kConsoleStateRegionNotEnabled, + kConsoleStateRegionLoading, kConsoleStateCheckingVersion, kConsoleStateDownloading, kConsoleStateHasNavMesh, diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index cefff175a3..e754e77588 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -1,982 +1,1002 @@ -/** - * @file llpathfindingmanager.cpp - * @author William Todd Stinson - * @brief A state manager for the various pathfinding states. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include -#include - -#include "llviewerprecompiledheaders.h" -#include "llsd.h" -#include "lluuid.h" -#include "llpathfindingmanager.h" -#include "llsingleton.h" -#include "llhttpclient.h" -#include "llagent.h" -#include "llviewerregion.h" -#include "llpathfindingnavmesh.h" -#include "llpathfindingnavmeshstatus.h" -#include "llpathfindinglinkset.h" -#include "llpathfindinglinksetlist.h" -#include "llpathfindingcharacterlist.h" -#include "llhttpnode.h" - -#include -#include - -#define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" - -#define CAP_SERVICE_NAVMESH_STATUS "NavMeshGenerationStatus" - -#define CAP_SERVICE_AGENT_STATE "AgentPreferences" -#define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects" -#define DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD "alter_permanent_objects" - -#define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties" -#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties" - -#define CAP_SERVICE_CHARACTERS "CharacterProperties" - -#define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavMeshStatusUpdate" -#define SIM_MESSAGE_AGENT_STATE_UPDATE "/message/AgentPreferencesUpdate" -#define SIM_MESSAGE_BODY_FIELD "body" - -//--------------------------------------------------------------------------- -// LLNavMeshSimStateChangeNode -//--------------------------------------------------------------------------- - -class LLNavMeshSimStateChangeNode : public LLHTTPNode -{ -public: - virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const; -}; - -LLHTTPRegistration gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE); - -//--------------------------------------------------------------------------- -// LLAgentStateChangeNode -//--------------------------------------------------------------------------- - -class LLAgentStateChangeNode : public LLHTTPNode -{ -public: - virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const; -}; - -LLHTTPRegistration gHTTPRegistrationAgentStateChangeNode(SIM_MESSAGE_AGENT_STATE_UPDATE); - -//--------------------------------------------------------------------------- -// NavMeshStatusResponder -//--------------------------------------------------------------------------- - -class NavMeshStatusResponder : public LLHTTPClient::Responder -{ -public: - NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion); - virtual ~NavMeshStatusResponder(); - - virtual void result(const LLSD &pContent); - virtual void error(U32 pStatus, const std::string& pReason); - -protected: - -private: - std::string mCapabilityURL; - LLViewerRegion *mRegion; - LLUUID mRegionUUID; -}; - -//--------------------------------------------------------------------------- -// NavMeshResponder -//--------------------------------------------------------------------------- - -class NavMeshResponder : public LLHTTPClient::Responder -{ -public: - NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr); - virtual ~NavMeshResponder(); - - virtual void result(const LLSD &pContent); - virtual void error(U32 pStatus, const std::string& pReason); - -protected: - -private: - std::string mCapabilityURL; - U32 mNavMeshVersion; - LLPathfindingNavMeshPtr mNavMeshPtr; -}; - -//--------------------------------------------------------------------------- -// AgentStateResponder -//--------------------------------------------------------------------------- - -class AgentStateResponder : public LLHTTPClient::Responder -{ -public: - AgentStateResponder(const std::string &pCapabilityURL, LLPathfindingManager::EAgentState pRequestedAgentState = LLPathfindingManager::kAgentStateUnknown); - virtual ~AgentStateResponder(); - - virtual void result(const LLSD &pContent); - virtual void error(U32 pStatus, const std::string& pReason); - -protected: - -private: - std::string mCapabilityURL; - LLPathfindingManager::EAgentState mRequestedAgentState; -}; - -//--------------------------------------------------------------------------- -// LinksetsResponder -//--------------------------------------------------------------------------- - -class LinksetsResponder -{ -public: - LinksetsResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::linksets_callback_t pLinksetsCallback, bool pIsObjectRequested, bool pIsTerrainRequested); - virtual ~LinksetsResponder(); - - void handleObjectLinksetsResult(const LLSD &pContent); - void handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL); - void handleTerrainLinksetsResult(const LLSD &pContent); - void handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL); - -protected: - -private: - void sendCallback(); - - typedef enum - { - kNotRequested, - kWaiting, - kReceivedGood, - kReceivedError - } EMessagingState; - - LLPathfindingManager::request_id_t mRequestId; - LLPathfindingManager::linksets_callback_t mLinksetsCallback; - - EMessagingState mObjectMessagingState; - EMessagingState mTerrainMessagingState; - - LLPathfindingLinksetListPtr mObjectLinksetListPtr; - LLPathfindingLinksetPtr mTerrainLinksetPtr; -}; - -typedef boost::shared_ptr LinksetsResponderPtr; - -//--------------------------------------------------------------------------- -// ObjectLinksetsResponder -//--------------------------------------------------------------------------- - -class ObjectLinksetsResponder : public LLHTTPClient::Responder -{ -public: - ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr); - virtual ~ObjectLinksetsResponder(); - - virtual void result(const LLSD &pContent); - virtual void error(U32 pStatus, const std::string &pReason); - -protected: - -private: - std::string mCapabilityURL; - LinksetsResponderPtr mLinksetsResponsderPtr; -}; - -//--------------------------------------------------------------------------- -// TerrainLinksetsResponder -//--------------------------------------------------------------------------- - -class TerrainLinksetsResponder : public LLHTTPClient::Responder -{ -public: - TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr); - virtual ~TerrainLinksetsResponder(); - - virtual void result(const LLSD &pContent); - virtual void error(U32 pStatus, const std::string &pReason); - -protected: - -private: - std::string mCapabilityURL; - LinksetsResponderPtr mLinksetsResponsderPtr; -}; - -//--------------------------------------------------------------------------- -// CharactersResponder -//--------------------------------------------------------------------------- - -class CharactersResponder : public LLHTTPClient::Responder -{ -public: - CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::characters_callback_t pCharactersCallback); - virtual ~CharactersResponder(); - - virtual void result(const LLSD &pContent); - virtual void error(U32 pStatus, const std::string &pReason); - -protected: - -private: - std::string mCapabilityURL; - LLPathfindingManager::request_id_t mRequestId; - LLPathfindingManager::characters_callback_t mCharactersCallback; -}; - -//--------------------------------------------------------------------------- -// LLPathfindingManager -//--------------------------------------------------------------------------- - -LLPathfindingManager::LLPathfindingManager() - : LLSingleton(), - mNavMeshMap(), - mAgentStateSignal(), - mAgentState(kAgentStateUnknown), - mLastKnownNonErrorAgentState(kAgentStateUnknown) -{ -} - -LLPathfindingManager::~LLPathfindingManager() -{ -} - -bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const -{ - return isPathfindingEnabledForRegion(getCurrentRegion()); -} - -bool LLPathfindingManager::isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const -{ - std::string retrieveNavMeshURL = getRetrieveNavMeshURLForRegion(pRegion); - return !retrieveNavMeshURL.empty(); -} - -#ifdef DEPRECATED_UNVERSIONED_NAVMESH -bool LLPathfindingManager::isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX() const -{ - std::string navMeshStatusURL = getNavMeshStatusURLForRegion(getCurrentRegion()); - return !navMeshStatusURL.empty(); -} -#endif // DEPRECATED_UNVERSIONED_NAVMESH - -bool LLPathfindingManager::isAllowAlterPermanent() -{ - return (!isPathfindingEnabledForCurrentRegion() || (getAgentState() == kAgentStateUnfrozen)); -} - -bool LLPathfindingManager::isAllowViewTerrainProperties() const -{ - LLViewerRegion* region = getCurrentRegion(); - return (gAgent.isGodlike() || ((region != NULL) && region->canManageEstate())); -} - -LLPathfindingNavMesh::navmesh_slot_t LLPathfindingManager::registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback) -{ - LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); - return navMeshPtr->registerNavMeshListener(pNavMeshCallback); -} - -void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) -{ - LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); - - if ((pRegion == NULL) || !isPathfindingEnabledForRegion(pRegion)) - { - navMeshPtr->handleNavMeshNotEnabled(); - } - else - { - std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion); -#ifdef DEPRECATED_UNVERSIONED_NAVMESH - if (navMeshStatusURL.empty()) - { - LLPathfindingNavMeshStatus navMeshStatus = navMeshPtr->getNavMeshStatusXXX(); - navMeshStatus.incrementNavMeshVersionXXX(); - sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, navMeshStatus); - } - else - { - navMeshPtr->handleNavMeshCheckVersion(); - LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); - LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); - } -#else // DEPRECATED_UNVERSIONED_NAVMESH - llassert(!navMeshStatusURL.empty()); - navMeshPtr->handleNavMeshCheckVersion(); - LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); - LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); -#endif // DEPRECATED_UNVERSIONED_NAVMESH - } -} - -LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) -{ - return mAgentStateSignal.connect(pAgentStateCallback); -} - -LLPathfindingManager::EAgentState LLPathfindingManager::getAgentState() -{ - if (!isPathfindingEnabledForCurrentRegion()) - { - setAgentState(kAgentStateNotEnabled); - } - else - { - if (!isValidAgentState(mAgentState)) - { - requestGetAgentState(); - } - } - - return mAgentState; -} - -LLPathfindingManager::EAgentState LLPathfindingManager::getLastKnownNonErrorAgentState() const -{ - return mLastKnownNonErrorAgentState; -} - -void LLPathfindingManager::requestSetAgentState(EAgentState pRequestedAgentState) -{ - llassert(isValidAgentState(pRequestedAgentState)); - std::string agentStateURL = getAgentStateURLForCurrentRegion(); - - if (agentStateURL.empty()) - { - setAgentState(kAgentStateNotEnabled); - } - else - { - LLSD request; - request[ALTER_NAVMESH_OBJECTS_FIELD] = static_cast(pRequestedAgentState == kAgentStateUnfrozen); -#ifdef DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD - request[DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD] = static_cast(pRequestedAgentState == kAgentStateUnfrozen); -#endif // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD - - LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL, pRequestedAgentState); - LLHTTPClient::post(agentStateURL, request, responder); - } -} - -LLPathfindingManager::ERequestStatus LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, linksets_callback_t pLinksetsCallback) const -{ - ERequestStatus status; - - std::string objectLinksetsURL = getObjectLinksetsURLForCurrentRegion(); - std::string terrainLinksetsURL = getTerrainLinksetsURLForCurrentRegion(); - if (objectLinksetsURL.empty() || terrainLinksetsURL.empty()) - { - status = kRequestNotEnabled; - } - else - { - bool doRequestTerrain = isAllowViewTerrainProperties(); - LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, true, doRequestTerrain)); - - LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr); - LLHTTPClient::get(objectLinksetsURL, objectLinksetsResponder); - - if (doRequestTerrain) - { - LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); - LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder); - } - - status = kRequestStarted; - } - - return status; -} - -LLPathfindingManager::ERequestStatus LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, LLPathfindingLinksetListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, linksets_callback_t pLinksetsCallback) const -{ - ERequestStatus status = kRequestNotEnabled; - - std::string objectLinksetsURL = getObjectLinksetsURLForCurrentRegion(); - std::string terrainLinksetsURL = getTerrainLinksetsURLForCurrentRegion(); - if (objectLinksetsURL.empty() || terrainLinksetsURL.empty()) - { - status = kRequestNotEnabled; - } - else - { - LLSD objectPostData = pLinksetList->encodeObjectFields(pLinksetUse, pA, pB, pC, pD); - LLSD terrainPostData; - if (isAllowViewTerrainProperties()) - { - terrainPostData = pLinksetList->encodeTerrainFields(pLinksetUse, pA, pB, pC, pD); - } - - if (objectPostData.isUndefined() && terrainPostData.isUndefined()) - { - status = kRequestCompleted; - } - else - { - LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, !objectPostData.isUndefined(), !terrainPostData.isUndefined())); - - if (!objectPostData.isUndefined()) - { - LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr); - LLHTTPClient::put(objectLinksetsURL, objectPostData, objectLinksetsResponder); - } - - if (!terrainPostData.isUndefined()) - { - LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); - LLHTTPClient::put(terrainLinksetsURL, terrainPostData, terrainLinksetsResponder); - } - - status = kRequestStarted; - } - } - - return status; -} - -LLPathfindingManager::ERequestStatus LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, characters_callback_t pCharactersCallback) const -{ - ERequestStatus status; - - std::string charactersURL = getCharactersURLForCurrentRegion(); - if (charactersURL.empty()) - { - status = kRequestNotEnabled; - } - else - { - LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback); - LLHTTPClient::get(charactersURL, charactersResponder); - - status = kRequestStarted; - } - - return status; -} - -void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus) -{ - if ((pRegion == NULL) || !pRegion->isAlive()) - { - navMeshPtr->handleNavMeshNotEnabled(); - } - else - { - std::string navMeshURL = getRetrieveNavMeshURLForRegion(pRegion); - - if (navMeshURL.empty()) - { - navMeshPtr->handleNavMeshNotEnabled(); - } - else - { - navMeshPtr->handleNavMeshStart(pNavMeshStatus); - LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshStatus.getVersion(), navMeshPtr); - - LLSD postData; - LLHTTPClient::post(navMeshURL, postData, responder); - } - } -} - -void LLPathfindingManager::handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion) -{ - LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pNavMeshStatus.getRegionUUID()); - - if (!pNavMeshStatus.isValid()) - { - navMeshPtr->handleNavMeshError(); - } - else - { - if (navMeshPtr->hasNavMeshVersion(pNavMeshStatus)) - { - navMeshPtr->handleRefresh(pNavMeshStatus); - } - else - { - sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, pNavMeshStatus); - } - } -} - -void LLPathfindingManager::handleNavMeshStatusUpdate(const LLPathfindingNavMeshStatus &pNavMeshStatus) -{ - LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pNavMeshStatus.getRegionUUID()); - - if (!pNavMeshStatus.isValid()) - { - navMeshPtr->handleNavMeshError(); - } - else - { - navMeshPtr->handleNavMeshNewVersion(pNavMeshStatus); - } -} - -LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(const LLUUID &pRegionUUID) -{ - LLPathfindingNavMeshPtr navMeshPtr; - NavMeshMap::iterator navMeshIter = mNavMeshMap.find(pRegionUUID); - if (navMeshIter == mNavMeshMap.end()) - { - navMeshPtr = LLPathfindingNavMeshPtr(new LLPathfindingNavMesh(pRegionUUID)); - mNavMeshMap.insert(std::pair(pRegionUUID, navMeshPtr)); - } - else - { - navMeshPtr = navMeshIter->second; - } - - return navMeshPtr; -} - -LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion *pRegion) -{ - LLUUID regionUUID; - if (pRegion != NULL) - { - regionUUID = pRegion->getRegionID(); - } - - return getNavMeshForRegion(regionUUID); -} - -bool LLPathfindingManager::isValidAgentState(EAgentState pAgentState) -{ - return ((pAgentState == kAgentStateFrozen) || (pAgentState == kAgentStateUnfrozen)); -} - -void LLPathfindingManager::requestGetAgentState() -{ - std::string agentStateURL = getAgentStateURLForCurrentRegion(); - - if (agentStateURL.empty()) - { - setAgentState(kAgentStateNotEnabled); - } - else - { - LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL); - LLHTTPClient::get(agentStateURL, responder); - } -} - -void LLPathfindingManager::setAgentState(EAgentState pAgentState) -{ - mAgentState = pAgentState; - - if (mAgentState != kAgentStateError) - { - mLastKnownNonErrorAgentState = mAgentState; - } - - mAgentStateSignal(mAgentState); -} - -void LLPathfindingManager::handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState) -{ -#ifndef DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD - llassert(pContent.has(ALTER_NAVMESH_OBJECTS_FIELD)); - llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); - EAgentState agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); -#else // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD - EAgentState agentState = kAgentStateUnknown; - if (pContent.has(ALTER_NAVMESH_OBJECTS_FIELD)) - { - llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); - agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); - } - else - { - llassert(pContent.has(DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD)); - llassert(pContent.get(DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); - agentState = (pContent.get(DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); - } -#endif // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD - - if (isValidAgentState(pRequestedAgentState) && (agentState != pRequestedAgentState)) - { - agentState = kAgentStateError; - llassert(0); - } - - setAgentState(agentState); -} - -void LLPathfindingManager::handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL) -{ - llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; - setAgentState(kAgentStateError); -} - -void LLPathfindingManager::handleAgentStateUpdate(const LLSD &pContent) -{ - llassert(pContent.has(ALTER_NAVMESH_OBJECTS_FIELD)); - llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); - EAgentState agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); - - setAgentState(agentState); -} - -std::string LLPathfindingManager::getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const -{ - return getCapabilityURLForRegion(pRegion, CAP_SERVICE_NAVMESH_STATUS); -} - -std::string LLPathfindingManager::getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const -{ - return getCapabilityURLForRegion(pRegion, CAP_SERVICE_RETRIEVE_NAVMESH); -} - -std::string LLPathfindingManager::getAgentStateURLForCurrentRegion() const -{ - return getCapabilityURLForCurrentRegion(CAP_SERVICE_AGENT_STATE); -} - -std::string LLPathfindingManager::getObjectLinksetsURLForCurrentRegion() const -{ - return getCapabilityURLForCurrentRegion(CAP_SERVICE_OBJECT_LINKSETS); -} - -std::string LLPathfindingManager::getTerrainLinksetsURLForCurrentRegion() const -{ - return getCapabilityURLForCurrentRegion(CAP_SERVICE_TERRAIN_LINKSETS); -} - -std::string LLPathfindingManager::getCharactersURLForCurrentRegion() const -{ - return getCapabilityURLForCurrentRegion(CAP_SERVICE_CHARACTERS); -} - -std::string LLPathfindingManager::getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const -{ - return getCapabilityURLForRegion(getCurrentRegion(), pCapabilityName); -} - -std::string LLPathfindingManager::getCapabilityURLForRegion(LLViewerRegion *pRegion, const std::string &pCapabilityName) const -{ - std::string capabilityURL(""); - - if (pRegion != NULL) - { - capabilityURL = pRegion->getCapability(pCapabilityName); - } - - if (capabilityURL.empty()) - { - llwarns << "cannot find capability '" << pCapabilityName << "' for current region '" - << ((pRegion != NULL) ? pRegion->getName() : "") << "'" << llendl; - } - - return capabilityURL; -} - -LLViewerRegion *LLPathfindingManager::getCurrentRegion() const -{ - return gAgent.getRegion(); -} - -//--------------------------------------------------------------------------- -// LLNavMeshSimStateChangeNode -//--------------------------------------------------------------------------- - -void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const -{ -#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE - llinfos << "STINSON DEBUG: Received NavMeshStatusUpdate: " << pInput << llendl; -#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE - llassert(pInput.has(SIM_MESSAGE_BODY_FIELD)); - llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap()); - LLPathfindingNavMeshStatus navMeshStatus(pInput.get(SIM_MESSAGE_BODY_FIELD)); - LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(navMeshStatus); -} - -//--------------------------------------------------------------------------- -// LLAgentStateChangeNode -//--------------------------------------------------------------------------- - -void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const -{ -#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE - llinfos << "STINSON DEBUG: Received AgentPreferencesUpdate: " << pInput << llendl; -#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE - llassert(pInput.has(SIM_MESSAGE_BODY_FIELD)); - llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap()); - LLPathfindingManager::getInstance()->handleAgentStateUpdate(pInput.get(SIM_MESSAGE_BODY_FIELD)); -} - -//--------------------------------------------------------------------------- -// NavMeshStatusResponder -//--------------------------------------------------------------------------- - -NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion) - : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), - mRegion(pRegion), - mRegionUUID() -{ - if (mRegion != NULL) - { - mRegionUUID = mRegion->getRegionID(); - } -} - -NavMeshStatusResponder::~NavMeshStatusResponder() -{ -} - -void NavMeshStatusResponder::result(const LLSD &pContent) -{ -#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE - llinfos << "STINSON DEBUG: Received requested NavMeshStatus: " << pContent << llendl; -#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE - LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, pContent); - LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion); -} - -void NavMeshStatusResponder::error(U32 pStatus, const std::string& pReason) -{ - llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; - LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID); - LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion); -} - -//--------------------------------------------------------------------------- -// NavMeshResponder -//--------------------------------------------------------------------------- - -NavMeshResponder::NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr) - : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), - mNavMeshVersion(pNavMeshVersion), - mNavMeshPtr(pNavMeshPtr) -{ -} - -NavMeshResponder::~NavMeshResponder() -{ -} - -void NavMeshResponder::result(const LLSD &pContent) -{ - mNavMeshPtr->handleNavMeshResult(pContent, mNavMeshVersion); -} - -void NavMeshResponder::error(U32 pStatus, const std::string& pReason) -{ - mNavMeshPtr->handleNavMeshError(pStatus, pReason, mCapabilityURL, mNavMeshVersion); -} - -//--------------------------------------------------------------------------- -// AgentStateResponder -//--------------------------------------------------------------------------- - -AgentStateResponder::AgentStateResponder(const std::string &pCapabilityURL, LLPathfindingManager::EAgentState pRequestedAgentState) - : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), - mRequestedAgentState(pRequestedAgentState) -{ -} - -AgentStateResponder::~AgentStateResponder() -{ -} - -void AgentStateResponder::result(const LLSD &pContent) -{ - LLPathfindingManager::getInstance()->handleAgentStateResult(pContent, mRequestedAgentState); -} - -void AgentStateResponder::error(U32 pStatus, const std::string &pReason) -{ - LLPathfindingManager::getInstance()->handleAgentStateError(pStatus, pReason, mCapabilityURL); -} - -//--------------------------------------------------------------------------- -// LinksetsResponder -//--------------------------------------------------------------------------- - -LinksetsResponder::LinksetsResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::linksets_callback_t pLinksetsCallback, bool pIsObjectRequested, bool pIsTerrainRequested) - : mRequestId(pRequestId), - mLinksetsCallback(pLinksetsCallback), - mObjectMessagingState(pIsObjectRequested ? kWaiting : kNotRequested), - mTerrainMessagingState(pIsTerrainRequested ? kWaiting : kNotRequested), - mObjectLinksetListPtr(), - mTerrainLinksetPtr() -{ -} - -LinksetsResponder::~LinksetsResponder() -{ -} - -void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent) -{ - mObjectLinksetListPtr = LLPathfindingLinksetListPtr(new LLPathfindingLinksetList(pContent)); - - mObjectMessagingState = kReceivedGood; - if (mTerrainMessagingState != kWaiting) - { - sendCallback(); - } -} - -void LinksetsResponder::handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL) -{ - llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; - mObjectMessagingState = kReceivedError; - if (mTerrainMessagingState != kWaiting) - { - sendCallback(); - } -} - -void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent) -{ - mTerrainLinksetPtr = LLPathfindingLinksetPtr(new LLPathfindingLinkset(pContent)); - - mTerrainMessagingState = kReceivedGood; - if (mObjectMessagingState != kWaiting) - { - sendCallback(); - } -} - -void LinksetsResponder::handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL) -{ - mTerrainMessagingState = kReceivedError; - if (mObjectMessagingState != kWaiting) - { - sendCallback(); - } -} - -void LinksetsResponder::sendCallback() -{ - llassert(mObjectMessagingState != kWaiting); - llassert(mTerrainMessagingState != kWaiting); - LLPathfindingManager::ERequestStatus requestStatus = - ((((mObjectMessagingState == kReceivedGood) || (mObjectMessagingState == kNotRequested)) && - ((mTerrainMessagingState == kReceivedGood) || (mTerrainMessagingState == kNotRequested))) ? - LLPathfindingManager::kRequestCompleted : LLPathfindingManager::kRequestError); - - if (mObjectMessagingState != kReceivedGood) - { - mObjectLinksetListPtr = LLPathfindingLinksetListPtr(new LLPathfindingLinksetList()); - } - - if (mTerrainMessagingState == kReceivedGood) - { - mObjectLinksetListPtr->insert(std::pair(mTerrainLinksetPtr->getUUID().asString(), mTerrainLinksetPtr)); - } - - mLinksetsCallback(mRequestId, requestStatus, mObjectLinksetListPtr); -} - -//--------------------------------------------------------------------------- -// ObjectLinksetsResponder -//--------------------------------------------------------------------------- - -ObjectLinksetsResponder::ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) - : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), - mLinksetsResponsderPtr(pLinksetsResponsderPtr) -{ -} - -ObjectLinksetsResponder::~ObjectLinksetsResponder() -{ -} - -void ObjectLinksetsResponder::result(const LLSD &pContent) -{ - mLinksetsResponsderPtr->handleObjectLinksetsResult(pContent); -} - -void ObjectLinksetsResponder::error(U32 pStatus, const std::string &pReason) -{ - mLinksetsResponsderPtr->handleObjectLinksetsError(pStatus, pReason, mCapabilityURL); -} - -//--------------------------------------------------------------------------- -// TerrainLinksetsResponder -//--------------------------------------------------------------------------- - -TerrainLinksetsResponder::TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) - : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), - mLinksetsResponsderPtr(pLinksetsResponsderPtr) -{ -} - -TerrainLinksetsResponder::~TerrainLinksetsResponder() -{ -} - -void TerrainLinksetsResponder::result(const LLSD &pContent) -{ - mLinksetsResponsderPtr->handleTerrainLinksetsResult(pContent); -} - -void TerrainLinksetsResponder::error(U32 pStatus, const std::string &pReason) -{ - mLinksetsResponsderPtr->handleTerrainLinksetsError(pStatus, pReason, mCapabilityURL); -} - -//--------------------------------------------------------------------------- -// CharactersResponder -//--------------------------------------------------------------------------- - -CharactersResponder::CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::characters_callback_t pCharactersCallback) - : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL), - mRequestId(pRequestId), - mCharactersCallback(pCharactersCallback) -{ -} - -CharactersResponder::~CharactersResponder() -{ -} - -void CharactersResponder::result(const LLSD &pContent) -{ - LLPathfindingCharacterListPtr characterListPtr = LLPathfindingCharacterListPtr(new LLPathfindingCharacterList(pContent)); - mCharactersCallback(mRequestId, LLPathfindingManager::kRequestCompleted, characterListPtr); -} - -void CharactersResponder::error(U32 pStatus, const std::string &pReason) -{ - llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; - - LLPathfindingCharacterListPtr characterListPtr; - mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr); -} +/** + * @file llpathfindingmanager.cpp + * @author William Todd Stinson + * @brief A state manager for the various pathfinding states. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include +#include + +#include "llviewerprecompiledheaders.h" +#include "llsd.h" +#include "lluuid.h" +#include "llpathfindingmanager.h" +#include "llsingleton.h" +#include "llhttpclient.h" +#include "llagent.h" +#include "llviewerregion.h" +#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" +#include "llpathfindinglinkset.h" +#include "llpathfindinglinksetlist.h" +#include "llpathfindingcharacterlist.h" +#include "llhttpnode.h" + +#include +#include + +#define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" + +#define CAP_SERVICE_NAVMESH_STATUS "NavMeshGenerationStatus" + +#define CAP_SERVICE_AGENT_STATE "AgentPreferences" +#define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects" +#define DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD "alter_permanent_objects" + +#define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties" +#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties" + +#define CAP_SERVICE_CHARACTERS "CharacterProperties" + +#define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavMeshStatusUpdate" +#define SIM_MESSAGE_AGENT_STATE_UPDATE "/message/AgentPreferencesUpdate" +#define SIM_MESSAGE_BODY_FIELD "body" + +//--------------------------------------------------------------------------- +// LLNavMeshSimStateChangeNode +//--------------------------------------------------------------------------- + +class LLNavMeshSimStateChangeNode : public LLHTTPNode +{ +public: + virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const; +}; + +LLHTTPRegistration gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE); + +//--------------------------------------------------------------------------- +// LLAgentStateChangeNode +//--------------------------------------------------------------------------- + +class LLAgentStateChangeNode : public LLHTTPNode +{ +public: + virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const; +}; + +LLHTTPRegistration gHTTPRegistrationAgentStateChangeNode(SIM_MESSAGE_AGENT_STATE_UPDATE); + +//--------------------------------------------------------------------------- +// NavMeshStatusResponder +//--------------------------------------------------------------------------- + +class NavMeshStatusResponder : public LLHTTPClient::Responder +{ +public: + NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion); + virtual ~NavMeshStatusResponder(); + + virtual void result(const LLSD &pContent); + virtual void error(U32 pStatus, const std::string& pReason); + +protected: + +private: + std::string mCapabilityURL; + LLViewerRegion *mRegion; + LLUUID mRegionUUID; +}; + +//--------------------------------------------------------------------------- +// NavMeshResponder +//--------------------------------------------------------------------------- + +class NavMeshResponder : public LLHTTPClient::Responder +{ +public: + NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr); + virtual ~NavMeshResponder(); + + virtual void result(const LLSD &pContent); + virtual void error(U32 pStatus, const std::string& pReason); + +protected: + +private: + std::string mCapabilityURL; + U32 mNavMeshVersion; + LLPathfindingNavMeshPtr mNavMeshPtr; +}; + +//--------------------------------------------------------------------------- +// AgentStateResponder +//--------------------------------------------------------------------------- + +class AgentStateResponder : public LLHTTPClient::Responder +{ +public: + AgentStateResponder(const std::string &pCapabilityURL, LLPathfindingManager::EAgentState pRequestedAgentState = LLPathfindingManager::kAgentStateUnknown); + virtual ~AgentStateResponder(); + + virtual void result(const LLSD &pContent); + virtual void error(U32 pStatus, const std::string& pReason); + +protected: + +private: + std::string mCapabilityURL; + LLPathfindingManager::EAgentState mRequestedAgentState; +}; + +//--------------------------------------------------------------------------- +// LinksetsResponder +//--------------------------------------------------------------------------- + +class LinksetsResponder +{ +public: + LinksetsResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::linksets_callback_t pLinksetsCallback, bool pIsObjectRequested, bool pIsTerrainRequested); + virtual ~LinksetsResponder(); + + void handleObjectLinksetsResult(const LLSD &pContent); + void handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL); + void handleTerrainLinksetsResult(const LLSD &pContent); + void handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL); + +protected: + +private: + void sendCallback(); + + typedef enum + { + kNotRequested, + kWaiting, + kReceivedGood, + kReceivedError + } EMessagingState; + + LLPathfindingManager::request_id_t mRequestId; + LLPathfindingManager::linksets_callback_t mLinksetsCallback; + + EMessagingState mObjectMessagingState; + EMessagingState mTerrainMessagingState; + + LLPathfindingLinksetListPtr mObjectLinksetListPtr; + LLPathfindingLinksetPtr mTerrainLinksetPtr; +}; + +typedef boost::shared_ptr LinksetsResponderPtr; + +//--------------------------------------------------------------------------- +// ObjectLinksetsResponder +//--------------------------------------------------------------------------- + +class ObjectLinksetsResponder : public LLHTTPClient::Responder +{ +public: + ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr); + virtual ~ObjectLinksetsResponder(); + + virtual void result(const LLSD &pContent); + virtual void error(U32 pStatus, const std::string &pReason); + +protected: + +private: + std::string mCapabilityURL; + LinksetsResponderPtr mLinksetsResponsderPtr; +}; + +//--------------------------------------------------------------------------- +// TerrainLinksetsResponder +//--------------------------------------------------------------------------- + +class TerrainLinksetsResponder : public LLHTTPClient::Responder +{ +public: + TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr); + virtual ~TerrainLinksetsResponder(); + + virtual void result(const LLSD &pContent); + virtual void error(U32 pStatus, const std::string &pReason); + +protected: + +private: + std::string mCapabilityURL; + LinksetsResponderPtr mLinksetsResponsderPtr; +}; + +//--------------------------------------------------------------------------- +// CharactersResponder +//--------------------------------------------------------------------------- + +class CharactersResponder : public LLHTTPClient::Responder +{ +public: + CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::characters_callback_t pCharactersCallback); + virtual ~CharactersResponder(); + + virtual void result(const LLSD &pContent); + virtual void error(U32 pStatus, const std::string &pReason); + +protected: + +private: + std::string mCapabilityURL; + LLPathfindingManager::request_id_t mRequestId; + LLPathfindingManager::characters_callback_t mCharactersCallback; +}; + +//--------------------------------------------------------------------------- +// LLPathfindingManager +//--------------------------------------------------------------------------- + +LLPathfindingManager::LLPathfindingManager() + : LLSingleton(), + mNavMeshMap(), + mAgentStateSignal(), + mAgentState(kAgentStateUnknown), + mLastKnownNonErrorAgentState(kAgentStateUnknown) +{ +} + +LLPathfindingManager::~LLPathfindingManager() +{ +} + +bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const +{ + return isPathfindingEnabledForRegion(getCurrentRegion()); +} + +bool LLPathfindingManager::isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const +{ + std::string retrieveNavMeshURL = getRetrieveNavMeshURLForRegion(pRegion); + return !retrieveNavMeshURL.empty(); +} + +#ifdef DEPRECATED_UNVERSIONED_NAVMESH +bool LLPathfindingManager::isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX() const +{ + std::string navMeshStatusURL = getNavMeshStatusURLForRegion(getCurrentRegion()); + return !navMeshStatusURL.empty(); +} +#endif // DEPRECATED_UNVERSIONED_NAVMESH + +bool LLPathfindingManager::isAllowAlterPermanent() +{ + return (!isPathfindingEnabledForCurrentRegion() || (getAgentState() == kAgentStateUnfrozen)); +} + +bool LLPathfindingManager::isAllowViewTerrainProperties() const +{ + LLViewerRegion* region = getCurrentRegion(); + return (gAgent.isGodlike() || ((region != NULL) && region->canManageEstate())); +} + +LLPathfindingNavMesh::navmesh_slot_t LLPathfindingManager::registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback) +{ + LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); + return navMeshPtr->registerNavMeshListener(pNavMeshCallback); +} + +void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) +{ + LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); + + if (pRegion == NULL) + { + navMeshPtr->handleNavMeshNotEnabled(); + } + else if (!pRegion->capabilitiesReceived()) + { + navMeshPtr->handleNavMeshWaitForRegionLoad(); + pRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetNavMeshForRegion, this, _1)); + } + else if (!isPathfindingEnabledForRegion(pRegion)) + { + navMeshPtr->handleNavMeshNotEnabled(); + } + else + { + std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion); +#ifdef DEPRECATED_UNVERSIONED_NAVMESH + if (navMeshStatusURL.empty()) + { + LLPathfindingNavMeshStatus navMeshStatus = navMeshPtr->getNavMeshStatusXXX(); + navMeshStatus.incrementNavMeshVersionXXX(); + sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, navMeshStatus); + } + else + { + navMeshPtr->handleNavMeshCheckVersion(); + LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); + LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); + } +#else // DEPRECATED_UNVERSIONED_NAVMESH + llassert(!navMeshStatusURL.empty()); + navMeshPtr->handleNavMeshCheckVersion(); + LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion); + LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder); +#endif // DEPRECATED_UNVERSIONED_NAVMESH + } +} + +LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) +{ + return mAgentStateSignal.connect(pAgentStateCallback); +} + +LLPathfindingManager::EAgentState LLPathfindingManager::getAgentState() +{ + if (!isPathfindingEnabledForCurrentRegion()) + { + setAgentState(kAgentStateNotEnabled); + } + else + { + if (!isValidAgentState(mAgentState)) + { + requestGetAgentState(); + } + } + + return mAgentState; +} + +LLPathfindingManager::EAgentState LLPathfindingManager::getLastKnownNonErrorAgentState() const +{ + return mLastKnownNonErrorAgentState; +} + +void LLPathfindingManager::requestSetAgentState(EAgentState pRequestedAgentState) +{ + llassert(isValidAgentState(pRequestedAgentState)); + std::string agentStateURL = getAgentStateURLForCurrentRegion(); + + if (agentStateURL.empty()) + { + setAgentState(kAgentStateNotEnabled); + } + else + { + LLSD request; + request[ALTER_NAVMESH_OBJECTS_FIELD] = static_cast(pRequestedAgentState == kAgentStateUnfrozen); +#ifdef DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD + request[DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD] = static_cast(pRequestedAgentState == kAgentStateUnfrozen); +#endif // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD + + LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL, pRequestedAgentState); + LLHTTPClient::post(agentStateURL, request, responder); + } +} + +LLPathfindingManager::ERequestStatus LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, linksets_callback_t pLinksetsCallback) const +{ + ERequestStatus status; + + std::string objectLinksetsURL = getObjectLinksetsURLForCurrentRegion(); + std::string terrainLinksetsURL = getTerrainLinksetsURLForCurrentRegion(); + if (objectLinksetsURL.empty() || terrainLinksetsURL.empty()) + { + status = kRequestNotEnabled; + } + else + { + bool doRequestTerrain = isAllowViewTerrainProperties(); + LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, true, doRequestTerrain)); + + LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr); + LLHTTPClient::get(objectLinksetsURL, objectLinksetsResponder); + + if (doRequestTerrain) + { + LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); + LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder); + } + + status = kRequestStarted; + } + + return status; +} + +LLPathfindingManager::ERequestStatus LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, LLPathfindingLinksetListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, linksets_callback_t pLinksetsCallback) const +{ + ERequestStatus status = kRequestNotEnabled; + + std::string objectLinksetsURL = getObjectLinksetsURLForCurrentRegion(); + std::string terrainLinksetsURL = getTerrainLinksetsURLForCurrentRegion(); + if (objectLinksetsURL.empty() || terrainLinksetsURL.empty()) + { + status = kRequestNotEnabled; + } + else + { + LLSD objectPostData = pLinksetList->encodeObjectFields(pLinksetUse, pA, pB, pC, pD); + LLSD terrainPostData; + if (isAllowViewTerrainProperties()) + { + terrainPostData = pLinksetList->encodeTerrainFields(pLinksetUse, pA, pB, pC, pD); + } + + if (objectPostData.isUndefined() && terrainPostData.isUndefined()) + { + status = kRequestCompleted; + } + else + { + LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, !objectPostData.isUndefined(), !terrainPostData.isUndefined())); + + if (!objectPostData.isUndefined()) + { + LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr); + LLHTTPClient::put(objectLinksetsURL, objectPostData, objectLinksetsResponder); + } + + if (!terrainPostData.isUndefined()) + { + LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr); + LLHTTPClient::put(terrainLinksetsURL, terrainPostData, terrainLinksetsResponder); + } + + status = kRequestStarted; + } + } + + return status; +} + +LLPathfindingManager::ERequestStatus LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, characters_callback_t pCharactersCallback) const +{ + ERequestStatus status; + + std::string charactersURL = getCharactersURLForCurrentRegion(); + if (charactersURL.empty()) + { + status = kRequestNotEnabled; + } + else + { + LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback); + LLHTTPClient::get(charactersURL, charactersResponder); + + status = kRequestStarted; + } + + return status; +} + +void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus) +{ + if ((pRegion == NULL) || !pRegion->isAlive()) + { + navMeshPtr->handleNavMeshNotEnabled(); + } + else + { + std::string navMeshURL = getRetrieveNavMeshURLForRegion(pRegion); + + if (navMeshURL.empty()) + { + navMeshPtr->handleNavMeshNotEnabled(); + } + else + { + navMeshPtr->handleNavMeshStart(pNavMeshStatus); + LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshStatus.getVersion(), navMeshPtr); + + LLSD postData; + LLHTTPClient::post(navMeshURL, postData, responder); + } + } +} + +void LLPathfindingManager::handleDeferredGetNavMeshForRegion(const LLUUID &pRegionUUID) +{ + LLViewerRegion *currentRegion = getCurrentRegion(); + + if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID)) + { + requestGetNavMeshForRegion(currentRegion); + } +} + +void LLPathfindingManager::handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion) +{ + LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pNavMeshStatus.getRegionUUID()); + + if (!pNavMeshStatus.isValid()) + { + navMeshPtr->handleNavMeshError(); + } + else + { + if (navMeshPtr->hasNavMeshVersion(pNavMeshStatus)) + { + navMeshPtr->handleRefresh(pNavMeshStatus); + } + else + { + sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, pNavMeshStatus); + } + } +} + +void LLPathfindingManager::handleNavMeshStatusUpdate(const LLPathfindingNavMeshStatus &pNavMeshStatus) +{ + LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pNavMeshStatus.getRegionUUID()); + + if (!pNavMeshStatus.isValid()) + { + navMeshPtr->handleNavMeshError(); + } + else + { + navMeshPtr->handleNavMeshNewVersion(pNavMeshStatus); + } +} + +LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(const LLUUID &pRegionUUID) +{ + LLPathfindingNavMeshPtr navMeshPtr; + NavMeshMap::iterator navMeshIter = mNavMeshMap.find(pRegionUUID); + if (navMeshIter == mNavMeshMap.end()) + { + navMeshPtr = LLPathfindingNavMeshPtr(new LLPathfindingNavMesh(pRegionUUID)); + mNavMeshMap.insert(std::pair(pRegionUUID, navMeshPtr)); + } + else + { + navMeshPtr = navMeshIter->second; + } + + return navMeshPtr; +} + +LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion *pRegion) +{ + LLUUID regionUUID; + if (pRegion != NULL) + { + regionUUID = pRegion->getRegionID(); + } + + return getNavMeshForRegion(regionUUID); +} + +bool LLPathfindingManager::isValidAgentState(EAgentState pAgentState) +{ + return ((pAgentState == kAgentStateFrozen) || (pAgentState == kAgentStateUnfrozen)); +} + +void LLPathfindingManager::requestGetAgentState() +{ + std::string agentStateURL = getAgentStateURLForCurrentRegion(); + + if (agentStateURL.empty()) + { + setAgentState(kAgentStateNotEnabled); + } + else + { + LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL); + LLHTTPClient::get(agentStateURL, responder); + } +} + +void LLPathfindingManager::setAgentState(EAgentState pAgentState) +{ + mAgentState = pAgentState; + + if (mAgentState != kAgentStateError) + { + mLastKnownNonErrorAgentState = mAgentState; + } + + mAgentStateSignal(mAgentState); +} + +void LLPathfindingManager::handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState) +{ +#ifndef DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD + llassert(pContent.has(ALTER_NAVMESH_OBJECTS_FIELD)); + llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); + EAgentState agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); +#else // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD + EAgentState agentState = kAgentStateUnknown; + if (pContent.has(ALTER_NAVMESH_OBJECTS_FIELD)) + { + llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); + agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); + } + else + { + llassert(pContent.has(DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD)); + llassert(pContent.get(DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); + agentState = (pContent.get(DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); + } +#endif // DEPRECATED_ALTER_NAVMESH_OBJECTS_FIELD + + if (isValidAgentState(pRequestedAgentState) && (agentState != pRequestedAgentState)) + { + agentState = kAgentStateError; + llassert(0); + } + + setAgentState(agentState); +} + +void LLPathfindingManager::handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL) +{ + llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; + setAgentState(kAgentStateError); +} + +void LLPathfindingManager::handleAgentStateUpdate(const LLSD &pContent) +{ + llassert(pContent.has(ALTER_NAVMESH_OBJECTS_FIELD)); + llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); + EAgentState agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); + + setAgentState(agentState); +} + +std::string LLPathfindingManager::getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const +{ + return getCapabilityURLForRegion(pRegion, CAP_SERVICE_NAVMESH_STATUS); +} + +std::string LLPathfindingManager::getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const +{ + return getCapabilityURLForRegion(pRegion, CAP_SERVICE_RETRIEVE_NAVMESH); +} + +std::string LLPathfindingManager::getAgentStateURLForCurrentRegion() const +{ + return getCapabilityURLForCurrentRegion(CAP_SERVICE_AGENT_STATE); +} + +std::string LLPathfindingManager::getObjectLinksetsURLForCurrentRegion() const +{ + return getCapabilityURLForCurrentRegion(CAP_SERVICE_OBJECT_LINKSETS); +} + +std::string LLPathfindingManager::getTerrainLinksetsURLForCurrentRegion() const +{ + return getCapabilityURLForCurrentRegion(CAP_SERVICE_TERRAIN_LINKSETS); +} + +std::string LLPathfindingManager::getCharactersURLForCurrentRegion() const +{ + return getCapabilityURLForCurrentRegion(CAP_SERVICE_CHARACTERS); +} + +std::string LLPathfindingManager::getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const +{ + return getCapabilityURLForRegion(getCurrentRegion(), pCapabilityName); +} + +std::string LLPathfindingManager::getCapabilityURLForRegion(LLViewerRegion *pRegion, const std::string &pCapabilityName) const +{ + std::string capabilityURL(""); + + if (pRegion != NULL) + { + capabilityURL = pRegion->getCapability(pCapabilityName); + } + + if (capabilityURL.empty()) + { + llwarns << "cannot find capability '" << pCapabilityName << "' for current region '" + << ((pRegion != NULL) ? pRegion->getName() : "") << "'" << llendl; + } + + return capabilityURL; +} + +LLViewerRegion *LLPathfindingManager::getCurrentRegion() const +{ + return gAgent.getRegion(); +} + +//--------------------------------------------------------------------------- +// LLNavMeshSimStateChangeNode +//--------------------------------------------------------------------------- + +void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const +{ +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Received NavMeshStatusUpdate: " << pInput << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE + llassert(pInput.has(SIM_MESSAGE_BODY_FIELD)); + llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap()); + LLPathfindingNavMeshStatus navMeshStatus(pInput.get(SIM_MESSAGE_BODY_FIELD)); + LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(navMeshStatus); +} + +//--------------------------------------------------------------------------- +// LLAgentStateChangeNode +//--------------------------------------------------------------------------- + +void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const +{ +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Received AgentPreferencesUpdate: " << pInput << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE + llassert(pInput.has(SIM_MESSAGE_BODY_FIELD)); + llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap()); + LLPathfindingManager::getInstance()->handleAgentStateUpdate(pInput.get(SIM_MESSAGE_BODY_FIELD)); +} + +//--------------------------------------------------------------------------- +// NavMeshStatusResponder +//--------------------------------------------------------------------------- + +NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion) + : LLHTTPClient::Responder(), + mCapabilityURL(pCapabilityURL), + mRegion(pRegion), + mRegionUUID() +{ + if (mRegion != NULL) + { + mRegionUUID = mRegion->getRegionID(); + } +} + +NavMeshStatusResponder::~NavMeshStatusResponder() +{ +} + +void NavMeshStatusResponder::result(const LLSD &pContent) +{ +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Received requested NavMeshStatus: " << pContent << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE + LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, pContent); + LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion); +} + +void NavMeshStatusResponder::error(U32 pStatus, const std::string& pReason) +{ + llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; + LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID); + LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion); +} + +//--------------------------------------------------------------------------- +// NavMeshResponder +//--------------------------------------------------------------------------- + +NavMeshResponder::NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr) + : LLHTTPClient::Responder(), + mCapabilityURL(pCapabilityURL), + mNavMeshVersion(pNavMeshVersion), + mNavMeshPtr(pNavMeshPtr) +{ +} + +NavMeshResponder::~NavMeshResponder() +{ +} + +void NavMeshResponder::result(const LLSD &pContent) +{ + mNavMeshPtr->handleNavMeshResult(pContent, mNavMeshVersion); +} + +void NavMeshResponder::error(U32 pStatus, const std::string& pReason) +{ + mNavMeshPtr->handleNavMeshError(pStatus, pReason, mCapabilityURL, mNavMeshVersion); +} + +//--------------------------------------------------------------------------- +// AgentStateResponder +//--------------------------------------------------------------------------- + +AgentStateResponder::AgentStateResponder(const std::string &pCapabilityURL, LLPathfindingManager::EAgentState pRequestedAgentState) + : LLHTTPClient::Responder(), + mCapabilityURL(pCapabilityURL), + mRequestedAgentState(pRequestedAgentState) +{ +} + +AgentStateResponder::~AgentStateResponder() +{ +} + +void AgentStateResponder::result(const LLSD &pContent) +{ + LLPathfindingManager::getInstance()->handleAgentStateResult(pContent, mRequestedAgentState); +} + +void AgentStateResponder::error(U32 pStatus, const std::string &pReason) +{ + LLPathfindingManager::getInstance()->handleAgentStateError(pStatus, pReason, mCapabilityURL); +} + +//--------------------------------------------------------------------------- +// LinksetsResponder +//--------------------------------------------------------------------------- + +LinksetsResponder::LinksetsResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::linksets_callback_t pLinksetsCallback, bool pIsObjectRequested, bool pIsTerrainRequested) + : mRequestId(pRequestId), + mLinksetsCallback(pLinksetsCallback), + mObjectMessagingState(pIsObjectRequested ? kWaiting : kNotRequested), + mTerrainMessagingState(pIsTerrainRequested ? kWaiting : kNotRequested), + mObjectLinksetListPtr(), + mTerrainLinksetPtr() +{ +} + +LinksetsResponder::~LinksetsResponder() +{ +} + +void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent) +{ + mObjectLinksetListPtr = LLPathfindingLinksetListPtr(new LLPathfindingLinksetList(pContent)); + + mObjectMessagingState = kReceivedGood; + if (mTerrainMessagingState != kWaiting) + { + sendCallback(); + } +} + +void LinksetsResponder::handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL) +{ + llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; + mObjectMessagingState = kReceivedError; + if (mTerrainMessagingState != kWaiting) + { + sendCallback(); + } +} + +void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent) +{ + mTerrainLinksetPtr = LLPathfindingLinksetPtr(new LLPathfindingLinkset(pContent)); + + mTerrainMessagingState = kReceivedGood; + if (mObjectMessagingState != kWaiting) + { + sendCallback(); + } +} + +void LinksetsResponder::handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL) +{ + mTerrainMessagingState = kReceivedError; + if (mObjectMessagingState != kWaiting) + { + sendCallback(); + } +} + +void LinksetsResponder::sendCallback() +{ + llassert(mObjectMessagingState != kWaiting); + llassert(mTerrainMessagingState != kWaiting); + LLPathfindingManager::ERequestStatus requestStatus = + ((((mObjectMessagingState == kReceivedGood) || (mObjectMessagingState == kNotRequested)) && + ((mTerrainMessagingState == kReceivedGood) || (mTerrainMessagingState == kNotRequested))) ? + LLPathfindingManager::kRequestCompleted : LLPathfindingManager::kRequestError); + + if (mObjectMessagingState != kReceivedGood) + { + mObjectLinksetListPtr = LLPathfindingLinksetListPtr(new LLPathfindingLinksetList()); + } + + if (mTerrainMessagingState == kReceivedGood) + { + mObjectLinksetListPtr->insert(std::pair(mTerrainLinksetPtr->getUUID().asString(), mTerrainLinksetPtr)); + } + + mLinksetsCallback(mRequestId, requestStatus, mObjectLinksetListPtr); +} + +//--------------------------------------------------------------------------- +// ObjectLinksetsResponder +//--------------------------------------------------------------------------- + +ObjectLinksetsResponder::ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) + : LLHTTPClient::Responder(), + mCapabilityURL(pCapabilityURL), + mLinksetsResponsderPtr(pLinksetsResponsderPtr) +{ +} + +ObjectLinksetsResponder::~ObjectLinksetsResponder() +{ +} + +void ObjectLinksetsResponder::result(const LLSD &pContent) +{ + mLinksetsResponsderPtr->handleObjectLinksetsResult(pContent); +} + +void ObjectLinksetsResponder::error(U32 pStatus, const std::string &pReason) +{ + mLinksetsResponsderPtr->handleObjectLinksetsError(pStatus, pReason, mCapabilityURL); +} + +//--------------------------------------------------------------------------- +// TerrainLinksetsResponder +//--------------------------------------------------------------------------- + +TerrainLinksetsResponder::TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr) + : LLHTTPClient::Responder(), + mCapabilityURL(pCapabilityURL), + mLinksetsResponsderPtr(pLinksetsResponsderPtr) +{ +} + +TerrainLinksetsResponder::~TerrainLinksetsResponder() +{ +} + +void TerrainLinksetsResponder::result(const LLSD &pContent) +{ + mLinksetsResponsderPtr->handleTerrainLinksetsResult(pContent); +} + +void TerrainLinksetsResponder::error(U32 pStatus, const std::string &pReason) +{ + mLinksetsResponsderPtr->handleTerrainLinksetsError(pStatus, pReason, mCapabilityURL); +} + +//--------------------------------------------------------------------------- +// CharactersResponder +//--------------------------------------------------------------------------- + +CharactersResponder::CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::characters_callback_t pCharactersCallback) + : LLHTTPClient::Responder(), + mCapabilityURL(pCapabilityURL), + mRequestId(pRequestId), + mCharactersCallback(pCharactersCallback) +{ +} + +CharactersResponder::~CharactersResponder() +{ +} + +void CharactersResponder::result(const LLSD &pContent) +{ + LLPathfindingCharacterListPtr characterListPtr = LLPathfindingCharacterListPtr(new LLPathfindingCharacterList(pContent)); + mCharactersCallback(mRequestId, LLPathfindingManager::kRequestCompleted, characterListPtr); +} + +void CharactersResponder::error(U32 pStatus, const std::string &pReason) +{ + llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; + + LLPathfindingCharacterListPtr characterListPtr; + mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr); +} + diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 795ee88f3d..9797c783b5 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -1,143 +1,146 @@ -/** - * @file llpathfindingmanager.h - * @author William Todd Stinson - * @brief A state manager for the various pathfinding states. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLPATHFINDINGMANAGER_H -#define LL_LLPATHFINDINGMANAGER_H - -#include "llsingleton.h" -#include "lluuid.h" -#include "llpathfindingnavmesh.h" -#include "llpathfindinglinkset.h" -#include "llpathfindinglinksetlist.h" -#include "llpathfindingcharacterlist.h" - -#include -#include - -#include -#include - -class LLFloater; -class LLViewerRegion; -class LLPathfindingNavMeshStatus; - -class LLPathfindingManager : public LLSingleton -{ - friend class LLNavMeshSimStateChangeNode; - friend class LLAgentStateChangeNode; - friend class NavMeshStatusResponder; - friend class AgentStateResponder; -public: - typedef std::map NavMeshMap; - - typedef enum { - kAgentStateUnknown, - kAgentStateFrozen, - kAgentStateUnfrozen, - kAgentStateNotEnabled, - kAgentStateError - } EAgentState; - - typedef boost::function agent_state_callback_t; - typedef boost::signals2::signal agent_state_signal_t; - typedef boost::signals2::connection agent_state_slot_t; - - typedef enum { - kRequestStarted, - kRequestCompleted, - kRequestNotEnabled, - kRequestError - } ERequestStatus; - - typedef U32 request_id_t; - - typedef boost::function linksets_callback_t; - typedef boost::function characters_callback_t; - - LLPathfindingManager(); - virtual ~LLPathfindingManager(); - - bool isPathfindingEnabledForCurrentRegion() const; - bool isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const; -#ifdef DEPRECATED_UNVERSIONED_NAVMESH - bool isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX() const; -#endif // DEPRECATED_UNVERSIONED_NAVMESH - - bool isAllowAlterPermanent(); - bool isAllowViewTerrainProperties() const; - - LLPathfindingNavMesh::navmesh_slot_t registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback); - void requestGetNavMeshForRegion(LLViewerRegion *pRegion); - - agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback); - EAgentState getAgentState(); - EAgentState getLastKnownNonErrorAgentState() const; - void requestSetAgentState(EAgentState pAgentState); - - ERequestStatus requestGetLinksets(request_id_t pRequestId, linksets_callback_t pLinksetsCallback) const; - ERequestStatus requestSetLinksets(request_id_t pRequestId, LLPathfindingLinksetListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, linksets_callback_t pLinksetsCallback) const; - - ERequestStatus requestGetCharacters(request_id_t pRequestId, characters_callback_t pCharactersCallback) const; - -protected: - -private: - void sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus); - - void handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion); - void handleNavMeshStatusUpdate(const LLPathfindingNavMeshStatus &pNavMeshStatus); - - LLPathfindingNavMeshPtr getNavMeshForRegion(const LLUUID &pRegionUUID); - LLPathfindingNavMeshPtr getNavMeshForRegion(LLViewerRegion *pRegion); - - static bool isValidAgentState(EAgentState pAgentState); - - void requestGetAgentState(); - void setAgentState(EAgentState pAgentState); - void handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState); - void handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL); - void handleAgentStateUpdate(const LLSD &pContent); - - std::string getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const; - std::string getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const; - std::string getAgentStateURLForCurrentRegion() const; - std::string getObjectLinksetsURLForCurrentRegion() const; - std::string getTerrainLinksetsURLForCurrentRegion() const; - std::string getCharactersURLForCurrentRegion() const; - - std::string getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const; - std::string getCapabilityURLForRegion(LLViewerRegion *pRegion, const std::string &pCapabilityName) const; - LLViewerRegion *getCurrentRegion() const; - - NavMeshMap mNavMeshMap; - - agent_state_signal_t mAgentStateSignal; - EAgentState mAgentState; - EAgentState mLastKnownNonErrorAgentState; -}; - -#endif // LL_LLPATHFINDINGMANAGER_H +/** + * @file llpathfindingmanager.h + * @author William Todd Stinson + * @brief A state manager for the various pathfinding states. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPATHFINDINGMANAGER_H +#define LL_LLPATHFINDINGMANAGER_H + +#include "llsingleton.h" +#include "lluuid.h" +#include "llpathfindingnavmesh.h" +#include "llpathfindinglinkset.h" +#include "llpathfindinglinksetlist.h" +#include "llpathfindingcharacterlist.h" + +#include +#include + +#include +#include + +class LLFloater; +class LLViewerRegion; +class LLPathfindingNavMeshStatus; + +class LLPathfindingManager : public LLSingleton +{ + friend class LLNavMeshSimStateChangeNode; + friend class LLAgentStateChangeNode; + friend class NavMeshStatusResponder; + friend class AgentStateResponder; +public: + typedef std::map NavMeshMap; + + typedef enum { + kAgentStateUnknown, + kAgentStateFrozen, + kAgentStateUnfrozen, + kAgentStateNotEnabled, + kAgentStateError + } EAgentState; + + typedef boost::function agent_state_callback_t; + typedef boost::signals2::signal agent_state_signal_t; + typedef boost::signals2::connection agent_state_slot_t; + + typedef enum { + kRequestStarted, + kRequestCompleted, + kRequestNotEnabled, + kRequestError + } ERequestStatus; + + typedef U32 request_id_t; + + typedef boost::function linksets_callback_t; + typedef boost::function characters_callback_t; + + LLPathfindingManager(); + virtual ~LLPathfindingManager(); + + bool isPathfindingEnabledForCurrentRegion() const; + bool isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const; +#ifdef DEPRECATED_UNVERSIONED_NAVMESH + bool isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX() const; +#endif // DEPRECATED_UNVERSIONED_NAVMESH + + bool isAllowAlterPermanent(); + bool isAllowViewTerrainProperties() const; + + LLPathfindingNavMesh::navmesh_slot_t registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback); + void requestGetNavMeshForRegion(LLViewerRegion *pRegion); + + agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback); + EAgentState getAgentState(); + EAgentState getLastKnownNonErrorAgentState() const; + void requestSetAgentState(EAgentState pAgentState); + + ERequestStatus requestGetLinksets(request_id_t pRequestId, linksets_callback_t pLinksetsCallback) const; + ERequestStatus requestSetLinksets(request_id_t pRequestId, LLPathfindingLinksetListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, linksets_callback_t pLinksetsCallback) const; + + ERequestStatus requestGetCharacters(request_id_t pRequestId, characters_callback_t pCharactersCallback) const; + +protected: + +private: + void sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus); + + void handleDeferredGetNavMeshForRegion(const LLUUID &pRegionUUID); + + void handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion); + void handleNavMeshStatusUpdate(const LLPathfindingNavMeshStatus &pNavMeshStatus); + + LLPathfindingNavMeshPtr getNavMeshForRegion(const LLUUID &pRegionUUID); + LLPathfindingNavMeshPtr getNavMeshForRegion(LLViewerRegion *pRegion); + + static bool isValidAgentState(EAgentState pAgentState); + + void requestGetAgentState(); + void setAgentState(EAgentState pAgentState); + void handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState); + void handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL); + void handleAgentStateUpdate(const LLSD &pContent); + + std::string getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const; + std::string getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const; + std::string getAgentStateURLForCurrentRegion() const; + std::string getObjectLinksetsURLForCurrentRegion() const; + std::string getTerrainLinksetsURLForCurrentRegion() const; + std::string getCharactersURLForCurrentRegion() const; + + std::string getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const; + std::string getCapabilityURLForRegion(LLViewerRegion *pRegion, const std::string &pCapabilityName) const; + LLViewerRegion *getCurrentRegion() const; + + NavMeshMap mNavMeshMap; + + agent_state_signal_t mAgentStateSignal; + EAgentState mAgentState; + EAgentState mLastKnownNonErrorAgentState; +}; + +#endif // LL_LLPATHFINDINGMANAGER_H + diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 10e9abaf0c..4e4e9fceef 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -1,195 +1,201 @@ -/** - * @file llpathfindingnavmesh.cpp - * @author William Todd Stinson - * @brief A class for representing the navmesh of a pathfinding region. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "lluuid.h" -#include "llpathfindingnavmesh.h" -#include "llpathfindingnavmeshstatus.h" -#include "llsdserialize.h" - -#include - -#define NAVMESH_VERSION_FIELD "navmesh_version" -#define NAVMESH_DATA_FIELD "navmesh_data" - -//--------------------------------------------------------------------------- -// LLPathfindingNavMesh -//--------------------------------------------------------------------------- - -LLPathfindingNavMesh::LLPathfindingNavMesh(const LLUUID &pRegionUUID) - : mNavMeshStatus(pRegionUUID), - mNavMeshRequestStatus(kNavMeshRequestUnknown), - mNavMeshSignal(), - mNavMeshData() - -{ -} - -LLPathfindingNavMesh::~LLPathfindingNavMesh() -{ -} - -LLPathfindingNavMesh::navmesh_slot_t LLPathfindingNavMesh::registerNavMeshListener(navmesh_callback_t pNavMeshCallback) -{ - return mNavMeshSignal.connect(pNavMeshCallback); -} - -bool LLPathfindingNavMesh::hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const -{ - return ((mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()) && - ((mNavMeshRequestStatus == kNavMeshRequestStarted) || (mNavMeshRequestStatus == kNavMeshRequestCompleted) || - ((mNavMeshRequestStatus == kNavMeshRequestChecking) && !mNavMeshData.empty()))); -} - -void LLPathfindingNavMesh::handleNavMeshCheckVersion() -{ - setRequestStatus(kNavMeshRequestChecking); -} - -void LLPathfindingNavMesh::handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus) -{ - llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID()); - llassert(mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()); - mNavMeshStatus = pNavMeshStatus; - if (mNavMeshRequestStatus == kNavMeshRequestChecking) - { - llassert(!mNavMeshData.empty()); - setRequestStatus(kNavMeshRequestCompleted); - } - else - { - sendStatus(); - } -} - -void LLPathfindingNavMesh::handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) -{ - llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID()); - if (mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()) - { - mNavMeshStatus = pNavMeshStatus; - sendStatus(); - } - else - { - mNavMeshData.clear(); - mNavMeshStatus = pNavMeshStatus; - setRequestStatus(kNavMeshRequestNeedsUpdate); - } -} - -void LLPathfindingNavMesh::handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus) -{ - llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID()); - mNavMeshStatus = pNavMeshStatus; - setRequestStatus(kNavMeshRequestStarted); -} - -void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion) -{ - if (pContent.has(NAVMESH_VERSION_FIELD)) - { - llassert(pContent.get(NAVMESH_VERSION_FIELD).isInteger()); - llassert(pContent.get(NAVMESH_VERSION_FIELD).asInteger() >= 0); - U32 embeddedNavMeshVersion = static_cast(pContent.get(NAVMESH_VERSION_FIELD).asInteger()); - llassert(embeddedNavMeshVersion == pNavMeshVersion); // stinson 03/13/2012 : does this ever occur? - if (embeddedNavMeshVersion != pNavMeshVersion) - { - llwarns << "Mismatch between expected and embedded navmesh versions occurred" << llendl; - pNavMeshVersion = embeddedNavMeshVersion; - } - } - - if (mNavMeshStatus.getVersion() == pNavMeshVersion) - { - ENavMeshRequestStatus status; - if ( pContent.has(NAVMESH_DATA_FIELD) ) - { - const LLSD::Binary &value = pContent.get(NAVMESH_DATA_FIELD).asBinary(); - unsigned int binSize = value.size(); - std::string newStr(reinterpret_cast(&value[0]), binSize); - std::istringstream streamdecomp( newStr ); - unsigned int decompBinSize = 0; - bool valid = false; - U8* pUncompressedNavMeshContainer = unzip_llsdNavMesh( valid, decompBinSize, streamdecomp, binSize ) ; - if ( !valid ) - { - llwarns << "Unable to decompress the navmesh llsd." << llendl; - status = kNavMeshRequestError; - } - else - { - llassert(pUncompressedNavMeshContainer); - mNavMeshData.resize( decompBinSize ); - memcpy( &mNavMeshData[0], &pUncompressedNavMeshContainer[0], decompBinSize ); - status = kNavMeshRequestCompleted; - } - if ( pUncompressedNavMeshContainer ) - { - free( pUncompressedNavMeshContainer ); - } - } - else - { - llwarns << "No mesh data received" << llendl; - status = kNavMeshRequestError; - } - setRequestStatus(status); - } -} - -void LLPathfindingNavMesh::handleNavMeshNotEnabled() -{ - mNavMeshData.clear(); - setRequestStatus(kNavMeshRequestNotEnabled); -} - -void LLPathfindingNavMesh::handleNavMeshError() -{ - mNavMeshData.clear(); - setRequestStatus(kNavMeshRequestError); -} - -void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion) -{ - llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; - if (mNavMeshStatus.getVersion() == pNavMeshVersion) - { - handleNavMeshError(); - } -} - -void LLPathfindingNavMesh::setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus) -{ - mNavMeshRequestStatus = pNavMeshRequestStatus; - sendStatus(); -} - -void LLPathfindingNavMesh::sendStatus() -{ - mNavMeshSignal(mNavMeshRequestStatus, mNavMeshStatus, mNavMeshData); -} +/** + * @file llpathfindingnavmesh.cpp + * @author William Todd Stinson + * @brief A class for representing the navmesh of a pathfinding region. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "lluuid.h" +#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" +#include "llsdserialize.h" + +#include + +#define NAVMESH_VERSION_FIELD "navmesh_version" +#define NAVMESH_DATA_FIELD "navmesh_data" + +//--------------------------------------------------------------------------- +// LLPathfindingNavMesh +//--------------------------------------------------------------------------- + +LLPathfindingNavMesh::LLPathfindingNavMesh(const LLUUID &pRegionUUID) + : mNavMeshStatus(pRegionUUID), + mNavMeshRequestStatus(kNavMeshRequestUnknown), + mNavMeshSignal(), + mNavMeshData() + +{ +} + +LLPathfindingNavMesh::~LLPathfindingNavMesh() +{ +} + +LLPathfindingNavMesh::navmesh_slot_t LLPathfindingNavMesh::registerNavMeshListener(navmesh_callback_t pNavMeshCallback) +{ + return mNavMeshSignal.connect(pNavMeshCallback); +} + +bool LLPathfindingNavMesh::hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const +{ + return ((mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()) && + ((mNavMeshRequestStatus == kNavMeshRequestStarted) || (mNavMeshRequestStatus == kNavMeshRequestCompleted) || + ((mNavMeshRequestStatus == kNavMeshRequestChecking) && !mNavMeshData.empty()))); +} + +void LLPathfindingNavMesh::handleNavMeshWaitForRegionLoad() +{ + setRequestStatus(kNavMeshRequestWaiting); +} + +void LLPathfindingNavMesh::handleNavMeshCheckVersion() +{ + setRequestStatus(kNavMeshRequestChecking); +} + +void LLPathfindingNavMesh::handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus) +{ + llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID()); + llassert(mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()); + mNavMeshStatus = pNavMeshStatus; + if (mNavMeshRequestStatus == kNavMeshRequestChecking) + { + llassert(!mNavMeshData.empty()); + setRequestStatus(kNavMeshRequestCompleted); + } + else + { + sendStatus(); + } +} + +void LLPathfindingNavMesh::handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) +{ + llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID()); + if (mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()) + { + mNavMeshStatus = pNavMeshStatus; + sendStatus(); + } + else + { + mNavMeshData.clear(); + mNavMeshStatus = pNavMeshStatus; + setRequestStatus(kNavMeshRequestNeedsUpdate); + } +} + +void LLPathfindingNavMesh::handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus) +{ + llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID()); + mNavMeshStatus = pNavMeshStatus; + setRequestStatus(kNavMeshRequestStarted); +} + +void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion) +{ + if (pContent.has(NAVMESH_VERSION_FIELD)) + { + llassert(pContent.get(NAVMESH_VERSION_FIELD).isInteger()); + llassert(pContent.get(NAVMESH_VERSION_FIELD).asInteger() >= 0); + U32 embeddedNavMeshVersion = static_cast(pContent.get(NAVMESH_VERSION_FIELD).asInteger()); + llassert(embeddedNavMeshVersion == pNavMeshVersion); // stinson 03/13/2012 : does this ever occur? + if (embeddedNavMeshVersion != pNavMeshVersion) + { + llwarns << "Mismatch between expected and embedded navmesh versions occurred" << llendl; + pNavMeshVersion = embeddedNavMeshVersion; + } + } + + if (mNavMeshStatus.getVersion() == pNavMeshVersion) + { + ENavMeshRequestStatus status; + if ( pContent.has(NAVMESH_DATA_FIELD) ) + { + const LLSD::Binary &value = pContent.get(NAVMESH_DATA_FIELD).asBinary(); + unsigned int binSize = value.size(); + std::string newStr(reinterpret_cast(&value[0]), binSize); + std::istringstream streamdecomp( newStr ); + unsigned int decompBinSize = 0; + bool valid = false; + U8* pUncompressedNavMeshContainer = unzip_llsdNavMesh( valid, decompBinSize, streamdecomp, binSize ) ; + if ( !valid ) + { + llwarns << "Unable to decompress the navmesh llsd." << llendl; + status = kNavMeshRequestError; + } + else + { + llassert(pUncompressedNavMeshContainer); + mNavMeshData.resize( decompBinSize ); + memcpy( &mNavMeshData[0], &pUncompressedNavMeshContainer[0], decompBinSize ); + status = kNavMeshRequestCompleted; + } + if ( pUncompressedNavMeshContainer ) + { + free( pUncompressedNavMeshContainer ); + } + } + else + { + llwarns << "No mesh data received" << llendl; + status = kNavMeshRequestError; + } + setRequestStatus(status); + } +} + +void LLPathfindingNavMesh::handleNavMeshNotEnabled() +{ + mNavMeshData.clear(); + setRequestStatus(kNavMeshRequestNotEnabled); +} + +void LLPathfindingNavMesh::handleNavMeshError() +{ + mNavMeshData.clear(); + setRequestStatus(kNavMeshRequestError); +} + +void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion) +{ + llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; + if (mNavMeshStatus.getVersion() == pNavMeshVersion) + { + handleNavMeshError(); + } +} + +void LLPathfindingNavMesh::setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus) +{ + mNavMeshRequestStatus = pNavMeshRequestStatus; + sendStatus(); +} + +void LLPathfindingNavMesh::sendStatus() +{ + mNavMeshSignal(mNavMeshRequestStatus, mNavMeshStatus, mNavMeshData); +} + diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 290f7a2cdf..55fdd9aaa7 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -1,95 +1,98 @@ -/** - * @file llpathfindingnavmesh.h - * @author William Todd Stinson - * @brief A class for representing the navmesh of a pathfinding region. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLPATHFINDINGNAVMESH_H -#define LL_LLPATHFINDINGNAVMESH_H - -#include "llsd.h" - -#include - -#include -#include -#include - -#include "llpathfindingnavmeshstatus.h" - -class LLUUID; -class LLPathfindingNavMesh; - -typedef boost::shared_ptr LLPathfindingNavMeshPtr; - -class LLPathfindingNavMesh -{ -public: - typedef enum { - kNavMeshRequestUnknown, - kNavMeshRequestChecking, - kNavMeshRequestNeedsUpdate, - kNavMeshRequestStarted, - kNavMeshRequestCompleted, - kNavMeshRequestNotEnabled, - kNavMeshRequestError - } ENavMeshRequestStatus; - - typedef boost::function navmesh_callback_t; - typedef boost::signals2::signal navmesh_signal_t; - typedef boost::signals2::connection navmesh_slot_t; - - LLPathfindingNavMesh(const LLUUID &pRegionUUID); - virtual ~LLPathfindingNavMesh(); - - navmesh_slot_t registerNavMeshListener(navmesh_callback_t pNavMeshCallback); - -#ifdef DEPRECATED_UNVERSIONED_NAVMESH - const LLPathfindingNavMeshStatus &getNavMeshStatusXXX() const {return mNavMeshStatus;}; -#endif // DEPRECATED_UNVERSIONED_NAVMESH - - bool hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const; - - void handleNavMeshCheckVersion(); - void handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus); - void handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus); - void handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus); - void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion); - void handleNavMeshNotEnabled(); - void handleNavMeshError(); - void handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion); - -protected: - -private: - void setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus); - void sendStatus(); - - LLPathfindingNavMeshStatus mNavMeshStatus; - ENavMeshRequestStatus mNavMeshRequestStatus; - navmesh_signal_t mNavMeshSignal; - LLSD::Binary mNavMeshData; -}; - -#endif // LL_LLPATHFINDINGNAVMESH_H +/** + * @file llpathfindingnavmesh.h + * @author William Todd Stinson + * @brief A class for representing the navmesh of a pathfinding region. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPATHFINDINGNAVMESH_H +#define LL_LLPATHFINDINGNAVMESH_H + +#include "llsd.h" + +#include + +#include +#include +#include + +#include "llpathfindingnavmeshstatus.h" + +class LLUUID; +class LLPathfindingNavMesh; + +typedef boost::shared_ptr LLPathfindingNavMeshPtr; + +class LLPathfindingNavMesh +{ +public: + typedef enum { + kNavMeshRequestUnknown, + kNavMeshRequestWaiting, + kNavMeshRequestChecking, + kNavMeshRequestNeedsUpdate, + kNavMeshRequestStarted, + kNavMeshRequestCompleted, + kNavMeshRequestNotEnabled, + kNavMeshRequestError + } ENavMeshRequestStatus; + + typedef boost::function navmesh_callback_t; + typedef boost::signals2::signal navmesh_signal_t; + typedef boost::signals2::connection navmesh_slot_t; + + LLPathfindingNavMesh(const LLUUID &pRegionUUID); + virtual ~LLPathfindingNavMesh(); + + navmesh_slot_t registerNavMeshListener(navmesh_callback_t pNavMeshCallback); + +#ifdef DEPRECATED_UNVERSIONED_NAVMESH + const LLPathfindingNavMeshStatus &getNavMeshStatusXXX() const {return mNavMeshStatus;}; +#endif // DEPRECATED_UNVERSIONED_NAVMESH + + bool hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const; + + void handleNavMeshWaitForRegionLoad(); + void handleNavMeshCheckVersion(); + void handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus); + void handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus); + void handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus); + void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion); + void handleNavMeshNotEnabled(); + void handleNavMeshError(); + void handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion); + +protected: + +private: + void setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus); + void sendStatus(); + + LLPathfindingNavMeshStatus mNavMeshStatus; + ENavMeshRequestStatus mNavMeshRequestStatus; + navmesh_signal_t mNavMeshSignal; + LLSD::Binary mNavMeshData; +}; + +#endif // LL_LLPATHFINDINGNAVMESH_H + diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index 9c7b493701..f7872f6e29 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -206,6 +206,7 @@ void LLPathfindingNavMeshZone::handleNavMeshLocation() void LLPathfindingNavMeshZone::updateStatus() { bool hasRequestUnknown = false; + bool hasRequestWaiting = false; bool hasRequestChecking = false; bool hasRequestNeedsUpdate = false; bool hasRequestStarted = false; @@ -228,6 +229,9 @@ void LLPathfindingNavMeshZone::updateStatus() case LLPathfindingNavMesh::kNavMeshRequestUnknown : hasRequestUnknown = true; break; + case LLPathfindingNavMesh::kNavMeshRequestWaiting : + hasRequestWaiting = true; + break; case LLPathfindingNavMesh::kNavMeshRequestChecking : hasRequestChecking = true; break; @@ -254,7 +258,14 @@ void LLPathfindingNavMeshZone::updateStatus() } ENavMeshZoneRequestStatus zoneRequestStatus = kNavMeshZoneRequestUnknown; - if (hasRequestNeedsUpdate) + if (hasRequestWaiting) + { + zoneRequestStatus = kNavMeshZoneRequestWaiting; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + llinfos << "STINSON DEBUG: Navmesh zone update is WAITING" << llendl; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE + } + else if (hasRequestNeedsUpdate) { zoneRequestStatus = kNavMeshZoneRequestNeedsUpdate; #ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index 7f83e9d37b..8c330559a9 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -1,134 +1,136 @@ -/** - * @file llpathfindingnavmeshzone.h - * @author William Todd Stinson - * @brief A class for representing the zone of navmeshes containing and possible surrounding the current region. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLPATHFINDINGNAVMESHZONE_H -#define LL_LLPATHFINDINGNAVMESHZONE_H - -#include "llsd.h" -#include "lluuid.h" -#include "llpathfindingnavmesh.h" -#include "llpathfindingnavmeshstatus.h" - -#include - -#include -#include -#include - -class LLPathfindingNavMeshStatus; - -//#define XXX_STINSON_DEBUG_NAVMESH_ZONE - -class LLPathfindingNavMeshZone -{ -public: - typedef enum { - kNavMeshZoneRequestUnknown, - kNavMeshZoneRequestChecking, - kNavMeshZoneRequestNeedsUpdate, - kNavMeshZoneRequestStarted, - kNavMeshZoneRequestCompleted, - kNavMeshZoneRequestNotEnabled, - kNavMeshZoneRequestError - } ENavMeshZoneRequestStatus; - - typedef enum { - kNavMeshZonePending, - kNavMeshZoneBuilding, - kNavMeshZoneSomePending, - kNavMeshZoneSomeBuilding, - kNavMeshZonePendingAndBuilding, - kNavMeshZoneComplete - } ENavMeshZoneStatus; - - typedef boost::function navmesh_zone_callback_t; - typedef boost::signals2::signal navmesh_zone_signal_t; - typedef boost::signals2::connection navmesh_zone_slot_t; - - LLPathfindingNavMeshZone(); - virtual ~LLPathfindingNavMeshZone(); - - navmesh_zone_slot_t registerNavMeshZoneListener(navmesh_zone_callback_t pNavMeshZoneCallback); - void initialize(); - - void enable(); - void disable(); - void refresh(); - - ENavMeshZoneStatus getNavMeshZoneStatus() const; - -protected: - -private: - typedef boost::function navmesh_location_callback_t; - class NavMeshLocation - { - public: - NavMeshLocation(S32 pDirection, navmesh_location_callback_t pLocationCallback); - virtual ~NavMeshLocation(); - - void enable(); - void refresh(); - void disable(); - - LLPathfindingNavMesh::ENavMeshRequestStatus getRequestStatus() const; - LLPathfindingNavMeshStatus::ENavMeshStatus getNavMeshStatus() const; -#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE - const LLUUID &getRegionUUID() const {return mRegionUUID;}; - S32 getDirection() const {return mDirection;}; -#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE - - protected: - - private: - void handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLPathfindingNavMeshStatus &pNavMeshStatus, const LLSD::Binary &pNavMeshData); - - void clear(); - LLViewerRegion *getRegion() const; - - S32 mDirection; - LLUUID mRegionUUID; - bool mHasNavMesh; - U32 mNavMeshVersion; - LLPathfindingNavMeshStatus::ENavMeshStatus mNavMeshStatus; - navmesh_location_callback_t mLocationCallback; - LLPathfindingNavMesh::ENavMeshRequestStatus mRequestStatus; - LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot; - }; - - typedef boost::shared_ptr NavMeshLocationPtr; - typedef std::vector NavMeshLocationPtrs; - - void handleNavMeshLocation(); - void updateStatus(); - - NavMeshLocationPtrs mNavMeshLocationPtrs; - ENavMeshZoneRequestStatus mNavMeshZoneRequestStatus; - navmesh_zone_signal_t mNavMeshZoneSignal; -}; - -#endif // LL_LLPATHFINDINGNAVMESHZONE_H +/** + * @file llpathfindingnavmeshzone.h + * @author William Todd Stinson + * @brief A class for representing the zone of navmeshes containing and possible surrounding the current region. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPATHFINDINGNAVMESHZONE_H +#define LL_LLPATHFINDINGNAVMESHZONE_H + +#include "llsd.h" +#include "lluuid.h" +#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" + +#include + +#include +#include +#include + +class LLPathfindingNavMeshStatus; + +//#define XXX_STINSON_DEBUG_NAVMESH_ZONE + +class LLPathfindingNavMeshZone +{ +public: + typedef enum { + kNavMeshZoneRequestUnknown, + kNavMeshZoneRequestWaiting, + kNavMeshZoneRequestChecking, + kNavMeshZoneRequestNeedsUpdate, + kNavMeshZoneRequestStarted, + kNavMeshZoneRequestCompleted, + kNavMeshZoneRequestNotEnabled, + kNavMeshZoneRequestError + } ENavMeshZoneRequestStatus; + + typedef enum { + kNavMeshZonePending, + kNavMeshZoneBuilding, + kNavMeshZoneSomePending, + kNavMeshZoneSomeBuilding, + kNavMeshZonePendingAndBuilding, + kNavMeshZoneComplete + } ENavMeshZoneStatus; + + typedef boost::function navmesh_zone_callback_t; + typedef boost::signals2::signal navmesh_zone_signal_t; + typedef boost::signals2::connection navmesh_zone_slot_t; + + LLPathfindingNavMeshZone(); + virtual ~LLPathfindingNavMeshZone(); + + navmesh_zone_slot_t registerNavMeshZoneListener(navmesh_zone_callback_t pNavMeshZoneCallback); + void initialize(); + + void enable(); + void disable(); + void refresh(); + + ENavMeshZoneStatus getNavMeshZoneStatus() const; + +protected: + +private: + typedef boost::function navmesh_location_callback_t; + class NavMeshLocation + { + public: + NavMeshLocation(S32 pDirection, navmesh_location_callback_t pLocationCallback); + virtual ~NavMeshLocation(); + + void enable(); + void refresh(); + void disable(); + + LLPathfindingNavMesh::ENavMeshRequestStatus getRequestStatus() const; + LLPathfindingNavMeshStatus::ENavMeshStatus getNavMeshStatus() const; +#ifdef XXX_STINSON_DEBUG_NAVMESH_ZONE + const LLUUID &getRegionUUID() const {return mRegionUUID;}; + S32 getDirection() const {return mDirection;}; +#endif // XXX_STINSON_DEBUG_NAVMESH_ZONE + + protected: + + private: + void handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLPathfindingNavMeshStatus &pNavMeshStatus, const LLSD::Binary &pNavMeshData); + + void clear(); + LLViewerRegion *getRegion() const; + + S32 mDirection; + LLUUID mRegionUUID; + bool mHasNavMesh; + U32 mNavMeshVersion; + LLPathfindingNavMeshStatus::ENavMeshStatus mNavMeshStatus; + navmesh_location_callback_t mLocationCallback; + LLPathfindingNavMesh::ENavMeshRequestStatus mRequestStatus; + LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot; + }; + + typedef boost::shared_ptr NavMeshLocationPtr; + typedef std::vector NavMeshLocationPtrs; + + void handleNavMeshLocation(); + void updateStatus(); + + NavMeshLocationPtrs mNavMeshLocationPtrs; + ENavMeshZoneRequestStatus mNavMeshZoneRequestStatus; + navmesh_zone_signal_t mNavMeshZoneSignal; +}; + +#endif // LL_LLPATHFINDINGNAVMESHZONE_H + diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index a951106640..54d44be015 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -14,6 +14,7 @@ Cannot find pathing library implementation. This region is not enabled for pathfinding. + Waiting for the region to finish loading. Checking the status of the navmesh. Downloading the navmesh. The navmesh has changed on the server. Downloading the latest navmesh. -- cgit v1.3 From 78910cf3016fc55eaf8214640b348df0f8bcdeda Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 26 Jun 2012 18:04:19 -0700 Subject: Updating the header licensing comments. --- indra/llrender/llrendernavprim.cpp | 53 +++++++++++---------- indra/llrender/llrendernavprim.h | 56 +++++++++++----------- indra/newview/llfloaterpathfindingcharacters.cpp | 51 ++++++++++---------- indra/newview/llfloaterpathfindingcharacters.h | 19 ++++---- indra/newview/llfloaterpathfindingconsole.cpp | 19 ++++---- indra/newview/llfloaterpathfindingconsole.h | 51 ++++++++++---------- indra/newview/llfloaterpathfindinglinksets.cpp | 17 +++---- indra/newview/llfloaterpathfindinglinksets.h | 51 ++++++++++---------- indra/newview/llfloaterpathfindingobjects.cpp | 2 +- indra/newview/llfloaterpathfindingobjects.h | 2 +- indra/newview/llpathfindingcharacter.cpp | 51 ++++++++++---------- indra/newview/llpathfindingcharacter.h | 51 ++++++++++---------- indra/newview/llpathfindingcharacterlist.cpp | 51 ++++++++++---------- indra/newview/llpathfindingcharacterlist.h | 51 ++++++++++---------- indra/newview/llpathfindinglinkset.cpp | 51 ++++++++++---------- indra/newview/llpathfindinglinkset.h | 51 ++++++++++---------- indra/newview/llpathfindinglinksetlist.cpp | 51 ++++++++++---------- indra/newview/llpathfindinglinksetlist.h | 51 ++++++++++---------- indra/newview/llpathfindingmanager.cpp | 53 ++++++++++----------- indra/newview/llpathfindingmanager.h | 53 +++++++++++---------- indra/newview/llpathfindingnavmesh.cpp | 58 ++++++++++++----------- indra/newview/llpathfindingnavmesh.h | 54 +++++++++++----------- indra/newview/llpathfindingnavmeshstatus.cpp | 59 +++++++++++++----------- indra/newview/llpathfindingnavmeshstatus.h | 51 ++++++++++---------- indra/newview/llpathfindingnavmeshzone.cpp | 55 +++++++++++----------- indra/newview/llpathfindingnavmeshzone.h | 54 +++++++++++----------- indra/newview/llpathfindingpathtool.cpp | 52 +++++++++++---------- indra/newview/llpathfindingpathtool.h | 51 ++++++++++---------- 28 files changed, 639 insertions(+), 630 deletions(-) (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp index c24a09028f..e7bc89396c 100644 --- a/indra/llrender/llrendernavprim.cpp +++ b/indra/llrender/llrendernavprim.cpp @@ -1,36 +1,39 @@ /** - * @file LLRenderNavPrim.cpp - * @brief Renderable primitives used by the pathing library - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llrendernavprim.cpp +* @brief Implementation of llrendernavprim +* @author Prep@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #include "linden_common.h" + #include "llrendernavprim.h" + #include "llerror.h" #include "llglheaders.h" -#include "llvertexbuffer.h" #include "llglslshader.h" +#include "llvertexbuffer.h" //============================================================================= LLRenderNavPrim gRenderNav; diff --git a/indra/llrender/llrendernavprim.h b/indra/llrender/llrendernavprim.h index eb45e259d2..a0c5e4005d 100644 --- a/indra/llrender/llrendernavprim.h +++ b/indra/llrender/llrendernavprim.h @@ -1,31 +1,31 @@ /** - * @file LLRenderNavPrim.h - * @brief - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_RENDER_NAVPRIM_H -#define LL_RENDER_NAVPRIM_H +* @file llrendernavprim.h +* @brief Header file for llrendernavprim +* @author Prep@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLRENDERNAVPRIM_H +#define LL_LLRENDERNAVPRIM_H #include "llmath.h" #include "v3math.h" @@ -56,4 +56,4 @@ private: extern LLRenderNavPrim gRenderNav; -#endif +#endif // LL_LLRENDERNAVPRIM_H diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 5245b78871..c20e78ade1 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -1,29 +1,30 @@ /** - * @file llfloaterpathfindingcharacters.cpp - * @author William Todd Stinson - * @brief "Pathfinding characters" floater, allowing for identification of pathfinding characters and their cpu usage. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llfloaterpathfindingcharacters.cpp +* @brief "Pathfinding characters" floater, allowing for identification of pathfinding characters and their cpu usage. +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index 56e08b7603..94cc39a06a 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -1,30 +1,29 @@ /** -* @file llfloaterpathfindingcharacters.h -* @author William Todd Stinson -* @brief "Pathfinding characters" floater, allowing for identification of pathfinding characters and their cpu usage. +* @file llfloaterpathfindingcharacters.h +* @brief "Pathfinding characters" floater, allowing for identification of pathfinding characters and their cpu usage. +* @author Stinson@lindenlab.com * -* $LicenseInfo:firstyear=2002&license=viewerlgpl$ +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. -* +* Copyright (C) 2012, Linden Research, Inc. +* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. -* +* * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. -* +* * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* +* * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - #ifndef LL_LLFLOATERPATHFINDINGCHARACTERS_H #define LL_LLFLOATERPATHFINDINGCHARACTERS_H diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index c2d19bfb9a..ab5775de06 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -1,32 +1,35 @@ /** * @file llfloaterpathfindingconsole.cpp -* @author William Todd Stinson -* @brief "Pathfinding console" floater, allowing manipulation of the Havok AI pathfinding settings. +* @brief "Pathfinding console" floater, allowing for viewing and testing of the pathfinding navmesh through Havok AI utilities. +* @author Stinson@lindenlab.com * -* $LicenseInfo:firstyear=2002&license=viewerlgpl$ +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. -* +* Copyright (C) 2012, Linden Research, Inc. +* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. -* +* * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. -* +* * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* +* * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + #include "llviewerprecompiledheaders.h" + #include "llfloaterpathfindingconsole.h" + #include "llfloaterpathfindinglinksets.h" #include "llfloaterpathfindingcharacters.h" diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index b0c14e5345..97300520d6 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -1,30 +1,29 @@ /** - * @file llfloaterpathfindingconsole.h - * @author William Todd Stinson - * @brief "Pathfinding console" floater, allowing manipulation of the Havok AI pathfinding settings. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +* @file llfloaterpathfindingconsole.h +* @brief "Pathfinding console" floater, allowing for viewing and testing of the pathfinding navmesh through Havok AI utilities. +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLFLOATERPATHFINDINGCONSOLE_H #define LL_LLFLOATERPATHFINDINGCONSOLE_H diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index ae814b0087..ae83bcfaee 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -1,30 +1,31 @@ /** * @file llfloaterpathfindinglinksets.cpp -* @author William Todd Stinson -* @brief "Pathfinding linksets" floater, allowing manipulation of the Havok AI pathfinding settings. +* @brief "Pathfinding linksets" floater, allowing manipulation of the linksets on the current region. +* @author Stinson@lindenlab.com * -* $LicenseInfo:firstyear=2002&license=viewerlgpl$ +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. -* +* Copyright (C) 2012, Linden Research, Inc. +* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. -* +* * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. -* +* * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* +* * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + #include "llviewerprecompiledheaders.h" #include "llfloaterpathfindinglinksets.h" diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 8e82992dbf..2db41ce479 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -1,30 +1,29 @@ /** - * @file llfloaterpathfindinglinksets.h - * @author William Todd Stinson - * @brief "Pathfinding linksets" floater, allowing manipulation of the Havok AI pathfinding settings. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +* @file llfloaterpathfindinglinksets.h +* @brief "Pathfinding linksets" floater, allowing manipulation of the linksets on the current region. +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLFLOATERPATHFINDINGLINKSETS_H #define LL_LLFLOATERPATHFINDINGLINKSETS_H diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index eb18fa00d5..da664038cf 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -1,6 +1,6 @@ /** * @file llfloaterpathfindingobjects.cpp -* @brief Implementation of llfloaterpathfindingobjects +* @brief Base class for both the pathfinding linksets and characters floater. * @author Stinson@lindenlab.com * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index 84b0f3f3fe..42db7bba65 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -1,6 +1,6 @@ /** * @file llfloaterpathfindingobjects.h -* @brief Header file for llfloaterpathfindingobjects +* @brief Base class for both the pathfinding linksets and characters floater. * @author Stinson@lindenlab.com * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp index c9f3555e9c..9dd9fa503b 100644 --- a/indra/newview/llpathfindingcharacter.cpp +++ b/indra/newview/llpathfindingcharacter.cpp @@ -1,29 +1,30 @@ /** - * @file llpathfindingcharacter.cpp - * @author William Todd Stinson - * @brief Definition of a pathfinding character that contains various properties required for havok pathfinding. - * - * $LicenseInfo:firstyear=2012&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llpathfindingcharacter.cpp +* @brief Definition of a pathfinding character that contains various properties required for havok pathfinding. +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" diff --git a/indra/newview/llpathfindingcharacter.h b/indra/newview/llpathfindingcharacter.h index 1b0a154d77..6317f5224a 100644 --- a/indra/newview/llpathfindingcharacter.h +++ b/indra/newview/llpathfindingcharacter.h @@ -1,30 +1,29 @@ /** - * @file llpathfindingcharacter.h - * @author William Todd Stinson - * @brief Definition of a pathfinding character that contains various properties required for havok pathfinding. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +* @file llpathfindingcharacter.h +* @brief Definition of a pathfinding character that contains various properties required for havok pathfinding. +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLPATHFINDINGCHARACTER_H #define LL_LLPATHFINDINGCHARACTER_H diff --git a/indra/newview/llpathfindingcharacterlist.cpp b/indra/newview/llpathfindingcharacterlist.cpp index 9b0ed14e35..12340cebfa 100644 --- a/indra/newview/llpathfindingcharacterlist.cpp +++ b/indra/newview/llpathfindingcharacterlist.cpp @@ -1,29 +1,30 @@ /** - * @file llpathfindingcharacterlist.cpp - * @author William Todd Stinson - * @brief Class to implement the list of a set of pathfinding characters - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llpathfindingcharacterlist.cpp +* @brief Implementation of llpathfindingcharacterlist +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" diff --git a/indra/newview/llpathfindingcharacterlist.h b/indra/newview/llpathfindingcharacterlist.h index 734cfcafa1..4ecf70001d 100644 --- a/indra/newview/llpathfindingcharacterlist.h +++ b/indra/newview/llpathfindingcharacterlist.h @@ -1,30 +1,29 @@ /** - * @file llpathfindingcharacterlist.h - * @author William Todd Stinson - * @brief Class to implement the list of a set of pathfinding characters - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +* @file llpathfindingcharacterlist.h +* @brief Header file for llpathfindingcharacterlist +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLPATHFINDINGCHARACTERLIST_H #define LL_LLPATHFINDINGCHARACTERLIST_H diff --git a/indra/newview/llpathfindinglinkset.cpp b/indra/newview/llpathfindinglinkset.cpp index 4cb749b3ca..fe4daabd89 100644 --- a/indra/newview/llpathfindinglinkset.cpp +++ b/indra/newview/llpathfindinglinkset.cpp @@ -1,29 +1,30 @@ /** - * @file llpathfindinglinksets.cpp - * @author William Todd Stinson - * @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llpathfindinglinkset.cpp +* @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding. +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" diff --git a/indra/newview/llpathfindinglinkset.h b/indra/newview/llpathfindinglinkset.h index 03c526560c..73b4d6bad4 100644 --- a/indra/newview/llpathfindinglinkset.h +++ b/indra/newview/llpathfindinglinkset.h @@ -1,30 +1,29 @@ /** - * @file llpathfindinglinkset.h - * @author William Todd Stinson - * @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +* @file llpathfindinglinkset.h +* @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding. +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLPATHFINDINGLINKSET_H #define LL_LLPATHFINDINGLINKSET_H diff --git a/indra/newview/llpathfindinglinksetlist.cpp b/indra/newview/llpathfindinglinksetlist.cpp index 5323635438..746fa342a1 100644 --- a/indra/newview/llpathfindinglinksetlist.cpp +++ b/indra/newview/llpathfindinglinksetlist.cpp @@ -1,29 +1,30 @@ /** - * @file llpathfindinglinksetlist.cpp - * @author William Todd Stinson - * @brief Class to implement the list of a set of pathfinding linksets - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llpathfindinglinksetlist.cpp +* @brief Implementation of llpathfindinglinksetlist +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" diff --git a/indra/newview/llpathfindinglinksetlist.h b/indra/newview/llpathfindinglinksetlist.h index 50a8e069d0..77c6358640 100644 --- a/indra/newview/llpathfindinglinksetlist.h +++ b/indra/newview/llpathfindinglinksetlist.h @@ -1,30 +1,29 @@ /** - * @file llpathfindinglinksetlist.h - * @author William Todd Stinson - * @brief Class to implement the list of a set of pathfinding linksets - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +* @file llpathfindinglinksetlist.h +* @brief Header file for llpathfindinglinksetlist +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLPATHFINDINGLINKSETLIST_H #define LL_LLPATHFINDINGLINKSETLIST_H diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index bafcf57944..019ddbfe96 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -1,29 +1,30 @@ -/** - * @file llpathfindingmanager.cpp - * @author William Todd Stinson - * @brief A state manager for the various pathfinding states. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +/** +* @file llpathfindingmanager.cpp +* @brief Implementation of llpathfindingmanager +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 9aa3065d89..65589fe3a0 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -1,30 +1,29 @@ -/** - * @file llpathfindingmanager.h - * @author William Todd Stinson - * @brief A state manager for the various pathfinding states. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +/** +* @file llpathfindingmanager.h +* @brief Header file for llpathfindingmanager +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLPATHFINDINGMANAGER_H #define LL_LLPATHFINDINGMANAGER_H diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 4e4e9fceef..1a49560712 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -1,35 +1,38 @@ -/** - * @file llpathfindingnavmesh.cpp - * @author William Todd Stinson - * @brief A class for representing the navmesh of a pathfinding region. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +/** +* @file llpathfindingnavmesh.cpp +* @brief Implementation of llpathfindingnavmesh +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" -#include "lluuid.h" + #include "llpathfindingnavmesh.h" + #include "llpathfindingnavmeshstatus.h" #include "llsdserialize.h" +#include "lluuid.h" #include @@ -198,4 +201,3 @@ void LLPathfindingNavMesh::sendStatus() { mNavMeshSignal(mNavMeshRequestStatus, mNavMeshStatus, mNavMeshData); } - diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 02b403ab75..17618d8724 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -1,30 +1,29 @@ -/** - * @file llpathfindingnavmesh.h - * @author William Todd Stinson - * @brief A class for representing the navmesh of a pathfinding region. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +/** +* @file llpathfindingnavmesh.h +* @brief Header file for llpathfindingnavmesh +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLPATHFINDINGNAVMESH_H #define LL_LLPATHFINDINGNAVMESH_H @@ -91,4 +90,3 @@ private: }; #endif // LL_LLPATHFINDINGNAVMESH_H - diff --git a/indra/newview/llpathfindingnavmeshstatus.cpp b/indra/newview/llpathfindingnavmeshstatus.cpp index 5cddb995a4..4bb0bc5a18 100644 --- a/indra/newview/llpathfindingnavmeshstatus.cpp +++ b/indra/newview/llpathfindingnavmeshstatus.cpp @@ -1,38 +1,41 @@ /** - * @file llpathfindingnavmeshstatus.cpp - * @author William Todd Stinson - * @brief A class for representing the navmesh status of a pathfinding region. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llpathfindingnavmeshstatus.cpp +* @brief Implementation of llpathfindingnavmeshstatus +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" -#include "llsd.h" -#include "lluuid.h" -#include "llstring.h" + #include "llpathfindingnavmeshstatus.h" #include +#include "llsd.h" +#include "lluuid.h" +#include "llstring.h" + #define REGION_FIELD "region_id" #define STATUS_FIELD "status" #define VERSION_FIELD "version" diff --git a/indra/newview/llpathfindingnavmeshstatus.h b/indra/newview/llpathfindingnavmeshstatus.h index 837fc43cc5..3834aa2ab8 100644 --- a/indra/newview/llpathfindingnavmeshstatus.h +++ b/indra/newview/llpathfindingnavmeshstatus.h @@ -1,30 +1,29 @@ /** - * @file llpathfindingnavmeshstatus.h - * @author William Todd Stinson - * @brief A class for representing the navmesh status of a pathfinding region. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +* @file llpathfindingnavmeshstatus.h +* @brief Header file for llpathfindingnavmeshstatus +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLPATHFINDINGNAVMESHSTATUS_H #define LL_LLPATHFINDINGNAVMESHSTATUS_H diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index ee81762792..0298eedfef 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -1,37 +1,40 @@ /** - * @file llpathfindingnavmeshzone.cpp - * @author William Todd Stinson - * @brief A class for representing the zone of navmeshes containing and possible surrounding the current region. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llpathfindingnavmeshzone.cpp +* @brief Implementation of llpathfindingnavmeshzone +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" + +#include "llpathfindingnavmeshzone.h" + #include "llsd.h" #include "lluuid.h" #include "llagent.h" #include "llviewerregion.h" #include "llpathfindingnavmesh.h" -#include "llpathfindingnavmeshzone.h" #include "llpathfindingmanager.h" #include "llviewercontrol.h" diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index d4e7a717b2..0229de50ec 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -1,30 +1,29 @@ -/** - * @file llpathfindingnavmeshzone.h - * @author William Todd Stinson - * @brief A class for representing the zone of navmeshes containing and possible surrounding the current region. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +/** +* @file llpathfindingnavmeshzone.h +* @brief Header file for llpathfindingnavmeshzone +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLPATHFINDINGNAVMESHZONE_H #define LL_LLPATHFINDINGNAVMESHZONE_H @@ -128,4 +127,3 @@ private: }; #endif // LL_LLPATHFINDINGNAVMESHZONE_H - diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index 6cf90addab..ac4a2fffb9 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -1,31 +1,33 @@ /** - * @file llpathfindingpathtool.cpp - * @author William Todd Stinson - * @brief XXX - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llpathfindingpathtool.cpp +* @brief Implementation of llpathfindingpathtool +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + #include "llviewerprecompiledheaders.h" + #include "llpathfindingpathtool.h" #include "llagent.h" diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h index 8a79da43c9..e0db87d1ed 100644 --- a/indra/newview/llpathfindingpathtool.h +++ b/indra/newview/llpathfindingpathtool.h @@ -1,30 +1,29 @@ /** - * @file llpathfindingpathtool.h - * @author William Todd Stinson - * @brief XXX - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - +* @file llpathfindingpathtool.h +* @brief Header file for llpathfindingpathtool +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #ifndef LL_LLPATHFINDINGPATHTOOL_H #define LL_LLPATHFINDINGPATHTOOL_H -- cgit v1.3 From 685a672b74550ca0dbf8a816257c84c9c44fd34d Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 28 Jun 2012 15:37:55 -0700 Subject: Cleaning up new files in preparation for merge into viewer-release. --- indra/newview/llfloaterpathfindingcharacters.cpp | 4 ++ indra/newview/llfloaterpathfindingcharacters.h | 6 ++- indra/newview/llfloaterpathfindingconsole.cpp | 51 ++++++++++++---------- indra/newview/llfloaterpathfindingconsole.h | 23 +++++----- indra/newview/llfloaterpathfindinglinksets.cpp | 4 ++ indra/newview/llfloaterpathfindinglinksets.h | 49 +++++++++++---------- indra/newview/llfloaterpathfindingobjects.cpp | 2 - indra/newview/llfloaterpathfindingobjects.h | 1 + indra/newview/llpanelpathfindingrebakenavmesh.cpp | 5 +-- indra/newview/llpanelpathfindingrebakenavmesh.h | 3 -- indra/newview/llpathfindingcharacter.cpp | 2 + indra/newview/llpathfindingcharacter.h | 4 +- indra/newview/llpathfindingmanager.cpp | 47 ++++++++++++-------- indra/newview/llpathfindingmanager.h | 10 ++--- indra/newview/llpathfindingnavmesh.cpp | 6 ++- indra/newview/llpathfindingnavmesh.h | 5 +-- indra/newview/llpathfindingnavmeshstatus.cpp | 2 +- indra/newview/llpathfindingnavmeshstatus.h | 4 +- indra/newview/llpathfindingnavmeshzone.cpp | 25 ++++++----- indra/newview/llpathfindingnavmeshzone.h | 13 +++--- indra/newview/llpathfindingobject.cpp | 2 +- indra/newview/llpathfindingobject.h | 8 ++-- indra/newview/llpathfindingobjectlist.h | 1 - indra/newview/llpathfindingpathtool.cpp | 10 ++--- indra/newview/llpathfindingpathtool.h | 8 ++-- .../xui/en/floater_pathfinding_characters.xml | 16 +++---- .../skins/default/xui/en/panel_navmesh_rebake.xml | 1 - 27 files changed, 167 insertions(+), 145 deletions(-) (limited to 'indra/newview/llpathfindingnavmesh.cpp') diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index c20e78ade1..739e56a7c3 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -40,11 +40,15 @@ #include "llpathfindingobject.h" #include "llpathfindingobjectlist.h" #include "llpathinglib.h" +#include "llquaternion.h" #include "llsd.h" #include "lluicolortable.h" +#include "lluuid.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "pipeline.h" +#include "v3math.h" +#include "v4color.h" LLHandle LLFloaterPathfindingCharacters::sInstanceHandle; diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index 94cc39a06a..ef389ad428 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -30,10 +30,14 @@ #include "llfloaterpathfindingobjects.h" #include "llhandle.h" #include "llpathfindingobjectlist.h" +#include "lluuid.h" #include "v4color.h" +class LLCheckBoxCtrl; class LLPathfindingCharacter; +class LLQuaternion; class LLSD; +class LLVector3; class LLFloaterPathfindingCharacters : public LLFloaterPathfindingObjects { @@ -43,7 +47,7 @@ public: BOOL isShowPhysicsCapsule() const; void setShowPhysicsCapsule(BOOL pIsShowPhysicsCapsule); - BOOL isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot ) const; + BOOL isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot) const; static void openCharactersWithSelectedObjects(); static LLHandle getInstanceHandle(); diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 0bd5dc0263..2fe60a8d8f 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -30,30 +30,31 @@ #include "llfloaterpathfindingconsole.h" -#include "llfloaterpathfindinglinksets.h" -#include "llfloaterpathfindingcharacters.h" +#include + +#include -#include "llsd.h" -#include "llhandle.h" -#include "llcontrol.h" -#include "llpanel.h" #include "llbutton.h" #include "llcheckboxctrl.h" -#include "llsliderctrl.h" -#include "lllineeditor.h" -#include "lltextbase.h" -#include "lltabcontainer.h" #include "llcombobox.h" +#include "llcontrol.h" +#include "llenvmanager.h" +#include "llfloaterpathfindingcharacters.h" +#include "llfloaterpathfindinglinksets.h" #include "llfloaterreg.h" +#include "llhandle.h" +#include "llpanel.h" #include "llpathfindingnavmeshzone.h" -#include "llpathfindingmanager.h" -#include "llenvmanager.h" #include "llpathfindingpathtool.h" +#include "llpathinglib.h" +#include "llsliderctrl.h" +#include "llsd.h" +#include "lltabcontainer.h" +#include "lltextbase.h" #include "lltoolmgr.h" #include "lltoolfocus.h" -#include "pipeline.h" -#include "llpathinglib.h" #include "llviewerparcelmgr.h" +#include "pipeline.h" #define XUI_RENDER_HEATMAP_NONE 0 #define XUI_RENDER_HEATMAP_A 1 @@ -89,8 +90,6 @@ LLHandle LLFloaterPathfindingConsole::sInstanceHandle; -extern LLPipeline gPipeline; - //--------------------------------------------------------------------------- // LLFloaterPathfindingConsole //--------------------------------------------------------------------------- @@ -213,7 +212,7 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) { if (!mNavMeshZoneSlot.connected()) { - mNavMeshZoneSlot = mNavMeshZone.registerNavMeshZoneListener(boost::bind(&LLFloaterPathfindingConsole::onNavMeshZoneCB, this, _1)); + mNavMeshZoneSlot = mNavMeshZone.registerNavMeshZoneListener(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshZoneStatus, this, _1)); } mIsNavMeshUpdating = false; @@ -500,9 +499,10 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mSavedSettingNavMeshFaceSlot(), mSavedSettingTestPathValidEndSlot(), mSavedSettingTestPathInvalidEndSlot(), - mSavedSettingWaterSlot(), mSavedSettingTestPathSlot(), - mConsoleState(kConsoleStateUnknown) + mSavedSettingWaterSlot(), + mConsoleState(kConsoleStateUnknown), + mRenderableRestoreList() { mSelfHandle.bind(this); } @@ -541,7 +541,10 @@ void LLFloaterPathfindingConsole::onShowNavMeshSet() void LLFloaterPathfindingConsole::onShowWalkabilitySet() { - LLPathingLib::getInstance()->setNavMeshMaterialType(getRenderHeatmapType()); + if (LLPathingLib::getInstance() != NULL) + { + LLPathingLib::getInstance()->setNavMeshMaterialType(getRenderHeatmapType()); + } } void LLFloaterPathfindingConsole::onCharacterWidthSet() @@ -559,7 +562,7 @@ void LLFloaterPathfindingConsole::onClearPathClicked() clearPath(); } -void LLFloaterPathfindingConsole::onNavMeshZoneCB(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus) +void LLFloaterPathfindingConsole::handleNavMeshZoneStatus(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus) { switch (pNavMeshZoneRequestStatus) { @@ -641,6 +644,7 @@ void LLFloaterPathfindingConsole::setDefaultInputs() { mViewTestTabContainer->selectTab(XUI_VIEW_TAB_INDEX); setRenderWorld(TRUE); + setRenderWorldMovablesOnly(FALSE); setRenderNavMesh(FALSE); setRenderWalkables(FALSE); setRenderMaterialVolumes(FALSE); @@ -648,7 +652,6 @@ void LLFloaterPathfindingConsole::setDefaultInputs() setRenderExclusionVolumes(FALSE); setRenderWaterPlane(FALSE); setRenderXRay(FALSE); - setRenderWorldMovablesOnly(FALSE); } void LLFloaterPathfindingConsole::setConsoleState(EConsoleState pConsoleState) @@ -1205,6 +1208,10 @@ void LLFloaterPathfindingConsole::deregisterSavedSettingsListeners() { mSavedSettingTestPathSlot.disconnect(); } + if (mSavedSettingWaterSlot.connected()) + { + mSavedSettingWaterSlot.disconnect(); + } } void LLFloaterPathfindingConsole::handleRetrieveNeighborChange(LLControlVariable *pControl, const LLSD &pNewValue) diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index 97300520d6..4b2f7672e4 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -27,26 +27,27 @@ #ifndef LL_LLFLOATERPATHFINDINGCONSOLE_H #define LL_LLFLOATERPATHFINDINGCONSOLE_H +#include + +#include + #include "llfloater.h" #include "llhandle.h" -#include "llpathinglib.h" #include "llpathfindingnavmeshzone.h" #include "llpathfindingpathtool.h" +#include "llpathinglib.h" #include "v4color.h" -#include - -class LLSD; +class LLButton; +class LLCheckBoxCtrl; +class LLComboBox; +class LLControlVariable; class LLPanel; +class LLSD; class LLSliderCtrl; -class LLLineEditor; -class LLTextBase; -class LLCheckBoxCtrl; class LLTabContainer; -class LLComboBox; -class LLButton; +class LLTextBase; class LLToolset; -class LLControlVariable; class LLFloaterPathfindingConsole : public LLFloater @@ -122,7 +123,7 @@ private: void onCharacterTypeSwitch(); void onClearPathClicked(); - void onNavMeshZoneCB(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus); + void handleNavMeshZoneStatus(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus); void onRegionBoundaryCross(); void onPathEvent(); diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index ae83bcfaee..15490ff87e 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -30,11 +30,14 @@ #include "llfloaterpathfindinglinksets.h" +#include + #include #include "llagent.h" #include "llbutton.h" #include "llcombobox.h" +#include "llfloaterpathfindingobjects.h" #include "llfloaterreg.h" #include "lllineeditor.h" #include "llnotificationsutil.h" @@ -46,6 +49,7 @@ #include "lltextbase.h" #include "lltextvalidate.h" #include "lluicolortable.h" +#include "lluictrl.h" #include "v3math.h" #include "v4color.h" diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 2db41ce479..b3e7acfbfe 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -27,9 +27,10 @@ #ifndef LL_LLFLOATERPATHFINDINGLINKSETS_H #define LL_LLFLOATERPATHFINDINGLINKSETS_H +#include + #include "llfloaterpathfindingobjects.h" #include "llpathfindinglinkset.h" -#include "llpathfindingmanager.h" #include "llpathfindingobjectlist.h" #include "v4color.h" @@ -102,29 +103,29 @@ private: LLPathfindingLinkset::ELinksetUse convertToLinksetUse(LLSD pXuiValue) const; LLSD convertToXuiValue(LLPathfindingLinkset::ELinksetUse pLinksetUse) const; - LLLineEditor *mFilterByName; - LLLineEditor *mFilterByDescription; - LLComboBox *mFilterByLinksetUse; - LLComboBox *mEditLinksetUse; - LLScrollListItem *mEditLinksetUseUnset; - LLScrollListItem *mEditLinksetUseWalkable; - LLScrollListItem *mEditLinksetUseStaticObstacle; - LLScrollListItem *mEditLinksetUseDynamicObstacle; - LLScrollListItem *mEditLinksetUseMaterialVolume; - LLScrollListItem *mEditLinksetUseExclusionVolume; - LLScrollListItem *mEditLinksetUseDynamicPhantom; - LLTextBase *mLabelWalkabilityCoefficients; - LLTextBase *mLabelEditA; - LLLineEditor *mEditA; - LLTextBase *mLabelEditB; - LLLineEditor *mEditB; - LLTextBase *mLabelEditC; - LLLineEditor *mEditC; - LLTextBase *mLabelEditD; - LLLineEditor *mEditD; - LLButton *mApplyEditsButton; - - LLColor4 mBeaconColor; + LLLineEditor *mFilterByName; + LLLineEditor *mFilterByDescription; + LLComboBox *mFilterByLinksetUse; + LLComboBox *mEditLinksetUse; + LLScrollListItem *mEditLinksetUseUnset; + LLScrollListItem *mEditLinksetUseWalkable; + LLScrollListItem *mEditLinksetUseStaticObstacle; + LLScrollListItem *mEditLinksetUseDynamicObstacle; + LLScrollListItem *mEditLinksetUseMaterialVolume; + LLScrollListItem *mEditLinksetUseExclusionVolume; + LLScrollListItem *mEditLinksetUseDynamicPhantom; + LLTextBase *mLabelWalkabilityCoefficients; + LLTextBase *mLabelEditA; + LLLineEditor *mEditA; + LLTextBase *mLabelEditB; + LLLineEditor *mEditB; + LLTextBase *mLabelEditC; + LLLineEditor *mEditC; + LLTextBase *mLabelEditD; + LLLineEditor *mEditD; + LLButton *mApplyEditsButton; + + LLColor4 mBeaconColor; }; #endif // LL_LLFLOATERPATHFINDINGLINKSETS_H diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index da664038cf..847997836b 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -57,7 +57,6 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "pipeline.h" #include "v3dmath.h" #include "v3math.h" #include "v4color.h" @@ -835,4 +834,3 @@ LLPathfindingObjectPtr LLFloaterPathfindingObjects::findObject(const LLScrollLis return objectPtr; } - diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index 42db7bba65..e8d446b598 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -28,6 +28,7 @@ #define LL_LLFLOATERPATHFINDINGOBJECTS_H #include + #include #include "llagent.h" diff --git a/indra/newview/llpanelpathfindingrebakenavmesh.cpp b/indra/newview/llpanelpathfindingrebakenavmesh.cpp index f423b5891f..2c8c46c7bc 100644 --- a/indra/newview/llpanelpathfindingrebakenavmesh.cpp +++ b/indra/newview/llpanelpathfindingrebakenavmesh.cpp @@ -36,7 +36,6 @@ #include "llagent.h" #include "llbutton.h" #include "llenvmanager.h" -#include "llhandle.h" #include "llhints.h" #include "llnotificationsutil.h" #include "llpanel.h" @@ -45,9 +44,7 @@ #include "llpathfindingnavmeshstatus.h" #include "lltoolbar.h" #include "lltoolbarview.h" -#include "lltoolmgr.h" #include "lltooltip.h" -#include "llview.h" #include "llviewercontrol.h" #include "llviewerregion.h" @@ -218,6 +215,7 @@ void LLPanelPathfindingRebakeNavmesh::handleNavMeshStatus(const LLPathfindingNav void LLPanelPathfindingRebakeNavmesh::handleRegionBoundaryCrossed() { createNavMeshStatusListenerForCurrentRegion(); + mCanRebakeRegion = FALSE; LLPathfindingManager::getInstance()->requestGetAgentState(); } @@ -227,7 +225,6 @@ void LLPanelPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrentRegio { mNavMeshSlot.disconnect(); } - mCanRebakeRegion = FALSE; LLViewerRegion *currentRegion = gAgent.getRegion(); if (currentRegion != NULL) diff --git a/indra/newview/llpanelpathfindingrebakenavmesh.h b/indra/newview/llpanelpathfindingrebakenavmesh.h index a77cddbc50..5fe581ec2f 100644 --- a/indra/newview/llpanelpathfindingrebakenavmesh.h +++ b/indra/newview/llpanelpathfindingrebakenavmesh.h @@ -27,17 +27,14 @@ #ifndef LL_LLPANELPATHFINDINGREBAKENAVMESH_H #define LL_LLPANELPATHFINDINGREBAKENAVMESH_H -#include #include -#include "llhandle.h" #include "llpanel.h" #include "llpathfindingmanager.h" #include "llpathfindingnavmesh.h" class LLButton; class LLPathfindingNavMeshStatus; -class LLView; class LLPanelPathfindingRebakeNavmesh : public LLPanel { diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp index 9dd9fa503b..00f2ebc4bb 100644 --- a/indra/newview/llpathfindingcharacter.cpp +++ b/indra/newview/llpathfindingcharacter.cpp @@ -30,6 +30,8 @@ #include "llpathfindingcharacter.h" +#include + #include "llpathfindingobject.h" #include "llsd.h" diff --git a/indra/newview/llpathfindingcharacter.h b/indra/newview/llpathfindingcharacter.h index 6317f5224a..7cf9f401b0 100644 --- a/indra/newview/llpathfindingcharacter.h +++ b/indra/newview/llpathfindingcharacter.h @@ -27,6 +27,8 @@ #ifndef LL_LLPATHFINDINGCHARACTER_H #define LL_LLPATHFINDINGCHARACTER_H +#include + #include "llpathfindingobject.h" class LLSD; @@ -48,8 +50,6 @@ public: protected: -public: - private: void parseCharacterData(const LLSD &pCharacterData); diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 90199a9cae..2dd01e931e 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -33,7 +33,9 @@ #include #include +#include #include +#include #include #include "llagent.h" @@ -53,7 +55,6 @@ #include "lluuid.h" #include "llviewerregion.h" #include "llweb.h" -#include "llenvmanager.h" #define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" @@ -366,12 +367,6 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, b } } -LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) -{ - return mAgentStateSignal.connect(pAgentStateCallback); -} - - void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const { LLPathfindingObjectListPtr emptyLinksetListPtr; @@ -495,6 +490,11 @@ void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_ } } +LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) +{ + return mAgentStateSignal.connect(pAgentStateCallback); +} + void LLPathfindingManager::requestGetAgentState() { LLViewerRegion *currentRegion = getCurrentRegion(); @@ -525,14 +525,24 @@ void LLPathfindingManager::requestGetAgentState() void LLPathfindingManager::requestRebakeNavMesh(rebake_navmesh_callback_t pRebakeNavMeshCallback) { - std::string navMeshStatusURL = getNavMeshStatusURLForCurrentRegion(); - llassert(!navMeshStatusURL.empty()) - if (!navMeshStatusURL.empty()) + LLViewerRegion *currentRegion = getCurrentRegion(); + + if (currentRegion == NULL) + { + pRebakeNavMeshCallback(false); + } + else if (!isPathfindingEnabledForRegion(currentRegion)) { - LLSD mPostData; - mPostData["command"] = "rebuild"; + pRebakeNavMeshCallback(false); + } + else + { + std::string navMeshStatusURL = getNavMeshStatusURLForCurrentRegion(); + llassert(!navMeshStatusURL.empty()); + LLSD postData; + postData["command"] = "rebuild"; LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(navMeshStatusURL, pRebakeNavMeshCallback); - LLHTTPClient::post(navMeshStatusURL, mPostData, responder); + LLHTTPClient::post(navMeshStatusURL, postData, responder); } } @@ -673,11 +683,6 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion return getNavMeshForRegion(regionUUID); } -std::string LLPathfindingManager::getAgentStateURLForRegion(LLViewerRegion *pRegion) const -{ - return getCapabilityURLForRegion(pRegion, CAP_SERVICE_AGENT_STATE); -} - std::string LLPathfindingManager::getNavMeshStatusURLForCurrentRegion() const { return getNavMeshStatusURLForRegion(getCurrentRegion()); @@ -708,6 +713,11 @@ std::string LLPathfindingManager::getCharactersURLForCurrentRegion() const return getCapabilityURLForCurrentRegion(CAP_SERVICE_CHARACTERS); } +std::string LLPathfindingManager::getAgentStateURLForRegion(LLViewerRegion *pRegion) const +{ + return getCapabilityURLForRegion(pRegion, CAP_SERVICE_AGENT_STATE); +} + std::string LLPathfindingManager::getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const { return getCapabilityURLForRegion(getCurrentRegion(), pCapabilityName); @@ -1037,4 +1047,3 @@ void CharactersResponder::error(U32 pStatus, const std::string &pReason) LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList()); mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr); } - diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 65589fe3a0..c61ff244fc 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -37,12 +37,10 @@ #include "llpathfindingobjectlist.h" #include "llpathfindingnavmesh.h" #include "llsingleton.h" -#include "lluuid.h" -#include "llpanel.h" -#include "llmoveview.h" -class LLViewerRegion; class LLPathfindingNavMeshStatus; +class LLUUID; +class LLViewerRegion; class LLPathfindingManager : public LLSingleton { @@ -51,8 +49,6 @@ class LLPathfindingManager : public LLSingleton friend class LLAgentStateChangeNode; friend class AgentStateResponder; public: - typedef std::map NavMeshMap; - typedef enum { kRequestStarted, kRequestCompleted, @@ -96,6 +92,8 @@ public: protected: private: + typedef std::map NavMeshMap; + void sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus); void handleDeferredGetAgentStateForRegion(const LLUUID &pRegionUUID); diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 1a49560712..e01dd3a152 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -30,12 +30,13 @@ #include "llpathfindingnavmesh.h" +#include + #include "llpathfindingnavmeshstatus.h" +#include "llsd.h" #include "llsdserialize.h" #include "lluuid.h" -#include - #define NAVMESH_VERSION_FIELD "navmesh_version" #define NAVMESH_DATA_FIELD "navmesh_data" @@ -119,6 +120,7 @@ void LLPathfindingNavMesh::handleNavMeshStart(const LLPathfindingNavMeshStatus & void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion) { + llassert(pContent.has(NAVMESH_VERSION_FIELD)); if (pContent.has(NAVMESH_VERSION_FIELD)) { llassert(pContent.get(NAVMESH_VERSION_FIELD).isInteger()); diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 17618d8724..7a844f54ce 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -27,8 +27,6 @@ #ifndef LL_LLPATHFINDINGNAVMESH_H #define LL_LLPATHFINDINGNAVMESH_H -#include "llsd.h" - #include #include @@ -36,9 +34,10 @@ #include #include "llpathfindingnavmeshstatus.h" +#include "llsd.h" -class LLUUID; class LLPathfindingNavMesh; +class LLUUID; typedef boost::shared_ptr LLPathfindingNavMeshPtr; diff --git a/indra/newview/llpathfindingnavmeshstatus.cpp b/indra/newview/llpathfindingnavmeshstatus.cpp index 4bb0bc5a18..2eaa6075ca 100644 --- a/indra/newview/llpathfindingnavmeshstatus.cpp +++ b/indra/newview/llpathfindingnavmeshstatus.cpp @@ -33,8 +33,8 @@ #include #include "llsd.h" -#include "lluuid.h" #include "llstring.h" +#include "lluuid.h" #define REGION_FIELD "region_id" #define STATUS_FIELD "status" diff --git a/indra/newview/llpathfindingnavmeshstatus.h b/indra/newview/llpathfindingnavmeshstatus.h index 3834aa2ab8..74533fa484 100644 --- a/indra/newview/llpathfindingnavmeshstatus.h +++ b/indra/newview/llpathfindingnavmeshstatus.h @@ -27,10 +27,10 @@ #ifndef LL_LLPATHFINDINGNAVMESHSTATUS_H #define LL_LLPATHFINDINGNAVMESHSTATUS_H -#include "lluuid.h" - #include +#include "lluuid.h" + class LLSD; class LLPathfindingNavMeshStatus diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index 0298eedfef..e190dbba65 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -30,20 +30,22 @@ #include "llpathfindingnavmeshzone.h" -#include "llsd.h" -#include "lluuid.h" -#include "llagent.h" -#include "llviewerregion.h" -#include "llpathfindingnavmesh.h" -#include "llpathfindingmanager.h" -#include "llviewercontrol.h" - -#include "llpathinglib.h" - -#include #include #include +#include +#include +#include + +#include "llagent.h" +#include "llpathfindingmanager.h" +#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" +#include "llpathinglib.h" +#include "llsd.h" +#include "lluuid.h" +#include "llviewercontrol.h" +#include "llviewerregion.h" #define CENTER_REGION 99 @@ -104,7 +106,6 @@ void LLPathfindingNavMeshZone::disable() void LLPathfindingNavMeshZone::refresh() { - llassert(LLPathingLib::getInstance() != NULL); if (LLPathingLib::getInstance() != NULL) { LLPathingLib::getInstance()->cleanupResidual(); diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index 0229de50ec..baa1cc5979 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -27,19 +27,18 @@ #ifndef LL_LLPATHFINDINGNAVMESHZONE_H #define LL_LLPATHFINDINGNAVMESHZONE_H -#include "llsd.h" -#include "lluuid.h" -#include "llpathfindingnavmesh.h" -#include "llpathfindingnavmeshstatus.h" -#include "llviewerregion.h" - #include #include #include #include -class LLPathfindingNavMeshStatus; +#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" +#include "llsd.h" +#include "lluuid.h" + +class LLViewerRegion; class LLPathfindingNavMeshZone { diff --git a/indra/newview/llpathfindingobject.cpp b/indra/newview/llpathfindingobject.cpp index 65fcedf2f5..f5c0f7874d 100644 --- a/indra/newview/llpathfindingobject.cpp +++ b/indra/newview/llpathfindingobject.cpp @@ -32,11 +32,11 @@ #include -#include "v3math.h" #include "llavatarname.h" #include "llavatarnamecache.h" #include "llsd.h" #include "lluuid.h" +#include "v3math.h" #define PATHFINDING_OBJECT_NAME_FIELD "name" #define PATHFINDING_OBJECT_DESCRIPTION_FIELD "description" diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index 924ea3f298..4b2d546bb1 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -27,14 +27,14 @@ #ifndef LL_LLPATHFINDINGOBJECT_H #define LL_LLPATHFINDINGOBJECT_H -#include "llavatarname.h" -#include "lluuid.h" -#include "v3math.h" - #include #include +#include "llavatarname.h" +#include "lluuid.h" +#include "v3math.h" + class LLPathfindingObject; class LLSD; diff --git a/indra/newview/llpathfindingobjectlist.h b/indra/newview/llpathfindingobjectlist.h index 94c53f3aba..3ad8e8b096 100644 --- a/indra/newview/llpathfindingobjectlist.h +++ b/indra/newview/llpathfindingobjectlist.h @@ -34,7 +34,6 @@ #include "llpathfindingobject.h" -class LLSD; class LLPathfindingObjectList; typedef boost::shared_ptr LLPathfindingObjectListPtr; diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index ac4a2fffb9..006755e20b 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -30,17 +30,17 @@ #include "llpathfindingpathtool.h" +#include +#include + #include "llagent.h" +#include "llpathfindingmanager.h" +#include "llpathinglib.h" #include "llsingleton.h" #include "lltool.h" #include "llviewercamera.h" #include "llviewerregion.h" #include "llviewerwindow.h" -#include "llpathfindingmanager.h" -#include "llpathinglib.h" - -#include -#include #define PATH_TOOL_NAME "PathfindingPathTool" diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h index e0db87d1ed..97284265f1 100644 --- a/indra/newview/llpathfindingpathtool.h +++ b/indra/newview/llpathfindingpathtool.h @@ -27,13 +27,13 @@ #ifndef LL_LLPATHFINDINGPATHTOOL_H #define LL_LLPATHFINDINGPATHTOOL_H -#include "llsingleton.h" -#include "lltool.h" -#include "llpathinglib.h" - #include #include +#include "llpathinglib.h" +#include "llsingleton.h" +#include "lltool.h" + class LLPathfindingPathTool : public LLTool, public LLSingleton { public: diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml index c1f1f60c1b..4331e1f340 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml @@ -150,14 +150,14 @@ left_pad="0" width="150" /> + height="19" + follows="left|bottom" + label="Show physics capsule" + layout="topleft" + name="show_physics_capsule" + top_pad="-19" + left_pad="0" + width="150" />