diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-08-26 12:58:01 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-08-26 12:58:01 +0300 |
commit | bccd47ab4f5d358bf8f1e4b6ceb4b1e90936b1a8 (patch) | |
tree | f250baa174b4aa865031e7bccaac2d13d4b886ea /source/blender/simulations/bparticles/forces.cpp | |
parent | 5a3a155438c7a1dc97b5c660eac626cee46354cb (diff) |
remove particle block from interfaces
Diffstat (limited to 'source/blender/simulations/bparticles/forces.cpp')
-rw-r--r-- | source/blender/simulations/bparticles/forces.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp index 51b88d2efdf..c7efe2395be 100644 --- a/source/blender/simulations/bparticles/forces.cpp +++ b/source/blender/simulations/bparticles/forces.cpp @@ -10,12 +10,12 @@ Force::~Force() void GravityForce::add_force(ForceInterface &interface) { - ParticlesBlock &block = interface.block(); + ParticleSet particles = interface.particles(); MutableArrayRef<float3> destination = interface.combined_destination(); auto inputs = m_compute_inputs->compute(interface); - for (uint pindex = 0; pindex < block.active_amount(); pindex++) { + for (uint pindex : particles.pindices()) { float3 acceleration = inputs->get<float3>("Direction", 0, pindex); destination[pindex] += acceleration; } @@ -23,14 +23,14 @@ void GravityForce::add_force(ForceInterface &interface) void TurbulenceForce::add_force(ForceInterface &interface) { - ParticlesBlock &block = interface.block(); + ParticleSet particles = interface.particles(); MutableArrayRef<float3> destination = interface.combined_destination(); - auto positions = block.attributes().get<float3>("Position"); + auto positions = particles.attributes().get<float3>("Position"); auto inputs = m_compute_inputs->compute(interface); - for (uint pindex = 0; pindex < block.active_amount(); pindex++) { + for (uint pindex : particles.pindices()) { float3 pos = positions[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; |