From 4d2dcb6a5fbd075df16db169460e4d3791289475 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 23 Aug 2019 15:41:33 +0200 Subject: Initial implementation of updated ui proposal --- source/blender/simulations/bparticles/forces.cpp | 29 ------------------------ 1 file changed, 29 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 09afd175d82..51b88d2efdf 100644 --- a/source/blender/simulations/bparticles/forces.cpp +++ b/source/blender/simulations/bparticles/forces.cpp @@ -40,33 +40,4 @@ void TurbulenceForce::add_force(ForceInterface &interface) } } -void PointForce::add_force(ForceInterface &interface) -{ - ParticlesBlock &block = interface.block(); - MutableArrayRef destination = interface.combined_destination(); - - auto inputs = m_compute_inputs->compute(interface); - - for (uint pindex = 0; pindex < block.active_amount(); pindex++) { - float3 direction = inputs->get("Direction", 0, pindex); - float strength = inputs->get("Strength", 1, pindex); - float falloff = inputs->get("Falloff", 2, pindex); - float distance = inputs->get("Distance", 3, pindex); - bool gravitation = inputs->get("Gravitation", 4, pindex); - - if (gravitation) { - if (distance < FLT_EPSILON) { - strength = 0.0f; - } - else { - strength *= powf(distance, -2.0f); - } - } - - direction *= (strength * falloff); - - destination[pindex] += direction; - } -} - } // namespace BParticles -- cgit v1.2.3