Page 1 of 1

Modify Particle Emitter

Posted: Sun Mar 27, 2005 4:39 pm
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!

Posted: Mon Mar 28, 2005 2:34 pm
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?

Posted: Tue Mar 29, 2005 10:20 pm
by ntitan
Bump.

Anyone? Please? With sugar on top!

Posted: Tue Mar 29, 2005 11:35 pm
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....