aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleBoxEmitter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CParticleBoxEmitter.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CParticleBoxEmitter.h133
1 files changed, 133 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleBoxEmitter.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleBoxEmitter.h
new file mode 100644
index 0000000..e9190a9
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleBoxEmitter.h
@@ -0,0 +1,133 @@
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_BOX_EMITTER_H_INCLUDED__
6#define __C_PARTICLE_BOX_EMITTER_H_INCLUDED__
7
8#include "IParticleBoxEmitter.h"
9#include "irrArray.h"
10#include "aabbox3d.h"
11
12namespace irr
13{
14namespace scene
15{
16
17//! A default box emitter
18class CParticleBoxEmitter : public IParticleBoxEmitter
19{
20public:
21
22 //! constructor
23 CParticleBoxEmitter(
24 const core::aabbox3df& box,
25 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
26 u32 minParticlesPerSecond = 20,
27 u32 maxParticlesPerSecond = 40,
28 video::SColor minStartColor = video::SColor(255,0,0,0),
29 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 direction the emitter emits particles.
42 virtual void setDirection( const core::vector3df& newDirection ) { Direction = newDirection; }
43
44 //! Set minimum number of particles emitted per second.
45 virtual void setMinParticlesPerSecond( u32 minPPS ) { MinParticlesPerSecond = minPPS; }
46
47 //! Set maximum number of particles emitted per second.
48 virtual void setMaxParticlesPerSecond( u32 maxPPS ) { MaxParticlesPerSecond = maxPPS; }
49
50 //! Set minimum start color.
51 virtual void setMinStartColor( const video::SColor& color ) { MinStartColor = color; }
52
53 //! Set maximum start color.
54 virtual void setMaxStartColor( const video::SColor& color ) { MaxStartColor = color; }
55
56 //! Set the maximum starting size for particles
57 virtual void setMaxStartSize( const core::dimension2df& size ) { MaxStartSize = size; };
58
59 //! Set the minimum starting size for particles
60 virtual void setMinStartSize( const core::dimension2df& size ) { MinStartSize = size; };
61
62 //! Set the minimum particle life-time in milliseconds
63 virtual void setMinLifeTime( u32 lifeTimeMin ) { MinLifeTime = lifeTimeMin; }
64
65 //! Set the maximum particle life-time in milliseconds
66 virtual void setMaxLifeTime( u32 lifeTimeMax ) { MaxLifeTime = lifeTimeMax; }
67
68 //! Maximal random derivation from the direction
69 virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) { MaxAngleDegrees = maxAngleDegrees; }
70
71 //! Set box from which the particles are emitted.
72 virtual void setBox( const core::aabbox3df& box ) { Box = box; }
73
74 //! Gets direction the emitter emits particles.
75 virtual const core::vector3df& getDirection() const { return Direction; }
76
77 //! Gets minimum number of particles emitted per second.
78 virtual u32 getMinParticlesPerSecond() const { return MinParticlesPerSecond; }
79
80 //! Gets maximum number of particles emitted per second.
81 virtual u32 getMaxParticlesPerSecond() const { return MaxParticlesPerSecond; }
82
83 //! Gets minimum start color.
84 virtual const video::SColor& getMinStartColor() const { return MinStartColor; }
85
86 //! Gets maximum start color.
87 virtual const video::SColor& getMaxStartColor() const { return MaxStartColor; }
88
89 //! Gets the maximum starting size for particles
90 virtual const core::dimension2df& getMaxStartSize() const { return MaxStartSize; }
91
92 //! Gets the minimum starting size for particles
93 virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; }
94
95 //! Get the minimum particle life-time in milliseconds
96 virtual u32 getMinLifeTime() const { return MinLifeTime; }
97
98 //! Get the maximum particle life-time in milliseconds
99 virtual u32 getMaxLifeTime() const { return MaxLifeTime; }
100
101 //! Maximal random derivation from the direction
102 virtual s32 getMaxAngleDegrees() const { return MaxAngleDegrees; }
103
104 //! Get box from which the particles are emitted.
105 virtual const core::aabbox3df& getBox() const { return Box; }
106
107 //! Writes attributes of the object.
108 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
109
110 //! Reads attributes of the object.
111 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
112
113private:
114
115 core::array<SParticle> Particles;
116 core::aabbox3df Box;
117 core::vector3df Direction;
118 core::dimension2df MaxStartSize, MinStartSize;
119 u32 MinParticlesPerSecond, MaxParticlesPerSecond;
120 video::SColor MinStartColor, MaxStartColor;
121 u32 MinLifeTime, MaxLifeTime;
122
123 u32 Time;
124 u32 Emitted;
125 s32 MaxAngleDegrees;
126};
127
128} // end namespace scene
129} // end namespace irr
130
131
132#endif
133