From 9f2ac304e30a07b34eccb947410ddb9e527ea5f6 Mon Sep 17 00:00:00 2001 From: lognz Date: Sat, 11 Mar 2017 08:13:12 +0000 Subject: [PATCH] Corrected angle not factoring setDirection() into spawn angle --HG-- branch : particle system new features --- src/modules/graphics/ParticleSystem.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/graphics/ParticleSystem.cpp b/src/modules/graphics/ParticleSystem.cpp index 3f0e6fceb..c0037bf10 100644 --- a/src/modules/graphics/ParticleSystem.cpp +++ b/src/modules/graphics/ParticleSystem.cpp @@ -300,7 +300,6 @@ void ParticleSystem::initParticle(Particle *p, float t) max = sinf(rand_x) * areaSpread.getY(); p->position.x += cosf(areaSpreadAngle) * min - sinf(areaSpreadAngle) * max; p->position.y += sinf(areaSpreadAngle) * min + cosf(areaSpreadAngle) * max; - // dir += rand_x + areaSpreadAngle; break; case DISTRIBUTION_BORDER_RECTANGLE: rand_x = (float) rng.random((areaSpread.getX() + areaSpread.getY()) * -2, (areaSpread.getX() + areaSpread.getY()) * 2); @@ -329,7 +328,6 @@ void ParticleSystem::initParticle(Particle *p, float t) p->position.x += cosf(areaSpreadAngle) * min - sinf(areaSpreadAngle) * areaSpread.getY(); p->position.y += sinf(areaSpreadAngle) * min + cosf(areaSpreadAngle) * areaSpread.getY(); } - // dir += atan2(p->position.y - pos.getY(), p->position.x - pos.getX()); break; case DISTRIBUTION_NONE: default: @@ -338,7 +336,7 @@ void ParticleSystem::initParticle(Particle *p, float t) // Determine if the origin of each particle is the center of the area if (areaSpreadIsRelativeDirection) - dir = atan2(p->position.y - pos.getY(), p->position.x - pos.getX()); + dir += atan2(p->position.y - pos.getY(), p->position.x - pos.getX()); p->origin = pos;