Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ParticleTimeGenerator.cpp
Go to the documentation of this file.
1
2
4
5namespace Divide {
6
7void ParticleTimeGenerator::generate([[maybe_unused]] Task& packagedTasksParent,
8 [[maybe_unused]] TaskPool& parentPool,
9 [[maybe_unused]] const U64 deltaTimeUS,
10 ParticleData& p,
11 const U32 startIndex,
12 const U32 endIndex) {
13 for (U32 i = startIndex; i < endIndex; ++i) {
14 const F32 time = Random(_minTime, _maxTime);
15 vec4<F32>& misc = p._misc[i];
16 misc.x = time;
17 misc.y = 0.0f;
18 misc.z = time > EPSILON_F32 ? 1.f / misc.x : 0.f;
19 }
20}
21
22} //namespace Divide
Container to store data for a given set of particles.
Definition: ParticleData.h:59
vector< vec4< F32 > > _misc
x = time; y = interpolation; z = 1 / time; w = distance to camera sq;
Definition: ParticleData.h:74
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
T Random()
Definition: MathHelper.inl:95
constexpr F32 EPSILON_F32
uint32_t U32
uint64_t U64
void generate(Task &packagedTasksParent, TaskPool &parentPool, U64 deltaTimeUS, ParticleData &p, U32 startIndex, U32 endIndex) override