summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-18 18:51:35 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-18 19:31:19 +0300
commit4634a027d750565b2ecb226e5182c202da422cf6 (patch)
treeb79737f75a6e5226d4284337c30cb76949e1757c
parent075dd47b8528e7e7897595b95d0d215ab3b75867 (diff)
downloadplus-4634a027d750565b2ecb226e5182c202da422cf6.tar.gz
plus-4634a027d750565b2ecb226e5182c202da422cf6.tar.bz2
plus-4634a027d750565b2ecb226e5182c202da422cf6.tar.xz
plus-4634a027d750565b2ecb226e5182c202da422cf6.zip
Ignore particle randomnes parameters less than 10.
-rw-r--r--src/particle/particle.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp
index aeb79a1b1..4bf01207c 100644
--- a/src/particle/particle.cpp
+++ b/src/particle/particle.cpp
@@ -158,14 +158,14 @@ void Particle::updateSelf() restrict2
}
}
- if (mRandomness > 0)
+ if (mRandomness >= 10) // reduce useless calculations
{
const int rand2 = mRandomness * 2;
- mVelocity.x += static_cast<float>(rand() % rand2 - mRandomness)
+ mVelocity.x += static_cast<float>(std::rand() % rand2 - mRandomness)
/ 1000.0F;
- mVelocity.y += static_cast<float>(rand() % rand2 - mRandomness)
+ mVelocity.y += static_cast<float>(std::rand() % rand2 - mRandomness)
/ 1000.0F;
- mVelocity.z += static_cast<float>(rand() % rand2 - mRandomness)
+ mVelocity.z += static_cast<float>(std::rand() % rand2 - mRandomness)
/ 1000.0F;
}