diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-22 02:12:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-22 02:12:41 +0300 |
commit | 238642d6a99d3f764529a339d0802d3e3909f391 (patch) | |
tree | f115374ffdf930f530bfc916065823032fc303cb /src/particle/particle.cpp | |
parent | ad56ac4bda60beddf33640df346801af1ece9ccf (diff) | |
download | manaverse-238642d6a99d3f764529a339d0802d3e3909f391.tar.gz manaverse-238642d6a99d3f764529a339d0802d3e3909f391.tar.bz2 manaverse-238642d6a99d3f764529a339d0802d3e3909f391.tar.xz manaverse-238642d6a99d3f764529a339d0802d3e3909f391.zip |
Use strong typed enum ParticlePhysics.
Diffstat (limited to 'src/particle/particle.cpp')
-rw-r--r-- | src/particle/particle.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index 3019aeda0..40b1b7a5a 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -140,11 +140,11 @@ void Particle::updateSelf() restrict2 switch (ParticleEngine::fastPhysics) { - case 1: + case ParticlePhysics::Normal: invHypotenuse = fastInvSqrt( dist.x * dist.x + dist.y * dist.y + dist.z * dist.z); break; - case 2: + case ParticlePhysics::Fast: if (dist.x == 0.0f) { invHypotenuse = 0; @@ -155,6 +155,7 @@ void Particle::updateSelf() restrict2 + static_cast<float>(fabs(dist.y)) + static_cast<float>(fabs(dist.z))); break; + case ParticlePhysics::Best: default: invHypotenuse = 1.0F / static_cast<float>(sqrt( dist.x * dist.x + dist.y * dist.y + dist.z * dist.z)); |