mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
removed 3 magic numbers in particle system
This commit is contained in:
parent
ace133a62e
commit
405cb516f6
2 changed files with 7 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue