diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-07-24 18:12:13 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-07-24 18:12:13 +0300 |
commit | 54724cc5b34c70210144a7df4f4fb3a2b0f39b39 (patch) | |
tree | 80899ebbf7fbd2f1c77a89d23f259a3c6681da89 /source/blender/simulations/bparticles/forces.cpp | |
parent | b60b1933845b814ad9b5364e8aff05e5ed90f642 (diff) |
simplify usage of particle functions
Diffstat (limited to 'source/blender/simulations/bparticles/forces.cpp')
-rw-r--r-- | source/blender/simulations/bparticles/forces.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp index f18c15cfc8a..7c7456e31dd 100644 --- a/source/blender/simulations/bparticles/forces.cpp +++ b/source/blender/simulations/bparticles/forces.cpp @@ -34,13 +34,11 @@ void TurbulenceForce::add_force(ForceInterface &interface) auto positions = block.attributes().get_float3("Position"); - auto caller = m_compute_inputs.get_caller(interface); - auto strengths = caller.add_output<float3>("Strength"); - caller.call(block.active_range().as_array_ref()); + auto inputs = m_compute_inputs.compute(interface); for (uint pindex = 0; pindex < block.active_amount(); pindex++) { float3 pos = positions[pindex]; - float3 strength = strengths[pindex]; + float3 strength = inputs.get<float3>("Strength", 0, pindex); float x = (BLI_gNoise(0.5f, pos.x, pos.y, pos.z + 1000.0f, false, 1) - 0.5f) * strength.x; float y = (BLI_gNoise(0.5f, pos.x, pos.y + 1000.0f, pos.z, false, 1) - 0.5f) * strength.y; float z = (BLI_gNoise(0.5f, pos.x + 1000.0f, pos.y, pos.z, false, 1) - 0.5f) * strength.z; |