Show
Ignore:
Timestamp:
09/20/10 13:50:24 (4 years ago)
Author:
robert
Message:

From Wang Rui, reverted changes to osgPartcile that caused problems with osgparticleeffects.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgparticleshader/osgparticleshader.cpp

    r11765 r11779  
    167167    // is still usable, with which we should define another geode to contain a particle system. 
    168168    osg::ref_ptr<osgParticle::ParticleSystemUpdater> updater = new osgParticle::ParticleSystemUpdater; 
    169     updater->addDrawable( ps.get() ); 
     169    //updater->addDrawable( ps.get() ); 
    170170     
    171171    osg::ref_ptr<osg::Group> root = new osg::Group; 
    172172    root->addChild( parent.get() ); 
    173173    root->addChild( updater.get() ); 
     174     
     175    // FIXME 2010.9.19: the updater can't be a drawable; otehrwise the ParticleEffect will not work properly. why? 
     176    updater->addParticleSystem( ps.get() ); 
     177     
     178    osg::ref_ptr<osg::Geode> geode = new osg::Geode; 
     179    geode->addDrawable( ps.get() ); 
     180    root->addChild( geode.get() ); 
    174181     
    175182    /*** 
     
    191198    // it is not the best solution so far, since there are still very few particles acting unexpectedly. 
    192199    return viewer.run(); 
     200     
     201    // FIXME 2010.9.19: At present, getDeltaTime() is not used and the implementations in the updater and processors still 
     202    // use a (t - _t0) as the delta time, which is of course causing floating errors. ParticleEffect will not work if we 
     203    // replace the delta time with getDeltaTime()... Need to find a solution. 
    193204}