Modify Particle Emitter

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
ntitan
Posts: 21
Joined: Tue Mar 22, 2005 2:44 pm

Modify Particle Emitter

Post by ntitan »

I'm trying to figure out the best way to modify a particle emitter. My understanding of C++ is still somewhat limited so pardon me if the answer is something obvious.

I need to update the direction/Lifetime of my particles to match my craft as it moves.

I've built an emitter like so:

Code: Select all

	tmp->LEngineFX = smgr->addParticleSystemSceneNode(false,tmp->node);
	tmp->LEngineFX->setPosition(vector3df(20.0f,20.0f,60.0f));
	tmp->LEngineFX->setScale(vector3df(4,4,4));

	tmp->LEngineFX->setParticleSize(dimension2d<f32>(2.0f, 2.0f));

	tmp->LEngineFXEmit = tmp->LEngineFX->createBoxEmitter(
		aabbox3d<f32>(-2,-2,-2,2,2,2), 
		vector3df(0.0f,0.0f,0.1f),
		400,600, 
		video::SColor(0,255,200,200), video::SColor(0,255,255,200),
		40,60);

	tmp->LEngineFX->setEmitter(tmp->LEngineFXEmit);
	tmp->LEngineFXEmit->drop();

Is the only way to update the emitter for my particle system to create a new one and then re-apply it to my particle system e.g. tmp->LEngineFX->setEmitter(tmp->NEWLEngineFXEmit);

This seems like it would take more process/memory then neccessary.

Thanks for any help!
ntitan
Posts: 21
Joined: Tue Mar 22, 2005 2:44 pm

Post by ntitan »

OK, so how is anyone else adding particle emitters to an object that rotates?

I'm just trying to make my particle emitters velocity, spray out of the back of my engine. And turn off when no thrust is being applied.

Surely there's an easier answer then recreating the emitter every time you want to modify the velocity?
ntitan
Posts: 21
Joined: Tue Mar 22, 2005 2:44 pm

Post by ntitan »

Bump.

Anyone? Please? With sugar on top!
cartoonit
Posts: 286
Joined: Mon Nov 15, 2004 6:36 pm

Post by cartoonit »

Maybe set it as the parent of the node that u want it to follow, the particle emitter??? Theres something about rotating particles effects as well in the forums if you search, well in fact its in the tutorials as well....
Post Reply