Merge pull request #259 from jtorresfabra/fixes_kdtree

Fixes kdtree building
This commit is contained in:
OpenSceneGraph git repository 2017-06-02 09:29:05 +01:00 committed by GitHub
commit f3c4234f92
2 changed files with 8 additions and 10 deletions

View File

@ -361,8 +361,6 @@ int BuildKdTree::divide(KdTree::BuildOptions& options, osg::BoundingBox& bb, int
while(left<right && (_centers[_primitiveIndices[right]][axis]>mid)) { --right; }
while(left<right && (_centers[_primitiveIndices[right]][axis]>mid)) { --right; }
if (left<right)
{
std::swap(_primitiveIndices[left], _primitiveIndices[right]);

View File

@ -141,7 +141,7 @@ struct IntersectFunctor
}
}
// compate s and e against the yMin to yMax range of bb.
// compare s and e against the yMin to yMax range of bb.
if (s.y()<=e.y())
{
@ -179,7 +179,7 @@ struct IntersectFunctor
}
}
// compate s and e against the zMin to zMax range of bb.
// compare s and e against the zMin to zMax range of bb.
if (s.z()<=e.z())
{
@ -247,8 +247,8 @@ struct IntersectFunctor
value_type r,r0,r1,r2;
const value_type esplison = 1e-10;
if (det>esplison)
const value_type epsilon = 1e-10;
if (det>epsilon)
{
value_type u = (P*T);
if (u<0.0 || u>det) return;
@ -271,7 +271,7 @@ struct IntersectFunctor
r2 = v;
r = t * _inverse_length;
}
else if (det<-esplison)
else if (det<-epsilon)
{
value_type u = (P*T);
if (u>0.0 || u<det) return;
@ -595,7 +595,7 @@ bool LineSegmentIntersector::intersectAndClip(osg::Vec3d& s, osg::Vec3d& e,const
double epsilon = 1e-5;
// compate s and e against the xMin to xMax range of bb.
// compare s and e against the xMin to xMax range of bb.
if (s.x()<=e.x())
{
// trivial reject of segment wholely outside.
@ -636,7 +636,7 @@ bool LineSegmentIntersector::intersectAndClip(osg::Vec3d& s, osg::Vec3d& e,const
}
}
// compate s and e against the yMin to yMax range of bb.
// compare s and e against the yMin to yMax range of bb.
if (s.y()<=e.y())
{
// trivial reject of segment wholely outside.
@ -677,7 +677,7 @@ bool LineSegmentIntersector::intersectAndClip(osg::Vec3d& s, osg::Vec3d& e,const
}
}
// compate s and e against the zMin to zMax range of bb.
// compare s and e against the zMin to zMax range of bb.
if (s.z()<=e.z())
{
// trivial reject of segment wholely outside.