aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/particles/je_particle_emitter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Graphics/particles/je_particle_emitter.h')
-rw-r--r--src/libjin/Graphics/particles/je_particle_emitter.h136
1 files changed, 0 insertions, 136 deletions
diff --git a/src/libjin/Graphics/particles/je_particle_emitter.h b/src/libjin/Graphics/particles/je_particle_emitter.h
deleted file mode 100644
index 44bd1fb..0000000
--- a/src/libjin/Graphics/particles/je_particle_emitter.h
+++ /dev/null
@@ -1,136 +0,0 @@
-#ifndef __JE_PARTICLE_EMITTER_H__
-#define __JE_PARTICLE_EMITTER_H__
-
-#include "../../common/je_temporary.h"
-#include "../../math/je_vector2.hpp"
-
-#include "je_particle.h"
-
-namespace JinEngine
-{
- namespace Graphics
- {
- namespace Particles
- {
-
- struct PositionDef
- {
- bool enableRandom = false;
- Struct(position,
- struct
- {
- Math::Vector2<float> floor;
- Math::Vector2<float> ceil;
- } random;
- Math::Vector2<float> position;
- );
- };
-
- struct DirectionDef
- {
- bool enableRandom = false;
- Struct(direction,
- struct
- {
- float floor = 0;
- float ceil = 0;
- } random;
- float direction = 0;
- );
- };
-
- ///
- /// How many particles emitted per second.
- ///
- struct EmitRateDef
- {
- bool enableRandom = false;
- Struct(rate,
- struct
- {
- float floor = 1;
- float ceil = 1;
- } random;
- float rate = 1;
- );
- };
-
- ///
- /// Initial speed of particle.
- ///
- struct ForceDef
- {
- bool enableRandom = false;
- Struct(force,
- struct
- {
- float floor = 1;
- float ceil = 1;
- } random;
- float force = 1;
- );
- };
-
- ///
- /// Definition of particle emitter.
- ///
- struct ParticleEmitterDef
- {
- EmitRateDef emitRateDef; ///< Emit rate.
-
- PositionDef positionDef; ///< Emit position(relativily to the particle system center).
- DirectionDef directionDef; ///< Emit direction.
- ForceDef forceDef; ///< Emit force.
- };
-
- class ParticleSystem;
-
- ///
- /// Emit a single particle.
- ///
- class ParticleEmitter
- {
- public:
- ///
- ///
- ///
- ParticleEmitter(ParticleSystem& ps);
-
- ///
- ///
- ///
- void update(float dt);
-
- private:
- ///
- ///
- ///
- ParticleSystem& mPS;
-
- const ParticleEmitterDef& mDef;
-
- const ParticleDef& mPDef;
-
- ///
- /// Emit particle according to emitter definition and particle definition, particle system should
- /// assign particle value to the particle in particle pool, but not use this return particle.
- ///
- void emit();
-
- ///
- ///
- ///
- float mTime;
-
- ///
- ///
- ///
- float mInterval;
-
- };
-
- } // namespace Particles
- } // namespace Graphics
-} // namespace JinEngine
-
-#endif \ No newline at end of file