mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-21 18:40:01 +00:00
resolve issue of meshes that cross boundaries; should only be calculating the maxBound, not the minBound of y; also fix it in groundcover as it was copied blindly over;
This commit is contained in:
parent
471454adcf
commit
7dfaef7644
@ -172,7 +172,7 @@ namespace MWRender
|
|||||||
osg::Vec3f pos = ref.mPos.asVec3();
|
osg::Vec3f pos = ref.mPos.asVec3();
|
||||||
osg::Vec3f cellPos = pos / ESM::Land::REAL_SIZE;
|
osg::Vec3f cellPos = pos / ESM::Land::REAL_SIZE;
|
||||||
if ((minBound.x() > std::floor(minBound.x()) && cellPos.x() < minBound.x()) || (minBound.y() > std::floor(minBound.y()) && cellPos.y() < minBound.y())
|
if ((minBound.x() > std::floor(minBound.x()) && cellPos.x() < minBound.x()) || (minBound.y() > std::floor(minBound.y()) && cellPos.y() < minBound.y())
|
||||||
|| (maxBound.x() < std::ceil(maxBound.x()) && cellPos.x() >= maxBound.x()) || (minBound.y() < std::ceil(maxBound.y()) && cellPos.y() >= maxBound.y()))
|
|| (maxBound.x() < std::ceil(maxBound.x()) && cellPos.x() >= maxBound.x()) || (maxBound.y() < std::ceil(maxBound.y()) && cellPos.y() >= maxBound.y()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -507,7 +507,7 @@ namespace MWRender
|
|||||||
{
|
{
|
||||||
osg::Vec3f cellPos = pos / ESM::Land::REAL_SIZE;
|
osg::Vec3f cellPos = pos / ESM::Land::REAL_SIZE;
|
||||||
if ((minBound.x() > std::floor(minBound.x()) && cellPos.x() < minBound.x()) || (minBound.y() > std::floor(minBound.y()) && cellPos.y() < minBound.y())
|
if ((minBound.x() > std::floor(minBound.x()) && cellPos.x() < minBound.x()) || (minBound.y() > std::floor(minBound.y()) && cellPos.y() < minBound.y())
|
||||||
|| (maxBound.x() < std::ceil(maxBound.x()) && cellPos.x() >= maxBound.x()) || (minBound.y() < std::ceil(maxBound.y()) && cellPos.y() >= maxBound.y()))
|
|| (maxBound.x() < std::ceil(maxBound.x()) && cellPos.x() >= maxBound.x()) || (maxBound.y() < std::ceil(maxBound.y()) && cellPos.y() >= maxBound.y()))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user