mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
Recreate a special case for IntersectionVisitor on QuadTreeWorld
This commit is contained in:
parent
340801e08b
commit
54c8375672
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user