diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-10-06 19:17:20 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-10-06 19:35:12 +0300 |
commit | a0ebfab4f3a31f08da651cf129982cbb419e0603 (patch) | |
tree | b3a4dd58a0d09ccca9dcb61860243c8515bf8ae3 /extern/mantaflow/helper/util/randomstream.h | |
parent | 2b72860ff4473255ac73519e5a66c085c0c1fbe8 (diff) |
Fluid: Updated Mantaflow source files
Among code cleanups, this update includes a new flood-fill helper function for levelsets.
Diffstat (limited to 'extern/mantaflow/helper/util/randomstream.h')
-rw-r--r-- | extern/mantaflow/helper/util/randomstream.h | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/extern/mantaflow/helper/util/randomstream.h b/extern/mantaflow/helper/util/randomstream.h index 6c20ddc6a14..5b477326f6f 100644 --- a/extern/mantaflow/helper/util/randomstream.h +++ b/extern/mantaflow/helper/util/randomstream.h @@ -377,19 +377,6 @@ class RandomStream { } /*! get a random number from the stream */ - inline double getDouble(void) - { - return mtr.rand(); - }; - inline float getFloat(void) - { - return (float)mtr.rand(); - }; - - inline float getFloat(float min, float max) - { - return mtr.rand(max - min) + min; - }; inline float getRandNorm(float mean, float var) { return mtr.randNorm(mean, var); @@ -400,12 +387,20 @@ class RandomStream { { return getFloat(); } + inline Real getReal(float min, float max) + { + return getFloat(min, max); + } #else inline Real getReal() { return getDouble(); } + inline Real getReal(double min, double max) + { + return getDouble(min, max); + } #endif inline Vec3 getVec3() @@ -422,6 +417,24 @@ class RandomStream { private: MTRand mtr; + + inline double getDouble(void) + { + return mtr.rand(); + }; + inline float getFloat(void) + { + return (float)mtr.rand(); + }; + + inline double getDouble(double min, double max) + { + return mtr.rand(max - min) + min; + }; + inline float getFloat(float min, float max) + { + return (float)(mtr.rand(max - min) + min); + }; }; } // namespace Manta |