1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 21:40:03 +00:00

Use same world coordinates to compute distances

This commit is contained in:
Cédric Mocquillon 2021-07-10 19:04:46 +02:00
parent 83af0402b8
commit 269cd31059

View File

@ -485,8 +485,7 @@ namespace MWRender
constexpr auto copyMask = ~Mask_UpdateVisitor;
AnalyzeVisitor analyzeVisitor(copyMask);
osg::Vec3f center3 = { center.x(), center.y(), 0.f };
analyzeVisitor.mCurrentDistance = (viewPoint - center3).length2();
analyzeVisitor.mCurrentDistance = (viewPoint - worldCenter).length2();
float minSize = mMinSize;
if (mMinSizeMergeFactor)
minSize *= mMinSizeMergeFactor;