Simple question i think. I lack the information to know how to call it more than once. This code here:
ParticleSystem* windParticle = mSceneMgr->createParticleSystem("Wingtip", "Wingtip");
SceneNode* windParticleNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("WindParticle");
windParticleNode->attachObject(windParticle);
windParticleNode->setPosition(0,10,-10);
I call it once and it will stay on screen. but obviously if I was to call this entire code again it would crash as I can have only one instance of windparticle.
Problem is I don't know the code to re use the same particle over and over or the code to remove it off screen and I can't find any help on particles with ogre.Any help would be appreciated thanks.
How do I reuse a particle effect?
-
- Goblin
- Posts: 282
- Joined: Sat May 14, 2005 9:20 pm
- x 1
You can have more than one instance of a particle system template running at once - just give it a different name.
You can make particle systems timeout (ie not update) when offscreen with the 'nonvisible_update_timeout' attribute. See the manual. Or you can just destroy the systems with SceneManager::destroyParticleSystem yourself.
Code: Select all
ParticleSystem* windParticle = mSceneMgr->createParticleSystem("Wingtip1", "Wingtip");
SceneNode* windParticleNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("WindParticle1");
windParticle = mSceneMgr->createParticleSystem("Wingtip2", "Wingtip");
windParticleNode = SceneMgr->getRootSceneNode()->createChildSceneNode("WindParticle2");