aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/graphics/particles/je_particle_system.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-01-12 21:48:33 +0800
committerchai <chaifix@163.com>2019-01-12 21:48:33 +0800
commit8b00d67febf133e89f6a0bfabc41feed555dc4a9 (patch)
treefe48ef17c250afa40c2588300fcdb5920dba6951 /src/libjin/graphics/particles/je_particle_system.h
parenta907c39756ef6b368d06643afa491c49a9044a8e (diff)
*去掉文件前缀je_
Diffstat (limited to 'src/libjin/graphics/particles/je_particle_system.h')
-rw-r--r--src/libjin/graphics/particles/je_particle_system.h195
1 files changed, 0 insertions, 195 deletions
diff --git a/src/libjin/graphics/particles/je_particle_system.h b/src/libjin/graphics/particles/je_particle_system.h
deleted file mode 100644
index 4734313..0000000
--- a/src/libjin/graphics/particles/je_particle_system.h
+++ /dev/null
@@ -1,195 +0,0 @@
-#ifndef __JE_PARTICLE_EMMITTER_H__
-#define __JE_PARTICLE_EMMITTER_H__
-
-#include <vector>
-
-#include "../../common/je_temporary.h"
-#include "../../game/je_gameobject.h"
-
-#include "../je_sprite.h"
-
-#include "je_particle_emitter.h"
-#include "je_particle_pool.h"
-#include "je_particle.h"
-
-namespace JinEngine
-{
- namespace Graphics
- {
- namespace Particles
- {
-
- ///
- /// Definition of particle system.
- ///
- struct ParticleSystemDef
- {
- ParticleSystemDef() {}
- uint maxParticleCount = 1; ///< Max count of particles in pool. 1 by default.
- ParticleEmitterDef emitterDef; ///< Particle emitter definition.
- ParticleDef particleDef; ///< Particle definition.
- };
-
- ///
- /// Particle emitter, handle all particles it emitts.
- ///
- class ParticleSystem : public Renderable, public Game::GameObject
- {
- public:
- ///
- /// Particle system constructor
- ///
- /// @param def Definition of particle system.
- ///
- ParticleSystem(const ParticleSystemDef& def);
-
- ///
- ///
- ///
- ParticleSystem(uint maxCount = 64);
-
- ///
- ///
- ///
- ParticleSystem(const std::string & config);
-
- ///
- /// Particle system destructor.
- ///
- ~ParticleSystem();
-
- ///
- ///
- ///
- void setDefinition(const ParticleSystemDef& def);
-
- ///
- /// Load definition from config.
- ///
- void setDefinition(const std::string& config);
-
- ///
- /// Update particle system and all alive particles.
- ///
- void update(float dt);
-
- ///
- /// Render particle system.
- ///
- void render();
-
- ///
- /// Set particle system position.
- ///
- void setPosition(float x, float y);
-
- ///
- /// Set scale.
- ///
- void setScale(float sx, float sy);
-
- ///
- /// Pause particle spawn.
- ///
- void pause(bool isPause);
-
- ///
- /// Clear all particles.
- ///
- void clear();
-
- //////////////////////////////////////////////////////////////////////////////////////////////////
- // Particle Emitter modification.
- //////////////////////////////////////////////////////////////////////////////////////////////////
-
- void setEmitRate(float floor, float ceil);
- void setEmitRate(float rate);
-
- void setEmitForce(float floor, float ceil);
- void setEmitForce(float force);
-
- void setEmitDirection(float floor, float ceil);
- void setEmitDirection(float dir);
-
- void setEmitPosition(const Math::Vector2<float>& floor, const Math::Vector2<float>& ceil);
- void setEmitPosition(const Math::Vector2<float>& position);
-
- //////////////////////////////////////////////////////////////////////////////////////////////////
- // Particle modification.
- //////////////////////////////////////////////////////////////////////////////////////////////////
-
- void setParticleLife(float floor, float ceil);
- void setParticleLife(float time);
-
- void setParticleLinearAccelaration(Math::Vector2<float> ac);
-
- void setParticleRadialAccelaration(float ra);
-
- void setParticleAngularSpeed(float floor, float ceil);
- void setParticleAngularSpeed(float speed);
-
- void setParticleSpritesMode(SpriteMode mode);
- void addParticleSprite(const Sprite* sprite);
- void addParticleSprites(uint count, ...);
- void addParticleSprites(const std::vector<const Sprite*>& sprs);
- void removeParticleSprite(uint i);
-
- void enableParticleBlendAdditive(bool enable);
-
- void setParticleScale(float scale);
- void addParticleScalePoint(float scale, float t);
- void removeParticleScalePoint(uint i);
-
- void setParticleColor(Color tint);
- void addParticleColorPoint(Color tint, float t);
- void removeParticleColorPoint(uint i);
-
- void setParticleTransparency(float transparency);
- void addParticleTransparencyPoint(float transparency, float t);
- void removeParticleTransparencyPoint(uint i);
-
- private:
- friend class ParticleEmitter;
-
- ///
- /// Particle system position.
- ///
- Math::Vector2<float> mPosition;
-
- ///
- ///
- ///
- Particle* claim();
-
- ///
- ///
- ///
- void recycle(int i, Particle* p);
-
- ///
- /// Particle system definition.
- ///
- ParticleSystemDef mDef;
-
- ///
- /// Particle emitter.
- ///
- ParticleEmitter mEmitter;
-
- ///
- /// Particle pool.
- ///
- ParticlePool mParticlePool;
-
- ///
- /// Alive particles, that means these particles could join to the life cycle loop.
- ///
- std::vector<Particle*> mAliveParticles;
-
- };
-
- } // namespace Particles
- } // namespace Graphics
-} // namespace JinEngine
-
-#endif \ No newline at end of file