aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleSphereEmitter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CParticleSphereEmitter.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CParticleSphereEmitter.h141
1 files changed, 141 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleSphereEmitter.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleSphereEmitter.h
new file mode 100644
index 0000000..59736ec
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleSphereEmitter.h
@@ -0,0 +1,141 @@
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_SPHERE_EMITTER_H_INCLUDED__
6#define __C_PARTICLE_SPHERE_EMITTER_H_INCLUDED__
7
8#include "IParticleSphereEmitter.h"
9#include "irrArray.h"
10#include "aabbox3d.h"
11
12namespace irr
13{
14namespace scene
15{
16
17//! A default box emitter
18class CParticleSphereEmitter : public IParticleSphereEmitter
19{
20public:
21
22 //! constructor
23 CParticleSphereEmitter(
24 const core::vector3df& center, f32 radius,
25 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 //! 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 per second.
44 virtual void setMinParticlesPerSecond( u32 minPPS ) { MinParticlesPerSecond = minPPS; }
45
46 //! Set maximum number of particles per second.
47 virtual void setMaxParticlesPerSecond( u32 maxPPS ) { MaxParticlesPerSecond = maxPPS; }
48
49 //! Set minimum start color
50 virtual void setMinStartColor( const video::SColor& color ) { MinStartColor = color; }
51
52 //! Set maximum start color
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 sphere for particle emissions
71 virtual void setCenter( const core::vector3df& center ) { Center = center; }
72
73 //! Set the radius of the sphere for particle emissions
74 virtual void setRadius( f32 radius ) { Radius = radius; }
75
76 //! Gets direction the emitter emits particles
77 virtual const core::vector3df& getDirection() const { return Direction; }
78
79 //! Get minimum number of particles per second.
80 virtual u32 getMinParticlesPerSecond() const { return MinParticlesPerSecond; }
81
82 //! Get maximum number of particles per second.
83 virtual u32 getMaxParticlesPerSecond() const { return MaxParticlesPerSecond; }
84
85 //! Get minimum start color
86 virtual const video::SColor& getMinStartColor() const { return MinStartColor; }
87
88 //! Get maximum start color
89 virtual const video::SColor& getMaxStartColor() const { return MaxStartColor; }
90
91 //! Gets the maximum starting size for particles
92 virtual const core::dimension2df& getMaxStartSize() const { return MaxStartSize; }
93
94 //! Gets the minimum starting size for particles
95 virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; }
96
97 //! Get the minimum particle life-time in milliseconds
98 virtual u32 getMinLifeTime() const { return MinLifeTime; }
99
100 //! Get the maximum particle life-time in milliseconds
101 virtual u32 getMaxLifeTime() const { return MaxLifeTime; }
102
103 //! Get maximal random derivation from the direction
104 virtual s32 getMaxAngleDegrees() const { return MaxAngleDegrees; }
105
106 //! Get the center of the sphere for particle emissions
107 virtual const core::vector3df& getCenter() const { return Center; }
108
109 //! Get the radius of the sphere for particle emissions
110 virtual f32 getRadius() const { return Radius; }
111
112 //! Writes attributes of the object.
113 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
114
115 //! Reads attributes of the object.
116 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
117
118private:
119
120 core::array<SParticle> Particles;
121
122 core::vector3df Center;
123 f32 Radius;
124 core::vector3df Direction;
125
126 core::dimension2df MinStartSize, MaxStartSize;
127 u32 MinParticlesPerSecond, MaxParticlesPerSecond;
128 video::SColor MinStartColor, MaxStartColor;
129 u32 MinLifeTime, MaxLifeTime;
130
131 u32 Time;
132 u32 Emitted;
133 s32 MaxAngleDegrees;
134};
135
136} // end namespace scene
137} // end namespace irr
138
139
140#endif
141