mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 01:36:44 +00:00
Merge pull request #3085 from akortunov/master
Recreate a special case for IntersectionVisitor on QuadTreeWorld
This commit is contained in:
commit
a89b9f338c
1 changed files with 3 additions and 3 deletions
|
@ -143,7 +143,7 @@ ViewData *ViewDataMap::getViewData(osg::Object *viewer, const osg::Vec3f& viewPo
|
||||||
|
|
||||||
if (!vd->suitableToUse(activeGrid) || (vd->getViewPoint()-viewPoint).length2() >= mReuseDistance*mReuseDistance || vd->getWorldUpdateRevision() < mWorldUpdateRevision)
|
if (!vd->suitableToUse(activeGrid) || (vd->getViewPoint()-viewPoint).length2() >= mReuseDistance*mReuseDistance || vd->getWorldUpdateRevision() < mWorldUpdateRevision)
|
||||||
{
|
{
|
||||||
float shortestDist = mReuseDistance*mReuseDistance;
|
float shortestDist = viewer ? mReuseDistance*mReuseDistance : std::numeric_limits<float>::max();
|
||||||
const ViewData* mostSuitableView = nullptr;
|
const ViewData* mostSuitableView = nullptr;
|
||||||
for (const ViewData* other : mUsedViews)
|
for (const ViewData* other : mUsedViews)
|
||||||
{
|
{
|
||||||
|
@ -157,12 +157,12 @@ ViewData *ViewDataMap::getViewData(osg::Object *viewer, const osg::Vec3f& viewPo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mostSuitableView)
|
if (mostSuitableView && mostSuitableView != vd)
|
||||||
{
|
{
|
||||||
vd->copyFrom(*mostSuitableView);
|
vd->copyFrom(*mostSuitableView);
|
||||||
return vd;
|
return vd;
|
||||||
}
|
}
|
||||||
else
|
else if (!mostSuitableView)
|
||||||
{
|
{
|
||||||
vd->setViewPoint(viewPoint);
|
vd->setViewPoint(viewPoint);
|
||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
|
|
Loading…
Reference in a new issue