|
我看了<<OSG编程入门指南>>一书中的爆炸特效,其中代码如下:
osg::Group* explode = new osg::Group() ;
//风向
osg::Vec3 wind(1.0f,0.0f,0.0f);
//位置
osg::Vec3 position(0.0f,0.0f,-10.0f);
//爆炸模拟,10.0f为缩放比,默认为1.0f,不缩放
osgParticle::ExplosionEffect* explosion = new osgParticle::ExplosionEffect(position, 10.0f);
//碎片模拟
osgParticle::ExplosionDebrisEffect* explosionDebri = new osgParticle::ExplosionDebrisEffect(position, 10.0f);
//烟模拟
osgParticle::SmokeEffect* smoke = new osgParticle::SmokeEffect(position, 10.0f);
//火焰模拟
osgParticle::FireEffect* fire = new osgParticle::FireEffect(position, 10.0f);
//设置风向
explosion->setWind(wind);
explosionDebri->setWind(wind);
smoke->setWind(wind);
fire->setWind(wind);
这样是能出来爆炸特效,但是这个特效的时间怎么来控制呢? |
|