mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
Make ConvexHull::clip more resilient against large values.
This commit is contained in:
parent
987306feb9
commit
dd501f4132
1 changed files with 8 additions and 0 deletions
|
@ -2067,6 +2067,14 @@ struct ConvexHull
|
|||
++itr)
|
||||
{
|
||||
center += *itr;
|
||||
|
||||
center.x() = osg::maximum(center.x(), -DBL_MAX);
|
||||
center.y() = osg::maximum(center.y(), -DBL_MAX);
|
||||
center.z() = osg::maximum(center.z(), -DBL_MAX);
|
||||
|
||||
center.x() = osg::minimum(center.x(), DBL_MAX);
|
||||
center.y() = osg::minimum(center.y(), DBL_MAX);
|
||||
center.z() = osg::minimum(center.z(), DBL_MAX);
|
||||
}
|
||||
|
||||
center /= double(intersections.size());
|
||||
|
|
Loading…
Reference in a new issue