diff options
author | Stijn Buys <ingar@osirion.org> | 2008-11-16 13:53:44 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-11-16 13:53:44 +0000 |
commit | 315a8c2dff9b76ac5e1ebbef265f13ac19d65e3d (patch) | |
tree | dec6de0bcf7f19dd95b7121f27b185da67cee4e2 /src/render/particles.h | |
parent | 28ba97bdd8fb6ca352dc49dba01a66bd155ad523 (diff) |
engine trails
Diffstat (limited to 'src/render/particles.h')
-rw-r--r-- | src/render/particles.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/render/particles.h b/src/render/particles.h new file mode 100644 index 0000000..400971c --- /dev/null +++ b/src/render/particles.h @@ -0,0 +1,73 @@ +/* + render/particles.h + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_RENDER_PARTICLES_H__ +#define __INCLUDED_RENDER_PARTICLES_H__ + +#include <deque> + +#include "math/color.h" +#include "math/vector3f.h" +#include "core/entity.h" + +namespace render { + +class Particle { +public: + Particle(const math::Vector3f &location, float time); + Particle(const math::Vector3f &location, const math::Vector3f &up, const math::Vector3f &left, float time); + + inline const math::Vector3f &location() const { return particle_location; } + + inline const math::Vector3f &up() const { return particle_up; } + + inline const math::Vector3f &left() const { return particle_left; } + + inline const float time() const { return particle_time; } + +protected: + math::Vector3f particle_location; + math::Vector3f particle_up; + math::Vector3f particle_left; + + float particle_time; +}; + + +class ParticleStream { +public: + ParticleStream(const math::Vector3f &location, const math::Color &color, float radius, size_t texture, core::EntityControlable *entity = 0, bool oriented = false); + ~ParticleStream(); + + void draw(); + + inline const size_t texture() const { return particles_texture; } + + inline const math::Vector3f &location() const { return particles_location; } + +protected: + typedef std::deque<Particle *> Particles; + + math::Vector3f particles_location; + math::Color particles_color; + size_t particles_texture; + bool particles_oriented; + + float particles_radius; + float particles_timeout; + float particles_eject; + + float particles_last_eject; + + core::EntityControlable *particles_entity; + + Particles particles_stream; +}; + + +} // namespace render + +#endif // __INCLUDED_RENDER_PARTICLES_H__ |