summaryrefslogtreecommitdiff
path: root/src/particle.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-07-09 20:53:48 +0300
committerAndrei Karas <akaras@inbox.ru>2013-07-09 20:53:48 +0300
commitdee749e340a0286490c17d61562f95a53438e548 (patch)
tree9b5fdcd6579d131700a4584b3f12baddd5f557c6 /src/particle.cpp
parent9e1c8b7ab5db33f544305c3b160ca65b6972370f (diff)
downloadmanaverse-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.cpp6
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);
}
}