I want to share a simple particle emitter modification with the community. I hope it will be included ... I am using it on my game.
"setMaxMinLifeTime" function for emitters will be usefull. With this function it is possible to change the life time of particles.
"setParticlesPerSecond" function for emitters will be usefull. With this function it is possible to start/stop/restart the particle emitters.
Implementation;
Step 1 - (IParticleEmitter.h) - Add;
- To the class definition, public ...
Code: Select all
virtual void setParticlesPerSecond(int max, int min) = 0;
virtual void setMaxMinLifeTime(int max, int min) = 0;
- To the class definition, public ...
Code: Select all
void setParticlesPerSecond(int max, int min);
void setMaxMinLifeTime(int max, int min);
- To the class definition, public ...
Code: Select all
void setParticlesPerSecond(int max, int min);
void setMaxMinLifeTime(int max, int min);
Step 4 - (CParticlePointEmitter.cpp) - Add;
Code: Select all
void CParticlePointEmitter::setParticlesPerSecond(int max, int min)
{
MaxParticlesPerSecond = max;
MinParticlesPerSecond = min;
}
void CParticlePointEmitter::setMaxMinLifeTime(int max, int min)
{
MaxLifeTime = max;
MinLifeTime = min;
}
Step 5 - (CParticleBoxEmitter.cpp) - Add;
Code: Select all
void CParticleBoxEmitter::setParticlesPerSecond(int max, int min)
{
MaxParticlesPerSecond = max;
MinParticlesPerSecond = min;
}
void CParticleBoxEmitter::setMaxMinLifeTime(int max, int min)
{
MaxLifeTime = max;
MinLifeTime = min;
}