[osg-users] RayIntersector with KdTree causes a crash

Ale Maro sasha71 at teletu.it
Thu Jul 26 02:30:17 PDT 2018


Hi,

we have a problem with OSG 3.6.2 and Visual Studio 2017

We have a pick functionality in our software that uses RayIntersector.
We enabled KdTrees for this use.

When we apply the intersector to an object with a negative scale in the MatrixTransform parent node (e.g. scale = (-1, 1, 1)), it crashes inside the KdTree code.

If we disable kdtree everything works fine. 
It also works with Visual Studio 2013 and OSG 3.4.0. 

Here is the call stack when crashed:


> 
> >             osg157-osgUtild.dll!std::vector<unsigned int,std::allocator<unsigned int> >::operator[](const unsigned __int64 _Pos) Line 1818 C++
>                osg157-osgUtild.dll!osg::KdTree::intersect<osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > >(osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > & functor, const osg::KdTree::KdNode & node) Line 160      C++
>                osg157-osgUtild.dll!osg::KdTree::intersect<osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > >(osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > & functor, const osg::KdTree::KdNode & node) Line 176      C++
>                osg157-osgUtild.dll!osg::KdTree::intersect<osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > >(osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > & functor, const osg::KdTree::KdNode & node) Line 176      C++
>                osg157-osgUtild.dll!osgUtil::LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor & iv, osg::Drawable * drawable, const osg::Vec3d & s, const osg::Vec3d & e) Line 540             C++
>                osg157-osgUtild.dll!osgUtil::RayIntersector::intersect(osgUtil::IntersectionVisitor & iv, osg::Drawable * drawable) Line 122          C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::intersect(osg::Drawable * drawable) Line 282   C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Geode & geode) Line 240     C++
>                osg157-osgd.dll!osg::Geode::accept(osg::NodeVisitor & nv) Line 37         C++
>                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
>                osg157-osgFXd.dll!osgFX::Effect::inherited_traverse(osg::NodeVisitor & nv) Line 213      C++
>                osg157-osgFXd.dll!osgFX::Effect::traverse(osg::NodeVisitor & nv) Line 51              C++
>                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
>                osg157-osgFXd.dll!osgFX::Outline::accept(osg::NodeVisitor & nv) Line 54              C++
>                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
>                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & transform) Line 417      C++
>                osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform & node) Line 158              C++
>                osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor & nv) Line 37    C++
>                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
>                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
>                osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 38          C++
>                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
>                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & transform) Line 417      C++
>                osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform & node) Line 158              C++
>                osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor & nv) Line 37    C++
>                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
>                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
>                osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 38          C++
>                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
>                osg157-osgShadowd.dll!osgShadow::ShadowedScene::traverse(osg::NodeVisitor & nv) Line 69  C++
>                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
>                osg157-osgShadowd.dll!osgShadow::ShadowedScene::accept(osg::NodeVisitor & nv) Line 36     C++
>                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
>                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
>                osg157-osgd.dll!osg::NodeVisitor::apply(osg::ClipNode & node) Line 128              C++
>                osg157-osgd.dll!osg::ClipNode::accept(osg::NodeVisitor & nv) Line 35    C++
>                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
>                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
>                osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 38          C++
>                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
>                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
>                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Camera & camera) Line 498 C++
>                osg157-osgd.dll!osg::Camera::accept(osg::NodeVisitor & nv) Line 54       C++
> 
> 



Thank you in advance.


Berst regards

Ale

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74386#74386







More information about the osg-users mailing list