- Timestamp:
- 02/11/07 22:12:34 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgmanipulator/osgmanipulator.cpp
r6143 r6148 202 202 for(unsigned int i=0;i<_viewer->getNumberOfCameras();++i) 203 203 { 204 204 205 if ((ea.getEventType() == osgGA::GUIEventAdapter::PUSH) && 205 _viewer->computeIntersections(ea.getX(), ea.getY(), i, hitList))206 _viewer->computeIntersections(ea.getX(), ea.getY(), i, _pointer.hitList)) 206 207 { 207 208 float pixel_x,pixel_y; … … 213 214 osgUtil::SceneView* sv = sh ? sh->getSceneView() : 0; 214 215 if (! sv) continue; 215 216 for (osg::NodePath::iterator itr = hitList.front().getNodePath().begin(); 217 itr != hitList.front().getNodePath().end(); 216 217 _pointer.pixel_x = int(pixel_x+0.5); 218 _pointer.pixel_y = int(pixel_y+0.5); 219 _pointer.sv = sv; 220 _pointer.hitIter = _pointer.hitList.begin(); 221 222 for (osg::NodePath::iterator itr = _pointer.hitList.front().getNodePath().begin(); 223 itr != _pointer.hitList.front().getNodePath().end(); 218 224 ++itr) 219 225 { … … 221 227 if (dragger) 222 228 { 223 dragger->handle(int(pixel_x+0.5), int(pixel_y+0.5), *sv, 224 hitList, hitList.begin(), 225 ea, aa); 229 230 dragger->handle(_pointer, ea, aa); 226 231 _activeDragger = dragger; 227 232 break; … … 245 250 osgUtil::SceneView* sv = sh ? sh->getSceneView() : 0; 246 251 if (_activeDragger && sv) 247 _activeDragger->handle(int(pixel_x+0.5), int(pixel_y+0.5), *sv, 248 hitList, hitList.begin(), 249 ea, aa); 252 { 253 _pointer.pixel_x = int(pixel_x+0.5); 254 _pointer.pixel_y = int(pixel_y+0.5); 255 _pointer.sv = sv; 256 _pointer.hitIter = _pointer.hitList.begin(); 257 258 _activeDragger->handle(_pointer, ea, aa); 259 } 250 260 } 251 261 } … … 258 268 { 259 269 _activeDragger = 0; 260 hitList.clear();270 _pointer.hitList.clear(); 261 271 } 262 272 } … … 268 278 unsigned int _mode; 269 279 osgManipulator::Dragger* _activeDragger; 270 osg Util::IntersectVisitor::HitList hitList;280 osgManipulator::Dragger::PointerInfo _pointer; 271 281 }; 272 282
