360 photo and Area Search Improvements

Ensure that full update interest list is re-established for the current region after a TP
Ensure that it works properly with both 360 and Area Search overlapping
Make the Developer menu full update toggle show current state and allow it to reset to 0/default when floaters are in use as an override.
meow-7.2.2
Beq 2023-07-19 13:53:55 +01:00
parent 4ec632eebb
commit c911de1e8a
8 changed files with 267 additions and 90 deletions

View File

@ -174,6 +174,11 @@ FSAreaSearch::FSAreaSearch(const LLSD& key) :
mRlvBehaviorCallbackConnection()
{
LLViewerRegion::sFSAreaSearchActive = true;
if( LLViewerRegion* region = gAgent.getRegion() )
{
checkRegion();
}
mFactoryMap["area_search_list_panel"] = LLCallbackMap(createPanelList, this);
mFactoryMap["area_search_find_panel"] = LLCallbackMap(createPanelFind, this);
mFactoryMap["area_search_filter_panel"] = LLCallbackMap(createPanelFilter, this);
@ -185,11 +190,24 @@ FSAreaSearch::FSAreaSearch(const LLSD& key) :
mParcelChangedObserver = std::make_unique<FSParcelChangeObserver>(this);
LLViewerParcelMgr::getInstance()->addObserver(mParcelChangedObserver.get());
mRegionChangeConnection = gAgent.addRegionChangedCallback(boost::bind(&FSAreaSearch::checkRegion, this));
}
FSAreaSearch::~FSAreaSearch()
{
LLViewerRegion::sFSAreaSearchActive = false;
// Tell the Simulator not to send us everything anymore
// and revert to the regular "keyhole" frustum of interest
// list updates.
if( !LLApp::isExiting() )
{
if( LLViewerRegion* region = gAgent.getRegion() )
{
region->useFullUpdateInterestListMode(false);
}
}
if (!gIdleCallbacks.deleteFunction(idle, this))
{
LL_WARNS("FSAreaSearch") << "FSAreaSearch::~FSAreaSearch() failed to delete callback" << LL_ENDL;
@ -214,6 +232,11 @@ FSAreaSearch::~FSAreaSearch()
LLViewerParcelMgr::getInstance()->removeObserver(mParcelChangedObserver.get());
mParcelChangedObserver = nullptr;
}
if (mRegionChangeConnection.connected())
{
mRegionChangeConnection.disconnect();
}
}
BOOL FSAreaSearch::postBuild()
@ -320,24 +343,27 @@ void FSAreaSearch::updateRlvRestrictions(ERlvBehaviour behavior)
void FSAreaSearch::checkRegion()
{
if (mActive)
{
// Check if we changed region, and if we did, clear the object details cache.
if (LLViewerRegion* region = gAgent.getRegion(); region && (region != mLastRegion))
static LLViewerRegion *last_region = nullptr;
// Check if we changed region, if so reset the interest list to full,
LLViewerRegion* region = gAgent.getRegion();
if( region && (region != last_region) )
{
region->useFullUpdateInterestListMode(true, true); // we force this because we want a true count
if ( mActive )
{
if (!mExcludeNeighborRegions)
// and if we did and are active, clear the object details cache.
if( !mExcludeNeighborRegions )
{
std::vector<LLViewerRegion*> uniqueRegions;
region->getNeighboringRegions(uniqueRegions);
if (std::find(uniqueRegions.begin(), uniqueRegions.end(), mLastRegion) != uniqueRegions.end())
if( std::find( uniqueRegions.begin(), uniqueRegions.end(), last_region ) != uniqueRegions.end() )
{
// Crossed into a neighboring region, no need to clear everything.
mLastRegion = region;
last_region = region;
return;
}
// else teleported into a new region
}
mLastRegion = region;
mRequested = 0;
mObjectDetails.clear();
mRegionRequests.clear();
@ -347,7 +373,14 @@ void FSAreaSearch::checkRegion()
mPanelList->setAgentLastPosition(gAgent.getPositionGlobal());
mRefresh = true;
}
if( last_region )
{
// we clear the old region status, because the instance may persist for us
// but the region itself will have reset when we left.
last_region->clearFullUpdateInterestList();
}
}
last_region = region;
}
void FSAreaSearch::refreshList(bool cache_clear)

View File

@ -213,7 +213,8 @@ private:
typedef std::map<LLUUID, boost::signals2::connection> name_cache_connection_map_t;
name_cache_connection_map_t mNameCacheConnections;
LLViewerRegion* mLastRegion;
boost::signals2::connection mRegionChangeConnection; // reset interest list verbosity after TP
class FSParcelChangeObserver;
friend class FSParcelChangeObserver;

View File

@ -51,6 +51,27 @@
#include <iterator>
// <FS:Beq> Fix 360 capture missing objects after TP
void LLFloater360Capture::checkRegion()
{
static LLViewerRegion *last_region = nullptr;
// Check if we changed region, if so reset the interest list to full,
LLViewerRegion* region = gAgent.getRegion();
if( region && (region != last_region) )
{
region->useFullUpdateInterestListMode(true, true);
if( last_region )
{
// we clear the old region status, because the instance may persist for us
// but the region itself will have reset when we left.
last_region->clearFullUpdateInterestList();
}
}
last_region = region;
}
// </FS:Beq>
LLFloater360Capture::LLFloater360Capture(const LLSD& key)
: LLFloater(key)
{
@ -66,10 +87,19 @@ LLFloater360Capture::LLFloater360Capture(const LLSD& key)
// will take care of cleaning up for us.
if (gSavedSettings.getBOOL("360CaptureUseInterestListCap"))
{
// <FS:Beq> Fix 360 capture missing objects after TP
// send everything to us for as long as this floater is open
const bool send_everything = true;
changeInterestListMode(send_everything);
// const bool send_everything = true;
// changeInterestListMode(send_everything);
// }
// }
if( LLViewerRegion* region = gAgent.getRegion() )
{
checkRegion();
}
}
mRegionChangeConnection = gAgent.addRegionChangedCallback(boost::bind(&LLFloater360Capture::checkRegion, this));
// </FS:Beq>
}
LLFloater360Capture::~LLFloater360Capture()
@ -86,9 +116,22 @@ LLFloater360Capture::~LLFloater360Capture()
// list updates.
if (!LLApp::isExiting() && gSavedSettings.getBOOL("360CaptureUseInterestListCap"))
{
const bool send_everything = false;
changeInterestListMode(send_everything);
// <FS:Beq> Fix 360 capture missing objects after TP
// const bool send_everything = false;
// changeInterestListMode(send_everything);
// }
// }
if( LLViewerRegion* region = gAgent.getRegion() )
{
region->useFullUpdateInterestListMode(false);
}
}
if (mRegionChangeConnection.connected())
{
mRegionChangeConnection.disconnect();
}
// </FS:Beq>
}
BOOL LLFloater360Capture::postBuild()
@ -171,6 +214,8 @@ void LLFloater360Capture::onChooseQualityRadioGroup()
setSourceImageSize();
}
// <FS:Beq> Area search improvements - allow area search and 360 to coexist nicely.
// Code moved to LLViewerRegion.cpp
// Using a new capability, tell the simulator that we want it to send everything
// it knows about and not just what is in front of the camera, in its view
// frustum. We need this feature so that the contents of the region that appears
@ -183,40 +228,40 @@ void LLFloater360Capture::onChooseQualityRadioGroup()
// (hopefully) small period of time while the full contents resolves.
// Pass in a flag to ask the simulator/interest list to "send everything" or
// not (the default mode)
void LLFloater360Capture::changeInterestListMode(bool send_everything)
{
LLSD body;
// void LLFloater360Capture::changeInterestListMode(bool send_everything)
// {
// LLSD body;
// if (send_everything)
// {
// body["mode"] = LLSD::String("360");
// }
// else
// {
// body["mode"] = LLSD::String("default");
// }
if (send_everything)
{
body["mode"] = LLSD::String("360");
}
else
{
body["mode"] = LLSD::String("default");
}
if (gAgent.requestPostCapability("InterestList", body, [](const LLSD & response)
{
LL_INFOS("360Capture") <<
"InterestList capability responded: \n" <<
ll_pretty_print_sd(response) <<
LL_ENDL;
}))
{
LL_INFOS("360Capture") <<
"Successfully posted an InterestList capability request with payload: \n" <<
ll_pretty_print_sd(body) <<
LL_ENDL;
}
else
{
LL_INFOS("360Capture") <<
"Unable to post an InterestList capability request with payload: \n" <<
ll_pretty_print_sd(body) <<
LL_ENDL;
}
}
// if (gAgent.requestPostCapability("InterestList", body, [](const LLSD & response)
// {
// LL_INFOS("360Capture") <<
// "InterestList capability responded: \n" <<
// ll_pretty_print_sd(response) <<
// LL_ENDL;
// }))
// {
// LL_INFOS("360Capture") <<
// "Successfully posted an InterestList capability request with payload: \n" <<
// ll_pretty_print_sd(body) <<
// LL_ENDL;
// }
// else
// {
// LL_INFOS("360Capture") <<
// "Unable to post an InterestList capability request with payload: \n" <<
// ll_pretty_print_sd(body) <<
// LL_ENDL;
// }
// }
// </FS:Beq>
// There is is a setting (360CaptureSourceImageSize) that holds the size
// (width == height since it's a square) of each of the 6 source snapshots.

View File

@ -50,11 +50,14 @@ class LLFloater360Capture:
void onOpen(const LLSD& key) override;
void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override;
void changeInterestListMode(bool send_everything);
// void changeInterestListMode(bool send_everything); // <FS:Beq/> Area search improvements - code relocated to LLViewerRegion
const std::string getHTMLBaseFolder();
void capture360Images();
// <FS:Beq/> make 360 work properly after region crossing/TP
void checkRegion();
boost::signals2::connection mRegionChangeConnection;
// </FS:Beq>
const std::string makeFullPathToJS(const std::string filename);
void writeDataURLHeader(const std::string filename);
void writeDataURLFooter(const std::string filename);

View File

@ -1480,49 +1480,85 @@ class LLAdvancedDumpRegionObjectCache : public view_listener_t
}
};
class LLAdvancedInterestListFullUpdate : public view_listener_t
// <FS:Beq> Handle InterestListFullUpdate as a proper state toggle
// class LLAdvancedInterestListFullUpdate : public view_listener_t
// {
// bool handleEvent(const LLSD& userdata)
// {
// LLSD request;
// LLSD body;
// static bool using_360 = false;
// if (using_360)
// {
// body["mode"] = LLSD::String("default");
// }
// else
// {
// body["mode"] = LLSD::String("360");
// }
// using_360 = !using_360;
// if (gAgent.requestPostCapability("InterestList", body, [](const LLSD& response)
// {
// LL_INFOS("Int") <<
// "InterestList capability responded: \n" <<
// ll_pretty_print_sd(response) <<
// LL_ENDL;
// }))
// {
// LL_INFOS("360Capture") <<
// "Successfully posted an InterestList capability request with payload: \n" <<
// ll_pretty_print_sd(body) <<
// LL_ENDL;
// return true;
// }
// else
// {
// LL_INFOS("360Capture") <<
// "Unable to post an InterestList capability request with payload: \n" <<
// ll_pretty_print_sd(body) <<
// LL_ENDL;
// return false;
// }
// }
// };
class LLAdvancedCheckInterestListFullUpdate : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
LLSD request;
LLSD body;
static bool using_360 = false;
if (using_360)
LLViewerRegion* regionp = gAgent.getRegion();
if (regionp)
{
body["mode"] = LLSD::String("default");
bool current_value = ( regionp->mFullUpdateInUseCount > 0 );
return current_value;
}
else
{
body["mode"] = LLSD::String("360");
}
using_360 = !using_360;
if (gAgent.requestPostCapability("InterestList", body, [](const LLSD& response)
{
LL_INFOS("360Capture") <<
"InterestList capability responded: \n" <<
ll_pretty_print_sd(response) <<
LL_ENDL;
}))
{
LL_INFOS("360Capture") <<
"Successfully posted an InterestList capability request with payload: \n" <<
ll_pretty_print_sd(body) <<
LL_ENDL;
return true;
}
else
{
LL_INFOS("360Capture") <<
"Unable to post an InterestList capability request with payload: \n" <<
ll_pretty_print_sd(body) <<
LL_ENDL;
return false;
}
return false;
}
};
class LLAdvancedToggleInterestListFullUpdate : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
LLViewerRegion* regionp = gAgent.getRegion();
if (regionp)
{
bool current_value = ( regionp->mFullUpdateInUseCount > 0 );
if(current_value)
{
regionp->useFullUpdateInterestListMode(false, true);
return false;
}
else
{
regionp->useFullUpdateInterestListMode(true);
return true;
}
}
return false;
}
};
// </FS:Beq>
class LLAdvancedBuyCurrencyTest : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@ -12238,7 +12274,12 @@ void initialize_menus()
// Advanced > World
view_listener_t::addMenu(new LLAdvancedDumpScriptedCamera(), "Advanced.DumpScriptedCamera");
view_listener_t::addMenu(new LLAdvancedDumpRegionObjectCache(), "Advanced.DumpRegionObjectCache");
view_listener_t::addMenu(new LLAdvancedInterestListFullUpdate(), "Advanced.InterestListFullUpdate");
// <FS:Beq> Make InterestList a proper stateful toggle
// view_listener_t::addMenu(new LLAdvancedInterestListFullUpdate(), "Advanced.InterestListFullUpdate");
view_listener_t::addMenu(new LLAdvancedCheckInterestListFullUpdate(), "Advanced.CheckInterestListFullUpdate");
view_listener_t::addMenu(new LLAdvancedToggleInterestListFullUpdate(), "Advanced.ToggleInterestListFullUpdate");
// </FS:Beq>
// Advanced > UI
commit.add("Advanced.WebBrowserTest", boost::bind(&handle_web_browser_test, _2)); // sigh! this one opens the MEDIA browser

View File

@ -1728,6 +1728,7 @@ BOOL LLViewerRegion::isViewerCameraStatic()
void LLViewerRegion::killInvisibleObjects(F32 max_time)
{
if(sFSAreaSearchActive){ return; } // <FS:Beq/> FIRE-32668 Area Search improvements
if(!sVOCacheCullingEnabled)
{
return;
@ -3554,6 +3555,53 @@ void LLViewerRegion::logActiveCapabilities() const
log_capabilities(mImpl->mCapabilities);
}
// <FS:Beq> Area Search improvement
void LLViewerRegion::useFullUpdateInterestListMode(bool send_everything, bool force_update)
{
static const char *FSLogTag = "InterestListMode";
U32 previousCount = mFullUpdateInUseCount;
LLSD body;
LL_DEBUGS(FSLogTag) << "useFullUpdateInterestListMode" << " send_everything:" << send_everything << " inUse: " << mFullUpdateInUseCount << LL_ENDL;
if (send_everything)
{
body["mode"] = LLSD::String("360");
mFullUpdateInUseCount++; // we increment irrespective of the actual success as we're really just tracking the attempts.
}
else
{
if(mFullUpdateInUseCount > 0)
{
mFullUpdateInUseCount--; // see above.
}
if(force_update)
{
mFullUpdateInUseCount=0; // when we are forcing the off state then we need to clear the count to zero.
}
body["mode"] = LLSD::String("default");
}
if( force_update || ( send_everything && mFullUpdateInUseCount == 1 ) || ( ( !send_everything ) && mFullUpdateInUseCount == 0 && previousCount != 0) ) // Only send if this is the first enable or last disable.
{
if (gAgent.requestPostCapability("InterestList", body,
[](const LLSD &response)
{
LL_INFOS(FSLogTag) << "InterestList capability responded: \n"
<< ll_pretty_print_sd(response) << LL_ENDL;
}))
{
LL_INFOS(FSLogTag) << "Successfully posted an InterestList capability request with payload: \n"
<< ll_pretty_print_sd(body) << LL_ENDL;
}
else
{
LL_INFOS(FSLogTag) << "Unable to post an InterestList capability request with payload: \n"
<< ll_pretty_print_sd(body) << LL_ENDL;
}
}
LL_DEBUGS(FSLogTag) << "useFullUpdateInterestListMode" << " (AFTER): inUse: " << mFullUpdateInUseCount << LL_ENDL;
}
// </FS:Beq>
LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type)
{
if (type < mImpl->mObjectPartition.size() && type < PARTITION_VO_CACHE)

View File

@ -351,7 +351,11 @@ public:
bool dynamicPathfindingEnabled() const;
bool avatarHoverHeightEnabled() const;
// <FS:Beq> Area search improvements
U32 mFullUpdateInUseCount {0};
void clearFullUpdateInterestList(){ LL_DEBUGS("InterestListMode") << "Resetting for previous region" << LL_ENDL; mFullUpdateInUseCount = 0; };
void useFullUpdateInterestListMode(bool full_update, bool force_update=false);
// </FS:Beq>
// </FS:CR>
#ifdef OPENSIM
std::set<std::string> getGods() { return mGodNames; };

View File

@ -4756,13 +4756,15 @@
function="Advanced.DumpRegionObjectCache" />
</menu_item_call>
<menu_item_call
<menu_item_check
label="Interest List: Full Update"
name="Interest List: Full Update"
shortcut="alt|shift|I">
<menu_item_call.on_click
function="Advanced.InterestListFullUpdate" />
</menu_item_call>
<menu_item_check.on_check
function="Advanced.CheckInterestListFullUpdate" />
<menu_item_check.on_click
function="Advanced.ToggleInterestListFullUpdate" />
</menu_item_check>
<menu_item_call
label="Dump Simulator Features to Nearby Chat"
name="DumpSimFeaturesToChat">