From 7e4c48977846b7eb18d1ad81d87236baa6356e63 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 25 Jul 2019 10:01:10 +0200 Subject: use particle function for gravity force --- source/blender/simulations/bparticles/forces.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'source/blender/simulations/bparticles/forces.cpp') 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 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(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("Direction", 0, pindex); + destination[pindex] += acceleration; } }; -- cgit v1.2.3