aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/particle/je_particle.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Graphics/particle/je_particle.h')
-rw-r--r--src/libjin/Graphics/particle/je_particle.h154
1 files changed, 0 insertions, 154 deletions
diff --git a/src/libjin/Graphics/particle/je_particle.h b/src/libjin/Graphics/particle/je_particle.h
deleted file mode 100644
index 089bf35..0000000
--- a/src/libjin/Graphics/particle/je_particle.h
+++ /dev/null
@@ -1,154 +0,0 @@
-#ifndef __JE_PARTICLE_H
-#define __JE_PARTICLE_H
-
-#include "../../math/je_vector2.hpp"
-
-namespace JinEngine
-{
- namespace Graphics
- {
-
- class ParticleEmitter;
-
- struct LifeTimeDef
- {
- bool enableRandom = false;
- union
- {
- struct
- {
- float min, max;
- } random;
- float life;
- } life;
- };
-
- struct LinearAccelaration
- {
-
- };
-
- struct SpeedOverTimeDef
- {
- bool enable = false;
- bool enableRandom = false;
- union
- {
- struct
- {
- Math::Vector2<float> startFloor;
- Math::Vector2<float> startCeil;
- Math::Vector2<float> endFloor;
- Math::Vector2<float> endCeil;
- } random;
- struct
- {
- Math::Vector2<float> start;
- Math::Vector2<float> end;
- } speed;
- } speed;
- };
-
- struct SizeOverTimeDef
- {
- bool enable = false;
- bool enableRandom = false;
- union {
- struct {
- float startFloor = 1;
- float startCeil = 1;
- float endFloor = 1;
- float endCeil = 1;
- } random;
- struct {
- float start = 1;
- float end = 1;
- } size;
- } size;
- };
-
- struct ColorOverTime
- {
- bool enable = false;
- Color colorStart = Color::WHITE;
- Color colorEnd = Color::WHITE;
- };
-
- ///
- ///
- ///
- struct ParticleDef
- {
- private:
- friend class ParticleEmitter;
-
- public:
- // Basic definitions.
- LifeTimeDef lifeTimeDef; ///<
- // Optional definitions.
-
- SpeedOverTimeDef speedOverTimeDef; ///<
- SizeOverTimeDef sizeOverTimeDef; ///<
- ColorOverTime colorOverTimeDef; ///<
- };
-
- ///
- /// A single particle contains various properties of particle, such as position, accelaration, color and
- /// other attributes changed over time.
- ///
- struct Particle
- {
- Particle(const ParticleDef& particleDef);
- ///
- /// Whole life time.
- ///
- float lifeTime = 0.0f;
-
- ///
- /// Current life time.
- ///
- float life = 0.0f;
-
- ///
- /// Current position.
- ///
- float position[2] = {0,0};
-
- ///
- /// Emitte direction.
- ///
- float direction = 0;
-
- Math::Vector2<float> speed;
- Math::Vector2<float> linearAcceleration;
- float radialAcceleration = 0;
- float tangetialAcceleration = 0;
-
- ///
- /// Size over lifetime.
- ///
- float size = 1;
- float sizeBegin = 1;
- float sizeEnd = 1;
-
- float rotation = 0;
- float angle = 0;
-
- ///
- /// Color over lifetime.
- ///
- Color color = Color::WHITE;
- Color colorStart = Color::WHITE;
- Color colorEnd = Color::WHITE;
-
- ///
- /// Is particle still alive? Alive is equivalent to NOT available in particle pool.
- ///
- bool alive = false;
-
- };
-
- } // namespace Graphics
-} // namespace JinEngine
-
-#endif \ No newline at end of file