Show
Ignore:
Timestamp:
08/25/05 16:12:08 (9 years ago)
Author:
robert
Message:

Added support for rapid movement of the emitter, with particle now seeding between
the position of the emitter in the previous frame and the new position in the new
frame, the number of particles added also scales up to compensate for this movement.

Files:
1 modified

Legend:

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

    r4301 r4459  
    6363    { 
    6464        const osg::BoundingSphere& bs = glider->getBound(); 
    65         float size = radius/bs.radius()*0.3f; 
     65        float size = radius/bs.radius()*0.15f; 
    6666 
    6767        osg::MatrixTransform* positioned = new osg::MatrixTransform; 
     
    8585    { 
    8686        const osg::BoundingSphere& bs = cessna->getBound(); 
    87         float size = radius/bs.radius()*0.3f; 
     87        float size = radius/bs.radius()*0.15f; 
    8888 
    8989        osg::MatrixTransform* positioned = new osg::MatrixTransform; 
     
    221221    // create the moving models. 
    222222    { 
    223         root->addChild(createMovingModel(osg::Vec3(500.0f,500.0f,500.0f),100.0f)); 
     223        root->addChild(createMovingModel(osg::Vec3(500.0f,500.0f,500.0f),300.0f)); 
    224224    } 
    225225} 
     
    272272             
    273273            osg::Vec3 position = handleMovingModels ? hit.getLocalIntersectPoint() : hit.getWorldIntersectPoint(); 
    274             float scale = 20.0f * ((float)rand() / (float)RAND_MAX); 
    275             float intensity = handleMovingModels ? 5.0f : 1.0f; 
     274            float scale = 10.0f * ((float)rand() / (float)RAND_MAX); 
     275            float intensity = 1.0f; 
    276276 
    277277            osgParticle::ExplosionEffect* explosion = new osgParticle::ExplosionEffect(position, scale, intensity); 
    278278            osgParticle::ExplosionDebrisEffect* explosionDebri = new osgParticle::ExplosionDebrisEffect(position, scale, intensity); 
    279             osgParticle::SmokeEffect* smoke = new osgParticle::SmokeEffect(position, scale, intensity); 
     279            osgParticle::ParticleEffect* smoke = new osgParticle::SmokeEffect(position, scale, intensity); 
    280280            osgParticle::FireEffect* fire = new osgParticle::FireEffect(position, scale, intensity); 
    281281