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:
authorJacques Lucke <jacques@blender.org>2020-07-24 14:37:55 +0300
committerJacques Lucke <jacques@blender.org>2020-07-24 14:37:55 +0300
commit74fcb4d4c2f3c72747119a672c7e322f6f910478 (patch)
treedc3fc78988e74bad920a6dbb739bdf8fdd80081b /source/blender/simulation/intern/particle_allocator.hh
parentf495b583bee5d43755c19bea4704e40d0e0f8a54 (diff)
Particles: initial particle birth action
A particle action is some function that is triggered by some event. Right now, users cannot control this. There is just a randomize-velocity on-birth action. So the direction of spawned particles is slightly randomized now. This also adds a new integer attribute called "Hash" which is useful for a number of things. Mainly for generating random numbers for a specific particle. The ID of a particle is not necessarily a good source of randomness.
Diffstat (limited to 'source/blender/simulation/intern/particle_allocator.hh')
-rw-r--r--source/blender/simulation/intern/particle_allocator.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/simulation/intern/particle_allocator.hh b/source/blender/simulation/intern/particle_allocator.hh
index 1e7578a75ed..1c412508fe6 100644
--- a/source/blender/simulation/intern/particle_allocator.hh
+++ b/source/blender/simulation/intern/particle_allocator.hh
@@ -70,10 +70,11 @@ class ParticleAllocator : NonCopyable, NonMovable {
private:
AttributesAllocator attributes_allocator_;
std::atomic<int> next_id_;
+ uint32_t hash_seed_;
public:
- ParticleAllocator(const fn::AttributesInfo &attributes_info, int next_id)
- : attributes_allocator_(attributes_info), next_id_(next_id)
+ ParticleAllocator(const fn::AttributesInfo &attributes_info, int next_id, uint32_t hash_seed)
+ : attributes_allocator_(attributes_info), next_id_(next_id), hash_seed_(hash_seed)
{
}