/* 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 #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 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__