[Bf-blender-cvs] [c2e4c7490f2] functions: take reference to emitter interface

Jacques Lucke noreply at git.blender.org
Mon Jun 24 12:38:15 CEST 2019


Commit: c2e4c7490f26194cee1adb2ec02bdfb9079a7c3b
Author: Jacques Lucke
Date:   Mon Jun 24 09:47:30 2019 +0200
Branches: functions
https://developer.blender.org/rBc2e4c7490f26194cee1adb2ec02bdfb9079a7c3b

take reference to emitter interface

===================================================================

M	source/blender/simulations/bparticles/core.hpp
M	source/blender/simulations/bparticles/emitters.cpp
M	source/blender/simulations/bparticles/simulate.cpp

===================================================================

diff --git a/source/blender/simulations/bparticles/core.hpp b/source/blender/simulations/bparticles/core.hpp
index 9af1e33caf4..2753d4d2b6a 100644
--- a/source/blender/simulations/bparticles/core.hpp
+++ b/source/blender/simulations/bparticles/core.hpp
@@ -171,7 +171,7 @@ class Emitter {
  public:
   virtual ~Emitter();
 
-  virtual void emit(EmitterInterface interface) = 0;
+  virtual void emit(EmitterInterface &interface) = 0;
 };
 
 class ParticleInfluences {
diff --git a/source/blender/simulations/bparticles/emitters.cpp b/source/blender/simulations/bparticles/emitters.cpp
index 335c445eae7..c7820ad6a93 100644
--- a/source/blender/simulations/bparticles/emitters.cpp
+++ b/source/blender/simulations/bparticles/emitters.cpp
@@ -20,7 +20,7 @@ class PointEmitter : public Emitter {
   {
   }
 
-  void emit(EmitterInterface interface) override
+  void emit(EmitterInterface &interface) override
   {
     auto &target = interface.request_raw();
     auto positions = target.attributes().get_float3("Position");
@@ -44,7 +44,7 @@ class SurfaceEmitter : public Emitter {
   {
   }
 
-  void emit(EmitterInterface interface) override
+  void emit(EmitterInterface &interface) override
   {
     MLoop *loops = m_mesh->mloop;
     MVert *verts = m_mesh->mvert;
@@ -85,7 +85,7 @@ class PathEmitter : public Emitter {
   {
   }
 
-  void emit(EmitterInterface interface) override
+  void emit(EmitterInterface &interface) override
   {
     SmallVector<float3> positions;
     for (uint i = 0; i < m_path.len - 1; i++) {
diff --git a/source/blender/simulations/bparticles/simulate.cpp b/source/blender/simulations/bparticles/simulate.cpp
index 26ac40a0771..1cc072d6397 100644
--- a/source/blender/simulations/bparticles/simulate.cpp
+++ b/source/blender/simulations/bparticles/simulate.cpp
@@ -376,7 +376,8 @@ BLI_NOINLINE static void emit_new_particles_from_emitter(ParticlesContainer &con
     return targets.last();
   };
 
-  emitter.emit(EmitterInterface{request_target});
+  EmitterInterface interface{request_target};
+  emitter.emit(interface);
 
   for (uint i = 0; i < targets.size(); i++) {
     EmitterTarget &target = targets[i];



More information about the Bf-blender-cvs mailing list