diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-07-09 20:53:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-07-09 20:53:48 +0300 |
commit | dee749e340a0286490c17d61562f95a53438e548 (patch) | |
tree | 9b5fdcd6579d131700a4584b3f12baddd5f557c6 /src/particle.cpp | |
parent | 9e1c8b7ab5db33f544305c3b160ca65b6972370f (diff) | |
download | manaverse-dee749e340a0286490c17d61562f95a53438e548.tar.gz manaverse-dee749e340a0286490c17d61562f95a53438e548.tar.bz2 manaverse-dee749e340a0286490c17d61562f95a53438e548.tar.xz manaverse-dee749e340a0286490c17d61562f95a53438e548.zip |
a bit improve particles calculation speed.
Diffstat (limited to 'src/particle.cpp')
-rw-r--r-- | src/particle.cpp | 6 |
1 files 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); } } |