]> git.lizzy.rs Git - irrlicht.git/blob - include/IParticleAffector.h
Fix pixel-perfect draw2DLine on OpenGL
[irrlicht.git] / include / IParticleAffector.h
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __I_PARTICLE_AFFECTOR_H_INCLUDED__\r
6 #define __I_PARTICLE_AFFECTOR_H_INCLUDED__\r
7 \r
8 #include "IAttributeExchangingObject.h"\r
9 #include "SParticle.h"\r
10 \r
11 namespace irr\r
12 {\r
13 namespace scene\r
14 {\r
15 \r
16 //! Types of built in particle affectors\r
17 enum E_PARTICLE_AFFECTOR_TYPE\r
18 {\r
19         EPAT_NONE = 0,\r
20         EPAT_ATTRACT,\r
21         EPAT_FADE_OUT,\r
22         EPAT_GRAVITY,\r
23         EPAT_ROTATE,\r
24         EPAT_SCALE,\r
25         EPAT_COUNT\r
26 };\r
27 \r
28 //! Names for built in particle affectors\r
29 const c8* const ParticleAffectorTypeNames[] =\r
30 {\r
31         "None",\r
32         "Attract",\r
33         "FadeOut",\r
34         "Gravity",\r
35         "Rotate",\r
36         "Scale",\r
37         0\r
38 };\r
39 \r
40 //! A particle affector modifies particles.\r
41 class IParticleAffector : public virtual io::IAttributeExchangingObject\r
42 {\r
43 public:\r
44 \r
45         //! constructor\r
46         IParticleAffector() : Enabled(true) {}\r
47 \r
48         //! Affects an array of particles.\r
49         /** \param now Current time. (Same as ITimer::getTime() would return)\r
50         \param particlearray Array of particles.\r
51         \param count Amount of particles in array. */\r
52         virtual void affect(u32 now, SParticle* particlearray, u32 count) = 0;\r
53 \r
54         //! Sets whether or not the affector is currently enabled.\r
55         virtual void setEnabled(bool enabled) { Enabled = enabled; }\r
56 \r
57         //! Gets whether or not the affector is currently enabled.\r
58         virtual bool getEnabled() const { return Enabled; }\r
59 \r
60         //! Get emitter type\r
61         virtual E_PARTICLE_AFFECTOR_TYPE getType() const = 0;\r
62 \r
63 protected:\r
64         bool Enabled;\r
65 };\r
66 \r
67 } // end namespace scene\r
68 } // end namespace irr\r
69 \r
70 \r
71 #endif\r
72 \r