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

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

运行效果如下:

相关推荐
directx3d_beginner5 天前
10,cookbook的lod示例
osg
directx3d_beginner6 天前
8,将0级简模文件和精模文件同时放入pagedlod
osg
directx3d_beginner6 天前
9,0级建模文件和0级精模文件写成根节点
osg
directx3d_beginner7 天前
5,保存4个一级节点
osg
directx3d_beginner7 天前
1, pagedlod和lod
osg
一梦、んんん18 天前
osgEarth指北针(使用原生界面canvas实现,更轻量级)
osgearth
一梦、んんん21 天前
Osgearth后期处理+多窗口显示
osgearth·fbo
CHPCWWHSU1 个月前
pointCloudExtractor:一个基于 osgPotree 的 Potree 点云数据提取工具
目标识别·osg·potree·点云提取
CHPCWWHSU2 个月前
CesiumforUnreal环境准备
c++·cesium·unreal·osg
妙为2 个月前
osgEarth中文显示乱码
中文乱码·osgearth·osg