From dee749e340a0286490c17d61562f95a53438e548 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 9 Jul 2013 20:53:48 +0300 Subject: a bit improve particles calculation speed. --- src/particle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/particle.cpp b/src/particle.cpp index 6e8ab14a7..b93fe376d 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -127,7 +127,7 @@ bool Particle::update() if (mTarget && mAcceleration != 0.0f) { - Vector dist = mPos - mTarget->getPosition(); + Vector dist = mPos - mTarget->mPos; dist.x *= SIN45; float invHypotenuse; @@ -243,7 +243,7 @@ bool Particle::update() { Particle *const particle = *p; // move particle with its parent if desired - if (particle->doesFollow()) + if (particle->mFollow) particle->moveBy(change); // update particle @@ -269,7 +269,7 @@ void Particle::moveBy(const Vector &change) FOR_EACH (ParticleConstIterator, p, mChildParticles) { Particle *const particle = *p; - if (particle->doesFollow()) + if (particle->mFollow) particle->moveBy(change); } } -- cgit v1.2.3-70-g09d2