diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-18 18:51:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-18 19:31:19 +0300 |
commit | 4634a027d750565b2ecb226e5182c202da422cf6 (patch) | |
tree | b79737f75a6e5226d4284337c30cb76949e1757c /src/particle | |
parent | 075dd47b8528e7e7897595b95d0d215ab3b75867 (diff) | |
download | manaverse-4634a027d750565b2ecb226e5182c202da422cf6.tar.gz manaverse-4634a027d750565b2ecb226e5182c202da422cf6.tar.bz2 manaverse-4634a027d750565b2ecb226e5182c202da422cf6.tar.xz manaverse-4634a027d750565b2ecb226e5182c202da422cf6.zip |
Ignore particle randomnes parameters less than 10.
Diffstat (limited to 'src/particle')
-rw-r--r-- | src/particle/particle.cpp | 8 |
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; } |