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

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

运行效果如下:

相关推荐
xiyangxiaoguo12 天前
使用OpenSceneGraph (osg)实现一个星系漫游
osg
slntJy17 天前
ubantu&windows搭建gis开发环境(qt+osg+osgearth+osgqt)
gis·win11·osgearth·ubantu·osg·osgqt
CHPCWWHSU1 个月前
vulkanscenegraph显示倾斜模型(5.4)-相机操纵器
c++·osg·vulkan·vsg
CHPCWWHSU1 个月前
vulkanscenegraph显示倾斜模型(5.3)-相机
c++·osg·vulkan·vsg
是阿牛啊2 个月前
【ubuntu20安装usv_sim_lsa (无人水面航行器模拟环境) - v0.3】
ubuntu·ros·osg·usv_sim
蜕变的土豆2 个月前
十一、OSG学习笔记-操作系统接口
osg
蜕变的土豆2 个月前
八、OSG学习笔记-
osg
Jennifer33K4 个月前
UE5.4运行报错解决(关于osg使用-无法解决的外部命令)(未解决)
osg
读万卷书不如行万里路呀5 个月前
数字地球程序框架搭建(三)
osg·加载模型不显示·加载模型显示位置不对