diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-23 22:23:36 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-23 22:23:36 +0200 |
commit | 6e2c5e1b57210b10f8781f103e5c46308544339f (patch) | |
tree | 9738592f2082de1881a0ea019bf3c99644134aef /src/crepe/api/ParticleEmitter.cpp | |
parent | 9b7be419c9dcc6ebd1e504713c7b2676ca3d2fdf (diff) |
more nitpicking
Diffstat (limited to 'src/crepe/api/ParticleEmitter.cpp')
-rw-r--r-- | src/crepe/api/ParticleEmitter.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/crepe/api/ParticleEmitter.cpp b/src/crepe/api/ParticleEmitter.cpp index 298a5ec..2e07562 100644 --- a/src/crepe/api/ParticleEmitter.cpp +++ b/src/crepe/api/ParticleEmitter.cpp @@ -1,29 +1,28 @@ -#include "ParticleEmitter.h" -#include "Particle.h" #include <ctime> #include <iostream> +#include "Particle.h" +#include "ParticleEmitter.h" + using namespace crepe; -ParticleEmitter::ParticleEmitter(uint32_t gameObjectId, uint32_t max_particles, - uint32_t emission_rate, uint32_t speed, - uint32_t speed_offset, uint32_t angle, - uint32_t angleOffset, float m_begin_lifespan, - float m_end_lifespan) - : Component(gameObjectId), m_max_particles(max_particles), - m_emission_rate(emission_rate), m_speed(speed), m_speed_offset(speed_offset), - m_position{0, 0}, m_begin_lifespan(m_begin_lifespan), - m_end_lifespan(m_end_lifespan) { +ParticleEmitter::ParticleEmitter(uint32_t game_object_id, + uint32_t max_particles, uint32_t emission_rate, + uint32_t speed, uint32_t speed_offset, + uint32_t angle, uint32_t angleOffset, + float begin_lifespan, float end_lifespan) + : Component(game_object_id), max_particles(max_particles), + emission_rate(emission_rate), speed(speed), speed_offset(speed_offset), + position{0, 0}, begin_lifespan(begin_lifespan), + end_lifespan(end_lifespan) { std::srand( static_cast<uint32_t>(std::time(nullptr))); // initialize random seed std::cout << "Create emitter" << std::endl; - m_min_angle - = (360 + angle - (angleOffset % 360)) % 360; // calculate minAngle - m_max_angle - = (360 + angle + (angleOffset % 360)) % 360; // calculate maxAngle - m_position.x = 400; - m_position.y = 400; - for (size_t i = 0; i < m_max_particles; i++) { + min_angle = (360 + angle - (angleOffset % 360)) % 360; // calculate minAngle + max_angle = (360 + angle + (angleOffset % 360)) % 360; // calculate maxAngle + position.x = 400; + position.y = 400; + for (size_t i = 0; i < max_particles; i++) { this->particles.emplace_back(); } } |