aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleCylinderEmitter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CParticleCylinderEmitter.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CParticleCylinderEmitter.h164
1 files changed, 164 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleCylinderEmitter.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleCylinderEmitter.h
new file mode 100644
index 0000000..3b0fe41
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleCylinderEmitter.h
@@ -0,0 +1,164 @@
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_CYLINDER_EMITTER_H_INCLUDED__
6#define __C_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__
7
8#include "IParticleCylinderEmitter.h"
9#include "irrArray.h"
10
11namespace irr
12{
13namespace scene
14{
15
16//! A default box emitter
17class CParticleCylinderEmitter : public IParticleCylinderEmitter
18{
19public:
20
21 //! constructor
22 CParticleCylinderEmitter(
23 const core::vector3df& center, f32 radius,
24 const core::vector3df& normal, f32 length,
25 bool outlineOnly = false, const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
26 u32 minParticlesPerSecond = 20,
27 u32 maxParticlesPerSecond = 40,
28 const video::SColor& minStartColor = video::SColor(255,0,0,0),
29 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
30 u32 lifeTimeMin=2000,
31 u32 lifeTimeMax=4000,
32 s32 maxAngleDegrees=0,
33 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
34 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f)
35 );
36
37 //! Prepares an array with new particles to emitt into the system
38 //! and returns how much new particles there are.
39 virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray);
40
41 //! Set the center of the radius for the cylinder, at one end of the cylinder
42 virtual void setCenter( const core::vector3df& center ) { Center = center; }
43
44 //! Set the normal of the cylinder
45 virtual void setNormal( const core::vector3df& normal ) { Normal = normal; }
46
47 //! Set the radius of the cylinder
48 virtual void setRadius( f32 radius ) { Radius = radius; }
49
50 //! Set the length of the cylinder
51 virtual void setLength( f32 length ) { Length = length; }
52
53 //! Set whether or not to draw points inside the cylinder
54 virtual void setOutlineOnly( bool outlineOnly ) { OutlineOnly = outlineOnly; }
55
56 //! Set direction the emitter emits particles
57 virtual void setDirection( const core::vector3df& newDirection ) { Direction = newDirection; }
58
59 //! Set direction the emitter emits particles
60 virtual void setMinParticlesPerSecond( u32 minPPS ) { MinParticlesPerSecond = minPPS; }
61
62 //! Set direction the emitter emits particles
63 virtual void setMaxParticlesPerSecond( u32 maxPPS ) { MaxParticlesPerSecond = maxPPS; }
64
65 //! Set direction the emitter emits particles
66 virtual void setMinStartColor( const video::SColor& color ) { MinStartColor = color; }
67
68 //! Set direction the emitter emits particles
69 virtual void setMaxStartColor( const video::SColor& color ) { MaxStartColor = color; }
70
71 //! Set the maximum starting size for particles
72 virtual void setMaxStartSize( const core::dimension2df& size ) { MaxStartSize = size; }
73
74 //! Set the minimum starting size for particles
75 virtual void setMinStartSize( const core::dimension2df& size ) { MinStartSize = size; }
76
77 //! Set the minimum particle life-time in milliseconds
78 virtual void setMinLifeTime( u32 lifeTimeMin ) { MinLifeTime = lifeTimeMin; }
79
80 //! Set the maximum particle life-time in milliseconds
81 virtual void setMaxLifeTime( u32 lifeTimeMax ) { MaxLifeTime = lifeTimeMax; }
82
83 //! Maximal random derivation from the direction
84 virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) { MaxAngleDegrees = maxAngleDegrees; }
85
86 //! Get the center of the cylinder
87 virtual const core::vector3df& getCenter() const { return Center; }
88
89 //! Get the normal of the cylinder
90 virtual const core::vector3df& getNormal() const { return Normal; }
91
92 //! Get the radius of the cylinder
93 virtual f32 getRadius() const { return Radius; }
94
95 //! Get the center of the cylinder
96 virtual f32 getLength() const { return Length; }
97
98 //! Get whether or not to draw points inside the cylinder
99 virtual bool getOutlineOnly() const { return OutlineOnly; }
100
101 //! Gets direction the emitter emits particles
102 virtual const core::vector3df& getDirection() const { return Direction; }
103
104 //! Gets direction the emitter emits particles
105 virtual u32 getMinParticlesPerSecond() const { return MinParticlesPerSecond; }
106
107 //! Gets direction the emitter emits particles
108 virtual u32 getMaxParticlesPerSecond() const { return MaxParticlesPerSecond; }
109
110 //! Gets direction the emitter emits particles
111 virtual const video::SColor& getMinStartColor() const { return MinStartColor; }
112
113 //! Gets direction the emitter emits particles
114 virtual const video::SColor& getMaxStartColor() const { return MaxStartColor; }
115
116 //! Gets the maximum starting size for particles
117 virtual const core::dimension2df& getMaxStartSize() const { return MaxStartSize; }
118
119 //! Gets the minimum starting size for particles
120 virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; }
121
122 //! Get the minimum particle life-time in milliseconds
123 virtual u32 getMinLifeTime() const { return MinLifeTime; }
124
125 //! Get the maximum particle life-time in milliseconds
126 virtual u32 getMaxLifeTime() const { return MaxLifeTime; }
127
128 //! Maximal random derivation from the direction
129 virtual s32 getMaxAngleDegrees() const { return MaxAngleDegrees; }
130
131 //! Writes attributes of the object.
132 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
133
134 //! Reads attributes of the object.
135 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
136
137private:
138
139 core::array<SParticle> Particles;
140
141 core::vector3df Center;
142 core::vector3df Normal;
143 core::vector3df Direction;
144 core::dimension2df MaxStartSize, MinStartSize;
145 u32 MinParticlesPerSecond, MaxParticlesPerSecond;
146 video::SColor MinStartColor, MaxStartColor;
147 u32 MinLifeTime, MaxLifeTime;
148
149 f32 Radius;
150 f32 Length;
151
152 u32 Time;
153 u32 Emitted;
154 s32 MaxAngleDegrees;
155
156 bool OutlineOnly;
157};
158
159} // end namespace scene
160} // end namespace irr
161
162
163#endif
164