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