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-07-18 17:39:28 +0300
committerJacques Lucke <mail@jlucke.com>2019-07-18 17:39:28 +0300
commit182cc120159cbe25a486dd3d42aeeb5cc7089902 (patch)
treea5d70b934beeb7ca0344326368c1f7ce5f3239d4 /source/blender/simulations/bparticles/forces.cpp
parent83e75345a2ee131c915ac8b721390b12fe6992c4 (diff)
fix trail creation for partial time steps
Diffstat (limited to 'source/blender/simulations/bparticles/forces.cpp')
-rw-r--r--source/blender/simulations/bparticles/forces.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp
index e9e83744be4..1d859a3adc4 100644
--- a/source/blender/simulations/bparticles/forces.cpp
+++ b/source/blender/simulations/bparticles/forces.cpp
@@ -59,11 +59,14 @@ void CreateTrailHandler::execute(OffsetHandlerInterface &interface)
SmallVector<float3> new_positions;
SmallVector<float> new_birth_times;
for (uint pindex : particles.pindices()) {
+ float time_factor = interface.time_factors()[pindex];
TimeSpan time_span = interface.time_span(pindex);
float current_time = frequency * (std::floor(time_span.start() / frequency) + 1.0f);
+
+ float3 total_offset = position_offsets[pindex] * time_factor;
while (current_time < time_span.end()) {
float factor = time_span.get_factor_safe(current_time);
- new_positions.append(positions[pindex] + position_offsets[pindex] * factor);
+ new_positions.append(positions[pindex] + total_offset * factor);
new_birth_times.append(current_time);
current_time += frequency;
}