[osg-users] [forum] Dragging individual model nodes

Catalin Flower inbox.icf at gmail.com
Wed Apr 24 00:30:59 PDT 2019


Hi,

You have to find the node associated to your object by intersection:

	osgUtil::LineSegmentIntersector::Intersections ints;
	bool bHasIntersections = viewer->computeIntersections(viewer->getCamera(), osgUtil::Intersector::WINDOW, x, y, ints, CULL_MASK_HERE);

	if (bHasIntersections)
	{
		const osgUtil::LineSegmentIntersector::Intersection& inter = *(ints.begin());

		const osg::NodePath& nodePath = inter.nodePath;
		unsigned int idx = nodePath.size();
		while (idx--)
		{
			osg::Node*node =nodePath[idx];

....


Thank you!

Cheers,
Catalin

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







More information about the osg-users mailing list