These screenshots show a simple explosion-like particle system without and with trails:
The zip with the patch contains some usage information, but I'm posting here the code with which the second screenshot was generated:
Code: Select all
IParticleSystemSceneNode *particle_node = scenemgr->addParticleSystemSceneNode(false);
particle_node->setParticleSize(dimension2d<f32>(10.0,10.0));
IParticleEmitter *emitter = particle_node->createPointEmitter(vector3df(0.0,0.1,0.0),10,20,
SColor(255,255,255,255),SColor(255,255,255,255),
4000,4500,180);
particle_node->setEmitter(emitter);
emitter->drop();
particle_node->setMaterialFlag(EMF_LIGHTING,false);
particle_node->setMaterialTexture(0,driver->getTexture("fire.bmp"));
particle_node->setMaterialType(EMT_TRANSPARENT_VERTEX_ALPHA);
IParticleSystemSceneNode *trail_node = scenemgr->addParticleSystemSceneNode(false);
trail_node->setParticleSize(dimension2d<f32>(10.0,10.0));
emitter = trail_node->createTrailEmitter(particle_node,60,200,0.0,
vector3df(0.0,0.0,0.0));
trail_node->setEmitter(emitter);
emitter->drop();
IParticleAffector *affector = trail_node->createFadeOutParticleAffector(SColor(0,0,0,0),200);
trail_node->addAffector(affector);
affector->drop();
trail_node->setMaterialFlag(EMF_LIGHTING,false);
trail_node->setMaterialTexture(0,driver->getTexture("fire.bmp"));
trail_node->setMaterialType(EMT_TRANSPARENT_VERTEX_ALPHA);