Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
blob: 400971ced29bdce8088956bdbd44d190e077c6c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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__