diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CParticleBoxEmitter.h | 266 |
1 files changed, 133 insertions, 133 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CParticleBoxEmitter.h b/libraries/irrlicht-1.8/source/Irrlicht/CParticleBoxEmitter.h index e9190a9..b6c56f7 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CParticleBoxEmitter.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CParticleBoxEmitter.h | |||
@@ -1,133 +1,133 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __C_PARTICLE_BOX_EMITTER_H_INCLUDED__ | 5 | #ifndef __C_PARTICLE_BOX_EMITTER_H_INCLUDED__ |
6 | #define __C_PARTICLE_BOX_EMITTER_H_INCLUDED__ | 6 | #define __C_PARTICLE_BOX_EMITTER_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IParticleBoxEmitter.h" | 8 | #include "IParticleBoxEmitter.h" |
9 | #include "irrArray.h" | 9 | #include "irrArray.h" |
10 | #include "aabbox3d.h" | 10 | #include "aabbox3d.h" |
11 | 11 | ||
12 | namespace irr | 12 | namespace irr |
13 | { | 13 | { |
14 | namespace scene | 14 | namespace scene |
15 | { | 15 | { |
16 | 16 | ||
17 | //! A default box emitter | 17 | //! A default box emitter |
18 | class CParticleBoxEmitter : public IParticleBoxEmitter | 18 | class CParticleBoxEmitter : public IParticleBoxEmitter |
19 | { | 19 | { |
20 | public: | 20 | public: |
21 | 21 | ||
22 | //! constructor | 22 | //! constructor |
23 | CParticleBoxEmitter( | 23 | CParticleBoxEmitter( |
24 | const core::aabbox3df& box, | 24 | const core::aabbox3df& box, |
25 | const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), | 25 | const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), |
26 | u32 minParticlesPerSecond = 20, | 26 | u32 minParticlesPerSecond = 20, |
27 | u32 maxParticlesPerSecond = 40, | 27 | u32 maxParticlesPerSecond = 40, |
28 | video::SColor minStartColor = video::SColor(255,0,0,0), | 28 | video::SColor minStartColor = video::SColor(255,0,0,0), |
29 | video::SColor maxStartColor = video::SColor(255,255,255,255), | 29 | video::SColor maxStartColor = video::SColor(255,255,255,255), |
30 | u32 lifeTimeMin=2000, | 30 | u32 lifeTimeMin=2000, |
31 | u32 lifeTimeMax=4000, | 31 | u32 lifeTimeMax=4000, |
32 | s32 maxAngleDegrees=0, | 32 | s32 maxAngleDegrees=0, |
33 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), | 33 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), |
34 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) | 34 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) |
35 | ); | 35 | ); |
36 | 36 | ||
37 | //! Prepares an array with new particles to emitt into the system | 37 | //! Prepares an array with new particles to emitt into the system |
38 | //! and returns how much new particles there are. | 38 | //! and returns how much new particles there are. |
39 | virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray); | 39 | virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray); |
40 | 40 | ||
41 | //! Set direction the emitter emits particles. | 41 | //! Set direction the emitter emits particles. |
42 | virtual void setDirection( const core::vector3df& newDirection ) { Direction = newDirection; } | 42 | virtual void setDirection( const core::vector3df& newDirection ) { Direction = newDirection; } |
43 | 43 | ||
44 | //! Set minimum number of particles emitted per second. | 44 | //! Set minimum number of particles emitted per second. |
45 | virtual void setMinParticlesPerSecond( u32 minPPS ) { MinParticlesPerSecond = minPPS; } | 45 | virtual void setMinParticlesPerSecond( u32 minPPS ) { MinParticlesPerSecond = minPPS; } |
46 | 46 | ||
47 | //! Set maximum number of particles emitted per second. | 47 | //! Set maximum number of particles emitted per second. |
48 | virtual void setMaxParticlesPerSecond( u32 maxPPS ) { MaxParticlesPerSecond = maxPPS; } | 48 | virtual void setMaxParticlesPerSecond( u32 maxPPS ) { MaxParticlesPerSecond = maxPPS; } |
49 | 49 | ||
50 | //! Set minimum start color. | 50 | //! Set minimum start color. |
51 | virtual void setMinStartColor( const video::SColor& color ) { MinStartColor = color; } | 51 | virtual void setMinStartColor( const video::SColor& color ) { MinStartColor = color; } |
52 | 52 | ||
53 | //! Set maximum start color. | 53 | //! Set maximum start color. |
54 | virtual void setMaxStartColor( const video::SColor& color ) { MaxStartColor = color; } | 54 | virtual void setMaxStartColor( const video::SColor& color ) { MaxStartColor = color; } |
55 | 55 | ||
56 | //! Set the maximum starting size for particles | 56 | //! Set the maximum starting size for particles |
57 | virtual void setMaxStartSize( const core::dimension2df& size ) { MaxStartSize = size; }; | 57 | virtual void setMaxStartSize( const core::dimension2df& size ) { MaxStartSize = size; }; |
58 | 58 | ||
59 | //! Set the minimum starting size for particles | 59 | //! Set the minimum starting size for particles |
60 | virtual void setMinStartSize( const core::dimension2df& size ) { MinStartSize = size; }; | 60 | virtual void setMinStartSize( const core::dimension2df& size ) { MinStartSize = size; }; |
61 | 61 | ||
62 | //! Set the minimum particle life-time in milliseconds | 62 | //! Set the minimum particle life-time in milliseconds |
63 | virtual void setMinLifeTime( u32 lifeTimeMin ) { MinLifeTime = lifeTimeMin; } | 63 | virtual void setMinLifeTime( u32 lifeTimeMin ) { MinLifeTime = lifeTimeMin; } |
64 | 64 | ||
65 | //! Set the maximum particle life-time in milliseconds | 65 | //! Set the maximum particle life-time in milliseconds |
66 | virtual void setMaxLifeTime( u32 lifeTimeMax ) { MaxLifeTime = lifeTimeMax; } | 66 | virtual void setMaxLifeTime( u32 lifeTimeMax ) { MaxLifeTime = lifeTimeMax; } |
67 | 67 | ||
68 | //! Maximal random derivation from the direction | 68 | //! Maximal random derivation from the direction |
69 | virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) { MaxAngleDegrees = maxAngleDegrees; } | 69 | virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) { MaxAngleDegrees = maxAngleDegrees; } |
70 | 70 | ||
71 | //! Set box from which the particles are emitted. | 71 | //! Set box from which the particles are emitted. |
72 | virtual void setBox( const core::aabbox3df& box ) { Box = box; } | 72 | virtual void setBox( const core::aabbox3df& box ) { Box = box; } |
73 | 73 | ||
74 | //! Gets direction the emitter emits particles. | 74 | //! Gets direction the emitter emits particles. |
75 | virtual const core::vector3df& getDirection() const { return Direction; } | 75 | virtual const core::vector3df& getDirection() const { return Direction; } |
76 | 76 | ||
77 | //! Gets minimum number of particles emitted per second. | 77 | //! Gets minimum number of particles emitted per second. |
78 | virtual u32 getMinParticlesPerSecond() const { return MinParticlesPerSecond; } | 78 | virtual u32 getMinParticlesPerSecond() const { return MinParticlesPerSecond; } |
79 | 79 | ||
80 | //! Gets maximum number of particles emitted per second. | 80 | //! Gets maximum number of particles emitted per second. |
81 | virtual u32 getMaxParticlesPerSecond() const { return MaxParticlesPerSecond; } | 81 | virtual u32 getMaxParticlesPerSecond() const { return MaxParticlesPerSecond; } |
82 | 82 | ||
83 | //! Gets minimum start color. | 83 | //! Gets minimum start color. |
84 | virtual const video::SColor& getMinStartColor() const { return MinStartColor; } | 84 | virtual const video::SColor& getMinStartColor() const { return MinStartColor; } |
85 | 85 | ||
86 | //! Gets maximum start color. | 86 | //! Gets maximum start color. |
87 | virtual const video::SColor& getMaxStartColor() const { return MaxStartColor; } | 87 | virtual const video::SColor& getMaxStartColor() const { return MaxStartColor; } |
88 | 88 | ||
89 | //! Gets the maximum starting size for particles | 89 | //! Gets the maximum starting size for particles |
90 | virtual const core::dimension2df& getMaxStartSize() const { return MaxStartSize; } | 90 | virtual const core::dimension2df& getMaxStartSize() const { return MaxStartSize; } |
91 | 91 | ||
92 | //! Gets the minimum starting size for particles | 92 | //! Gets the minimum starting size for particles |
93 | virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; } | 93 | virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; } |
94 | 94 | ||
95 | //! Get the minimum particle life-time in milliseconds | 95 | //! Get the minimum particle life-time in milliseconds |
96 | virtual u32 getMinLifeTime() const { return MinLifeTime; } | 96 | virtual u32 getMinLifeTime() const { return MinLifeTime; } |
97 | 97 | ||
98 | //! Get the maximum particle life-time in milliseconds | 98 | //! Get the maximum particle life-time in milliseconds |
99 | virtual u32 getMaxLifeTime() const { return MaxLifeTime; } | 99 | virtual u32 getMaxLifeTime() const { return MaxLifeTime; } |
100 | 100 | ||
101 | //! Maximal random derivation from the direction | 101 | //! Maximal random derivation from the direction |
102 | virtual s32 getMaxAngleDegrees() const { return MaxAngleDegrees; } | 102 | virtual s32 getMaxAngleDegrees() const { return MaxAngleDegrees; } |
103 | 103 | ||
104 | //! Get box from which the particles are emitted. | 104 | //! Get box from which the particles are emitted. |
105 | virtual const core::aabbox3df& getBox() const { return Box; } | 105 | virtual const core::aabbox3df& getBox() const { return Box; } |
106 | 106 | ||
107 | //! Writes attributes of the object. | 107 | //! Writes attributes of the object. |
108 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; | 108 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; |
109 | 109 | ||
110 | //! Reads attributes of the object. | 110 | //! Reads attributes of the object. |
111 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); | 111 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); |
112 | 112 | ||
113 | private: | 113 | private: |
114 | 114 | ||
115 | core::array<SParticle> Particles; | 115 | core::array<SParticle> Particles; |
116 | core::aabbox3df Box; | 116 | core::aabbox3df Box; |
117 | core::vector3df Direction; | 117 | core::vector3df Direction; |
118 | core::dimension2df MaxStartSize, MinStartSize; | 118 | core::dimension2df MaxStartSize, MinStartSize; |
119 | u32 MinParticlesPerSecond, MaxParticlesPerSecond; | 119 | u32 MinParticlesPerSecond, MaxParticlesPerSecond; |
120 | video::SColor MinStartColor, MaxStartColor; | 120 | video::SColor MinStartColor, MaxStartColor; |
121 | u32 MinLifeTime, MaxLifeTime; | 121 | u32 MinLifeTime, MaxLifeTime; |
122 | 122 | ||
123 | u32 Time; | 123 | u32 Time; |
124 | u32 Emitted; | 124 | u32 Emitted; |
125 | s32 MaxAngleDegrees; | 125 | s32 MaxAngleDegrees; |
126 | }; | 126 | }; |
127 | 127 | ||
128 | } // end namespace scene | 128 | } // end namespace scene |
129 | } // end namespace irr | 129 | } // end namespace irr |
130 | 130 | ||
131 | 131 | ||
132 | #endif | 132 | #endif |
133 | 133 | ||