From 4634a027d750565b2ecb226e5182c202da422cf6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Mar 2016 18:51:35 +0300 Subject: Ignore particle randomnes parameters less than 10. --- src/particle/particle.cpp | 8 ++++---- 1 file 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(rand() % rand2 - mRandomness) + mVelocity.x += static_cast(std::rand() % rand2 - mRandomness) / 1000.0F; - mVelocity.y += static_cast(rand() % rand2 - mRandomness) + mVelocity.y += static_cast(std::rand() % rand2 - mRandomness) / 1000.0F; - mVelocity.z += static_cast(rand() % rand2 - mRandomness) + mVelocity.z += static_cast(std::rand() % rand2 - mRandomness) / 1000.0F; } -- cgit v1.2.3-60-g2f50