Changeset 1875 for OpenSceneGraph/trunk/examples/osgpick/osgpick.cpp
- Timestamp:
- 04/14/03 17:44:30 (10 years ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/examples/osgpick/osgpick.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgpick/osgpick.cpp
r1868 r1875 82 82 float x=ea.getXnormalized(); 83 83 float y=ea.getYnormalized(); 84 85 Producer::Camera *cmm=_cg->getCamera(0); 86 osg::Matrix vum(osg::Matrix(cmm->getViewMatrix()) * 87 osg::Matrix(cmm->getProjectionMatrix())/* * 88 osg::Matrix::translate(1.0f,1.0f,1.0f) * 89 osg::Matrix::scale(0.5f,0.5f,0.5f)*/); 90 84 91 osgUtil::PickVisitor iv; 85 const float *matView;86 const float *matProj;87 Producer::Camera *cmm=_cg->getCamera(0);88 matView=cmm->getViewMatrix();89 matProj=cmm->getProjectionMatrix();90 osg::Matrix vum;91 vum.set(matView);92 vum.postMult(osg::Matrix(matProj));93 osg::Matrix windowmatrix=osg::Matrix::translate(1.0f,1.0f,1.0f)*94 osg::Matrix::scale(0.5f,0.5f,0.5f);95 vum.postMult(windowmatrix);96 92 osgUtil::IntersectVisitor::HitList& hlist=iv.getHits(scene, vum, x,y); 97 93 std::string gdlist=""; … … 106 102 osg::Geode* geode = hitr->_geode.get(); 107 103 // the geodes are identified by name. 108 if (geode) { 109 gdlist=gdlist+" "+geode->getName(); 104 if (geode) 105 { 106 if (!geode->getName().empty()) 107 { 108 gdlist=gdlist+" "+geode->getName(); 109 } 110 else 111 { 112 gdlist=gdlist+" geode"; 113 } 110 114 } 111 115 }
