aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/ParticleEmitter.cpp
diff options
context:
space:
mode:
authorjaroWMR <jarorutjes07@gmail.com>2024-10-20 14:33:19 +0200
committerjaroWMR <jarorutjes07@gmail.com>2024-10-20 14:33:19 +0200
commitd8483cfab70b5aca3baae6e0588924da8b54e090 (patch)
tree5326d27e365ddea1923ee64586e0c5fc3befe6a9 /src/crepe/ParticleEmitter.cpp
parent4ff1159fe5f6ee6dd8becc662bc95a93acda545a (diff)
updated components to have an ID
Diffstat (limited to 'src/crepe/ParticleEmitter.cpp')
-rw-r--r--src/crepe/ParticleEmitter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crepe/ParticleEmitter.cpp b/src/crepe/ParticleEmitter.cpp
index 30cba7c..318c6db 100644
--- a/src/crepe/ParticleEmitter.cpp
+++ b/src/crepe/ParticleEmitter.cpp
@@ -5,8 +5,8 @@
using namespace crepe;
-ParticleEmitter::ParticleEmitter(uint32_t maxParticles, uint32_t emissionRate, uint32_t speed, uint32_t speedOffset, uint32_t angle, uint32_t angleOffset, float m_beginLifespan, float m_endLifespan)
- : m_maxParticles(maxParticles), m_emissionRate(emissionRate), m_speed(speed), m_speedOffset(speedOffset), m_position{0, 0}, m_beginLifespan(m_beginLifespan),m_endLifespan(m_endLifespan) {
+ParticleEmitter::ParticleEmitter(uint32_t gameObjectId ,uint32_t maxParticles, uint32_t emissionRate, uint32_t speed, uint32_t speedOffset, uint32_t angle, uint32_t angleOffset, float m_beginLifespan, float m_endLifespan)
+ : Component(gameObjectId), m_maxParticles(maxParticles), m_emissionRate(emissionRate), m_speed(speed), m_speedOffset(speedOffset), m_position{0, 0}, m_beginLifespan(m_beginLifespan),m_endLifespan(m_endLifespan) {
std::srand(static_cast<uint32_t>(std::time(nullptr))); // initialize random seed
std::cout << "Create emitter" << std::endl;
m_minAngle = (360 + angle - (angleOffset % 360)) % 360; // calculate minAngle