diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-08-23 16:41:33 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-08-23 16:41:33 +0300 |
commit | 4d2dcb6a5fbd075df16db169460e4d3791289475 (patch) | |
tree | 37de54d82c74b652b1289123a0f9b5d578eb3c6e /source/blender/simulations/bparticles/forces.cpp | |
parent | 9c05112910946581ccf17b23fc0ec5f0297467a3 (diff) |
Initial implementation of updated ui proposal
Diffstat (limited to 'source/blender/simulations/bparticles/forces.cpp')
-rw-r--r-- | source/blender/simulations/bparticles/forces.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
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<float3> destination = interface.combined_destination(); - - auto inputs = m_compute_inputs->compute(interface); - - for (uint pindex = 0; pindex < block.active_amount(); pindex++) { - float3 direction = inputs->get<float3>("Direction", 0, pindex); - float strength = inputs->get<float>("Strength", 1, pindex); - float falloff = inputs->get<float>("Falloff", 2, pindex); - float distance = inputs->get<float>("Distance", 3, pindex); - bool gravitation = inputs->get<bool>("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 |