diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-07-25 11:01:10 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-07-25 11:01:10 +0300 |
commit | 7e4c48977846b7eb18d1ad81d87236baa6356e63 (patch) | |
tree | 2d85a3d852796a93f4b321553f35d45fcb058b4b /source/blender/simulations/bparticles/forces.cpp | |
parent | c92dd7bed6e0deeeef17a70cff38cc832706f22c (diff) |
use particle function for gravity force
Diffstat (limited to 'source/blender/simulations/bparticles/forces.cpp')
-rw-r--r-- | source/blender/simulations/bparticles/forces.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp index 9101e7d9271..f28fb478785 100644 --- a/source/blender/simulations/bparticles/forces.cpp +++ b/source/blender/simulations/bparticles/forces.cpp @@ -13,17 +13,11 @@ void GravityForce::add_force(ForceInterface &interface) ParticlesBlock &block = interface.block(); ArrayRef<float3> destination = interface.combined_destination(); - FN_TUPLE_CALL_ALLOC_TUPLES(m_compute_acceleration_body, fn_in, fn_out); - - FN::ExecutionStack stack; - FN::ExecutionContext execution_context(stack); - - m_compute_acceleration_body.call(fn_in, fn_out, execution_context); - - float3 acceleration = fn_out.get<float3>(0); + auto inputs = m_compute_inputs.compute(interface); - for (uint i = 0; i < block.active_amount(); i++) { - destination[i] += acceleration; + for (uint pindex = 0; pindex < block.active_amount(); pindex++) { + float3 acceleration = inputs->get<float3>("Direction", 0, pindex); + destination[pindex] += acceleration; } }; |