FIRE-11593: Opensim "4096 Bug" proposed fix generously contributed by Latif Khalifa

master
Cinders 2013-09-12 19:58:11 -06:00
parent 751a3de625
commit 1c7a593517
5 changed files with 43 additions and 4 deletions

View File

@ -396,6 +396,7 @@ public:
child->insert(data);
}
}
#ifndef OPENSIM // <FS:CR> FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa
else
{
//it's not in here, give it to the root
@ -411,6 +412,7 @@ public:
node->insert(data);
}
#endif // <FS:CR> FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa
return false;
}
@ -734,7 +736,6 @@ public:
return false;
}
#ifndef OPENSIM // <FS:ND> FIRE-11593; Don't limit center of octree to 2^20, otherwise we end with the famous longjump bug (cannot TP further than 4095 regions [4096*256 = 2^20]
LLVector4a MAX_MAG;
MAX_MAG.splat(1024.f*1024.f);
@ -750,7 +751,6 @@ public:
//OCT_ERRS << "!!! ELEMENT EXCEEDS RANGE OF SPATIAL PARTITION !!!" << llendl;
return false;
}
#endif // <FS:ND> FIRE-11593
if (this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup()))
{

View File

@ -5066,6 +5066,25 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
gAgent.getRegion()->getOriginGlobal());
gAgent.setRegion(regionp);
gObjectList.shiftObjects(shift_vector);
// <FS:CR> FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa
#ifdef OPENSIM
// Is this a really long jump?
if (shift_vector.length() > 2048.f * 256.f)
{
regionp->reInitPartitions();
gAgent.setRegion(regionp);
// Kill objects in the regions we left behind
for (LLWorld::region_list_t::const_iterator r = LLWorld::getInstance()->getRegionList().begin();
r != LLWorld::getInstance()->getRegionList().end(); ++r)
{
if (*r != regionp)
{
gObjectList.killObjects(*r);
}
}
}
#endif
// </FS:CR>
gAssetStorage->setUpstream(msg->getSender());
gCacheName->setUpstream(msg->getSender());
gViewerThrottle.sendToSim();

View File

@ -705,7 +705,9 @@ void LLViewerPartSim::updateSimulation()
LLViewerObject* vobj = mViewerPartGroups[i]->mVOPartGroupp;
S32 visirate = 1;
if (vobj)
// <FS:CR> FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa
//if (vobj)
if (vobj && vobj->mDrawable)
{
LLSpatialGroup* group = vobj->mDrawable->getSpatialGroup();
if (group && !group->isVisible()) // && !group->isState(LLSpatialGroup::OBJECT_DIRTY))
@ -716,7 +718,9 @@ void LLViewerPartSim::updateSimulation()
if ((LLDrawable::getCurrentFrame()+mViewerPartGroups[i]->mID)%visirate == 0)
{
if (vobj)
// <FS:CR> FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa
// <vobj)
if (vobj && vobj->mDrawable)
{
gPipeline.markRebuild(vobj->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
}

View File

@ -396,6 +396,12 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
// Create the object lists
initStats();
// <FS:CR> FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa
initPartitions();
}
void LLViewerRegion::initPartitions()
{
// </FS:CR>
//create object partitions
//MUST MATCH declaration of eObjectPartitions
@ -412,6 +418,14 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE
}
// <FS:CR> FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa
void LLViewerRegion::reInitPartitions()
{
std::for_each(mImpl->mObjectPartition.begin(), mImpl->mObjectPartition.end(), DeletePointer());
mImpl->mObjectPartition.clear();
initPartitions();
}
// </FS:CR>
void LLViewerRegion::initStats()
{

View File

@ -388,10 +388,12 @@ public:
};
void showReleaseNotes();
void reInitPartitions(); // <FS:CR> FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa
protected:
void disconnectAllNeighbors();
void initStats();
void initPartitions(); // <FS:CR> FIRE-11593: Opensim "4096 Bug" Fix by Latif Khalifa
public:
LLWind mWind;