Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Now, let's get started with coding. To create a particle system in Irrlicht, we can use the following procedure:
First we'll add a particle system to our scene.
IParticleSystemSceneNode* ps = smgr- >addParticleSystemSceneNode(false);
Next, we'll create an emitter to emit that particle.
IParticleEmitter* em = ps->createBoxEmitter( aabbox3d<f32>(-5, 0, -5, 5, 1, 5), vector3df(0.0f, 0.1f, 0.0f), 50, 200, SColor(0, 0, 0, 255), SColor(0, 255, 255, 255), 800, 1000, 0, dimension2df(10.f, 10.f), dimension2df(20.f, 20.f));
Set the emitter to the particle system we just created and release the emitter since we've already set it to our particle.
ps->setEmitter(em); em->drop();
Set the particle system properties.
ps->setPosition(vector3df(-70, 60, 40));
ps->setScale(vector3df(2, 2, 2));
ps->setMaterialFlag(EMF_LIGHTING, false);
ps->setMaterialFlag(EMF_ZWRITE_ENABLE, false);
ps->setMaterialTexture(0, driver- >getTexture("../../media/fireball.bmp"));
ps->setMaterialType(EMT_TRANSPARENT_ADD_COLOR);