diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-17 14:17:25 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-17 14:17:25 +0100 |
commit | e70c2a3a4a7f636f190cc64792029cadd3613337 (patch) | |
tree | 8371b0e067430db780b72638eb61555869641979 /src/crepe/Particle.h | |
parent | 68be6b67f79413cb4af0ca15262ca1547a7d0d41 (diff) | |
parent | 9957da232e7c96f7f88a7ab0edfa4aaf560d1c00 (diff) |
Merge branch 'master' into niels/UI
Diffstat (limited to 'src/crepe/Particle.h')
-rw-r--r-- | src/crepe/Particle.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/crepe/Particle.h b/src/crepe/Particle.h index d0397c9..ee0cd66 100644 --- a/src/crepe/Particle.h +++ b/src/crepe/Particle.h @@ -14,8 +14,6 @@ namespace crepe { * can also be reset or stopped. */ class Particle { - // TODO: add friend particleSsytem and rendersystem. Unit test will fail. - public: //! Position of the particle in 2D space. vec2 position; @@ -24,13 +22,13 @@ public: //! Accumulated force affecting the particle over time. vec2 force_over_time; //! Total lifespan of the particle in milliseconds. - uint32_t lifespan; + float lifespan; //! Active state of the particle; true if it is in use, false otherwise. bool active = false; //! The time the particle has been alive, in milliseconds. - uint32_t time_in_life = 0; + float time_in_life = 0; //! The angle at which the particle is oriented or moving. - double angle = 0; + float angle = 0; /** * \brief Resets the particle with new properties. @@ -43,14 +41,16 @@ public: * \param velocity The initial velocity of the particle. * \param angle The angle of the particle's trajectory or orientation. */ - void reset(uint32_t lifespan, const vec2 & position, const vec2 & velocity, double angle); + void reset(unsigned int lifespan, const vec2 & position, const vec2 & velocity, + float angle); /** * \brief Updates the particle's state. * * Advances the particle's position based on its velocity and applies accumulated forces. * Deactivates the particle if its lifespan has expired. + * \param dt The amount of fixed delta time that has passed. */ - void update(); + void update(double dt); /** * \brief Stops the particle's movement. * |