Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ParticleBoxGenerator.cpp
Go to the documentation of this file.
1
2
4
5namespace Divide {
6
7void ParticleBoxGenerator::generate(Task& packagedTasksParent,
8 TaskPool& parentPool,
9 [[maybe_unused]] const U64 deltaTimeUS,
10 ParticleData& p,
11 U32 startIndex,
12 U32 endIndex) {
15
16 using iter_t = decltype(std::begin(p._position));
17 for_each_interval<iter_t>(std::begin(p._position) + startIndex,
18 std::begin(p._position) + endIndex,
20 [&](iter_t from, iter_t to)
21 {
22 Start(*CreateTask(
23 &packagedTasksParent,
24 [from, to, min, max](const Task&) mutable
25 {
26 std::for_each(from, to, [min, max](vec4<F32>& position)
27 {
28 position.xyz = Random(min, max);
29 });
30 }),
31 parentPool);
32 });
33}
34
35} //namespace Divide
Container to store data for a given set of particles.
Definition: ParticleData.h:59
static constexpr U32 g_threadPartitionSize
Definition: ParticleData.h:61
vector< vec4< F32 > > _position
x,y,z = position; w = size
Definition: ParticleData.h:68
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
uint32_t U32
uint64_t U64
void generate(Task &packagedTasksParent, TaskPool &parentPool, U64 deltaTimeUS, ParticleData &p, U32 startIndex, U32 endIndex) override