Added fire effect, enabled by --fire command line option. The new fire effect
has been introduced to reproduce the scaling of paricle effects
This commit is contained in:
parent
a1c0c2a3eb
commit
7ec5673a7e
@ -1,7 +1,6 @@
|
|||||||
#this file is automatically generated
|
|
||||||
|
|
||||||
|
|
||||||
SET(TARGET_SRC osgsimulation.cpp )
|
SET(TARGET_SRC osgsimulation.cpp )
|
||||||
SET(TARGET_ADDED_LIBRARIES osgSim osgGA )
|
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgParticle osgSim osgGA )
|
||||||
|
|
||||||
#### end var setup ###
|
#### end var setup ###
|
||||||
SETUP_EXAMPLE(osgsimulation)
|
SETUP_EXAMPLE(osgsimulation)
|
||||||
|
@ -64,6 +64,8 @@
|
|||||||
#include <osgGA/AnimationPathManipulator>
|
#include <osgGA/AnimationPathManipulator>
|
||||||
#include <osgGA/TerrainManipulator>
|
#include <osgGA/TerrainManipulator>
|
||||||
|
|
||||||
|
#include <osgParticle/FireEffect>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
osg::Node* createEarth()
|
osg::Node* createEarth()
|
||||||
@ -293,6 +295,7 @@ int main(int argc, char **argv)
|
|||||||
std::string pathfile;
|
std::string pathfile;
|
||||||
while (arguments.read("-p",pathfile)) {}
|
while (arguments.read("-p",pathfile)) {}
|
||||||
|
|
||||||
|
bool addFireEffect = arguments.read("--fire");
|
||||||
|
|
||||||
// if user request help write it out to cout.
|
// if user request help write it out to cout.
|
||||||
if (arguments.read("-h") || arguments.read("--help"))
|
if (arguments.read("-h") || arguments.read("--help"))
|
||||||
@ -401,7 +404,16 @@ int main(int argc, char **argv)
|
|||||||
osg::MatrixTransform* scaler = new osg::MatrixTransform;
|
osg::MatrixTransform* scaler = new osg::MatrixTransform;
|
||||||
scaler->addChild(cessna);
|
scaler->addChild(cessna);
|
||||||
scaler->setMatrix(osg::Matrixd::scale(s,s,s)*osg::Matrixd::rotate(rotation));
|
scaler->setMatrix(osg::Matrixd::scale(s,s,s)*osg::Matrixd::rotate(rotation));
|
||||||
scaler->getOrCreateStateSet()->setMode(GL_RESCALE_NORMAL,osg::StateAttribute::ON);
|
scaler->getOrCreateStateSet()->setMode(GL_RESCALE_NORMAL,osg::StateAttribute::ON);
|
||||||
|
|
||||||
|
if (addFireEffect)
|
||||||
|
{
|
||||||
|
osg::Vec3d center = cessna->getBound().center();
|
||||||
|
|
||||||
|
osgParticle::FireEffect* fire = new osgParticle::FireEffect(center, 10.0f);
|
||||||
|
scaler->addChild(fire);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (false)
|
if (false)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user