removed 3 magic numbers in particle system

This commit is contained in:
Jeffrey Ventrella 2013-08-05 12:05:15 -07:00
parent ace133a62e
commit 405cb516f6
2 changed files with 7 additions and 3 deletions

View file

@ -344,9 +344,9 @@ void ParticleSystem::updateParticle(int p, float deltaTime) {
} else if (myEmitter.particleAttributes[lifeStage].modulationStyle == COLOR_MODULATION_STYLE_RAINBOW_CYCLE) {
float amp = myEmitter.particleAttributes[lifeStage].modulationAmplitude * ONE_HALF;
redModulation = sinf(radian * 0.5f) * amp;
greenModulation = sinf(radian * 0.7f) * amp;
bueModulation = sinf(radian * 1.0f) * amp;
redModulation = sinf(radian * RAINBOW_CYCLE_RED_RATE ) * amp;
greenModulation = sinf(radian * RAINBOW_CYCLE_GREEN_RATE) * amp;
bueModulation = sinf(radian * RAINBOW_CYCLE_BLUE_RATE ) * amp;
}
_particle[p].color.r += redModulation;

View file

@ -15,6 +15,10 @@ const int NULL_PARTICLE = -1;
const int MAX_EMITTERS = 100;
const int MAX_PARTICLES = 5000;
const float RAINBOW_CYCLE_RED_RATE = 0.5f;
const float RAINBOW_CYCLE_GREEN_RATE = 0.7f;
const float RAINBOW_CYCLE_BLUE_RATE = 1.0f;
enum ParticleRenderStyle
{
PARTICLE_RENDER_STYLE_SPHERE = 0,