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 'source/blender/simulation/intern/simulation_solver_influences.hh')
-rw-r--r--source/blender/simulation/intern/simulation_solver_influences.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/simulation/intern/simulation_solver_influences.hh b/source/blender/simulation/intern/simulation_solver_influences.hh
index 8d5e171bea0..0eb4dfbaf69 100644
--- a/source/blender/simulation/intern/simulation_solver_influences.hh
+++ b/source/blender/simulation/intern/simulation_solver_influences.hh
@@ -48,9 +48,19 @@ class ParticleForce {
};
struct SimulationInfluences {
+ /* TODO: Use a special type for a map that contains vectors. */
Map<std::string, Vector<const ParticleForce *>> particle_forces;
Map<std::string, fn::AttributesInfoBuilder *> particle_attributes_builder;
Vector<const ParticleEmitter *> particle_emitters;
+
+ Span<const ParticleForce *> get_particle_forces(StringRef particle_name) const
+ {
+ const Vector<const ParticleForce *> *forces = particle_forces.lookup_ptr(particle_name);
+ if (forces == nullptr) {
+ return {};
+ }
+ return *forces;
+ }
};
class SimulationStateMap {