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-11 17:05:51 +0300
committerJacques Lucke <mail@jlucke.com>2019-09-11 17:05:51 +0300
commit23de6e69606d8ad3835a453b8ee4088f6aa52532 (patch)
treed8d03f675bab9eb9f79e2f29aa70918fc9c189b3 /source/blender/simulations/bparticles/forces.cpp
parentf0821153952c7f492081e3b6a08a6a9b6c49b02f (diff)
new Falloff input for Turbulence Force
Diffstat (limited to 'source/blender/simulations/bparticles/forces.cpp')
-rw-r--r--source/blender/simulations/bparticles/forces.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp
index 99b9fd84041..5ee4ee6044c 100644
--- a/source/blender/simulations/bparticles/forces.cpp
+++ b/source/blender/simulations/bparticles/forces.cpp
@@ -31,13 +31,17 @@ void TurbulenceForce::add_force(ForceInterface &interface)
auto inputs = m_compute_inputs->compute(interface);
+ TemporaryArray<float> weights(destination.size());
+ m_falloff->compute(interface.attributes(), interface.pindices(), weights);
+
for (uint pindex : interface.pindices()) {
float3 pos = positions[pindex];
float3 strength = inputs->get<float3>("Strength", 0, pindex);
+ float weight = weights[pindex];
float x = (BLI_gNoise(0.5f, pos.x, pos.y, pos.z + 1000.0f, false, 1) - 0.5f) * strength.x;
float y = (BLI_gNoise(0.5f, pos.x, pos.y + 1000.0f, pos.z, false, 1) - 0.5f) * strength.y;
float z = (BLI_gNoise(0.5f, pos.x + 1000.0f, pos.y, pos.z, false, 1) - 0.5f) * strength.z;
- destination[pindex] += {x, y, z};
+ destination[pindex] += float3(x, y, z) * weight;
}
}