blob: 79a0f026008753dfb843d50574c22e32e733d55d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include "BLI_noise.h"
#include "forces.hpp"
namespace BParticles {
Force::~Force()
{
}
void CustomForce::add_force(ForceInterface &interface)
{
MutableArrayRef<float3> dst = interface.combined_destination();
ParticleFunctionEvaluator inputs{m_inputs_fn, interface.mask(), interface.attributes()};
inputs.context_builder().set_buffer_cache(interface.buffer_cache());
inputs.compute();
for (uint pindex : interface.mask()) {
dst[pindex] += inputs.get_single<float3>("Force", 0, pindex);
}
}
} // namespace BParticles
|