Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ParticleVelocityFromPositionGenerator.cpp
Go to the documentation of this file.
1
2
4
5namespace Divide {
6
7void ParticleVelocityFromPositionGenerator::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 p._velocity[i].xyz = Random(_minScale, _maxScale) * (p._position[i].xyz - _offset);
15 }
16}
17
18} //namespace Divide
Container to store data for a given set of particles.
Definition: ParticleData.h:59
vector< vec4< F32 > > _position
x,y,z = position; w = size
Definition: ParticleData.h:68
vector< vec4< F32 > > _velocity
x,y,z = _velocity; w = angle;
Definition: ParticleData.h:70
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
T Random()
Definition: MathHelper.inl:95
uint32_t U32
uint64_t U64
void generate(Task &packagedTasksParent, TaskPool &parentPool, U64 deltaTimeUS, ParticleData &p, U32 startIndex, U32 endIndex) override