1 ////////////////////////////////////////////////////////////////////////////////
2 //    Scorched3D (c) 2000-2011
3 //
4 //    This file is part of Scorched3D.
5 //
6 //    Scorched3D is free software; you can redistribute it and/or modify
7 //    it under the terms of the GNU General Public License as published by
8 //    the Free Software Foundation; either version 2 of the License, or
9 //    (at your option) any later version.
10 //
11 //    Scorched3D is distributed in the hope that it will be useful,
12 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //    GNU General Public License for more details.
15 //
16 //    You should have received a copy of the GNU General Public License along
17 //    with this program; if not, write to the Free Software Foundation, Inc.,
18 //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 ////////////////////////////////////////////////////////////////////////////////
20 
21 #if !defined(__INCLUDE_Particleh_INCLUDE__)
22 #define __INCLUDE_Particleh_INCLUDE__
23 
24 #include <common/Vector.h>
25 #include <graph/ParticleRenderer.h>
26 #include <GLEXT/GLTextureSet.h>
27 
28 class ParticleUserData
29 {
30 public:
~ParticleUserData()31 	virtual ~ParticleUserData() {}
32 };
33 
34 class ParticleEngine;
35 class Particle
36 {
37 public:
38 	Particle();
39 	virtual ~Particle();
40 
41 	void setParticle(
42 		float life, float mass, float friction,
43 		Vector &velocity, Vector &gravity,
44 		Vector &color, Vector &colorCounter,
45 		Vector &size, Vector &sizeCounter,
46 		float alpha, float alphaCounter,
47 		bool additiveTexture,
48 		bool windAffect);
49 	void unsetParticle();
50 
51 	float life_;
52 	float mass_;
53 	float friction_;
54 	float percent_, percentCounter_;
55 	Vector position_;
56 	Vector velocity_;
57 	Vector gravity_;
58 	Vector color_, colorCounter_;
59 	Vector size_, sizeCounter_;
60 	float alpha_, alphaCounter_;
61 	bool windAffect_;
62 	ParticleEngine *engine_;
63 	unsigned int type_;
64 
65 	// Used for texturing
66 	bool additiveTexture_;
67 	GLTexture *texture_;
68 	GLTextureSet *textureSet_;
69 	int textureCoord_;
70 	bool shadow_;
71 	bool simulated_;
72 
73 	float distance_; // Dist from camera
74 	ParticleUserData *userData_;
75 	ParticleRenderer *renderer_; // How to render
76 };
77 
78 #endif // __INCLUDE_Particleh_INCLUDE__
79