BuildTail(osg::Vec3(0, -10, 0), mtfly);
BuildTail(osg::Vec3(0, 10, 0), mtfly);
void COSGObject::BuildTail(osg::Vec3 position, osg::MatrixTransform* scaler)
{
osg::ref_ptr<osgParticle::FireEffect> fire = new osgParticle::FireEffect(position, 10);
fire->setUseLocalParticleSystem(false);
fire->getEmitter()->setEndless(true);
fire->getEmitter()->setLifeTime(1);
fire->getParticleSystem()->getDefaultParticleTemplate().setLifeTime(fire->getParticleSystem()->getDefaultParticleTemplate().getLifeTime()*10);
scaler->addChild(fire);
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable(fire->getParticleSystem());
mRoot->addChild(geode);
}
运行效果如下:
