Example 8 - wrong fire?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
fortikur
Posts: 25
Joined: Tue Nov 15, 2005 3:59 pm
Location: Hungary

Example 8 - wrong fire?

Post by fortikur »

I noticed, if I start Example 8 from the irrlicht examples that, when the fire emitter starts to work, it emits a strange "puff" in the beginning. I mean, if you start the example and as soon as it loads, you press LEFT (to sse the fire behind the dwarf), you will notice, that the emitter doesn't emit the particles continously. First, it emits a sort of fire ball, after it works fine.
I copied the emitter code into my code and saw, that if I write:

Code: Select all

	scene::IParticleSystemSceneNode* ps = 0;
	ps = scene->addParticleSystemSceneNode(false);
	ps->setPosition(core::vector3df(80,0,-150));
	ps->setScale(core::vector3df(2,2,2));

	ps->setParticleSize(core::dimension2d<f32>(20.0f, 20.0f));

    IParticleEmitter* em = ps->createBoxEmitter(
		core::aabbox3d<f32>(-7,0,-7,7,1,7),
		core::vector3df(0.0f,0.06f,0.0f),
		10,100, 
		video::SColor(0,255,255,255), video::SColor(0,255,255,255),
		600,1000);

	ps->setEmitter(em);
	em->drop();


	scene::IParticleAffector* paf =
	ps->createFadeOutParticleAffector();
	ps->addAffector(paf);
	paf->drop();



    ps->setMaterialFlag(video::EMF_LIGHTING, false);
	ps->setMaterialTexture(0, video->getTexture("fire.bmp"));
	ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
the first fire particle will go upwards alone (maybe there are a lot of particles on each other's top, cannot see it well). As it moves upwards, the "real" emitter will start to work and it works fine.

http://www.kokany.atw.hu/irr/xxx.jpg

Is this a bug in the engine, or the example is missing something?
Do emitters need timers to work correctly?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Emitters get the time as a parameter. There's a bug fix by Spintz which is already in the SVN to fix this initial error.
fortikur
Posts: 25
Joined: Tue Nov 15, 2005 3:59 pm
Location: Hungary

Post by fortikur »

I saw it, but the problem is, that i use irrlicht 1.1 and the patch is for 1.0.
I tried it with 1.1, but didn't work, so i grabbed my old Irrlicht stuff (1.0) and tried it. Worked.

But this is just a temporary solution. What happens if Irr 1.2, or 1.3, etc come out? I cannot upgrade and have to use the "bugged version".
sigh
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There are several solutions. One is to learn coding and understand why the patch does not work anymore. In most cases you don't even need to know how to code because it's mostly some spacing that changed.
Second would be to understand what I just wrote. It's permanently fixed in the SVN, so Irrlicht 1.2 will contain this fix. And you can also use the SVn version, or grab a new patch from there which might work better.
There are also other solutions, but I think these two will do for now. :wink:
fortikur
Posts: 25
Joined: Tue Nov 15, 2005 3:59 pm
Location: Hungary

Post by fortikur »

so Irrlicht 1.2 will contain this fix
Great! I'm looking forward to it!
till then, i will work on something else in my game.
Post Reply