aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleAttractionAffector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CParticleAttractionAffector.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CParticleAttractionAffector.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleAttractionAffector.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleAttractionAffector.h
new file mode 100644
index 0000000..0221cdf
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleAttractionAffector.h
@@ -0,0 +1,87 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
6#define __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
7
8#include "IParticleAttractionAffector.h"
9
10namespace irr
11{
12namespace scene
13{
14
15//! Particle Affector for attracting particles to a point
16class CParticleAttractionAffector : public IParticleAttractionAffector
17{
18public:
19
20 CParticleAttractionAffector(
21 const core::vector3df& point = core::vector3df(), f32 speed = 1.0f,
22 bool attract = true, bool affectX = true,
23 bool affectY = true, bool affectZ = true );
24
25 //! Affects a particle.
26 virtual void affect(u32 now, SParticle* particlearray, u32 count);
27
28 //! Set the point that particles will attract to
29 virtual void setPoint( const core::vector3df& point ) { Point = point; }
30
31 //! Set the speed, in game units per second that the particles will attract to
32 //! the specified point
33 virtual void setSpeed( f32 speed ) { Speed = speed; }
34
35 //! Set whether or not the particles are attracting or detracting
36 virtual void setAttract( bool attract ) { Attract = attract; }
37
38 //! Set whether or not this will affect particles in the X direction
39 virtual void setAffectX( bool affect ) { AffectX = affect; }
40
41 //! Set whether or not this will affect particles in the Y direction
42 virtual void setAffectY( bool affect ) { AffectY = affect; }
43
44 //! Set whether or not this will affect particles in the Z direction
45 virtual void setAffectZ( bool affect ) { AffectZ = affect; }
46
47 //! Get the point that particles are attracted to
48 virtual const core::vector3df& getPoint() const { return Point; }
49
50 //! Get the speed that points attract to the specified point
51 virtual f32 getSpeed() const { return Speed; }
52
53 //! Get whether or not the particles are attracting or detracting
54 virtual bool getAttract() const { return Attract; }
55
56 //! Get whether or not the particles X position are affected
57 virtual bool getAffectX() const { return AffectX; }
58
59 //! Get whether or not the particles Y position are affected
60 virtual bool getAffectY() const { return AffectY; }
61
62 //! Get whether or not the particles Z position are affected
63 virtual bool getAffectZ() const { return AffectZ; }
64
65 //! Writes attributes of the object.
66 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
67
68 //! Reads attributes of the object.
69 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
70
71private:
72
73 core::vector3df Point;
74 f32 Speed;
75 bool AffectX;
76 bool AffectY;
77 bool AffectZ;
78 bool Attract;
79 u32 LastTime;
80};
81
82} // end namespace scene
83} // end namespace irr
84
85
86#endif // __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
87