- Timestamp:
- 01/09/07 18:35:46 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgoccluder/osgoccluder.cpp
r5927 r5951 46 46 }; 47 47 48 bool OccluderEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&) 49 { 50 #if 0 48 bool OccluderEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa) 49 { 51 50 switch(ea.getEventType()) 52 51 { … … 54 53 { 55 54 if (ea.getKey()=='a') 55 56 56 { 57 float x = ea.getXnormalized(); 58 float y = ea.getYnormalized(); 59 60 osgUtil::IntersectVisitor::HitList hitList; 61 if (!_viewer->computeIntersections(x,y,hitList)) 57 osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa); 58 osgUtil::LineSegmentIntersector::Intersections intersections; 59 if (view && view->computeIntersections(ea.getX(), ea.getY(), intersections)) 62 60 { 63 return true; 64 } 65 66 if (!hitList.empty()) 67 { 68 69 osgUtil::Hit& hit = hitList.front(); 70 addPoint(hit.getWorldIntersectPoint()); 61 const osgUtil::LineSegmentIntersector::Intersection& hit = *(intersections.begin()); 62 if (hit.matrix.valid()) addPoint(hit.localIntersectionPoint * (*hit.matrix)); 63 else addPoint(hit.localIntersectionPoint); 71 64 } 72 65 … … 98 91 return false; 99 92 } 100 #else101 osg::notify(osg::NOTICE)<<"Computre intersections not implemented yet."<<std::endl;102 return false;103 #endif104 93 } 105 94
