summaryrefslogtreecommitdiff
path: root/src/particle.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-07-08 13:39:11 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-07-08 13:39:11 +0000
commit016faf8449aeb7dba2738da4fefa3609b3af589c (patch)
treebc25d08ff2df0ad2ba8f50886c83c06d78b6d11a /src/particle.cpp
parent1dab7893195814ba916bb9ec212a7084fd67fb97 (diff)
downloadmana-client-016faf8449aeb7dba2738da4fefa3609b3af589c.tar.gz
mana-client-016faf8449aeb7dba2738da4fefa3609b3af589c.tar.bz2
mana-client-016faf8449aeb7dba2738da4fefa3609b3af589c.tar.xz
mana-client-016faf8449aeb7dba2738da4fefa3609b3af589c.zip
Merged 0.0 changes from revision 3317 to 3362 to trunk.
Diffstat (limited to 'src/particle.cpp')
-rw-r--r--src/particle.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/particle.cpp b/src/particle.cpp
index 509c20ee..805da102 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -39,6 +39,8 @@
#include "utils/fastsqrt.h"
#include "utils/xml.h"
+#define SIN45 0.707106781f
+
class Graphics;
class Image;
@@ -122,7 +124,7 @@ Particle::update()
if (mTarget && mAcceleration != 0.0f)
{
- float distX = mPosX - mTarget->getPosX();
+ float distX = (mPosX - mTarget->getPosX()) * SIN45;
float distY = mPosY - mTarget->getPosY();
float distZ = mPosZ - mTarget->getPosZ();
float invHypotenuse;
@@ -167,8 +169,8 @@ Particle::update()
// Update position
mPosX += mVectorX;
- mPosY += mVectorY;
- mPosZ += mVectorZ;
+ mPosY += mVectorY * SIN45;
+ mPosZ += mVectorZ * SIN45;
// Update other stuff
if (mLifetimeLeft > 0)