createBoxEmitter box loading top of the camera

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
Radnussrini
Posts: 14
Joined: Tue Oct 10, 2006 5:58 am

createBoxEmitter box loading top of the camera

Post by Radnussrini »

Hi This is my code

scene::IParticleSystemSceneNode* ps = 0;
ps = smgr->addParticleSystemSceneNode(false);
ps->setPosition(core::vector3df(4266,419,3809));
ps->setScale(core::vector3df(2,2,2));

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

scene::IParticleEmitter* em = ps->createBoxEmitter(
core::aabbox3d<f32>(-270,-200,-270,270,300,300),
core::vector3df(0.01f,-0.02f,0.0f),
400,800,
video::SColor(0,255,255,255), video::SColor(0,255,255,255),
1800,3000);

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

scene::IParticleAffector* paf =
ps->createGravityAffector(core::vector3df(-0.05f,-0.03f, 0.0f), 2000);

ps->addAffector(paf);
paf->drop();

ps->setMaterialFlag(video::EMF_LIGHTING, false);
ps->setMaterialTexture(0, driver->getTexture("../../media/snowparticle.bmp"));
ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);


the code is run properly the problem is it loads a only a part of the map so ia planned to load the top of the camera. i tried to access the its not working Waiting for replays.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

problem is it loads a only a part of the map
The code you posted above doesn't load a map. It only creates a particle system, an emitter, and an affector. Reading your post I have no idea what the actual problem is. Could you please clearly state the problem you are having?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I didn't really want a PM on this, I wanted you to post here so there could be an open discussion.
The prob is I want to load camera top of a camara.
Okay, I guess. Your code snip does not have mention of any cameras, so it would be difficult to tell you what you are doing wrong. If you want one camera to be above [on top of] another camera, make a second camera that is the child of the first.
I try to load the box emitter to the top of the camera.
No, you loaded the box emitter at a fixed position. If you want the particle system to emit particles above the camera, even when the camera moves, you need to make the particle system a child of the camera.

Code: Select all

ps = smgr->addParticleSystemSceneNode(false, camera); 
Post Reply