- Timestamp:
- 01/09/07 18:35:46 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osglauncher/osglauncher.cpp
r5928 r5951 93 93 std::string PickHandler::pick(float x, float y) 94 94 { 95 #if 0 96 osgUtil::IntersectVisitor::HitList hlist; 97 if (_viewer->computeIntersections(x, y, hlist)) 98 { 99 for(osgUtil::IntersectVisitor::HitList::iterator hitr=hlist.begin(); 100 hitr!=hlist.end(); 95 osgUtil::LineSegmentIntersector::Intersections intersections; 96 if (_viewer->computeIntersections(x, y, intersections)) 97 { 98 for(osgUtil::LineSegmentIntersector::Intersections::iterator hitr = intersections.begin(); 99 hitr != intersections.end(); 101 100 ++hitr) 102 101 { 103 if (hitr->_geode.valid() && !hitr->_geode->getName().empty()) return hitr->_geode->getName(); 104 } 105 } 106 #else 107 osg::notify(osg::NOTICE)<<"Picking not implemented yet "<<x<<", "<<y<<std::endl; 108 #endif 102 osg::Node* node = hitr->nodePath.empty() ? 0 : hitr->nodePath.back(); 103 if (node && !node->getName().empty()) return node->getName(); 104 } 105 } 106 109 107 return ""; 110 108 } … … 417 415 viewer.setSceneData( root ); 418 416 419 // create the windows and run the threads.420 viewer.realize();421 422 417 osg::Matrix lookAt; 423 418 lookAt.makeLookAt(osg::Vec3(0.0f, -4.0f, 0.0f), centerScope, osg::Vec3(0.0f, 0.0f, 1.0f));
