1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

Merge pull request #3085 from akortunov/master

Recreate a special case for IntersectionVisitor on QuadTreeWorld
This commit is contained in:
Bret Curtis 2021-05-11 15:06:27 +02:00 committed by GitHub
commit a89b9f338c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
{
float shortestDist = mReuseDistance*mReuseDistance;
float shortestDist = viewer ? mReuseDistance*mReuseDistance : std::numeric_limits<float>::max();
const ViewData* mostSuitableView = nullptr;
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);
return vd;
}
else
else if (!mostSuitableView)
{
vd->setViewPoint(viewPoint);
needsUpdate = true;