diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-24 14:37:55 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-24 14:37:55 +0300 |
commit | 74fcb4d4c2f3c72747119a672c7e322f6f910478 (patch) | |
tree | dc3fc78988e74bad920a6dbb739bdf8fdd80081b /source/blender/simulation/intern/particle_mesh_emitter.cc | |
parent | f495b583bee5d43755c19bea4704e40d0e0f8a54 (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_mesh_emitter.cc')
-rw-r--r-- | source/blender/simulation/intern/particle_mesh_emitter.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/simulation/intern/particle_mesh_emitter.cc b/source/blender/simulation/intern/particle_mesh_emitter.cc index 15a6bffa884..81640695f92 100644 --- a/source/blender/simulation/intern/particle_mesh_emitter.cc +++ b/source/blender/simulation/intern/particle_mesh_emitter.cc @@ -291,7 +291,7 @@ static BLI_NOINLINE EmitterSettings compute_settings(const fn::MultiFunction &in EmitterSettings parameters; fn::MFContextBuilder mf_context; - mf_context.add_global_context("PersistentDataHandleMap", &context.solve_context().handle_map()); + mf_context.add_global_context("PersistentDataHandleMap", &context.solve_context.handle_map); fn::MFParamsBuilder mf_params{inputs_fn, 1}; bke::PersistentObjectHandle object_handle; @@ -300,7 +300,7 @@ static BLI_NOINLINE EmitterSettings compute_settings(const fn::MultiFunction &in inputs_fn.call(IndexRange(1), mf_params, mf_context); - parameters.object = context.solve_context().handle_map().lookup(object_handle); + parameters.object = context.solve_context.handle_map.lookup(object_handle); return parameters; } @@ -318,7 +318,7 @@ void ParticleMeshEmitter::emit(ParticleEmitterContext &context) const Vector<float> new_birth_times; if (!compute_new_particle_attributes(settings, - context.emit_interval(), + context.emit_interval, *state, new_positions, new_velocities, |