Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/particles.h')
-rw-r--r--src/render/particles.h114
1 files changed, 67 insertions, 47 deletions
diff --git a/src/render/particles.h b/src/render/particles.h
index 5b159da..909d027 100644
--- a/src/render/particles.h
+++ b/src/render/particles.h
@@ -57,45 +57,58 @@ public:
enum Type {Jet = 0, Trail = 1, Flame = 2, Spray = 3 };
inline const Type type() const {
- return particles_type;
+ return particlescript_type;
}
inline const std::string &label() const {
- return particles_label;
+ return particlescript_label;
}
inline const std::string &texture() const {
- return particles_texture;
+ return particlescript_texture;
}
inline const math::Color &color() const {
- return particles_color;
+ return particlescript_color;
+ }
+
+ /// axis transformation relative to the ejector
+ inline const math::Axis &axis() const {
+ return particlescript_axis;
}
inline float radius() const {
- return particles_radius;
+ return particlescript_radius;
}
inline float timeout() const {
- return particles_timeout;
+ return particlescript_timeout;
}
inline float eject() const {
- return particles_eject;
+ return particlescript_eject;
}
inline float speed() const {
- return particles_speed;
+ return particlescript_speed;
}
inline float alpha() const {
- return particles_alpha;
+ return particlescript_alpha;
}
inline float offset() const {
- return particles_offset;
+ return particlescript_offset;
+ }
+
+ inline const model::Cull cull() const {
+ return particlescript_cull;
}
+ inline const ParticleScript *next() const {
+ return particlescript_next;
+ }
+
static ParticleScript *load(const std::string &label);
static void clear();
@@ -104,24 +117,29 @@ public:
private:
static ParticleScript *find(const std::string &label);
- ParticleScript(const std::string label);
+ ParticleScript(const std::string & label);
~ParticleScript();
- std::string particles_label;
- std::string particles_texture;
- Type particles_type;
- math::Color particles_color;
-
- float particles_radius;
- float particles_timeout;
- float particles_eject;
- float particles_speed;
- float particles_alpha;
- float particles_offset;
+ std::string particlescript_label;
+ std::string particlescript_texture;
+ Type particlescript_type;
+ math::Color particlescript_color;
+ math::Axis particlescript_axis;
+
+ float particlescript_radius;
+ float particlescript_timeout;
+ float particlescript_eject;
+ float particlescript_speed;
+ float particlescript_alpha;
+ float particlescript_offset;
+
+ model::Cull particlescript_cull;
+
+ ParticleScript *particlescript_next;
typedef std::map<std::string, ParticleScript *> Registry;
- static Registry particles_registry;
+ static Registry particlescript_registry;
};
/* ---- class ParticleSystem --------------------------------------- */
@@ -130,7 +148,7 @@ private:
class ParticleSystem
{
public:
- ParticleSystem(ParticleScript *script, core::Entity *entity, model::Particles *modelclass);
+ ParticleSystem(const ParticleScript *script, const core::Entity *entity, const model::Particles *modelclass);
virtual ~ParticleSystem();
/// index of the texture to use
@@ -151,8 +169,13 @@ public:
inline const model::Cull cull() const {
return particlesystem_cull;
}
+
+ /// color of the particles
+ inline const math::Color & color() const {
+ return particlesystem_color;
+ }
- virtual void draw(float elapsed);
+ virtual void draw(const float elapsed);
void set_timeout(float timeout);
@@ -162,33 +185,30 @@ public:
void clear();
protected:
- core::Entity *particlesystem_entity;
-
typedef std::deque<Particle *> Stream;
inline Stream & stream() {
return particlesystem_stream;
}
-
- size_t particlesystem_texture;
-
+ Stream particlesystem_stream;
+
math::Axis particlesystem_axis;
math::Vector3f particlesystem_location;
-
- float particlesystem_last_eject;
-
- ParticleScript *particlesystem_script;
-
- Stream particlesystem_stream;
-
math::Vector3f ejector_location;
+ math::Color particlesystem_color;
+ model::Cull particlesystem_cull;
+
+
bool ejector_active;
+ float particlesystem_last_eject;
float particlesystem_radius;
float now;
- math::Color color;
- model::Particles *particlesystem_modelclass;
- model::Cull particlesystem_cull;
+ size_t particlesystem_texture;
+
+ const model::Particles *particlesystem_modelclass;
+ const ParticleScript *particlesystem_script;
+ const core::Entity *particlesystem_entity;
};
/* ---- class Flame ------------------------------------------------ */
@@ -197,10 +217,10 @@ protected:
class Flame : public ParticleSystem
{
public:
- Flame(ParticleScript *script, core::Entity *entity, model::Particles *modelclass);
+ Flame(const ParticleScript *script, const core::Entity *entity, const model::Particles *modelclass);
virtual ~Flame();
- virtual void draw(float elapsed);
+ virtual void draw(const float elapsed);
};
/* ---- class Jet -------------------------------------------------- */
@@ -209,10 +229,10 @@ public:
class Jet : public ParticleSystem
{
public:
- Jet(ParticleScript *script, core::Entity *entity, model::Particles *modelclass);
+ Jet(const ParticleScript *script, const core::Entity *entity, const model::Particles *modelclass);
virtual ~Jet();
- virtual void draw(float elapsed);
+ virtual void draw(const float elapsed);
};
/* ---- class Spray ----------------------------------------------- */
@@ -221,10 +241,10 @@ public:
class Spray : public ParticleSystem
{
public:
- Spray(ParticleScript *script, core::Entity *entity, model::Particles *modelclass);
+ Spray(const ParticleScript *script, const core::Entity *entity, const model::Particles *modelclass);
virtual ~Spray();
- virtual void draw(float elapsed);
+ virtual void draw(const float elapsed);
};
/* ---- class Trail ------------------------------------------------ */
@@ -233,7 +253,7 @@ public:
class Trail : public ParticleSystem
{
public:
- Trail(ParticleScript *script, core::Entity *entity, model::Particles *modelclass);
+ Trail(const ParticleScript *script, const core::Entity *entity, const model::Particles *modelclass);
virtual ~Trail();
virtual void draw(float elapsed);