Show
Ignore:
Timestamp:
03/22/05 21:26:45 (10 years ago)
Author:
robert
Message:

Moved ParticleSystemUpdater? into ParticleEffect? nodes to simplify usage
of nodes.

Files:
1 modified

Legend:

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

    r3935 r3936  
    117117        xform->addChild(positioned); 
    118118 
     119        // add particle effects to cessna. 
     120        { 
     121            osg::PositionAttitudeTransform* positionEffects = new osg::PositionAttitudeTransform; 
     122            positionEffects->setPosition(osg::Vec3(0.0f,0.0f,0.0f)); 
     123            xform->addChild(positionEffects); 
     124 
     125            osgParticle::ExplosionEffect* explosion = new osgParticle::ExplosionEffect; 
     126            osgParticle::SmokeEffect* smoke = new osgParticle::SmokeEffect; 
     127            osgParticle::FireEffect* fire = new osgParticle::FireEffect; 
     128 
     129            positionEffects->addChild(explosion); 
     130            positionEffects->addChild(smoke); 
     131            positionEffects->addChild(fire); 
     132        } 
     133         
    119134        model->addChild(xform); 
    120135    } 
     
    221236        osgParticle::FireEffect* fire = new osgParticle::FireEffect; 
    222237 
    223         //osg::Geode* geode = new osg::Geode; 
    224         //geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f,0.0f,0.0f),10.0f))); 
    225         //positionEffects->addChild(geode); 
    226  
    227238        positionEffects->addChild(explosion); 
    228239        positionEffects->addChild(smoke); 
    229240        positionEffects->addChild(fire); 
    230241 
    231         osgParticle::ParticleSystemUpdater *psu = new osgParticle::ParticleSystemUpdater; 
    232  
    233         psu->addParticleSystem(explosion->getParticleSystem()); 
    234         psu->addParticleSystem(smoke->getParticleSystem()); 
    235         psu->addParticleSystem(fire->getParticleSystem()); 
    236  
    237         // add the updater node to the scene graph 
    238         root->addChild(psu); 
    239242    } 
    240243