Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/mantaflow/preprocessed/particle.cpp')
-rw-r--r--extern/mantaflow/preprocessed/particle.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/extern/mantaflow/preprocessed/particle.cpp b/extern/mantaflow/preprocessed/particle.cpp
index 05c561e2c60..ad1c344d307 100644
--- a/extern/mantaflow/preprocessed/particle.cpp
+++ b/extern/mantaflow/preprocessed/particle.cpp
@@ -28,9 +28,15 @@
using namespace std;
namespace Manta {
-ParticleBase::ParticleBase(FluidSolver *parent)
- : PbClass(parent), mMaxParticles(0), mAllowCompress(true), mFreePdata(false)
+int ParticleBase::globalSeed = 9832;
+
+ParticleBase::ParticleBase(FluidSolver *parent, int fixedSeed)
+ : PbClass(parent), mMaxParticles(0), mAllowCompress(true), mFreePdata(false), mSeed(fixedSeed)
{
+ // use global random seed if none is given
+ if (fixedSeed == -1) {
+ mSeed = globalSeed;
+ }
}
ParticleBase::~ParticleBase()