Show
Ignore:
Timestamp:
03/17/08 11:29:23 (7 years ago)
Author:
robert
Message:

Added fire effect, enabled by --fire command line option. The new fire effect
has been introduced to reproduce the scaling of paricle effects

Files:
1 modified

Legend:

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

    r6962 r7960  
    6565#include <osgGA/TerrainManipulator> 
    6666 
     67#include <osgParticle/FireEffect> 
     68 
    6769#include <iostream> 
    6870 
     
    294296    while (arguments.read("-p",pathfile)) {} 
    295297 
     298    bool addFireEffect = arguments.read("--fire"); 
    296299 
    297300    // if user request help write it out to cout. 
     
    402405                scaler->addChild(cessna); 
    403406                scaler->setMatrix(osg::Matrixd::scale(s,s,s)*osg::Matrixd::rotate(rotation)); 
    404                 scaler->getOrCreateStateSet()->setMode(GL_RESCALE_NORMAL,osg::StateAttribute::ON);         
     407                scaler->getOrCreateStateSet()->setMode(GL_RESCALE_NORMAL,osg::StateAttribute::ON); 
     408                 
     409                if (addFireEffect) 
     410                {                 
     411                    osg::Vec3d center = cessna->getBound().center(); 
     412                     
     413                    osgParticle::FireEffect* fire = new osgParticle::FireEffect(center, 10.0f); 
     414                    scaler->addChild(fire); 
     415                } 
     416                 
    405417 
    406418                if (false)