diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-07-18 18:34:40 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-07-18 18:34:40 +0300 |
commit | 9a965af52918ef3a19baa1bc282b9243222e651f (patch) | |
tree | 6b91a00904b850d0a26075ace6772e186fcb039d /source/blender/simulations/bparticles/forces.cpp | |
parent | 49d2d8b47ec63e4d1e437ef84cdb5d45f571b547 (diff) |
move offset handlers to separate file
Diffstat (limited to 'source/blender/simulations/bparticles/forces.cpp')
-rw-r--r-- | source/blender/simulations/bparticles/forces.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp index 1d859a3adc4..28d00e9355d 100644 --- a/source/blender/simulations/bparticles/forces.cpp +++ b/source/blender/simulations/bparticles/forces.cpp @@ -44,38 +44,4 @@ void TurbulenceForce::add_force(ParticlesBlock &block, ArrayRef<float3> r_force) } } -void CreateTrailHandler::execute(OffsetHandlerInterface &interface) -{ - if (m_rate <= 0.0f) { - return; - } - - ParticleSet particles = interface.particles(); - auto positions = particles.attributes().get_float3("Position"); - auto position_offsets = interface.offsets().get_float3("Position"); - - float frequency = 1.0f / m_rate; - - 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] + total_offset * factor); - new_birth_times.append(current_time); - current_time += frequency; - } - } - - auto new_particles = interface.particle_allocator().request(m_particle_type_name, - new_positions.size()); - new_particles.set_float3("Position", new_positions); - new_particles.set_float("Birth Time", new_birth_times); -} - } // namespace BParticles |