Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-09-02 18:56:14 +0300
committerJacques Lucke <mail@jlucke.com>2019-09-02 18:56:14 +0300
commit0d700d201a11aba45719609a617dc9e13f8f97d4 (patch)
tree26cd5a643cad6e268f519e84ff454837abac5820 /source/blender/simulations/bparticles/forces.cpp
parentd2fe280a6ee8f51cb5eff8420bedd217952309fd (diff)
remove ParticleSet and ParticleSets abstraction
Diffstat (limited to 'source/blender/simulations/bparticles/forces.cpp')
-rw-r--r--source/blender/simulations/bparticles/forces.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp
index c7efe2395be..1f3f5e98162 100644
--- a/source/blender/simulations/bparticles/forces.cpp
+++ b/source/blender/simulations/bparticles/forces.cpp
@@ -10,12 +10,11 @@ Force::~Force()
void GravityForce::add_force(ForceInterface &interface)
{
- ParticleSet particles = interface.particles();
MutableArrayRef<float3> destination = interface.combined_destination();
auto inputs = m_compute_inputs->compute(interface);
- for (uint pindex : particles.pindices()) {
+ for (uint pindex : interface.pindices()) {
float3 acceleration = inputs->get<float3>("Direction", 0, pindex);
destination[pindex] += acceleration;
}
@@ -23,14 +22,12 @@ void GravityForce::add_force(ForceInterface &interface)
void TurbulenceForce::add_force(ForceInterface &interface)
{
- ParticleSet particles = interface.particles();
MutableArrayRef<float3> destination = interface.combined_destination();
-
- auto positions = particles.attributes().get<float3>("Position");
+ auto positions = interface.attributes().get<float3>("Position");
auto inputs = m_compute_inputs->compute(interface);
- for (uint pindex : particles.pindices()) {
+ for (uint pindex : interface.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;