Yes ,I konw it .But when I do this,it's wrong.Can you tell me why?
 
class PHandler : public osgGA::GUIEventHandler {
public: 
 PHandler() {}        
 bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
 {
  osgViewer::Viewer* viewer = dynamic_cast<osgViewer::Viewer*>(&aa);
  osg::Group* group = dynamic_cast<osg::Group*>(viewer->getSceneData()) ;
  group->setDataVariance(osg::Object::DYNAMIC) ;
  osgParticle::ExplosionEffect* ee 
=dynamic_cast<osgParticle::ExplosionEffect*>(group->getChild(1)) ;
  switch(ea.getEventType())
  {
  case(osgGA::GUIEventAdapter::PUSH):
   {
    if(ee->areAllParticlesDead())
    {
     group->removeChild(1) ;
    }
   }
   return false;
  default:
   return false;
  }
 }
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to