实时飞行粒子尾迹(十二)

复制代码
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);
}

运行效果如下:

相关推荐
扶尔魔ocy3 天前
【qt openGL入门笔记】windows编译MinGW版本的osgearth(2.10.1)
qt·opengl·osg
扶尔魔ocy4 天前
【QT OpenGL】知识点编目及传送门
qt·opengl·osg
扶尔魔ocy16 天前
【qt openGL入门笔记】OSG实现飞机模型在网格图上飞行并进行态势标绘(四)
qt·opengl·osg
扶尔魔ocy19 天前
【qt openGL入门笔记】OSG实现显示飞机模型飞行的点迹(二)
qt·opengl·osg
扶尔魔ocy19 天前
【qt openGL入门笔记】OSG实现飞机模型在网格图上飞行(三)
opengl·osg
扶尔魔ocy20 天前
【qt openGL入门笔记】OSG实现飞机模型在网格图上飞行
qt·opengl·osg
Being--3 个月前
搭建OsgEarth验证GIS数据发布服务的Agent
gis·agent·osgearth·ai落地
directx3d_beginner8 个月前
10,cookbook的lod示例
osg
directx3d_beginner8 个月前
8,将0级简模文件和精模文件同时放入pagedlod
osg
directx3d_beginner8 个月前
9,0级建模文件和0级精模文件写成根节点
osg