Code: Select all
camera = smgr->addCameraSceneNode(0, vector3df(0,10,-40), vector3df(0,0,0));
IParticleSystemSceneNode* ps = 0;
ps = smgr->addParticleSystemSceneNode(false);
ps->setPosition(core::vector3df(0,0,-10));
ps->setParticleSize(core::dimension2d<f32>(3.0f, 3.0f));
scene::IParticleEmitter* em = ps->createPointEmitter(vector3df(0.0f,0.003f,0),
500,600,
SColor(0,20,20,20),SColor(0,70,70,70),
900,1800,
45);
ps->setEmitter(em);
em->drop();
scene::IParticleAffector* paf =
ps->createFadeOutParticleAffector(SColor(0,0,0,0),500);
ps->addAffector(paf);
paf->drop();
paf = ps->createGravityAffector(vector3df(0.0f,0.006f,0.0f),2000);
ps->addAffector(paf);
paf->drop();
ps->setMaterialFlag(video::EMF_LIGHTING, false);
ps->setMaterialTexture(0, driver->getTexture("particle.bmp"));
ps->setMaterialType(EMT_TRANSPARENT_VERTEX_ALPHA);