aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Particle.hpp
diff options
context:
space:
mode:
authorjaroWMR <jarorutjes07@gmail.com>2024-10-07 18:07:17 +0200
committerjaroWMR <jarorutjes07@gmail.com>2024-10-07 18:07:17 +0200
commit5f84969c851530ebc430be2cf8e99c945ff7a4a7 (patch)
tree9fcd2755dbfd456f20f0ad37c18c7281b81382b1 /src/crepe/Particle.hpp
parent5cf5cf64d6f9597849ed5558da4f1bc201165fed (diff)
improved particle system from 90ms to ~ 0.7ms
Diffstat (limited to 'src/crepe/Particle.hpp')
-rw-r--r--src/crepe/Particle.hpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/crepe/Particle.hpp b/src/crepe/Particle.hpp
index f71fd67..669a8ab 100644
--- a/src/crepe/Particle.hpp
+++ b/src/crepe/Particle.hpp
@@ -1,18 +1,20 @@
#pragma once
-class Particle {
-public:
- struct Position {
+struct Position {
float x;
float y;
};
+class Particle {
+public:
+
Position position;
Position velocity;
float lifespan;
+ bool active;
- Particle(float lifespan, Position position, Position velocity);
+ Particle();
+ void reset(float lifespan, Position position, Position velocity);
void update(float deltaTime);
- bool isAlive() const;
float timeInLife;
};