In the example of osgparticleeffects,how to know that the particle effects 
disappear?
I find the function  areAllParticlesDead  does't work.Is there any other way to 
judge it??
 
If I do like this,when the particle effects disappears,but memory don't 
release! Why?
 
 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) ;
     group->removeChild(2) ;
     group->removeChild(3) ;
     group->removeChild(4) ;
    }
   }
   return false;
  default:
   return false;
  }
 }
 
Thank you! 
 
 
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to