[osg-users] RayIntersector with KdTree causes a crash

Robert Osfield robert.osfield at gmail.com
Wed Sep 5 10:07:40 PDT 2018


Hi Ale,

Thanks for the updating test program, this illustrates a separate bug
in the KdTree copy constructor.  I have added missing copying of the
indices:

~/OpenSceneGraph/src/osg$ git diff
diff --git a/src/osg/KdTree.cpp b/src/osg/KdTree.cpp
index 709c12f99..3f7a4a34a 100644
--- a/src/osg/KdTree.cpp
+++ b/src/osg/KdTree.cpp
@@ -492,6 +492,8 @@ KdTree::KdTree(const KdTree& rhs, const
osg::CopyOp& copyop):
     Shape(rhs, copyop),
     _degenerateCount(rhs._degenerateCount),
     _vertices(rhs._vertices),
+    _primitiveIndices(rhs._primitiveIndices),
+    _vertexIndices(rhs._vertexIndices),
     _kdNodes(rhs._kdNodes)
 {
 }

Could you test out the commit?

    https://github.com/openscenegraph/OpenSceneGraph/commit/34d58d447d7f0b35d7bb20572a2f5d4fd26b7961

Cheers.
Robert.


More information about the osg-users mailing list