]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CParticleAttractionAffector.h
Merging r5975 through r6036 from trunk to ogl-es branch.
[irrlicht.git] / source / Irrlicht / CParticleAttractionAffector.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 __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__\r
6 #define __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__\r
7 \r
8 #include "IrrCompileConfig.h"\r
9 #ifdef _IRR_COMPILE_WITH_PARTICLES_\r
10 \r
11 #include "IParticleAttractionAffector.h"\r
12 \r
13 namespace irr\r
14 {\r
15 namespace scene\r
16 {\r
17 \r
18 //! Particle Affector for attracting particles to a point\r
19 class CParticleAttractionAffector : public IParticleAttractionAffector\r
20 {\r
21 public:\r
22 \r
23         CParticleAttractionAffector(\r
24                 const core::vector3df& point = core::vector3df(), f32 speed = 1.0f,\r
25                 bool attract = true, bool affectX = true,\r
26                 bool affectY = true, bool affectZ = true );\r
27 \r
28         //! Affects a particle.\r
29         virtual void affect(u32 now, SParticle* particlearray, u32 count) _IRR_OVERRIDE_;\r
30 \r
31         //! Set the point that particles will attract to\r
32         virtual void setPoint( const core::vector3df& point ) _IRR_OVERRIDE_ { Point = point; }\r
33 \r
34         //! Set the speed, in game units per second that the particles will attract to the specified point\r
35         virtual void setSpeed( f32 speed ) _IRR_OVERRIDE_ { Speed = speed; }\r
36 \r
37         //! Set whether or not the particles are attracting or detracting\r
38         virtual void setAttract( bool attract ) _IRR_OVERRIDE_ { Attract = attract; }\r
39 \r
40         //! Set whether or not this will affect particles in the X direction\r
41         virtual void setAffectX( bool affect ) _IRR_OVERRIDE_ { AffectX = affect; }\r
42 \r
43         //! Set whether or not this will affect particles in the Y direction\r
44         virtual void setAffectY( bool affect ) _IRR_OVERRIDE_ { AffectY = affect; }\r
45 \r
46         //! Set whether or not this will affect particles in the Z direction\r
47         virtual void setAffectZ( bool affect ) _IRR_OVERRIDE_ { AffectZ = affect; }\r
48 \r
49         //! Get the point that particles are attracted to\r
50         virtual const core::vector3df& getPoint() const _IRR_OVERRIDE_ { return Point; }\r
51 \r
52         //! Get the speed that points attract to the specified point\r
53         virtual f32 getSpeed() const _IRR_OVERRIDE_ { return Speed; }\r
54 \r
55         //! Get whether or not the particles are attracting or detracting\r
56         virtual bool getAttract() const _IRR_OVERRIDE_ { return Attract; }\r
57 \r
58         //! Get whether or not the particles X position are affected\r
59         virtual bool getAffectX() const _IRR_OVERRIDE_ { return AffectX; }\r
60 \r
61         //! Get whether or not the particles Y position are affected\r
62         virtual bool getAffectY() const _IRR_OVERRIDE_ { return AffectY; }\r
63 \r
64         //! Get whether or not the particles Z position are affected\r
65         virtual bool getAffectZ() const _IRR_OVERRIDE_ { return AffectZ; }\r
66 \r
67         //! Writes attributes of the object.\r
68         virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_;\r
69 \r
70         //! Reads attributes of the object.\r
71         virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_;\r
72 \r
73 private:\r
74 \r
75         core::vector3df Point;\r
76         f32 Speed;\r
77         bool AffectX;\r
78         bool AffectY;\r
79         bool AffectZ;\r
80         bool Attract;\r
81         u32 LastTime;\r
82 };\r
83 \r
84 } // end namespace scene\r
85 } // end namespace irr\r
86 \r
87 #endif // _IRR_COMPILE_WITH_PARTICLES_\r
88 \r
89 #endif // __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__\r
90 \r